From 912e189937a46113bf256398d636785c315a4451 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 May 2026 17:10:45 +0200 Subject: [PATCH 01/31] Bump codecov/codecov-action from 5 to 6 (#8437) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5 to 6. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v5...v6) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ef173a2d933..997f97a58fb 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -196,7 +196,7 @@ jobs: key: ${{ steps.coverage-build-state-key.outputs.value }} - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v6 with: files: _coverage/coverage.json fail_ci_if_error: false From 0782ee365accad57ff0ed932952002ce680c6fdb Mon Sep 17 00:00:00 2001 From: Florian Hammerschmidt Date: Thu, 28 May 2026 18:37:58 +0200 Subject: [PATCH 02/31] Upload PR dev-playground bundles (#8447) * Upload PR dev-playground bundles * Add safe dev playground PR bundle previews * Post a comment with the playground URL --- .github/workflows/ci.yml | 15 ++++ .../workflows/playground_preview_cleanup.yml | 28 ++++++++ .../workflows/playground_preview_upload.yml | 60 ++++++++++++++++ packages/dev-playground/src/Bindings.res | 2 + packages/dev-playground/src/CompilerApi.res | 70 +++++++++++++++++-- packages/dev-playground/src/CompilerApi.resi | 4 +- packages/dev-playground/src/Main.res | 6 +- packages/dev-playground/src/UrlState.res | 12 +--- 8 files changed, 179 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/playground_preview_cleanup.yml create mode 100644 .github/workflows/playground_preview_upload.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3e37552acc..78bad0e36dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -382,6 +382,20 @@ jobs: if: matrix.build_playground run: yarn workspace playground test + - name: Stage PR dev playground compiler bundle + if: ${{ matrix.build_playground && github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'master' && github.event.pull_request.head.repo.full_name == github.repository }} + env: + PLAYGROUND_PREVIEW_ID: pr-${{ github.event.pull_request.number }} + run: yarn workspace dev-playground stage-local-bundle "$PLAYGROUND_PREVIEW_ID" + + - name: "Upload artifacts: PR dev playground compiler bundle" + if: ${{ matrix.build_playground && github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'master' && github.event.pull_request.head.repo.full_name == github.repository }} + uses: actions/upload-artifact@v7 + with: + name: dev-playground-pr-${{ github.event.pull_request.number }}-bundle + path: packages/dev-playground/public/playground-bundles/pr-${{ github.event.pull_request.number }} + if-no-files-found: error + - name: Stage dev playground compiler bundle if: ${{ matrix.build_playground && github.event_name == 'push' && github.ref == 'refs/heads/master' }} run: yarn workspace dev-playground stage-master-bundle @@ -457,6 +471,7 @@ jobs: env: VITE_DEFAULT_COMPILER_VERSION: master VITE_COMPILER_VERSIONS: '[{"id":"master","label":"master"}]' + VITE_COMPILER_PREVIEW_ROOT: https://cdn.rescript-lang.org/dev-playground-bundles GITHUB_PAGES_PATH: dev-playground PLAYGROUND_BUNDLE_ID: master steps: diff --git a/.github/workflows/playground_preview_cleanup.yml b/.github/workflows/playground_preview_cleanup.yml new file mode 100644 index 00000000000..447c6e94d1f --- /dev/null +++ b/.github/workflows/playground_preview_cleanup.yml @@ -0,0 +1,28 @@ +name: Playground Preview Cleanup + +on: + pull_request_target: + branches: [master] + types: [closed] + +jobs: + cleanup: + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} + runs-on: ubuntu-24.04 + steps: + - name: Setup Rclone + uses: cometkim/rclone-actions/setup-rclone@main + + - name: Configure Rclone remote + uses: cometkim/rclone-actions/configure-remote/s3-provider@main + with: + name: rescript + provider: Cloudflare + endpoint: https://${{ vars.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com + access-key-id: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }} + acl: private + + - name: Delete preview bundle + continue-on-error: true + run: rclone purge "rescript:cdn-assets/dev-playground-bundles/pr-${{ github.event.pull_request.number }}" diff --git a/.github/workflows/playground_preview_upload.yml b/.github/workflows/playground_preview_upload.yml new file mode 100644 index 00000000000..3c38f7498ad --- /dev/null +++ b/.github/workflows/playground_preview_upload.yml @@ -0,0 +1,60 @@ +name: Playground Preview Upload + +on: + workflow_run: + workflows: [CI] + types: [completed] + +jobs: + upload: + if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.pull_requests[0].base.ref == 'master' }} + runs-on: ubuntu-24.04 + permissions: + actions: read + contents: read + pull-requests: write + env: + PLAYGROUND_PREVIEW_ID: pr-${{ github.event.workflow_run.pull_requests[0].number }} + steps: + - name: Download preview bundle artifact + uses: actions/download-artifact@v8 + with: + name: dev-playground-pr-${{ github.event.workflow_run.pull_requests[0].number }}-bundle + path: dev-playground-preview-bundle + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup Rclone + uses: cometkim/rclone-actions/setup-rclone@main + + - name: Configure Rclone remote + uses: cometkim/rclone-actions/configure-remote/s3-provider@main + with: + name: rescript + provider: Cloudflare + endpoint: https://${{ vars.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com + access-key-id: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }} + acl: private + + - name: Upload preview bundle + run: | + rclone sync \ + --stats 5 \ + --checkers 5000 \ + --transfers 8 \ + --buffer-size 128M \ + --s3-no-check-bucket \ + --s3-chunk-size 128M \ + --s3-upload-concurrency 8 \ + --fast-list \ + "dev-playground-preview-bundle" \ + "rescript:cdn-assets/dev-playground-bundles/${PLAYGROUND_PREVIEW_ID}/bundle" + + - name: Comment playground preview URL + uses: thollander/actions-comment-pull-request@v3 + with: + pr-number: ${{ github.event.workflow_run.pull_requests[0].number }} + comment-tag: dev-playground-preview + message: | + Developer playground preview: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/dev-playground/?version=pr-${{ github.event.workflow_run.pull_requests[0].number }} diff --git a/packages/dev-playground/src/Bindings.res b/packages/dev-playground/src/Bindings.res index 694aad80805..1b7f3f497f6 100644 --- a/packages/dev-playground/src/Bindings.res +++ b/packages/dev-playground/src/Bindings.res @@ -10,6 +10,8 @@ module Env = { external viteDefaultCompilerVersion: option = "import.meta.env.VITE_DEFAULT_COMPILER_VERSION" @val external viteCompilerVersions: option = "import.meta.env.VITE_COMPILER_VERSIONS" + @val + external viteCompilerPreviewRoot: option = "import.meta.env.VITE_COMPILER_PREVIEW_ROOT" @val external viteBaseUrl: option = "import.meta.env.BASE_URL" } diff --git a/packages/dev-playground/src/CompilerApi.res b/packages/dev-playground/src/CompilerApi.res index 25a09c0249f..7464ee94b04 100644 --- a/packages/dev-playground/src/CompilerApi.res +++ b/packages/dev-playground/src/CompilerApi.res @@ -1,3 +1,9 @@ +type compilerVersion = { + versionId: string, + versionLabel: string, + versionRoot: option, +} + module Version = { type t = { id: string, @@ -10,12 +16,28 @@ module Version = { | _ => None } + let normalizeRoot = root => + if root->String.endsWith("/") { + root->String.slice(~start=0, ~end=root->String.length - 1) + } else { + root + } + + let toPublic = (version: compilerVersion): t => { + id: version.versionId, + label: version.versionLabel, + } + let fromJson = json => switch json { | JSON.Object(item) => let? Some(id) = item->jsonStringField("id") let? Some(label) = item->jsonStringField("label") - Some({id, label}) + Some({ + versionId: id, + versionLabel: label, + versionRoot: item->jsonStringField("root")->Option.map(normalizeRoot), + }) | _ => None } } @@ -86,7 +108,7 @@ let pathFromBase = relativePath => { } let parseCompilerVersions = defaultVersion => { - let fallback = [{Version.id: defaultVersion, label: defaultVersion}] + let fallback = [{versionId: defaultVersion, versionLabel: defaultVersion, versionRoot: None}] switch Env.viteCompilerVersions { | None | Some("") => fallback | Some(versionJson) => @@ -100,8 +122,13 @@ let parseCompilerVersions = defaultVersion => { } } -let availableCompilerVersions = parseCompilerVersions(defaultConfig.compilerVersion) +let compilerVersions = parseCompilerVersions(defaultConfig.compilerVersion) +let availableCompilerVersions = compilerVersions->Array.map(Version.toPublic) let compilerRoot = pathFromBase("playground-bundles") +let compilerPreviewRoot = switch Env.viteCompilerPreviewRoot { +| Some(root) => root === "" ? None : Some(root->Version.normalizeRoot) +| None => None +} let loadedScripts: Map.t> = Map.make() let compilerApis: Map.t = Map.make() let compilers: Map.t = Map.make() @@ -116,6 +143,41 @@ let hasFunction = (value, name) => let versionOrDefault = version => version === "" ? defaultConfig.compilerVersion : version +let isPreviewVersion = version => version->String.search(/^pr-[0-9]+$/) === 0 + +let previewVersionRoot = version => + switch compilerPreviewRoot { + | Some(root) if version->isPreviewVersion => Some(`${root}/${version}/bundle`) + | _ => None + } + +let versionRoot = version => { + let selectedVersion = versionOrDefault(version) + switch compilerVersions->Array.findMap(version => + version.versionId === selectedVersion ? version.versionRoot : None + ) { + | Some(root) => root + | None => + switch selectedVersion->previewVersionRoot { + | Some(root) => root + | None => `${compilerRoot}/${selectedVersion}` + } + } +} + +let isConfiguredVersion = version => + compilerVersions->Array.some(compilerVersion => compilerVersion.versionId === version) + +let isLoadableVersion = version => + version->isConfiguredVersion || version->previewVersionRoot->Option.isSome + +let selectableCompilerVersions = activeVersion => + if activeVersion->isConfiguredVersion || !(activeVersion->previewVersionRoot->Option.isSome) { + availableCompilerVersions + } else { + Array.concat(availableCompilerVersions, [{Version.id: activeVersion, label: activeVersion}]) + } + let createScriptLoadPromise = src => Promise.make((resolve, reject) => { let document = Document.current @@ -140,8 +202,6 @@ let loadScript = (src, ~cache=true) => createScriptLoadPromise(src) } -let versionRoot = version => `${compilerRoot}/${versionOrDefault(version)}` - let applyConfig = ( instance, ~moduleSystem: PlaygroundConfig.moduleSystem, diff --git a/packages/dev-playground/src/CompilerApi.resi b/packages/dev-playground/src/CompilerApi.resi index f0b075bade9..45c4c7c540b 100644 --- a/packages/dev-playground/src/CompilerApi.resi +++ b/packages/dev-playground/src/CompilerApi.resi @@ -38,7 +38,9 @@ type formatResult = result let defaultConfig: PlaygroundConfig.t -let availableCompilerVersions: array +let selectableCompilerVersions: string => array + +let isLoadableVersion: string => bool let init: string => promise diff --git a/packages/dev-playground/src/Main.res b/packages/dev-playground/src/Main.res index 7bd1e608ac1..91ffae6b5bd 100644 --- a/packages/dev-playground/src/Main.res +++ b/packages/dev-playground/src/Main.res @@ -231,9 +231,9 @@ module SettingsPanel = { }} > {Node.fragment( - CompilerApi.availableCompilerVersions->Array.map(version => - - ), + CompilerApi.selectableCompilerVersions( + Signal.get(config).compilerVersion, + )->Array.map(version => ), )} diff --git a/packages/dev-playground/src/UrlState.res b/packages/dev-playground/src/UrlState.res index 625c2a52d88..39a9fbeb2eb 100644 --- a/packages/dev-playground/src/UrlState.res +++ b/packages/dev-playground/src/UrlState.res @@ -85,13 +85,10 @@ let queryExperimentalFeatures = defaultExperimentalFeatures => | _ => defaultExperimentalFeatures } -let queryConfig = ( - ~defaultConfig: PlaygroundConfig.t, - ~availableCompilerVersions: array, -) => { +let queryConfig = (~defaultConfig: PlaygroundConfig.t) => { let requestedCompilerVersion = queryCompilerVersion(defaultConfig.compilerVersion) let compilerVersion = - availableCompilerVersions->Array.some(version => version.id === requestedCompilerVersion) + requestedCompilerVersion->CompilerApi.isLoadableVersion ? requestedCompilerVersion : defaultConfig.compilerVersion @@ -106,10 +103,7 @@ let queryConfig = ( let init = async (~defaultSource): state => { let source = await initialSource(defaultSource) - let config = queryConfig( - ~defaultConfig=CompilerApi.defaultConfig, - ~availableCompilerVersions=CompilerApi.availableCompilerVersions, - ) + let config = queryConfig(~defaultConfig=CompilerApi.defaultConfig) {source, config} } From 166253df51c250d8298fff90129cebe9d6c7d76e Mon Sep 17 00:00:00 2001 From: Pedro Castro Date: Sat, 30 May 2026 03:46:37 -0300 Subject: [PATCH 03/31] Use Yojson and lsp types for analysis JSON output (#8436) * Use Yojson and lsp types for analysis JSON output Replace the vendored JSON helpers with Yojson and the OCaml lsp types across analysis, reanalyze, and tools JSON handling. This updates LSP response construction for completions, hovers, diagnostics, code actions, symbols, signature help, and related CLI commands, refreshes analysis snapshots, and adjusts extract-codeblocks decoding for the new serialized output. * Delete Protocol.ml * Delete comments * Fix LSP JSON serialization Serialize analysis command results with Yojson output helpers instead of string extraction, fixing document symbols so they return JSON arrays instead of crashing. Also use typed LSP enum constructors for completion and inlay hint kinds, clean up JSON config parsing, and update analysis test snapshots. * Use Lsp.Uri for URI handling Replace the custom URI record with Lsp.Uri.t and delegate path/URI conversion to the LSP library. This fixes interface-aware analysis results so definitions, references, and renames consistently target .resi files when an interface is present, and updates the analysis snapshots accordingly. * remove `null` * Update GenericJsxCompletion.res.txt * Update tests * Update tests/analysis_tests/tests-sourcedirs-dependency/src/expected/Main.res.txt * Update tests/tools_tests * Remove null fields, `data` and `deprecated` * Update tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt * Update analysis_tests * Update analysis_tests * Remove unused pathToUri * docstrings: remove decodeFromJson implementation * Use basename instead of full URI in Xform test output * Fix rename `newUri` * Use only `Uri` instead of `Lsp.Uri` * update CHANGELOG.md * Omit null fields from doc extraction JSON Only include optional doc extraction fields like deprecated, detail, payload, and moduletypeid when they have values. Update tool test snapshots to match the leaner JSON output. * Update dune-project and dune files with yojson * Add `version` for textDocument in rename * Apply codex suggestions * rename: use `Uri.toPath` --- CHANGELOG.md | 1 + analysis.opam | 2 + analysis/bin/main.ml | 18 +- analysis/reanalyze/src/EmitJson.ml | 15 +- analysis/reanalyze/src/Log_.ml | 4 +- analysis/reanalyze/src/Paths.ml | 72 +- analysis/reanalyze/src/dune | 2 +- analysis/src/Cli.ml | 233 +- analysis/src/CodeActions.ml | 40 +- analysis/src/Commands.ml | 104 +- analysis/src/CompletionBackEnd.ml | 52 +- analysis/src/Diagnostics.ml | 22 +- analysis/src/DocumentSymbol.ml | 63 +- analysis/src/FindFiles.ml | 77 +- analysis/src/Hint.ml | 52 +- analysis/src/Loc.ml | 6 +- analysis/src/Markdown.ml | 2 +- analysis/src/Packages.ml | 35 +- analysis/src/Protocol.ml | 388 - analysis/src/SemanticTokens.ml | 2 +- analysis/src/SharedTypes.ml | 28 +- analysis/src/SignatureHelp.ml | 213 +- analysis/src/TypeUtils.ml | 22 +- analysis/src/Uri.ml | 34 +- analysis/src/Uri.mli | 3 +- analysis/src/Utils.ml | 10 +- analysis/src/Xform.ml | 75 +- analysis/src/YojsonHelpers.ml | 9 + analysis/src/dune | 2 +- analysis/vendor/.ocamlformat | 1 - analysis/vendor/dune | 1 - analysis/vendor/json/Json.ml | 536 - analysis/vendor/json/dune | 5 - dune-project | 8 +- .../RescriptTools_ExtractCodeBlocks.res | 2 +- .../src/expected/GenericJsxCompletion.res.txt | 131 +- .../ConstructorCompletion__Json.res.txt | 21 +- .../ConstructorCompletion__Own.res.txt | 21 +- .../src/expected/Main.res.txt | 10 +- .../not_compiled/expected/Diagnostics.res.txt | 42 +- .../not_compiled/expected/DocTemplate.res.txt | 59 +- .../expected/DocTemplate.resi.txt | 35 +- .../expected/SemanticTokens.res.txt | 3 +- .../expected/SemanticTokensArray.res.txt | 3 +- .../SemanticTokensArrayAccess.res.txt | 7 +- .../SemanticTokensArrayMutation.res.txt | 3 +- .../expected/SemanticTokensDict.res.txt | 3 +- .../tests/src/expected/Auto.res.txt | 7 +- .../tests/src/expected/CodeLens.res.txt | 39 +- .../src/expected/CompletePrioritize1.res.txt | 8 +- .../src/expected/CompletePrioritize2.res.txt | 25 +- .../tests/src/expected/Completion.res.txt | 3370 ++-- .../src/expected/CompletionAttributes.res.txt | 318 +- .../CompletionConfiguredBuiltins.res.txt | 26 +- .../src/expected/CompletionDicts.res.txt | 47 +- .../expected/CompletionExpressions.res.txt | 1647 +- .../src/expected/CompletionFromModule.res.txt | 205 +- .../expected/CompletionFromModule2.res.txt | 192 +- .../CompletionFunctionArguments.res.txt | 474 +- .../expected/CompletionInferValues.res.txt | 902 +- .../tests/src/expected/CompletionJsx.res.txt | 1436 +- .../src/expected/CompletionJsxProps.res.txt | 501 +- ...mpletionMultipleEditorCompleteFrom.res.txt | 51 +- .../expected/CompletionNullNullable.res.txt | 818 +- .../src/expected/CompletionObjects.res.txt | 36 +- .../src/expected/CompletionPattern.res.txt | 1222 +- .../src/expected/CompletionPipeChain.res.txt | 525 +- .../expected/CompletionPipeProperty.res.txt | 77 +- .../expected/CompletionPipeSubmodules.res.txt | 32 +- .../src/expected/CompletionRegexp.res.txt | 149 +- .../expected/CompletionTaggedTemplate.res.txt | 148 +- .../expected/CompletionTypeAnnotation.res.txt | 473 +- .../src/expected/CompletionTypeT.res.txt | 138 +- .../expected/CompletionTypedArrays.res.txt | 16731 +++++++++++----- .../tests/src/expected/Cross.res.txt | 248 +- .../tests/src/expected/Debug.res.txt | 39 +- .../tests/src/expected/Definition.res.txt | 45 +- .../expected/DefinitionWithInterface.res.txt | 16 +- .../expected/DefinitionWithInterface.resi.txt | 16 +- .../tests/src/expected/Destructuring.res.txt | 121 +- .../tests/src/expected/Div.res.txt | 15 +- .../tests/src/expected/DocComments.res.txt | 35 +- .../tests/src/expected/DocumentSymbol.res.txt | 292 +- .../DotPipeCompleteFromCurrentModule.res.txt | 28 +- .../expected/DotPipeCompletionSpec.res.txt | 1101 +- .../tests/src/expected/EnvCompletion.res.txt | 436 +- .../src/expected/ExhaustiveSwitch.res.txt | 137 +- .../tests/src/expected/Firebase.res.txt | 54 +- .../src/expected/FirstClassModules.res.txt | 291 +- .../tests/src/expected/Fragment.res.txt | 14 +- .../tests/src/expected/Hover.res.txt | 332 +- .../expected/IncludeModuleCompletion.res.txt | 303 +- .../tests/src/expected/InlayHint.res.txt | 120 +- .../tests/src/expected/Jsx2.res.txt | 328 +- .../tests/src/expected/Jsx2.resi.txt | 43 +- .../tests/src/expected/JsxV4.res.txt | 23 +- .../tests/src/expected/LongIdentTest.res.txt | 2 +- .../tests/src/expected/NestedRecords.res.txt | 23 +- .../src/expected/NestedRecordsHover.res.txt | 35 +- .../tests/src/expected/Patterns.res.txt | 32 +- .../tests/src/expected/PolyRec.res.txt | 7 +- .../tests/src/expected/PrepareRename.res.txt | 18 +- .../tests/src/expected/RecModules.res.txt | 14 +- .../src/expected/RecordCompletion.res.txt | 92 +- .../tests/src/expected/RecoveryOnProp.res.txt | 72 +- .../tests/src/expected/References.res.txt | 120 +- .../expected/ReferencesWithInterface.res.txt | 40 +- .../expected/ReferencesWithInterface.resi.txt | 40 +- .../tests/src/expected/Rename.res.txt | 70 +- .../src/expected/RenameWithInterface.res.txt | 76 +- .../src/expected/RenameWithInterface.resi.txt | 70 +- .../tests/src/expected/Reprod.res.txt | 305 +- .../tests/src/expected/RxjsCompletion.res.txt | 240 +- .../tests/src/expected/SignatureHelp.res.txt | 1015 +- .../tests/src/expected/TypeArgCtx.res.txt | 21 +- .../src/expected/TypeAtPosCompletion.res.txt | 79 +- .../tests/src/expected/TypeDefinition.res.txt | 48 +- .../tests/src/expected/Xform.res.txt | 127 +- tests/docstring_tests/DocTest.res | 10 +- tests/docstring_tests/DocTest.res.js | 7 +- tests/ounit_tests/ounit_json_tests.ml | 8 +- .../src/expected/DocExtraction2.res.json | 169 +- .../src/expected/DocExtraction2.resi.json | 169 +- .../src/expected/DocExtractionRes.res.json | 908 +- ...CodeBlocksTest.res.extracted.json.expected | 7 +- ...ocstringsTest1.res.extracted.json.expected | 16 +- ...cstringsTest1.resi.extracted.json.expected | 16 +- ...ocstringsTest2.res.extracted.json.expected | 16 +- ...ringsTestError.res.extracted.json.expected | 4 - ...tRescriptBlocks.md.extracted.json.expected | 10 +- tests/tools_tests/src/expected/ModC.res.json | 61 +- tests/tools_tests/src/expected/ModC.resi.json | 61 +- tools.opam | 1 + tools/bin/main.ml | 15 +- tools/src/dune | 2 +- tools/src/tools.ml | 398 +- 136 files changed, 24629 insertions(+), 15906 deletions(-) delete mode 100644 analysis/src/Protocol.ml create mode 100644 analysis/src/YojsonHelpers.ml delete mode 100644 analysis/vendor/.ocamlformat delete mode 100644 analysis/vendor/dune delete mode 100644 analysis/vendor/json/Json.ml delete mode 100644 analysis/vendor/json/dune diff --git a/CHANGELOG.md b/CHANGELOG.md index 220de756055..0e17898f54e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ - Improve deprecated attribute extraction and support record form. https://github.com/rescript-lang/rescript/pull/8396 - Refactor analysis to decouple I/O from core logic. https://github.com/rescript-lang/rescript/pull/8426 - Deprecate `Stdlib_Error` and `Stdlib_Exn` modules in favor of `JsError/JsExn`. https://github.com/rescript-lang/rescript/pull/8404 +- Remove vendored `Json` library and use `yojson` and `lsp` library for analysis. https://github.com/rescript-lang/rescript/pull/8436 #### :house: Internal diff --git a/analysis.opam b/analysis.opam index 8350d0a8a98..209189df6e4 100644 --- a/analysis.opam +++ b/analysis.opam @@ -11,6 +11,8 @@ depends: [ "ocaml" {>= "5.0.0"} "cppo" {= "1.8.0"} "odoc" {with-doc} + "lsp" {= "1.22.0"} + "yojson" {= "2.2.2"} ] build: [ ["dune" "subst"] {dev} diff --git a/analysis/bin/main.ml b/analysis/bin/main.ml index 0afe23855ab..98b66acc7fa 100644 --- a/analysis/bin/main.ml +++ b/analysis/bin/main.ml @@ -180,13 +180,12 @@ let main () = | _ -> raise (Failure "unsupported type") in let source = Files.readFile path |> Option.value ~default:"" in - let res = - Codemod.transform ~source - ~pos:(int_of_string line, int_of_string col) - ~debug ~typ ~hint - |> Json.escape - in - Printf.printf "\"%s\"" res + `String + (Codemod.transform ~source + ~pos:(int_of_string line, int_of_string col) + ~debug ~typ ~hint) + |> Yojson.Safe.pretty_to_string ~std:true + |> print_endline | [_; "diagnosticSyntax"; path] -> Cli.diagnosticSyntax ~path | [_; "references"; path; line; col] -> Cli.references ~path ~pos:(int_of_string line, int_of_string col) ~debug @@ -198,8 +197,9 @@ let main () = ~newName ~debug | [_; "semanticTokens"; currentFile] -> Cli.semanticTokens ~path:currentFile | [_; "createInterface"; path; cmiFile] -> - Printf.printf "\"%s\"" - (Json.escape (CreateInterface.command ~path ~cmiFile)) + `String (CreateInterface.command ~path ~cmiFile) + |> Yojson.Safe.pretty_to_string ~std:true + |> print_endline | [_; "format"; path] -> Cli.format ~path | [_; "test"; path] -> Cli.test ~path | [_; "cmt"; rescript_json; cmt_path] -> CmtViewer.dump rescript_json cmt_path diff --git a/analysis/reanalyze/src/EmitJson.ml b/analysis/reanalyze/src/EmitJson.ml index 26cf1f199fb..6a636bc8c07 100644 --- a/analysis/reanalyze/src/EmitJson.ml +++ b/analysis/reanalyze/src/EmitJson.ml @@ -4,18 +4,19 @@ let start () = Printf.printf "[" let finish () = Printf.printf "\n]\n" let emitClose () = "\n}" +let jsonString text = Yojson.Safe.to_string (`String text) let emitItem ~ppf ~name ~kind ~file ~range ~message = let open Format in items := !items + 1; let startLine, startCharacter, endLine, endCharacter = range in fprintf ppf "%s{\n" (if !items = 1 then "\n" else ",\n"); - fprintf ppf " \"name\": \"%s\",\n" name; - fprintf ppf " \"kind\": \"%s\",\n" kind; - fprintf ppf " \"file\": \"%s\",\n" file; + fprintf ppf " \"name\": %s,\n" (jsonString name); + fprintf ppf " \"kind\": %s,\n" (jsonString kind); + fprintf ppf " \"file\": %s,\n" (jsonString file); fprintf ppf " \"range\": [%d,%d,%d,%d],\n" startLine startCharacter endLine endCharacter; - fprintf ppf " \"message\": \"%s\"" message + fprintf ppf " \"message\": %s" (jsonString message) let locToPos (loc : Location.t) = (loc.loc_start.pos_lnum - 1, loc.loc_start.pos_cnum - loc.loc_start.pos_bol) @@ -24,6 +25,6 @@ let emitAnnotate ~pos ~text ~action = let line, character = pos in Format.asprintf ",\n\ - \ \"annotate\": { \"line\": %d, \"character\": %d, \"text\": \"%s\", \ - \"action\": \"%s\"}" - line character text action + \ \"annotate\": { \"line\": %d, \"character\": %d, \"text\": %s, \ + \"action\": %s}" + line character (jsonString text) (jsonString action) diff --git a/analysis/reanalyze/src/Log_.ml b/analysis/reanalyze/src/Log_.ml index 5a03ae55515..19e03cf8aef 100644 --- a/analysis/reanalyze/src/Log_.ml +++ b/analysis/reanalyze/src/Log_.ml @@ -164,12 +164,12 @@ let logIssue ~config ~(issue : Issue.t) = let open Format in let loc = issue.loc in if config.DceConfig.cli.json then - let file = Json.escape loc.loc_start.pos_fname in + let file = loc.loc_start.pos_fname in let startLine = loc.loc_start.pos_lnum - 1 in let startCharacter = loc.loc_start.pos_cnum - loc.loc_start.pos_bol in let endLine = loc.loc_end.pos_lnum - 1 in let endCharacter = loc.loc_end.pos_cnum - loc.loc_start.pos_bol in - let message = Json.escape (descriptionToMessage issue.description) in + let message = descriptionToMessage issue.description in Format.asprintf "%a%s%s" (fun ppf () -> EmitJson.emitItem ~ppf ~name:issue.name diff --git a/analysis/reanalyze/src/Paths.ml b/analysis/reanalyze/src/Paths.ml index 8e0f51ef7a4..f47282ee089 100644 --- a/analysis/reanalyze/src/Paths.ml +++ b/analysis/reanalyze/src/Paths.ml @@ -1,5 +1,11 @@ let rescriptJson = "rescript.json" +(** If `t` is an object (`Assoc), get the value associated with the given string key *) +let get key t = + match t with + | `Assoc items -> List.assoc_opt key items + | _ -> None + let readFile filename = try (* windows can't use open_in *) @@ -33,50 +39,49 @@ let setReScriptProjectRoot = lazy (setProjectRootFromCwd ()) module Config = struct let readSuppress conf = - match Json.get "suppress" conf with - | Some (Array elements) -> + match conf |> get "suppress" with + | Some (`List elements) -> let names = elements - |> List.filter_map (fun (x : Json.t) -> + |> List.filter_map (fun (x : Yojson.Safe.t) -> match x with - | String s -> Some s + | `String s -> Some s | _ -> None) in runConfig.suppress <- names @ runConfig.suppress | _ -> () let readUnsuppress conf = - match Json.get "unsuppress" conf with - | Some (Array elements) -> + match conf |> get "unsuppress" with + | Some (`List elements) -> let names = elements - |> List.filter_map (fun (x : Json.t) -> + |> List.filter_map (fun (x : Yojson.Safe.t) -> match x with - | String s -> Some s + | `String s -> Some s | _ -> None) in runConfig.unsuppress <- names @ runConfig.unsuppress | _ -> () let readAnalysis conf = - match Json.get "analysis" conf with - | Some (Array elements) -> + match conf |> get "analysis" with + | Some (`List elements) -> elements - |> List.iter (fun (x : Json.t) -> + |> List.iter (fun (x : Yojson.Safe.t) -> match x with - | String "all" -> RunConfig.all () - | String "dce" -> RunConfig.dce () - | String "exception" -> RunConfig.exception_ () - | String "termination" -> RunConfig.termination () + | `String "all" -> RunConfig.all () + | `String "dce" -> RunConfig.dce () + | `String "exception" -> RunConfig.exception_ () + | `String "termination" -> RunConfig.termination () | _ -> ()) | _ -> (* if no "analysis" specified, default to dce *) RunConfig.dce () let readTransitive conf = - match Json.get "transitive" conf with - | Some True -> RunConfig.transitive true - | Some False -> RunConfig.transitive false + match conf |> get "transitive" with + | Some (`Bool bool) -> RunConfig.transitive bool | _ -> () (* Read the config from rescript.json and apply it to runConfig and suppress and unsuppress *) @@ -85,10 +90,9 @@ module Config = struct let rescriptFile = Filename.concat runConfig.projectRoot rescriptJson in let processText text = - match Json.parse text with - | None -> () + match try Some (Yojson.Safe.from_string text) with _ -> None with | Some json -> ( - match Json.get "reanalyze" json with + match get "reanalyze" json with | Some conf -> readSuppress conf; readUnsuppress conf; @@ -97,6 +101,7 @@ module Config = struct | None -> (* if no "analysis" specified, default to dce *) RunConfig.dce ()) + | _ -> () in match readFile rescriptFile with @@ -145,18 +150,23 @@ let readCmtScan () = ["lib"; "bs"; ".sourcedirs.json"] |> List.fold_left Filename.concat runConfig.bsbProjectRoot in - let get key fn json = - Json.get key json |> Option.to_list |> List.filter_map fn + let get_fn key fn json = + get key json |> Option.to_list |> List.filter_map fn in - let read_entry (json : Json.t) = - let build_root = json |> get "build_root" Json.string in + let read_entry (json : Yojson.Safe.t) = + let build_root = + json |> get_fn "build_root" Yojson.Safe.Util.to_string_option + in let scan_dirs = - match json |> get "scan_dirs" Json.array with - | [arr] -> arr |> List.filter_map Json.string + match json |> get "scan_dirs" with + | Some (`List arr) -> + arr |> List.filter_map Yojson.Safe.Util.to_string_option | _ -> [] in let also_scan_build_root = - match json |> get "also_scan_build_root" Json.bool with + match + json |> get_fn "also_scan_build_root" Yojson.Safe.Util.to_bool_option + with | [b] -> b | _ -> false in @@ -167,9 +177,9 @@ let readCmtScan () = match readFile sourceDirsFile with | None -> [] | Some text -> ( - match Json.parse text with + match try Some (Yojson.Safe.from_string text) with _ -> None with | None -> [] | Some json -> ( - match json |> get "cmt_scan" Json.array with - | [arr] -> arr |> List.filter_map read_entry + match get "cmt_scan" json with + | Some (`List arr) -> arr |> List.filter_map read_entry | _ -> [])) diff --git a/analysis/reanalyze/src/dune b/analysis/reanalyze/src/dune index 3106987397f..7573766dfb3 100644 --- a/analysis/reanalyze/src/dune +++ b/analysis/reanalyze/src/dune @@ -2,4 +2,4 @@ (name reanalyze) (flags (-w "+6+26+27+32+33+39")) - (libraries reactive jsonlib ml str unix)) + (libraries reactive yojson ml str unix)) diff --git a/analysis/src/Cli.ml b/analysis/src/Cli.ml index bd8ced94a14..727313cb800 100644 --- a/analysis/src/Cli.ml +++ b/analysis/src/Cli.ml @@ -1,164 +1,160 @@ +let print_string json = + Yojson.Safe.pretty_to_string ~std:true json |> print_endline +let print_null () = `Null |> print_string +let print_list l = `List l |> print_string + let completion ~debug ~path ~pos ~currentFile = let full = Cmt.loadFullCmtFromPath ~path in let kindFile = Files.classifySourceFile currentFile in match Files.readFile currentFile with - | None | Some "" -> Protocol.null |> print_endline + | None | Some "" -> print_null () | Some source -> Commands.completion ~debug ~source ~kindFile ~pos ~full - |> List.map Protocol.stringifyCompletionItem - |> Protocol.array |> print_endline + |> List.map (fun c -> Lsp.Types.CompletionItem.yojson_of_t c) + |> print_list let completionResolve ~path ~modulePath = let full = Cmt.loadFullCmtFromPath ~path in - let result = - match Commands.completionResolve ~full ~modulePath with - | None -> Protocol.null - | Some content -> Protocol.wrapInQuotes content - in - print_endline result + match Commands.completionResolve ~full ~modulePath with + | None -> print_null () + | Some (`MarkupContent {value}) -> `String value |> print_string let inlayhint ~path ~pos ~maxLength ~debug = let full = Cmt.loadFullCmtFromPath ~path in let kindFile = Files.classifySourceFile path in match Files.readFile path with - | None -> Protocol.null |> print_endline + | None -> print_null () | Some source -> ( match Hint.inlay ~source ~kindFile ~pos ~maxLength ~full ~debug with | Some hints -> hints - |> List.map Protocol.stringifyHint - |> Protocol.array |> print_endline - | None -> Protocol.null |> print_endline) + |> List.map (fun h -> Lsp.Types.InlayHint.yojson_of_t h) + |> print_list + | None -> print_null ()) let codeLens ~path ~debug = let full = Cmt.loadFullCmtFromPath ~path in let kindFile = Files.classifySourceFile path in match Files.readFile path with - | None -> Protocol.null |> print_endline + | None -> print_null () | Some source -> ( match Hint.codeLens ~source ~kindFile ~full ~debug with | Some lens -> - lens - |> List.map Protocol.stringifyCodeLens - |> Protocol.array |> print_endline - | None -> Protocol.null |> print_endline) + lens |> List.map (fun l -> Lsp.Types.CodeLens.yojson_of_t l) |> print_list + | None -> print_null ()) let hover ~path ~pos ~currentFile ~debug ~supportsMarkdownLinks = let full = Cmt.loadFullCmtFromPath ~path in let kindFile = Files.classifySourceFile currentFile in match Files.readFile currentFile with - | None -> Protocol.null |> print_endline - | Some source -> - let result = - match - Commands.hover ~source ~kindFile ~pos ~debug ~supportsMarkdownLinks - ~full - with - | Some value -> Protocol.stringifyHover value - | None -> Protocol.null - in - print_endline result + | None -> print_null () + | Some source -> ( + match + Commands.hover ~source ~kindFile ~pos ~debug ~supportsMarkdownLinks ~full + with + | Some value -> Lsp.Types.Hover.yojson_of_t value |> print_string + | None -> print_null ()) let signatureHelp ~path ~pos ~currentFile ~debug ~allowForConstructorPayloads = let full = Cmt.loadFullCmtFromPath ~path in let kindFile = Files.classifySourceFile currentFile in match Files.readFile currentFile with - | None -> Protocol.null |> print_endline - | Some source -> - Commands.signatureHelp ~source ~kindFile ~pos ~allowForConstructorPayloads - ~full ~debug - |> Protocol.stringifySignatureHelp |> print_endline + | None -> print_null () + | Some source -> ( + match + SignatureHelp.signatureHelp ~source ~kindFile ~pos + ~allowForConstructorPayloads ~full ~debug + with + | None -> print_null () + | Some s -> Lsp.Types.SignatureHelp.yojson_of_t s |> print_string) let codeAction ~path ~startPos ~endPos ~currentFile ~debug = let kindFile = Files.classifySourceFile currentFile in match Files.readFile currentFile with - | None -> Protocol.null |> print_endline + | None -> print_null () | Some source -> Xform.extractCodeActions ~path ~startPos ~endPos ~source ~kindFile ~debug - |> CodeActions.stringifyCodeActions |> print_endline + |> List.map (fun c -> Lsp.Types.CodeAction.yojson_of_t c) + |> print_list let definition ~path ~pos ~debug = let full = Cmt.loadFullCmtFromPath ~path in - print_endline - (match Commands.definition ~full ~pos ~debug with - | None -> Protocol.null - | Some location -> location |> Protocol.stringifyLocation) + + match Commands.definition ~full ~pos ~debug with + | None -> print_null () + | Some location -> location |> Lsp.Types.Location.yojson_of_t |> print_string let typeDefinition ~path ~pos ~debug = let full = Cmt.loadFullCmtFromPath ~path in - print_endline - (match Commands.typeDefinition ~full ~pos ~debug with - | None -> Protocol.null - | Some location -> location |> Protocol.stringifyLocation) + match Commands.typeDefinition ~full ~pos ~debug with + | None -> print_null () + | Some location -> location |> Lsp.Types.Location.yojson_of_t |> print_string let references ~path ~pos ~debug = let full = Cmt.loadFullCmtFromPath ~path in let allLocs = Commands.references ~full ~pos ~debug in - print_endline - (if allLocs = [] then Protocol.null - else - "[\n" - ^ (allLocs |> List.map Protocol.stringifyLocation |> String.concat ",\n") - ^ "\n]") + if allLocs = [] then print_null () + else + allLocs + |> List.map (fun l -> Lsp.Types.Location.yojson_of_t l) + |> print_list let rename ~path ~pos ~newName ~debug = let full = Cmt.loadFullCmtFromPath ~path in - let result = - match Commands.rename ~full ~pos ~newName ~debug with - | None -> Protocol.null - | Some (fileRenames, textDocumentEdits) -> - let fileRenamesString = - fileRenames |> List.map Protocol.stringifyRenameFile - in - let textDocumentEditsString = - textDocumentEdits |> List.map Protocol.stringifyTextDocumentEdit - in - "[\n" - ^ (fileRenamesString @ textDocumentEditsString |> String.concat ",\n") - ^ "\n]" - in - print_endline result + match Commands.rename ~full ~pos ~newName ~debug with + | Some {documentChanges = Some documentChanges} -> + documentChanges + |> List.map (fun c -> + match c with + | `RenameFile r -> Lsp.Types.RenameFile.yojson_of_t r + | `TextDocumentEdit te -> Lsp.Types.TextDocumentEdit.yojson_of_t te + | `DeleteFile df -> Lsp.Types.DeleteFile.yojson_of_t df + | `CreateFile cf -> Lsp.Types.CreateFile.yojson_of_t cf) + |> print_list + | _ -> print_null () let prepareRename ~path ~pos ~debug = let full = Cmt.loadFullCmtFromPath ~path in - let result = - match Commands.prepareRename ~full ~pos ~debug with - | None -> Protocol.null - | Some (Range range) -> Protocol.stringifyRange range - | Some (Placeholder rangeph) -> - Protocol.stringifyRangeWithPlaceholder rangeph - in - print_endline result + match Commands.prepareRename ~full ~pos ~debug with + | None -> print_null () + | Some {range; placeholder = None} -> + Lsp.Types.Range.yojson_of_t range |> print_string + | Some {range; placeholder = Some placeholder} -> + `Assoc + [ + ("range", Lsp.Types.Range.yojson_of_t range); + ("placeholder", `String placeholder); + ] + |> print_string let format ~path = match Files.readFile path with - | None -> Protocol.null |> print_endline + | None -> print_null () | Some source -> ( let kindFile = Files.classifySourceFile path in match Commands.format ~source ~kindFile with | Ok textEdits -> ( match textEdits with - | {newText} :: _ -> Printf.printf "\"%s\"" (Json.escape newText) - | _ -> Protocol.null |> print_endline) - | Error _ -> Protocol.null |> print_endline) + | {newText} :: _ -> print_string (`String newText) + | _ -> print_null ()) + | Error _ -> print_null ()) let diagnosticSyntax ~path = match Files.readFile path with - | None -> Protocol.array [""] |> print_endline + | None -> print_list [] | Some source -> let kindFile = Files.classifySourceFile path in Diagnostics.document_syntax ~source ~kindFile - |> List.map Protocol.stringifyDiagnostic - |> Protocol.array |> print_endline + |> List.map Lsp.Types.Diagnostic.yojson_of_t + |> print_list let semanticTokens ~path = match Files.readFile path with - | None -> Protocol.null |> print_endline + | None -> print_null () | Some source -> let kindFile = Files.classifySourceFile path in let tokens = SemanticTokens.semanticTokens ~source ~kindFile in - let data = SemanticTokens.Token.arrayToJsonString tokens.data in - Printf.printf "{\"data\":%s}" data + Lsp.Types.SemanticTokens.yojson_of_t tokens |> print_string let test ~path = Uri.stripPath := true; @@ -327,26 +323,61 @@ let test ~path = in Sys.remove currentFile; codeActions - |> List.iter (fun {Protocol.title; edit = {documentChanges}} -> + |> List.iter (fun {Lsp.Types.CodeAction.title; edit} -> Printf.printf "Hit: %s\n" title; - documentChanges - |> List.iter (fun dc -> - match dc with - | Protocol.TextDocumentEdit tde -> - Printf.printf "\nTextDocumentEdit: %s\n" - tde.textDocument.uri; + match edit with + | Some {documentChanges} -> + documentChanges |> Option.get + |> List.iter + (fun + (dc : + [ `CreateFile of Lsp.Types.CreateFile.t + | `DeleteFile of Lsp.Types.DeleteFile.t + | `RenameFile of Lsp.Types.RenameFile.t + | `TextDocumentEdit of + Lsp.Types.TextDocumentEdit.t ]) + -> + match dc with + | `TextDocumentEdit tde -> + let filename = + tde.textDocument.uri |> Uri.toPath + |> Filename.basename + in + Printf.printf "\nTextDocumentEdit: %s\n" filename; - tde.edits - |> List.iter (fun {Protocol.range; newText} -> - let indent = - String.make range.start.character ' ' - in - Printf.printf - "%s\nnewText:\n%s<--here\n%s%s\n" - (Protocol.stringifyRange range) - indent indent newText) - | CreateFile cf -> - Printf.printf "\nCreateFile: %s\n" cf.uri)) + tde.edits + |> List.iter + (fun + (edit : + [ `AnnotatedTextEdit of + Lsp.Types.AnnotatedTextEdit.t + | `TextEdit of Lsp.Types.TextEdit.t ]) + -> + let start_char, newText, range = + match edit with + | `TextEdit te -> + ( te.range.start.character, + te.newText, + te.range ) + | `AnnotatedTextEdit te -> + ( te.range.start.character, + te.newText, + te.range ) + in + let indent = String.make start_char ' ' in + Printf.printf + "%s\nnewText:\n%s<--here\n%s%s\n" + (Lsp.Types.Range.yojson_of_t range + |> Yojson.Safe.pretty_to_string) + indent indent newText) + | `CreateFile cf -> + let filename = + cf.uri |> Uri.toPath |> Filename.basename + in + Printf.printf "\nCreateFile: %s\n" filename + | _ -> + failwith "not implemented text document edit test") + | None -> ()) | "c-a" -> let hint = String.sub rest 3 (String.length rest - 3) in print_endline diff --git a/analysis/src/CodeActions.ml b/analysis/src/CodeActions.ml index 013395b3abe..8f64eaba9a7 100644 --- a/analysis/src/CodeActions.ml +++ b/analysis/src/CodeActions.ml @@ -1,27 +1,23 @@ (* This is the return that's expected when resolving code actions *) -type result = Protocol.codeAction list - -let stringifyCodeActions codeActions = - Printf.sprintf {|%s|} - (codeActions |> List.map Protocol.stringifyCodeAction |> Protocol.array) let make ~title ~kind ~uri ~newText ~range = - let uri = uri |> Uri.fromPath |> Uri.toString in - { - Protocol.title; - codeActionKind = kind; - edit = - { - documentChanges = - [ - TextDocumentEdit - { - Protocol.textDocument = {version = None; uri}; - edits = [{newText; range}]; - }; - ]; - }; - } + let textDocument = + Lsp.Types.OptionalVersionedTextDocumentIdentifier.create + ~uri:(Uri.fromString uri) () + in + let edit = + Lsp.Types.WorkspaceEdit.create + ~documentChanges: + [ + `TextDocumentEdit + (Lsp.Types.TextDocumentEdit.create + ~edits:[`TextEdit (Lsp.Types.TextEdit.create ~range ~newText)] + ~textDocument); + ] + () + in + Lsp.Types.CodeAction.create ~title ~kind ~edit () let makeWithDocumentChanges ~title ~kind ~documentChanges = - {Protocol.title; codeActionKind = kind; edit = {documentChanges}} + let edit = Lsp.Types.WorkspaceEdit.create ~documentChanges () in + Lsp.Types.CodeAction.create ~title ~kind ~edit () diff --git a/analysis/src/Commands.ml b/analysis/src/Commands.ml index 0ce67fad485..78d35a331b3 100644 --- a/analysis/src/Commands.ml +++ b/analysis/src/Commands.ml @@ -33,7 +33,13 @@ let completionResolve ~(full : SharedTypes.full option) ~modulePath = None | Some file -> Some (file.structure.docstring |> String.concat "\n\n")) in - docstring + match docstring with + | None -> None + | Some value -> + Some + (`MarkupContent + (Lsp.Types.MarkupContent.create ~kind:Lsp.Types.MarkupKind.Markdown + ~value)) let hover ~source ~kindFile ~pos ~supportsMarkdownLinks ~full ~debug = let result = @@ -72,17 +78,21 @@ let hover ~source ~kindFile ~pos ~supportsMarkdownLinks ~full ~debug = if skipZero then None else Hover.newHover ~supportsMarkdownLinks ~full locItem) in - result + match result with + | None -> None + | Some value -> + Some + (Lsp.Types.Hover.create + ~contents: + (`MarkupContent + (Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown ~value)) + ()) let signatureHelp ~source ~kindFile ~pos ~allowForConstructorPayloads ~full ~debug = - match - SignatureHelp.signatureHelp ~debug ~source ~kindFile ~pos - ~allowForConstructorPayloads ~full - with - | None -> - {Protocol.signatures = []; activeSignature = None; activeParameter = None} - | Some res -> res + SignatureHelp.signatureHelp ~debug ~source ~kindFile ~pos + ~allowForConstructorPayloads ~full let definition ~full ~pos ~debug = let locationOpt = @@ -112,10 +122,8 @@ let definition ~full ~pos ~debug = if skipLoc then None else Some - { - Protocol.uri = Files.canonicalizeUri uri; - range = Utils.cmtLocToRange loc; - } + (Lsp.Types.Location.create ~range:(Utils.cmtLocToRange loc) + ~uri:(Files.canonicalizeUri uri |> Uri.fromString)) | Some _ -> None)) in locationOpt @@ -132,10 +140,8 @@ let typeDefinition ~full ~pos ~debug = | None -> None | Some (uri, loc) -> Some - { - Protocol.uri = Files.canonicalizeUri uri; - range = Utils.cmtLocToRange loc; - })) + (Lsp.Types.Location.create ~range:(Utils.cmtLocToRange loc) + ~uri:(Files.canonicalizeUri uri |> Uri.fromString)))) in maybeLocation @@ -157,10 +163,8 @@ let references ~full ~pos ~debug = | None -> Uri.toTopLevelLoc uri2 in - { - Protocol.uri = Uri.toString uri2; - range = Utils.cmtLocToRange loc; - } + Lsp.Types.Location.create ~range:(Utils.cmtLocToRange loc) + ~uri:(Uri.toString uri2 |> Uri.fromString) :: acc) []) in @@ -190,16 +194,20 @@ let rename ~full ~pos ~newName ~debug = referencesToToplevelModules |> List.map (fun uri -> let path = Uri.toPath uri in - let dir = Filename.dirname path in + let dir = + match Filename.dirname path with + | "." -> "" + | other -> other + in let newPath = Filename.concat dir (newName ^ Filename.extension path) in - let newUri = Uri.fromPath newPath in - Protocol. - { - oldUri = uri |> Uri.toString; - newUri = newUri |> Uri.toString; - }) + `RenameFile + (Lsp.Types.RenameFile.create + ~newUri: + (newPath |> Uri.fromPath |> Uri.toString |> Uri.fromPath) + ~oldUri:(uri |> Uri.toString |> Uri.fromString) + ())) in let textDocumentEdits = let module StringMap = Misc.StringMap in @@ -209,8 +217,9 @@ let rename ~full ~pos ~newName ~debug = |> List.fold_left (fun acc (uri, loc) -> let textEdit = - Protocol. - {range = Utils.cmtLocToRange loc; newText = newName} + `TextEdit + (Lsp.Types.TextEdit.create ~newText:newName + ~range:(Utils.cmtLocToRange loc)) in match StringMap.find_opt uri acc with | None -> StringMap.add uri [textEdit] acc @@ -220,16 +229,27 @@ let rename ~full ~pos ~newName ~debug = in StringMap.fold (fun uri edits acc -> + let textDocument = + Lsp.Types.OptionalVersionedTextDocumentIdentifier.create + ~version:0 ~uri:(Uri.fromString uri) () + in let textDocumentEdit = - Protocol.{textDocument = {uri; version = None}; edits} + `TextDocumentEdit + (Lsp.Types.TextDocumentEdit.create ~edits ~textDocument) in textDocumentEdit :: acc) textEditsByUri [] in - Some (fileRenames, textDocumentEdits)) + let documentChanges = fileRenames @ textDocumentEdits in + Some (Lsp.Types.WorkspaceEdit.create ~documentChanges ())) in result +type prepareRenameResult = { + range: Lsp.Types.Range.t; + placeholder: string option; +} + let prepareRename ~full ~pos ~debug = match full with | None -> None @@ -245,10 +265,7 @@ let prepareRename ~full ~pos ~debug = Some name | _ -> None in - Some - (match placeholderOpt with - | None -> Protocol.Range range - | Some placeholder -> Protocol.Placeholder {range; placeholder})) + Some {range; placeholder = placeholderOpt}) let format ~source ~kindFile = let create_range text = @@ -259,15 +276,12 @@ let format ~source ~kindFile = | Some line -> String.length line | None -> 0 in - Protocol. - { - range = - { - start = {line = 0; character = 0}; - end_ = {line = lines_len - 1; character}; - }; - newText = text; - } + let range = + Lsp.Types.Range.create + ~start:(Lsp.Types.Position.create ~line:0 ~character:0) + ~end_:(Lsp.Types.Position.create ~line:(lines_len - 1) ~character) + in + Lsp.Types.TextEdit.create ~newText:text ~range in let result = diff --git a/analysis/src/CompletionBackEnd.ml b/analysis/src/CompletionBackEnd.ml index 4ea79d7755a..8d934ca165d 100644 --- a/analysis/src/CompletionBackEnd.ml +++ b/analysis/src/CompletionBackEnd.ml @@ -379,8 +379,9 @@ let kindToDetail name (kind : Completion.kind) = let kindToData filePath (kind : Completion.kind) = match kind with - | FileModule f -> Some [("modulePath", f); ("filePath", filePath)] - | _ -> None + | FileModule f -> + Some (`Assoc [("modulePath", `String f); ("filePath", `String filePath)]) + | _ -> Some `Null let findAllCompletions ~(env : QueryEnv.t) ~prefix ~exact ~namesUsed ~(completionContext : Completable.completionContext) = @@ -816,24 +817,29 @@ let mkItem ?data ?additionalTextEdits name ~kind ~detail ~deprecated ~docstring let tags = match deprecated with | None -> [] - | Some _ -> [1 (* deprecated *)] + | Some _ -> [Lsp.Types.CompletionItemTag.Deprecated (* deprecated *)] in - Protocol. - { - label = name; - kind; - tags; - detail; - documentation = - (if docContent = "" then None - else Some {kind = "markdown"; value = docContent}); - sortText = None; - insertText = None; - insertTextFormat = None; - filterText = None; - data; - additionalTextEdits; - } + + let documentation = + match String.length docContent > 0 with + | true -> + Some + (`MarkupContent + (Lsp.Types.MarkupContent.create ~kind:Lsp.Types.MarkupKind.Markdown + ~value:docContent)) + | false -> None + in + + let deprecated = if Option.is_some deprecated then Some true else None in + let data = + match data with + | Some `Null | None -> None + | Some other -> Some other + in + + Lsp.Types.CompletionItem.create ~label:name ~kind ~tags ~detail ?documentation + ?deprecated ?data ?additionalTextEdits ?sortText:None ?insertText:None + ?insertTextFormat:None ?filterText:None () let completionToItem { @@ -852,7 +858,7 @@ let completionToItem let item = mkItem name ?additionalTextEdits ?data:(kindToData (full.file.uri |> Uri.toPath) kind) - ~kind:(Completion.kindToInt kind) + ~kind:(Completion.kindToLspCompletionItem kind) ~deprecated ~detail: (match detail with @@ -2129,12 +2135,12 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable = if debug then print_endline "Could not read package.json"; [] | Some s -> ( - match Json.parse s with - | Some (Object items) -> + match YojsonHelpers.from_string_opt s with + | Some (`Assoc items) -> items |> List.filter_map (fun (key, t) -> match (key, t) with - | ("dependencies" | "devDependencies"), Json.Object o -> + | ("dependencies" | "devDependencies"), `Assoc o -> Some (o |> List.filter_map (fun (pkgName, _) -> diff --git a/analysis/src/Diagnostics.ml b/analysis/src/Diagnostics.ml index 970936c022b..1dad9a9b6fa 100644 --- a/analysis/src/Diagnostics.ml +++ b/analysis/src/Diagnostics.ml @@ -8,16 +8,18 @@ let document_syntax ~source ~kindFile = let _, endline, endcol = Location.get_pos_info (Res_diagnostics.get_end_pos diagnostic) in - Protocol. - { - range = - { - start = {line = startline - 1; character = startcol}; - end_ = {line = endline - 1; character = endcol}; - }; - message = Res_diagnostics.explain diagnostic; - severity = 1; - }) + let range = + Lsp.Types.Range.create + ~start: + (Lsp.Types.Position.create ~line:(startline - 1) + ~character:startcol) + ~end_: + (Lsp.Types.Position.create ~line:(endline - 1) + ~character:endcol) + in + Lsp.Types.Diagnostic.create ~range + ~message:(`String (Res_diagnostics.explain diagnostic)) + ~severity:Lsp.Types.DiagnosticSeverity.Error ()) in if kindFile = Files.Res then let parseImplementation = diff --git a/analysis/src/DocumentSymbol.ml b/analysis/src/DocumentSymbol.ml index 0e5b982b5bf..856b0299063 100644 --- a/analysis/src/DocumentSymbol.ml +++ b/analysis/src/DocumentSymbol.ml @@ -1,29 +1,5 @@ (* https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentSymbol *) -type kind = - | Module - | Property - | Constructor - | Function - | Variable - | Constant - | String - | Number - | EnumMember - | TypeParameter - -let kindNumber = function - | Module -> 2 - | Property -> 7 - | Constructor -> 9 - | Function -> 12 - | Variable -> 13 - | Constant -> 14 - | String -> 15 - | Number -> 16 - | EnumMember -> 22 - | TypeParameter -> 26 - let command ~path = let symbols = ref [] in let addSymbol name loc kind = @@ -33,19 +9,21 @@ let command ~path = && loc.loc_end.pos_cnum >= 0 then let range = Utils.cmtLocToRange loc in - let symbol : Protocol.documentSymbolItem = - {name; range; kind = kindNumber kind; children = []} + let symbol = + Lsp.Types.DocumentSymbol.create ~name ~range ~selectionRange:range + ~children:[] ~kind () in symbols := symbol :: !symbols in let rec exprKind (exp : Parsetree.expression) = match exp.pexp_desc with - | Pexp_fun _ -> Function + | Pexp_fun _ -> Lsp.Types.SymbolKind.Function | Pexp_constraint (e, _) -> exprKind e - | Pexp_constant (Pconst_string _) -> String - | Pexp_constant (Pconst_float _ | Pconst_integer _) -> Number - | Pexp_constant _ -> Constant - | _ -> Variable + | Pexp_constant (Pconst_string _) -> Lsp.Types.SymbolKind.String + | Pexp_constant (Pconst_float _ | Pconst_integer _) -> + Lsp.Types.SymbolKind.Number + | Pexp_constant _ -> Lsp.Types.SymbolKind.Constant + | _ -> Lsp.Types.SymbolKind.Variable in let processTypeKind (tk : Parsetree.type_kind) = match tk with @@ -153,7 +131,7 @@ let command ~path = end_ = {line = el1; character = ec1}; }; } : - Protocol.documentSymbolItem) + Lsp.Types.DocumentSymbol.t) ({ range = { @@ -161,12 +139,12 @@ let command ~path = end_ = {line = el2; character = ec2}; }; } : - Protocol.documentSymbolItem) = + Lsp.Types.DocumentSymbol.t) = (sl1 > sl2 || (sl1 = sl2 && sc1 >= sc2)) && (el1 < el2 || (el1 = el2 && ec1 <= ec2)) in - let compareSymbol (s1 : Protocol.documentSymbolItem) - (s2 : Protocol.documentSymbolItem) = + let compareSymbol (s1 : Lsp.Types.DocumentSymbol.t) + (s2 : Lsp.Types.DocumentSymbol.t) = let n = compare s1.range.start.line s2.range.start.line in if n <> 0 then n else @@ -182,10 +160,13 @@ let command ~path = | [] -> [symbol] | last :: rest -> if isInside symbol last then - let newLast = - {last with children = last.children |> addSymbolToChildren ~symbol} - in - newLast :: rest + match last.children with + | Some c -> + let newLast = + {last with children = Some (c |> addSymbolToChildren ~symbol)} + in + newLast :: rest + | _ -> rest else symbol :: children in let rec addSortedSymbolsToChildren ~sortedSymbols children = @@ -198,4 +179,6 @@ let command ~path = in let sortedSymbols = !symbols |> List.sort compareSymbol in let symbolsWithChildren = [] |> addSortedSymbolsToChildren ~sortedSymbols in - print_endline (Protocol.stringifyDocumentSymbolItems symbolsWithChildren) + `List (symbolsWithChildren |> List.map Lsp.Types.DocumentSymbol.yojson_of_t) + |> Yojson.Safe.pretty_to_string ~std:true + |> print_endline diff --git a/analysis/src/FindFiles.ml b/analysis/src/FindFiles.ml index 9b2fd500849..9457640f958 100644 --- a/analysis/src/FindFiles.ml +++ b/analysis/src/FindFiles.ml @@ -6,33 +6,34 @@ let bind f x = Option.bind x f let getSourceDirectories ~includeDev ~baseDir config = let rec handleItem current item = match item with - | Json.Array contents -> - List.map (handleItem current) contents |> List.concat - | Json.String text -> [current /+ text] - | Json.Object _ -> ( + | `List contents -> List.map (handleItem current) contents |> List.concat + | `String text -> [current /+ text] + | `Assoc _ -> ( let dir = - item |> Json.get "dir" |> bind Json.string + item |> YojsonHelpers.get "dir" + |> bind Yojson.Safe.Util.to_string_option |> Option.value ~default:"Must specify directory" in let typ = if includeDev then "lib" else - item |> Json.get "type" |> bind Json.string + item |> YojsonHelpers.get "type" + |> bind Yojson.Safe.Util.to_string_option |> Option.value ~default:"lib" in if typ = "dev" then [] else - match item |> Json.get "subdirs" with - | None | Some Json.False -> [current /+ dir] - | Some Json.True -> + match item |> YojsonHelpers.get "subdirs" with + | None | Some (`Bool false) -> [current /+ dir] + | Some (`Bool true) -> Files.collectDirs (baseDir /+ current /+ dir) |> List.filter (fun name -> name <> Filename.current_dir_name) |> List.map (Files.relpath baseDir) | Some item -> (current /+ dir) :: handleItem (current /+ dir) item) | _ -> failwith "Invalid subdirs entry" in - match config |> Json.get "sources" with + match config |> YojsonHelpers.get "sources" with | None -> [] | Some item -> handleItem "" item @@ -94,28 +95,36 @@ let nameSpaceToName n = |> String.concat "" let getNamespace config = - let ns = config |> Json.get "namespace" in - let fromString = ns |> bind Json.string in + let ns = config |> YojsonHelpers.get "namespace" in + let fromString = ns |> bind Yojson.Safe.Util.to_string_option in let isNamespaced = - ns |> bind Json.bool |> Option.value ~default:(fromString |> Option.is_some) + ns + |> bind Yojson.Safe.Util.to_bool_option + |> Option.value ~default:(fromString |> Option.is_some) in let either x y = if x = None then y else x in if isNamespaced then - let fromName = config |> Json.get "name" |> bind Json.string in + let fromName = + config |> YojsonHelpers.get "name" + |> bind Yojson.Safe.Util.to_string_option + in either fromString fromName |> Option.map nameSpaceToName else None module StringSet = Set.Make (String) let getPublic config = - let public = config |> Json.get "public" in + let public = config |> YojsonHelpers.get "public" in match public with | None -> None | Some public -> ( - match public |> Json.array with + match public |> YojsonHelpers.to_list_opt with | None -> None | Some public -> - Some (public |> List.filter_map Json.string |> StringSet.of_list)) + Some + (public + |> List.filter_map Yojson.Safe.Util.to_string_option + |> StringSet.of_list)) let collectFiles directory = let allFiles = Files.readDirectory directory in @@ -141,7 +150,7 @@ let collectFiles directory = let readSourcedirsPackageRoots base = let sourceDirsFile = base /+ "lib" /+ "bs" /+ ".sourcedirs.json" in let readPackageEntry = function - | Json.Array [Json.String name; Json.String path] -> + | `List [`String name; `String path] -> let path = if Filename.is_relative path then base /+ path else path in Some (name, path) | _ -> None @@ -149,10 +158,12 @@ let readSourcedirsPackageRoots base = match Files.readFile sourceDirsFile with | None -> [] | Some text -> ( - match Json.parse text with + match YojsonHelpers.from_string_opt text with | None -> [] | Some json -> ( - match json |> Json.get "pkgs" |> bind Json.array with + match + json |> YojsonHelpers.get "pkgs" |> bind YojsonHelpers.to_list_opt + with | None -> [] | Some packages -> packages |> List.filter_map readPackageEntry)) @@ -242,20 +253,29 @@ let findProjectFiles ~public ~namespace ~path ~sourceDirectories ~libBs = let findDependencyFiles base config = let deps = match - ( config |> Json.get "dependencies" |> bind Json.array, - config |> Json.get "bs-dependencies" |> bind Json.array ) + ( config + |> YojsonHelpers.get "dependencies" + |> bind YojsonHelpers.to_list_opt, + config + |> YojsonHelpers.get "bs-dependencies" + |> bind YojsonHelpers.to_list_opt ) with | None, None -> [] - | Some deps, None | _, Some deps -> deps |> List.filter_map Json.string + | Some deps, None | _, Some deps -> + deps |> List.filter_map Yojson.Safe.Util.to_string_option in let devDeps = match - ( config |> Json.get "dev-dependencies" |> bind Json.array, - config |> Json.get "bs-dev-dependencies" |> bind Json.array ) + ( config + |> YojsonHelpers.get "dev-dependencies" + |> bind YojsonHelpers.to_list_opt, + config + |> YojsonHelpers.get "bs-dev-dependencies" + |> bind YojsonHelpers.to_list_opt ) with | None, None -> [] | Some devDeps, None | _, Some devDeps -> - devDeps |> List.filter_map Json.string + devDeps |> List.filter_map (fun x -> Some (Yojson.Safe.Util.to_string x)) in let deps = deps @ devDeps in Log.log ("Dependencies: " ^ String.concat " " deps); @@ -264,12 +284,12 @@ let findDependencyFiles base config = deps |> List.map (fun name -> let result = - Json.bind (findPackageRoot ~base ~sourcedirsPackageRoots name) + bind (fun path -> let rescriptJsonPath = path /+ "rescript.json" in let parseText text = - match Json.parse text with + match YojsonHelpers.from_string_opt text with | Some inner -> ( let namespace = getNamespace inner in let sourceDirectories = @@ -298,6 +318,7 @@ let findDependencyFiles base config = match Files.readFile rescriptJsonPath with | Some text -> parseText text | None -> None) + (findPackageRoot ~base ~sourcedirsPackageRoots name) in match result with diff --git a/analysis/src/Hint.ml b/analysis/src/Hint.ml index 81881be3bc0..d5f10838077 100644 --- a/analysis/src/Hint.ml +++ b/analysis/src/Hint.ml @@ -1,8 +1,8 @@ open SharedTypes type inlayHintKind = Type -let inlayKindToNumber = function - | Type -> 1 +let inlayKindToLspInlayHint = function + | Type -> Lsp.Types.InlayHintKind.Type let locItemToTypeHint ~full:{file; package} locItem = match locItem.locType with @@ -83,7 +83,7 @@ let inlay ~source ~kindFile ~pos ~maxLength ~full ~debug = | Some full -> let result = !hints - |> List.filter_map (fun ((range : Protocol.range), hintKind) -> + |> List.filter_map (fun ((range : Lsp.Types.Range.t), hintKind) -> match References.getLocItem ~full ~pos:(range.start.line, range.start.character + 1) @@ -91,20 +91,17 @@ let inlay ~source ~kindFile ~pos ~maxLength ~full ~debug = with | None -> None | Some locItem -> ( - let position : Protocol.position = - {line = range.start.line; character = range.end_.character} + let position = + Lsp.Types.Position.create ~line:range.start.line + ~character:range.end_.character in match locItemToTypeHint locItem ~full with | Some label -> ( + let kind = inlayKindToLspInlayHint hintKind in + let label = ": " ^ label in let result = - Protocol. - { - kind = inlayKindToNumber hintKind; - position; - paddingLeft = true; - paddingRight = false; - label = ": " ^ label; - } + Lsp.Types.InlayHint.create ~position ~kind ~paddingLeft:true + ~paddingRight:false ~label:(`String label) () in match maxlen with | Some value -> @@ -148,29 +145,24 @@ let codeLens ~source ~kindFile ~full ~debug = | Some full -> let result = !lenses - |> List.filter_map (fun (range : Protocol.range) -> + |> List.filter_map (fun (range : Lsp.Types.Range.t) -> match References.getLocItem ~full ~pos:(range.start.line, range.start.character + 1) ~debug with | Some {locType = Typed (_, typeExpr, _)} -> - Some - Protocol. - { - range; - command = - Some - { - (* Code lenses can run commands. An empty command string means we just want the editor - to print the text, not link to running a command. *) - command = ""; - (* Print the type with a huge line width, because the code lens always prints on a - single line in the editor. *) - title = - typeExpr |> Shared.typeToString ~lineWidth:400; - }; - } + (* Code lenses can run commands. An empty command string means we just want the editor + to print the text, not link to running a command. *) + let command = + Lsp.Types.Command.create + ~command:"" + (* Print the type with a huge line width, because the code lens always prints on a + single line in the editor. *) + ~title:(typeExpr |> Shared.typeToString ~lineWidth:400) + () + in + Some (Lsp.Types.CodeLens.create ~range ~command ()) | _ -> None) in Some result diff --git a/analysis/src/Loc.ml b/analysis/src/Loc.ml index 635b787128e..6febb9a6267 100644 --- a/analysis/src/Loc.ml +++ b/analysis/src/Loc.ml @@ -9,18 +9,18 @@ let toString (loc : t) = let hasPos ~pos loc = start loc <= pos && pos < end_ loc -(** Allows the character after the end to be included. Ie when the cursor is at the +(** Allows the character after the end to be included. Ie when the cursor is at the end of the word, like `someIdentifier`. Useful in some scenarios. *) let hasPosInclusiveEnd ~pos loc = start loc <= pos && pos <= end_ loc let mkPosition (pos : Pos.t) = let line, character = pos in - {Protocol.line; character} + Lsp.Types.Position.create ~line ~character let rangeOfLoc (loc : t) = let start = loc |> start |> mkPosition in let end_ = loc |> end_ |> mkPosition in - {Protocol.start; end_} + Lsp.Types.Range.create ~start ~end_ let isInside (x : t) (y : t) = x.loc_start.pos_cnum >= y.loc_start.pos_cnum diff --git a/analysis/src/Markdown.ml b/analysis/src/Markdown.ml index 0f82050fb0d..16d7f0c7a26 100644 --- a/analysis/src/Markdown.ml +++ b/analysis/src/Markdown.ml @@ -2,7 +2,7 @@ let spacing = "\n```\n \n```\n" let codeBlock code = Printf.sprintf "```rescript\n%s\n```" code let divider = "\n---\n" -type link = {startPos: Protocol.position; file: string; label: string} +type link = {startPos: Lsp.Types.Position.t; file: string; label: string} let linkToCommandArgs link = Printf.sprintf "[\"%s\",%i,%i]" link.file link.startPos.line diff --git a/analysis/src/Packages.ml b/analysis/src/Packages.ml index 8852119d17f..5edab49e2cf 100644 --- a/analysis/src/Packages.ml +++ b/analysis/src/Packages.ml @@ -41,38 +41,38 @@ let newBsPackage ~rootPath = | true -> BuildSystem.getStdlib rootPath | false -> BuildSystem.getLibBs rootPath in - match Json.parse raw with + match YojsonHelpers.from_string_opt raw with | Some config -> ( let namespace = FindFiles.getNamespace config in let rescriptVersion = getReScriptVersion () in let suffix = - match config |> Json.get "suffix" with - | Some (String suffix) -> suffix + match config |> YojsonHelpers.get "suffix" with + | Some (`String suffix) -> suffix | _ -> ".js" in let genericJsxModule = - let jsxConfig = config |> Json.get "jsx" in + let jsxConfig = config |> YojsonHelpers.get "jsx" in match jsxConfig with | Some jsxConfig -> ( - match jsxConfig |> Json.get "module" with - | Some (String m) when String.lowercase_ascii m <> "react" -> Some m + match jsxConfig |> YojsonHelpers.get "module" with + | Some (`String m) when String.lowercase_ascii m <> "react" -> Some m | _ -> None) | None -> None in let autocomplete = - match config |> Json.get "editor" with + match config |> YojsonHelpers.get "editor" with | Some editorConfig -> ( - match editorConfig |> Json.get "autocomplete" with - | Some (Object map) -> + match editorConfig |> YojsonHelpers.get "autocomplete" with + | Some (`Assoc map) -> map |> List.fold_left (fun acc (key, value) -> match value with - | Json.Array items -> + | `List items -> let values = items |> List.filter_map (function - | Json.String s -> Some s + | `String s -> Some s | _ -> None) in Misc.StringMap.add key values acc @@ -132,8 +132,10 @@ let newBsPackage ~rootPath = let bind f x = Option.bind x f in let compiler_flags = match - ( Json.get "compiler-flags" config |> bind Json.array, - Json.get "bsc-flags" config |> bind Json.array ) + ( YojsonHelpers.get "compiler-flags" config + |> bind YojsonHelpers.to_list_opt, + YojsonHelpers.get "bsc-flags" config + |> bind YojsonHelpers.to_list_opt ) with | Some compiler_flags, None | _, Some compiler_flags -> compiler_flags @@ -141,12 +143,15 @@ let newBsPackage ~rootPath = in let no_pervasives = compiler_flags - |> List.exists (fun s -> Json.string s = Some "-nopervasives") + |> List.exists (fun s -> + match s with + | `String s -> s = "-nopervasives" + | _ -> false) in let opens_from_compiler_flags = List.fold_left (fun opens item -> - match item |> Json.string with + match item |> Yojson.Safe.Util.to_string_option with | None -> opens | Some s -> ( let parts = String.split_on_char ' ' s in diff --git a/analysis/src/Protocol.ml b/analysis/src/Protocol.ml deleted file mode 100644 index 447584b7e9b..00000000000 --- a/analysis/src/Protocol.ml +++ /dev/null @@ -1,388 +0,0 @@ -type position = {line: int; character: int} -type range = {start: position; end_: position} -type markupContent = {kind: string; value: string} - -(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#command *) -type command = {title: string; command: string} - -(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeLens *) -type codeLens = {range: range; command: command option} - -type inlayHint = { - position: position; - label: string; - kind: int; - paddingLeft: bool; - paddingRight: bool; -} - -(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#parameterInformation *) -type parameterInformation = {label: int * int; documentation: markupContent} - -(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#signatureInformation *) -type signatureInformation = { - label: string; - parameters: parameterInformation list; - documentation: markupContent option; -} - -(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#signatureHelp *) -type signatureHelp = { - signatures: signatureInformation list; - activeSignature: int option; - activeParameter: int option; -} - -(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#insertTextFormat *) -type insertTextFormat = Snippet - -let insertTextFormatToInt f = - match f with - | Snippet -> 2 - -type textEdit = {range: range; newText: string} - -type completionItem = { - label: string; - kind: int; - tags: int list; - detail: string; - sortText: string option; - filterText: string option; - insertTextFormat: insertTextFormat option; - insertText: string option; - documentation: markupContent option; - data: (string * string) list option; - additionalTextEdits: textEdit list option; -} - -type location = {uri: string; range: range} -type documentSymbolItem = { - name: string; - kind: int; - range: range; - children: documentSymbolItem list; -} -type prepareRenameWithPlaceholder = {range: range; placeholder: string} -type prepareRename = - | Range of range - | Placeholder of prepareRenameWithPlaceholder -type renameFile = {oldUri: string; newUri: string} -type diagnostic = {range: range; message: string; severity: int} - -type optionalVersionedTextDocumentIdentifier = { - version: int option; - uri: string; -} - -type textDocumentEdit = { - textDocument: optionalVersionedTextDocumentIdentifier; - edits: textEdit list; -} - -type createFileOptions = {overwrite: bool option; ignoreIfExists: bool option} -type createFile = {uri: string; options: createFileOptions option} - -type documentChange = - | TextDocumentEdit of textDocumentEdit - | CreateFile of createFile - -type codeActionEdit = {documentChanges: documentChange list} -type codeActionKind = RefactorRewrite - -type codeAction = { - title: string; - codeActionKind: codeActionKind; - edit: codeActionEdit; -} - -type semanticTokens = {data: int array} - -let wrapInQuotes s = "\"" ^ Json.escape s ^ "\"" - -let null = "null" -let array l = "[" ^ String.concat ", " l ^ "]" - -let stringifyPosition p = - Printf.sprintf {|{"line": %i, "character": %i}|} p.line p.character - -let stringifyRange r = - Printf.sprintf {|{"start": %s, "end": %s}|} - (stringifyPosition r.start) - (stringifyPosition r.end_) - -let stringifyRangeWithPlaceholder (r : prepareRenameWithPlaceholder) = - Printf.sprintf - {|{ - "range": %s, - "placeholder": %s - }|} - (stringifyRange r.range) - (wrapInQuotes r.placeholder) - -let stringifyTextEdit (te : textEdit) = - Printf.sprintf - {|{ - "range": %s, - "newText": %s - }|} - (stringifyRange te.range) (wrapInQuotes te.newText) - -let stringifyMarkupContent (m : markupContent) = - Printf.sprintf {|{"kind": %s, "value": %s}|} (wrapInQuotes m.kind) - (wrapInQuotes m.value) - -(** None values are not emitted in the output. *) -let stringifyObject ?(startOnNewline = false) ?(indentation = 1) properties = - let indentationStr = String.make (indentation * 2) ' ' in - (if startOnNewline then "\n" ^ indentationStr else "") - ^ {|{ -|} - ^ (properties - |> List.filter_map (fun (key, value) -> - match value with - | None -> None - | Some v -> - Some (Printf.sprintf {|%s "%s": %s|} indentationStr key v)) - |> String.concat ",\n") - ^ "\n" ^ indentationStr ^ "}" - -let optWrapInQuotes s = - match s with - | None -> None - | Some s -> Some (wrapInQuotes s) - -let stringifyResult = function - | Ok r -> stringifyObject [("TAG", Some (wrapInQuotes "Ok")); ("_0", Some r)] - | Error e -> - stringifyObject [("TAG", Some (wrapInQuotes "Error")); ("_0", Some e)] - -let stringifyCompletionItem c = - stringifyObject - [ - ("label", Some (wrapInQuotes c.label)); - ("kind", Some (string_of_int c.kind)); - ("tags", Some (c.tags |> List.map string_of_int |> array)); - ("detail", Some (wrapInQuotes c.detail)); - ( "documentation", - Some - (match c.documentation with - | None -> null - | Some doc -> stringifyMarkupContent doc) ); - ("sortText", optWrapInQuotes c.sortText); - ("filterText", optWrapInQuotes c.filterText); - ("insertText", optWrapInQuotes c.insertText); - ( "insertTextFormat", - match c.insertTextFormat with - | None -> None - | Some insertTextFormat -> - Some (Printf.sprintf "%i" (insertTextFormatToInt insertTextFormat)) ); - ( "data", - match c.data with - | None -> None - | Some fields -> - Some - (fields - |> List.map (fun (key, value) -> (key, Some (wrapInQuotes value))) - |> stringifyObject ~indentation:2) ); - ( "additionalTextEdits", - match c.additionalTextEdits with - | Some additionalTextEdits -> - Some (additionalTextEdits |> List.map stringifyTextEdit |> array) - | None -> None ); - ] - -let stringifyHover value = - Printf.sprintf {|{"contents": %s}|} - (stringifyMarkupContent {kind = "markdown"; value}) - -let stringifyLocation (h : location) = - Printf.sprintf {|{"uri": %s, "range": %s}|} (wrapInQuotes h.uri) - (stringifyRange h.range) - -let stringifyDocumentSymbolItems items = - let buf = Buffer.create 10 in - let stringifyName name = Printf.sprintf "\"%s\"" (Json.escape name) in - let stringifyKind kind = string_of_int kind in - let emitStr = Buffer.add_string buf in - let emitSep () = emitStr ",\n" in - let rec emitItem ~indent item = - let openBrace = Printf.sprintf "%s{\n" indent in - let closeBrace = Printf.sprintf "\n%s}" indent in - let indent = indent ^ " " in - let emitField name s = - emitStr (Printf.sprintf "%s\"%s\": %s" indent name s) - in - emitStr openBrace; - emitField "name" (stringifyName item.name); - emitSep (); - emitField "kind" (stringifyKind item.kind); - emitSep (); - emitField "range" (stringifyRange item.range); - emitSep (); - emitField "selectionRange" (stringifyRange item.range); - if item.children <> [] then ( - emitSep (); - emitField "children" "[\n"; - emitBody ~indent (List.rev item.children); - emitStr "]"); - emitStr closeBrace - and emitBody ~indent items = - match items with - | [] -> () - | item :: rest -> - emitItem ~indent item; - if rest <> [] then emitSep (); - emitBody ~indent rest - in - let indent = "" in - emitStr "[\n"; - emitBody ~indent (List.rev items); - emitStr "\n]"; - Buffer.contents buf - -let stringifyRenameFile {oldUri; newUri} = - Printf.sprintf {|{ - "kind": "rename", - "oldUri": %s, - "newUri": %s -}|} - (wrapInQuotes oldUri) (wrapInQuotes newUri) - -let stringifyoptionalVersionedTextDocumentIdentifier td = - Printf.sprintf {|{ - "version": %s, - "uri": %s - }|} - (match td.version with - | None -> null - | Some v -> string_of_int v) - (wrapInQuotes td.uri) - -let stringifyTextDocumentEdit tde = - Printf.sprintf {|{ - "textDocument": %s, - "edits": %s - }|} - (stringifyoptionalVersionedTextDocumentIdentifier tde.textDocument) - (tde.edits |> List.map stringifyTextEdit |> array) - -let stringifyCreateFile cf = - stringifyObject - [ - ("kind", Some (wrapInQuotes "create")); - ("uri", Some (wrapInQuotes cf.uri)); - ( "options", - match cf.options with - | None -> None - | Some options -> - Some - (stringifyObject - [ - ( "overwrite", - match options.overwrite with - | None -> None - | Some ov -> Some (string_of_bool ov) ); - ( "ignoreIfExists", - match options.ignoreIfExists with - | None -> None - | Some i -> Some (string_of_bool i) ); - ]) ); - ] - -let stringifyDocumentChange dc = - match dc with - | TextDocumentEdit tde -> stringifyTextDocumentEdit tde - | CreateFile cf -> stringifyCreateFile cf - -let codeActionKindToString kind = - match kind with - | RefactorRewrite -> "refactor.rewrite" - -let stringifyCodeActionEdit cae = - Printf.sprintf {|{"documentChanges": %s}|} - (cae.documentChanges |> List.map stringifyDocumentChange |> array) - -let stringifyCodeAction ca = - Printf.sprintf {|{"title": %s, "kind": %s, "edit": %s}|} - (wrapInQuotes ca.title) - (wrapInQuotes (codeActionKindToString ca.codeActionKind)) - (ca.edit |> stringifyCodeActionEdit) - -let stringifyHint (hint : inlayHint) = - Printf.sprintf - {|{ - "position": %s, - "label": %s, - "kind": %i, - "paddingLeft": %b, - "paddingRight": %b -}|} - (stringifyPosition hint.position) - (wrapInQuotes hint.label) hint.kind hint.paddingLeft hint.paddingRight - -let stringifyCommand (command : command) = - Printf.sprintf {|{"title": %s, "command": %s}|} - (wrapInQuotes command.title) - (wrapInQuotes command.command) - -let stringifyCodeLens (codeLens : codeLens) = - Printf.sprintf - {|{ - "range": %s, - "command": %s - }|} - (stringifyRange codeLens.range) - (match codeLens.command with - | None -> "" - | Some command -> stringifyCommand command) - -let stringifyParameterInformation (parameterInformation : parameterInformation) - = - Printf.sprintf {|{"label": %s, "documentation": %s}|} - (let line, chr = parameterInformation.label in - "[" ^ string_of_int line ^ ", " ^ string_of_int chr ^ "]") - (stringifyMarkupContent parameterInformation.documentation) - -let stringifySignatureInformation (signatureInformation : signatureInformation) - = - Printf.sprintf - {|{ - "label": %s, - "parameters": %s%s - }|} - (wrapInQuotes signatureInformation.label) - (signatureInformation.parameters - |> List.map stringifyParameterInformation - |> array) - (match signatureInformation.documentation with - | None -> "" - | Some docs -> - Printf.sprintf ",\n \"documentation\": %s" - (stringifyMarkupContent docs)) - -let stringifySignatureHelp (signatureHelp : signatureHelp) = - Printf.sprintf - {|{ - "signatures": %s, - "activeSignature": %s, - "activeParameter": %s -}|} - (signatureHelp.signatures |> List.map stringifySignatureInformation |> array) - (match signatureHelp.activeSignature with - | None -> null - | Some activeSignature -> activeSignature |> string_of_int) - (match signatureHelp.activeParameter with - | None -> null - | Some activeParameter -> activeParameter |> string_of_int) - -(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnostic *) -let stringifyDiagnostic d = - Printf.sprintf - {|{ - "range": %s, - "message": %s, - "severity": %d, - "source": "ReScript" -}|} - (stringifyRange d.range) (wrapInQuotes d.message) d.severity diff --git a/analysis/src/SemanticTokens.ml b/analysis/src/SemanticTokens.ml index 86feab8ef8d..1862ba612f4 100644 --- a/analysis/src/SemanticTokens.ml +++ b/analysis/src/SemanticTokens.ml @@ -492,4 +492,4 @@ let command ~debug ~emitter ~source ~kindFile = let semanticTokens ~source ~kindFile = let emitter = Token.createEmitter () in command ~emitter ~debug:false ~source ~kindFile; - Protocol.{data = Token.emit emitter} + Lsp.Types.SemanticTokens.create ~data:(Token.emit emitter) () diff --git a/analysis/src/SharedTypes.ml b/analysis/src/SharedTypes.ml index 49752aebf43..cce06e969e9 100644 --- a/analysis/src/SharedTypes.ml +++ b/analysis/src/SharedTypes.ml @@ -833,7 +833,7 @@ module Completion = struct sortText: string option; insertText: string option; filterText: string option; - insertTextFormat: Protocol.insertTextFormat option; + insertTextFormat: Lsp.Types.InsertTextFormat.t option; env: QueryEnv.t; deprecated: string option; docstring: string list; @@ -841,7 +841,7 @@ module Completion = struct detail: string option; typeArgContext: typeArgContext option; data: (string * string) list option; - additionalTextEdits: Protocol.textEdit list option; + additionalTextEdits: Lsp.Types.TextEdit.t list option; synthetic: bool; (** Whether this item is an made up, synthetic item or not. *) } @@ -858,7 +858,8 @@ module Completion = struct sortText; insertText; insertTextFormat = - (if includesSnippets then Some Protocol.Snippet else None); + (if includesSnippets then Some Lsp.Types.InsertTextFormat.Snippet + else None); filterText; detail; typeArgContext; @@ -869,17 +870,18 @@ module Completion = struct (* https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_completion *) (* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItemKind *) - let kindToInt kind = + let kindToLspCompletionItem kind = match kind with - | Module _ -> 9 - | FileModule _ -> 9 - | Constructor (_, _) | PolyvariantConstructor (_, _) -> 4 - | ObjLabel _ -> 4 - | Label _ -> 4 - | Field (_, _) -> 5 - | Type _ | ExtractedType (_, `Type) -> 22 - | Value _ | ExtractedType (_, `Value) -> 12 - | Snippet _ | FollowContextPath _ -> 15 + | Module _ -> Lsp.Types.CompletionItemKind.Module + | FileModule _ -> Lsp.Types.CompletionItemKind.Module + | Constructor (_, _) | PolyvariantConstructor (_, _) -> + Lsp.Types.CompletionItemKind.Constructor + | ObjLabel _ -> Lsp.Types.CompletionItemKind.Constructor + | Label _ -> Lsp.Types.CompletionItemKind.Constructor + | Field (_, _) -> Lsp.Types.CompletionItemKind.Field + | Type _ | ExtractedType (_, `Type) -> Lsp.Types.CompletionItemKind.Struct + | Value _ | ExtractedType (_, `Value) -> Lsp.Types.CompletionItemKind.Value + | Snippet _ | FollowContextPath _ -> Lsp.Types.CompletionItemKind.Snippet end let kindFromInnerType (t : innerType) = diff --git a/analysis/src/SignatureHelp.ml b/analysis/src/SignatureHelp.ml index 68cfc405906..27a53a0ccbb 100644 --- a/analysis/src/SignatureHelp.ml +++ b/analysis/src/SignatureHelp.ml @@ -463,63 +463,71 @@ let signatureHelp ~debug ~source ~kindFile ~pos ~allowForConstructorPayloads let activeParameter = findActiveParameter ~argAtCursor ~args in let paramUnlabelledArgCount = ref 0 in - Some - { - Protocol.signatures = - [ - { - label = fnTypeStr; - parameters = - parameters - |> List.map (fun (argLabel, start, end_) -> - let paramArgCount = !paramUnlabelledArgCount in - paramUnlabelledArgCount := paramArgCount + 1; - let unlabelledArgCount = ref 0 in - { - Protocol.label = (start, end_); - documentation = - (match - args - |> List.find_opt (fun (lbl, _) -> - let argCount = !unlabelledArgCount in - unlabelledArgCount := argCount + 1; - match (lbl, argLabel) with - | ( Asttypes.Optional {txt = l1}, - Asttypes.Optional {txt = l2} ) - when l1 = l2 -> - true - | ( Labelled {txt = l1}, - Labelled {txt = l2} ) - when l1 = l2 -> - true - | Nolabel, Nolabel - when paramArgCount = argCount -> - true - | _ -> false) - with - | None -> - {Protocol.kind = "markdown"; value = ""} - | Some (_, labelTypExpr) -> - { - Protocol.kind = "markdown"; - value = - docsForLabel ~supportsMarkdownLinks ~file - ~package labelTypExpr; - }); - }); - documentation = - (match List.nth_opt docstring 0 with - | None -> None - | Some docs -> - Some {Protocol.kind = "markdown"; value = docs}); - }; - ]; - activeSignature = Some 0; - activeParameter = + let parametersInformation = + parameters + |> List.map (fun (argLabel, start, end_) -> + let paramArgCount = !paramUnlabelledArgCount in + paramUnlabelledArgCount := paramArgCount + 1; + let unlabelledArgCount = ref 0 in + let documentation = + match + args + |> List.find_opt (fun (lbl, _) -> + let argCount = !unlabelledArgCount in + unlabelledArgCount := argCount + 1; + match (lbl, argLabel) with + | ( Asttypes.Optional {txt = l1}, + Asttypes.Optional {txt = l2} ) + when l1 = l2 -> + true + | Labelled {txt = l1}, Labelled {txt = l2} + when l1 = l2 -> + true + | Nolabel, Nolabel when paramArgCount = argCount + -> + true + | _ -> false) + with + | None -> + Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown ~value:"" + | Some (_, labelTypExpr) -> + Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown + ~value: + (docsForLabel ~supportsMarkdownLinks ~file ~package + labelTypExpr) + in + Lsp.Types.ParameterInformation.create + ~label:(`Offset (start, end_)) + ~documentation:(`MarkupContent documentation) ()) + in + let signatures = + Lsp.Types.SignatureInformation.create ~label:fnTypeStr + ~parameters:parametersInformation + ?documentation: + (match List.nth_opt docstring 0 with + | None -> None + | Some docs -> + Some + (`MarkupContent + (Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown ~value:docs))) + ~activeParameter: + (match activeParameter with + | None -> Some (-1) + | activeParameter -> activeParameter) + () + in + let signature = + Lsp.Types.SignatureHelp.create ~signatures:[signatures] + ~activeParameter: (match activeParameter with | None -> Some (-1) - | activeParameter -> activeParameter); - } + | activeParameter -> activeParameter) + ~activeSignature:0 () + in + Some signature | _ -> None) | Some (_, ((`ConstructorExpr (lid, _) | `ConstructorPat (lid, _)) as cs)) -> ( @@ -702,57 +710,68 @@ let signatureHelp ~debug ~source ~kindFile ~pos ~allowForConstructorPayloads | None -> [] | Some (`SingleArg (_, docstring)) -> [ - { - Protocol.label = - (constructorNameLength + 1, String.length label - 1); - documentation = - {Protocol.kind = "markdown"; value = docstring}; - }; + Lsp.Types.ParameterInformation.create + ~label: + (`Offset + (constructorNameLength + 1, String.length label - 1)) + ~documentation: + (`MarkupContent + (Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown ~value:docstring)) + (); ] | Some (`InlineRecord fields) -> - (* Account for leading '({' *) let baseOffset = constructorNameLength + 2 in - { - Protocol.label = (0, 0); - documentation = {Protocol.kind = "markdown"; value = ""}; - } + (* Account for leading '({' *) + Lsp.Types.ParameterInformation.create + ~label:(`Offset (0, 0)) + ~documentation: + (`MarkupContent + (Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown ~value:"")) + () :: (fields |> List.map (fun (_, (field : field), (start, end_)) -> - { - Protocol.label = - (baseOffset + start, baseOffset + end_); - documentation = - { - Protocol.kind = "markdown"; - value = field.docstring |> String.concat "\n"; - }; - })) + Lsp.Types.ParameterInformation.create + ~label: + (`Offset (baseOffset + start, baseOffset + end_)) + ~documentation: + (`MarkupContent + (Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown + ~value: + (field.docstring |> String.concat "\n"))) + ())) | Some (`TupleArg items) -> (* Account for leading '(' *) let baseOffset = constructorNameLength + 1 in items |> List.map (fun (_, docstring, (start, end_)) -> - { - Protocol.label = (baseOffset + start, baseOffset + end_); - documentation = - {Protocol.kind = "markdown"; value = docstring}; - }) + Lsp.Types.ParameterInformation.create + ~label: + (`Offset (baseOffset + start, baseOffset + end_)) + ~documentation: + (`MarkupContent + (Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown + ~value:docstring)) + ()) in - Some - { - Protocol.signatures = - [ - { - label; - parameters = params; - documentation = - (match List.nth_opt constructor.docstring 0 with - | None -> None - | Some docs -> - Some {Protocol.kind = "markdown"; value = docs}); - }; - ]; - activeSignature = Some 0; - activeParameter = Some activeParameter; - })) + let signatures = + Lsp.Types.SignatureInformation.create ~label ~parameters:params + ?documentation: + (match List.nth_opt constructor.docstring 0 with + | None -> None + | Some docs -> + Some + (`MarkupContent + (Lsp.Types.MarkupContent.create + ~kind:Lsp.Types.MarkupKind.Markdown ~value:docs))) + ~activeParameter:(Some activeParameter) () + in + let signature = + Lsp.Types.SignatureHelp.create ~signatures:[signatures] + ~activeParameter:(Some activeParameter) ~activeSignature:0 () + in + Some signature)) | _ -> None)) diff --git a/analysis/src/TypeUtils.ml b/analysis/src/TypeUtils.ml index 466d2f8bcfd..fa85e92e417 100644 --- a/analysis/src/TypeUtils.ml +++ b/analysis/src/TypeUtils.ml @@ -3,7 +3,7 @@ open SharedTypes let modulePathFromEnv env = let moduleName = env.QueryEnv.file.moduleName in let transformedModuleName = - (* Transform namespaced module names from internal format (Context-Kaplay) + (* Transform namespaced module names from internal format (Context-Kaplay) to user-facing format (Kaplay.Context) *) match String.rindex_opt moduleName '-' with | None -> moduleName @@ -1151,15 +1151,15 @@ let getFirstFnUnlabelledArgType ~env ~full t = | _ -> None let makeAdditionalTextEditsForRemovingDot posOfDot = + let start = + Lsp.Types.Position.create ~line:(fst posOfDot) ~character:(snd posOfDot - 1) + in + let end_ = + Lsp.Types.Position.create ~line:(fst posOfDot) ~character:(snd posOfDot) + in [ - { - Protocol.range = - { - start = {line = fst posOfDot; character = snd posOfDot - 1}; - end_ = {line = fst posOfDot; character = snd posOfDot}; - }; - newText = ""; - }; + Lsp.Types.TextEdit.create ~newText:"" + ~range:(Lsp.Types.Range.create ~start ~end_); ] (** Turns a completion into a pipe completion. *) @@ -1184,9 +1184,9 @@ let transformCompletionToPipeCompletion ?(synthetic = false) ~env ?posOfDot | Some posOfDot -> Some (makeAdditionalTextEditsForRemovingDot posOfDot)); } -(** This takes a type expr and the env that type expr was found in, and produces a globally unique +(** This takes a type expr and the env that type expr was found in, and produces a globally unique id for that specific type. The globally unique id is the full path to the type as seen from the root - of the project. Example: type x in module SomeModule in file SomeFile would get the globally + of the project. Example: type x in module SomeModule in file SomeFile would get the globally unique id `SomeFile.SomeModule.x`.*) let rec findRootTypeId ~full ~env (t : Types.type_expr) = let debug = false in diff --git a/analysis/src/Uri.ml b/analysis/src/Uri.ml index 4b1d67f5434..912acbecbf2 100644 --- a/analysis/src/Uri.ml +++ b/analysis/src/Uri.ml @@ -1,27 +1,29 @@ -type t = {path: string; uri: string} +type t = Lsp.Uri.t let stripPath = ref false (* for use in tests *) -let pathToUri path = - if Sys.os_type = "Unix" then "file://" ^ path - else - "file://" - ^ (Str.global_replace (Str.regexp_string "\\") "/" path - |> Str.substitute_first (Str.regexp "^\\([a-zA-Z]\\):") (fun text -> - let name = Str.matched_group 1 text in - "/" ^ String.lowercase_ascii name ^ "%3A")) +let fromPath path = Lsp.Uri.of_path path +let fromString str = Lsp.Uri.of_string str +let isInterface uri = uri |> Lsp.Uri.to_string |> Filename.check_suffix "i" +let toPath uri = + (* Lsp.Uri.to_path remove the schema file:// but keep the `/` on start of path. *) + let p = Lsp.Uri.to_path uri in + if !stripPath then String.sub p 1 (String.length p - 1) else p -let fromPath path = {path; uri = pathToUri path} -let isInterface {path} = Filename.check_suffix path "i" -let toPath {path} = path - -let toTopLevelLoc {path} = +let toTopLevelLoc (uri : Lsp.Uri.t) = let topPos = - {Lexing.pos_fname = path; pos_lnum = 1; pos_bol = 0; pos_cnum = 0} + { + Lexing.pos_fname = uri |> Lsp.Uri.to_path; + pos_lnum = 1; + pos_bol = 0; + pos_cnum = 0; + } in {Location.loc_start = topPos; Location.loc_end = topPos; loc_ghost = false} -let toString {uri} = if !stripPath then Filename.basename uri else uri +let toString t = + if !stripPath then Filename.basename (Lsp.Uri.to_path t) + else Lsp.Uri.to_string t (* Light weight, hopefully-enough-for-the-purpose fn to encode URI components. Built to handle the reserved characters listed in diff --git a/analysis/src/Uri.mli b/analysis/src/Uri.mli index b6e94692bda..9079b6323c8 100644 --- a/analysis/src/Uri.mli +++ b/analysis/src/Uri.mli @@ -1,6 +1,7 @@ -type t +type t = Lsp.Uri.t val fromPath : string -> t +val fromString : string -> t val isInterface : t -> bool val stripPath : bool ref val toPath : t -> string diff --git a/analysis/src/Utils.ml b/analysis/src/Utils.ml index abc286af599..a4bfc33bec2 100644 --- a/analysis/src/Utils.ml +++ b/analysis/src/Utils.ml @@ -19,10 +19,12 @@ let isFirstCharUppercase s = String.length s > 0 && Char.equal s.[0] (Char.uppercase_ascii s.[0]) let cmtPosToPosition {Lexing.pos_lnum; pos_cnum; pos_bol} = - Protocol.{line = pos_lnum - 1; character = pos_cnum - pos_bol} + Lsp.Types.Position.create ~line:(pos_lnum - 1) ~character:(pos_cnum - pos_bol) let cmtLocToRange {Location.loc_start; loc_end} = - Protocol.{start = cmtPosToPosition loc_start; end_ = cmtPosToPosition loc_end} + let start = cmtPosToPosition loc_start in + let end_ = cmtPosToPosition loc_end in + Lsp.Types.Range.create ~start ~end_ let endOfLocation loc length = let open Location in @@ -185,12 +187,12 @@ let indent n text = let mkPosition (pos : Pos.t) = let line, character = pos in - {Protocol.line; character} + Lsp.Types.Position.create ~line ~character let rangeOfLoc (loc : Location.t) = let start = loc |> Loc.start |> mkPosition in let end_ = loc |> Loc.end_ |> mkPosition in - {Protocol.start; end_} + Lsp.Types.Range.create ~start ~end_ let rec expandPath (path : Path.t) = match path with diff --git a/analysis/src/Xform.ml b/analysis/src/Xform.ml index 8d66d8c757d..a9ca37d8bc4 100644 --- a/analysis/src/Xform.ml +++ b/analysis/src/Xform.ml @@ -163,8 +163,40 @@ module ModuleToFile = struct in let moduleName = pmb_name.txt in let newFilePath = - Uri.fromPath - (Filename.concat (Filename.dirname path) moduleName ^ ".res") + Filename.concat (Filename.dirname path) moduleName ^ ".res" + in + let uri = Uri.fromString newFilePath in + let documentChanges = + [ + `CreateFile + (Lsp.Types.CreateFile.create ~uri + ~options: + (Lsp.Types.CreateFileOptions.create ~overwrite:false + ~ignoreIfExists:true ()) + ()); + `TextDocumentEdit + (Lsp.Types.TextDocumentEdit.create + ~edits: + [ + `TextEdit + (Lsp.Types.TextEdit.create ~range + ~newText:textForExtractedFile); + ] + ~textDocument: + (Lsp.Types.OptionalVersionedTextDocumentIdentifier.create + ~uri ())); + `TextDocumentEdit + (Lsp.Types.TextDocumentEdit.create + ~edits: + [ + `TextEdit + (Lsp.Types.TextEdit.create ~range + ~newText:newTextInCurrentFile); + ] + ~textDocument: + (Lsp.Types.OptionalVersionedTextDocumentIdentifier.create + ~uri:(Uri.fromString path) ())); + ] in changed := Some @@ -172,38 +204,7 @@ module ModuleToFile = struct ~title: (Printf.sprintf "Extract local module \"%s\" to file \"%s\"" moduleName (moduleName ^ ".res")) - ~kind:RefactorRewrite - ~documentChanges: - [ - Protocol.CreateFile - { - uri = newFilePath |> Uri.toString; - options = - Some - {overwrite = Some false; ignoreIfExists = Some true}; - }; - TextDocumentEdit - { - textDocument = - {uri = newFilePath |> Uri.toString; version = None}; - edits = - [ - { - newText = textForExtractedFile; - range = - { - start = {line = 0; character = 0}; - end_ = {line = 0; character = 0}; - }; - }; - ]; - }; - TextDocumentEdit - { - textDocument = {uri = path; version = None}; - edits = [{newText = newTextInCurrentFile; range}]; - }; - ]); + ~kind:RefactorRewrite ~documentChanges); () | _ -> ()); Ast_iterator.default_iterator.structure_item iterator structure_item @@ -852,14 +853,14 @@ let parseImplementation ~source = in comments |> List.filter filter in - let printExpr ~(range : Protocol.range) (expr : Parsetree.expression) = + let printExpr ~(range : Lsp.Types.Range.t) (expr : Parsetree.expression) = let structure = [Ast_helper.Str.eval ~loc:expr.pexp_loc expr] in structure |> Res_printer.print_implementation ~comments:(comments |> filterComments ~loc:expr.pexp_loc) |> Utils.indent range.start.character in - let printStructureItem ~(range : Protocol.range) + let printStructureItem ~(range : Lsp.Types.Range.t) (item : Parsetree.structure_item) = let structure = [item] in structure @@ -886,7 +887,7 @@ let parseInterface ~source = in comments |> List.filter filter in - let printSignatureItem ~(range : Protocol.range) + let printSignatureItem ~(range : Lsp.Types.Range.t) (item : Parsetree.signature_item) = let signature_item = [item] in signature_item diff --git a/analysis/src/YojsonHelpers.ml b/analysis/src/YojsonHelpers.ml new file mode 100644 index 00000000000..0cae226f44b --- /dev/null +++ b/analysis/src/YojsonHelpers.ml @@ -0,0 +1,9 @@ +let get key (t : Yojson.Safe.t) : Yojson.Safe.t option = + match t with + | `Assoc items -> List.assoc_opt key items + | _ -> None + +let to_list_opt json = try Some (Yojson.Safe.Util.to_list json) with _ -> None + +let from_string_opt text = + try Some (Yojson.Safe.from_string text) with _ -> None diff --git a/analysis/src/dune b/analysis/src/dune index 0b27f5aac8d..132e9e438da 100644 --- a/analysis/src/dune +++ b/analysis/src/dune @@ -4,4 +4,4 @@ (backend bisect_ppx)) (flags (-w "+6+26+27+32+33+39")) - (libraries unix str ext ml jsonlib syntax reanalyze)) + (libraries unix str ext ml yojson lsp syntax reanalyze)) diff --git a/analysis/vendor/.ocamlformat b/analysis/vendor/.ocamlformat deleted file mode 100644 index 593b6a1ffcd..00000000000 --- a/analysis/vendor/.ocamlformat +++ /dev/null @@ -1 +0,0 @@ -disable diff --git a/analysis/vendor/dune b/analysis/vendor/dune deleted file mode 100644 index 07b82861535..00000000000 --- a/analysis/vendor/dune +++ /dev/null @@ -1 +0,0 @@ -(dirs ext ml res_syntax json flow_parser) diff --git a/analysis/vendor/json/Json.ml b/analysis/vendor/json/Json.ml deleted file mode 100644 index bfa60adc618..00000000000 --- a/analysis/vendor/json/Json.ml +++ /dev/null @@ -1,536 +0,0 @@ -(** # Json parser - * - * ## Basics - * - * ``` - * open Json.Infix; /* for the nice infix operators */ - * let raw = {|{"hello": "folks"}|}; - * let who = Json.parse(raw) |> Json.get("hello") |?> Json.string; - * Js.log(who); - * ``` - * - * ## Parse & stringify - * - * @doc parse, stringify - * - * ## Accessing descendents - * - * @doc get, nth, getPath - * - * ## Coercing to types - * - * @doc string, number, array, obj, bool, null - * - * ## The JSON type - * - * @doc t - * - * ## Infix operators for easier working - * - * @doc Infix - *) - -type t = - | String of string - | Number of float - | Array of t list - | Object of (string * t) list - | True - | False - | Null - -let string_of_number f = - let s = string_of_float f in - if s.[String.length s - 1] = '.' then String.sub s 0 (String.length s - 1) - else s - -(** - * This module is provided for easier working with optional values. - *) -module Infix = struct - (** The "force unwrap" operator - * - * If you're sure there's a value, you can force it. - * ``` - * open Json.Infix; - * let x: int = Some(10) |! "Expected this to be present"; - * Js.log(x); - * ``` - * - * But you gotta be sure, otherwise it will throw. - * ```reason;raises - * open Json.Infix; - * let x: int = None |! "This will throw"; - * ``` - *) - let ( |! ) o d = - match o with - | None -> failwith d - | Some v -> v - - (** The "upwrap with default" operator - * ``` - * open Json.Infix; - * let x: int = Some(10) |? 4; - * let y: int = None |? 5; - * Js.log2(x, y); - * ``` - *) - let ( |? ) o d = - match o with - | None -> d - | Some v -> v - - (** The "transform contents into new optional" operator - * ``` - * open Json.Infix; - * let maybeInc = x => x > 5 ? Some(x + 1) : None; - * let x: option(int) = Some(14) |?> maybeInc; - * let y: option(int) = None |?> maybeInc; - * ``` - *) - let ( |?> ) o fn = - match o with - | None -> None - | Some v -> fn v - - (** The "transform contents into new value & then re-wrap" operator - * ``` - * open Json.Infix; - * let inc = x => x + 1; - * let x: option(int) = Some(7) |?>> inc; - * let y: option(int) = None |?>> inc; - * Js.log2(x, y); - * ``` - *) - let ( |?>> ) o fn = - match o with - | None -> None - | Some v -> Some (fn v) - - (** "handle the value if present, otherwise here's the default" - * - * It's called fold because that's what people call it :?. It's the same as "transform contents to new value" + "unwrap with default". - * - * ``` - * open Json.Infix; - * let inc = x => x + 1; - * let x: int = fold(Some(4), 10, inc); - * let y: int = fold(None, 2, inc); - * Js.log2(x, y); - * ``` - *) - let fold o d f = - match o with - | None -> d - | Some v -> f v -end - -let escape text = - let ln = String.length text in - let buf = Buffer.create ln in - let rec loop i = - if i < ln then ( - (match text.[i] with - | '\012' -> Buffer.add_string buf "\\f" - | '\\' -> Buffer.add_string buf "\\\\" - | '"' -> Buffer.add_string buf "\\\"" - | '\n' -> Buffer.add_string buf "\\n" - | '\b' -> Buffer.add_string buf "\\b" - | '\r' -> Buffer.add_string buf "\\r" - | '\t' -> Buffer.add_string buf "\\t" - | c -> - let code = Char.code c in - if code < 0x20 then Printf.bprintf buf "\\u%04x" code - else Buffer.add_char buf c); - loop (i + 1)) - in - loop 0; - Buffer.contents buf - -(** - * ``` - * let text = {|{"hello": "folks", "aa": [2, 3, "four"]}|}; - * let result = Json.stringify(Json.parse(text)); - * Js.log(result); - * assert(text == result); - * ``` - *) -let rec stringify t = - match t with - | String value -> "\"" ^ escape value ^ "\"" - | Number num -> string_of_number num - | Array items -> "[" ^ String.concat ", " (List.map stringify items) ^ "]" - | Object items -> - "{" - ^ String.concat ", " - (List.map - (fun (k, v) -> "\"" ^ String.escaped k ^ "\": " ^ stringify v) - items) - ^ "}" - | True -> "true" - | False -> "false" - | Null -> "null" - -let white n = - let buffer = Buffer.create n in - for i = 0 to n - 1 do - Buffer.add_char buffer ' ' - done; - Buffer.contents buffer - -let rec stringifyPretty ?(indent = 0) t = - match t with - | String value -> "\"" ^ escape value ^ "\"" - | Number num -> string_of_number num - | Array [] -> "[]" - | Array [(String _ as contents)] -> "[" ^ stringifyPretty contents ^ "]" - | Array items -> - "[\n" ^ white indent - ^ String.concat - (",\n" ^ white indent) - (List.map (stringifyPretty ~indent:(indent + 2)) items) - ^ "\n" - ^ white (indent - 2) - ^ "]" - | Object [] -> "{}" - | Object items -> - "{\n" ^ white indent - ^ String.concat - (",\n" ^ white indent) - (List.map - (fun (k, v) -> - "\"" ^ String.escaped k ^ "\": " - ^ stringifyPretty ~indent:(indent + 2) v) - items) - ^ "\n" - ^ white (indent - 2) - ^ "}" - | True -> "true" - | False -> "false" - | Null -> "null" - -let unwrap message t = - match t with - | Some v -> v - | None -> failwith message - -module Parser = struct - let split_by ?(keep_empty = false) is_delim str = - let len = String.length str in - let rec loop acc last_pos pos = - if pos = -1 then - if last_pos = 0 && not keep_empty then acc - else String.sub str 0 last_pos :: acc - else if is_delim str.[pos] then - let new_len = last_pos - pos - 1 in - if new_len <> 0 || keep_empty then - let v = String.sub str (pos + 1) new_len in - loop (v :: acc) pos (pos - 1) - else loop acc pos (pos - 1) - else loop acc last_pos (pos - 1) - in - loop [] len (len - 1) - - let fail text pos message = - let pre = String.sub text 0 pos in - let lines = split_by (fun c -> c = '\n') pre in - let count = List.length lines in - let last = - match count > 0 with - | true -> List.nth lines (count - 1) - | false -> "" - in - let col = String.length last + 1 in - let line = List.length lines in - let string = - Printf.sprintf "Error \"%s\" at %d:%d -> %s\n" message line col last - in - failwith string - - let rec skipToNewline text pos = - if pos >= String.length text then pos - else if text.[pos] = '\n' then pos + 1 - else skipToNewline text (pos + 1) - - let stringTail text = - let len = String.length text in - if len > 1 then String.sub text 1 (len - 1) else "" - - let rec skipToCloseMultilineComment text pos = - if pos + 1 >= String.length text then failwith "Unterminated comment" - else if text.[pos] = '*' && text.[pos + 1] = '/' then pos + 2 - else skipToCloseMultilineComment text (pos + 1) - - let rec skipWhite text pos = - if - pos < String.length text - && (text.[pos] = ' ' - || text.[pos] = '\t' - || text.[pos] = '\n' - || text.[pos] = '\r') - then skipWhite text (pos + 1) - else pos - - (* from https://stackoverflow.com/a/42431362 *) - let utf8encode s = - let prefs = [|0; 192; 224|] in - let s1 n = String.make 1 (Char.chr n) in - let rec ienc k sofar resid = - let bct = if k = 0 then 7 else 6 - k in - if resid < 1 lsl bct then s1 (prefs.(k) + resid) ^ sofar - else ienc (k + 1) (s1 (128 + (resid mod 64)) ^ sofar) (resid / 64) - in - ienc 0 "" (int_of_string ("0x" ^ s)) - - let parseString text pos = - (* let i = ref(pos); *) - let buffer = Buffer.create (String.length text) in - let ln = String.length text in - let rec loop i = - match i >= ln with - | true -> fail text i "Unterminated string" - | false -> ( - match text.[i] with - | '"' -> i + 1 - | '\\' -> ( - match i + 1 >= ln with - | true -> fail text i "Unterminated string" - | false -> ( - match text.[i + 1] with - | '/' -> - Buffer.add_char buffer '/'; - loop (i + 2) - | 'f' -> - Buffer.add_char buffer '\012'; - loop (i + 2) - | 'u' when i + 6 < ln -> - Buffer.add_string buffer (utf8encode (String.sub text (i + 2) 4)); - loop (i + 7) - | _ -> - Buffer.add_string buffer (Scanf.unescaped (String.sub text i 2)); - loop (i + 2))) - | c -> - Buffer.add_char buffer c; - loop (i + 1)) - in - let final = loop pos in - (Buffer.contents buffer, final) - - let parseDigits text pos = - let len = String.length text in - let rec loop i = - if i >= len then i - else - match text.[i] with - | '0' .. '9' -> loop (i + 1) - | _ -> i - in - loop (pos + 1) - - let parseWithDecimal text pos = - let pos = parseDigits text pos in - if pos < String.length text && text.[pos] = '.' then - let pos = parseDigits text (pos + 1) in - pos - else pos - - let parseNumber text pos = - let pos = parseWithDecimal text pos in - let ln = String.length text in - if pos < ln - 1 && (text.[pos] = 'E' || text.[pos] = 'e') then - let pos = - match text.[pos + 1] with - | '-' | '+' -> pos + 2 - | _ -> pos + 1 - in - parseDigits text pos - else pos - - let parseNegativeNumber text pos = - let final = - if text.[pos] = '-' then parseNumber text (pos + 1) - else parseNumber text pos - in - (Number (float_of_string (String.sub text pos (final - pos))), final) - - let expect char text pos message = - if text.[pos] <> char then fail text pos ("Expected: " ^ message) - else pos + 1 - - let parseComment : 'a. string -> int -> (string -> int -> 'a) -> 'a = - fun text pos next -> - if text.[pos] <> '/' then - if text.[pos] = '*' then - next text (skipToCloseMultilineComment text (pos + 1)) - else failwith "Invalid syntax" - else next text (skipToNewline text (pos + 1)) - - let maybeSkipComment text pos = - if pos < String.length text && text.[pos] = '/' then - if pos + 1 < String.length text && text.[pos + 1] = '/' then - skipToNewline text (pos + 1) - else if pos + 1 < String.length text && text.[pos + 1] = '*' then - skipToCloseMultilineComment text (pos + 1) - else fail text pos "Invalid synatx" - else pos - - let rec skip text pos = - if pos = String.length text then pos - else - let n = skipWhite text pos |> maybeSkipComment text in - if n > pos then skip text n else n - - let rec parse text pos = - if pos >= String.length text then - fail text pos "Reached end of file without being done parsing" - else - match text.[pos] with - | '/' -> parseComment text (pos + 1) parse - | '[' -> parseArray text (pos + 1) - | '{' -> parseObject text (pos + 1) - | 'n' -> - if String.sub text pos 4 = "null" then (Null, pos + 4) - else fail text pos "unexpected character" - | 't' -> - if String.sub text pos 4 = "true" then (True, pos + 4) - else fail text pos "unexpected character" - | 'f' -> - if String.sub text pos 5 = "false" then (False, pos + 5) - else fail text pos "unexpected character" - | '\n' | '\t' | ' ' | '\r' -> parse text (skipWhite text pos) - | '"' -> - let s, pos = parseString text (pos + 1) in - (String s, pos) - | '-' | '0' .. '9' -> parseNegativeNumber text pos - | _ -> fail text pos "unexpected character" - - and parseArrayValue text pos = - let pos = skip text pos in - let value, pos = parse text pos in - let pos = skip text pos in - match text.[pos] with - | ',' -> - let pos = skip text (pos + 1) in - if text.[pos] = ']' then ([value], pos + 1) - else - let rest, pos = parseArrayValue text pos in - (value :: rest, pos) - | ']' -> ([value], pos + 1) - | _ -> fail text pos "unexpected character" - - and parseArray text pos = - let pos = skip text pos in - match text.[pos] with - | ']' -> (Array [], pos + 1) - | _ -> - let items, pos = parseArrayValue text pos in - (Array items, pos) - - and parseObjectValue text pos = - let pos = skip text pos in - if text.[pos] <> '"' then fail text pos "Expected string" - else - let key, pos = parseString text (pos + 1) in - let pos = skip text pos in - let pos = expect ':' text pos "Colon" in - let value, pos = parse text pos in - let pos = skip text pos in - match text.[pos] with - | ',' -> - let pos = skip text (pos + 1) in - if text.[pos] = '}' then ([(key, value)], pos + 1) - else - let rest, pos = parseObjectValue text pos in - ((key, value) :: rest, pos) - | '}' -> ([(key, value)], pos + 1) - | _ -> - let rest, pos = parseObjectValue text pos in - ((key, value) :: rest, pos) - - and parseObject text pos = - let pos = skip text pos in - if text.[pos] = '}' then (Object [], pos + 1) - else - let pairs, pos = parseObjectValue text pos in - (Object pairs, pos) -end -[@@nodoc] - -(** Turns some text into a json object. throws on failure *) -let parse text = - try - let item, pos = Parser.parse text 0 in - let pos = Parser.skip text pos in - if pos < String.length text then - (* failwith - ("Extra data after parse finished: " - ^ String.sub text pos (String.length text - pos)) *) - None - else Some item - with Invalid_argument _ | Failure _ -> None - -(* Accessor helpers *) -let bind v fn = - match v with - | None -> None - | Some v -> fn v - -(** If `t` is an object, get the value associated with the given string key *) -let get key t = - match t with - | Object items -> ( try Some (List.assoc key items) with Not_found -> None) - | _ -> None - -(** If `t` is an array, get the value associated with the given index *) -let nth n t = - match t with - | Array items -> - if n < List.length items then Some (List.nth items n) else None - | _ -> None - -let string t = - match t with - | String s -> Some s - | _ -> None -let number t = - match t with - | Number s -> Some s - | _ -> None -let array t = - match t with - | Array s -> Some s - | _ -> None -let obj t = - match t with - | Object s -> Some s - | _ -> None -let bool t = - match t with - | True -> Some true - | False -> Some false - | _ -> None -let null t = - match t with - | Null -> Some () - | _ -> None - -let rec parsePath keyList t = - match keyList with - | [] -> Some t - | head :: rest -> ( - match get head t with - | None -> None - | Some value -> parsePath rest value) - -(** Get a deeply nested value from an object `t`. - * ``` - * open Json.Infix; - * let json = Json.parse({|{"a": {"b": {"c": 2}}}|}); - * let num = Json.getPath("a.b.c", json) |?> Json.number; - * assert(num == Some(2.)) - * ``` - *) -let getPath path t = - let keys = Parser.split_by (fun c -> c = '.') path in - parsePath keys t diff --git a/analysis/vendor/json/dune b/analysis/vendor/json/dune deleted file mode 100644 index 32dbef0de79..00000000000 --- a/analysis/vendor/json/dune +++ /dev/null @@ -1,5 +0,0 @@ -(library - (name jsonlib) - (wrapped false) - (flags -w "-9") - (libraries)) diff --git a/dune-project b/dune-project index 404204f7f95..7ea218fc1bd 100644 --- a/dune-project +++ b/dune-project @@ -55,7 +55,11 @@ (>= 5.0.0)) (cppo (= 1.8.0)) - (odoc :with-doc))) + (odoc :with-doc) + (lsp + (= 1.22.0)) + (yojson + (= 2.2.2)))) (package (name tools) @@ -68,4 +72,6 @@ (cppo (= 1.8.0)) analysis + (yojson + (= 2.2.2)) (odoc :with-doc))) diff --git a/packages/@rescript/runtime/RescriptTools_ExtractCodeBlocks.res b/packages/@rescript/runtime/RescriptTools_ExtractCodeBlocks.res index b77ae5e8f6c..8174dc2c14e 100644 --- a/packages/@rescript/runtime/RescriptTools_ExtractCodeBlocks.res +++ b/packages/@rescript/runtime/RescriptTools_ExtractCodeBlocks.res @@ -7,4 +7,4 @@ type codeBlock = { /** `decodeFromJson(json)` parse JSON generated from `rescript-tools extract-codeblocks` command */ -external decodeFromJson: Stdlib_JSON.t => result, string> = "%identity" +external decodeFromJson: Stdlib_JSON.t => array = "%identity" diff --git a/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt b/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt index eb40ec0ba92..28f713fb42b 100644 --- a/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt +++ b/tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt @@ -5,25 +5,11 @@ Completable: Cjsx([div], "", []) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path GenericJsx.Elements.props -[{ - "label": "testing", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "test2", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }, { - "label": "children", - "kind": 4, - "tags": [], - "detail": "element", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "testing", "tags": [] }, + { "detail": "string", "kind": 4, "label": "test2", "tags": [] }, + { "detail": "element", "kind": 4, "label": "children", "tags": [] } +] Complete src/GenericJsxCompletion.res 3:17 posCursor:[3:17] posNoWhite:[3:16] Found expr:[3:3->3:18] @@ -33,19 +19,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [div] testing Path GenericJsx.Elements.props -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/GenericJsxCompletion.res 14:21 posCursor:[14:21] posNoWhite:[14:20] Found expr:[8:13->23:3] @@ -64,27 +41,40 @@ ContextPath Value[someString] Path someString Path Stdlib.String.st Path st -[{ - "label": "GenericJsx.string", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "Turns `string` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "String.startsWith", + "documentation": { + "kind": "markdown", + "value": "Turns `string` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "GenericJsx.string", + "sortText": "A", + "tags": [] + }, + { "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} - }, { - "label": "String.startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "String.startsWith", + "tags": [] + }, + { "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, + "kind": 12, + "label": "String.startsWithFrom", + "tags": [] + } +] Complete src/GenericJsxCompletion.res 20:24 posCursor:[20:24] posNoWhite:[20:23] Found expr:[8:13->23:3] @@ -106,25 +96,38 @@ ContextPath Value[someString] Path someString Path Stdlib.String.st Path st -[{ - "label": "string", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "Turns `string` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "String.startsWith", + "documentation": { + "kind": "markdown", + "value": "Turns `string` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "string", + "sortText": "A", + "tags": [] + }, + { "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} - }, { - "label": "String.startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "String.startsWith", + "tags": [] + }, + { "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, + "kind": 12, + "label": "String.startsWithFrom", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt b/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt index bab658f9b98..a5c176baecd 100644 --- a/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt +++ b/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt @@ -7,14 +7,19 @@ Completable: Cexpression CTypeAtPos()->variantPayload::Array($0) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CTypeAtPos() -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "t", - "documentation": {"kind": "markdown", "value": " \nA type representing a JSON object.\n\n\n```rescript\n@unboxed\ntype t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": " \nA type representing a JSON object.\n\n\n```rescript\n@unboxed\ntype t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict)\n | Array(array)\n```" + }, "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt b/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt index 6ea8bab362e..318cc3d18bd 100644 --- a/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt +++ b/tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt @@ -6,14 +6,19 @@ Completable: Cexpression CTypeAtPos()->variantPayload::One($0) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CTypeAtPos() -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "{miss: bool}", - "documentation": {"kind": "markdown", "value": "```rescript\n{miss: bool}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\n{miss: bool}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests-sourcedirs-dependency/src/expected/Main.res.txt b/tests/analysis_tests/tests-sourcedirs-dependency/src/expected/Main.res.txt index 4f24b0022f0..f63801d1bf7 100644 --- a/tests/analysis_tests/tests-sourcedirs-dependency/src/expected/Main.res.txt +++ b/tests/analysis_tests/tests-sourcedirs-dependency/src/expected/Main.res.txt @@ -6,11 +6,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[WorkspaceDep, value] Path WorkspaceDep.value -[{ - "label": "valueFromDependency", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "int", "kind": 12, "label": "valueFromDependency", "tags": [] } +] diff --git a/tests/analysis_tests/tests/not_compiled/expected/Diagnostics.res.txt b/tests/analysis_tests/tests/not_compiled/expected/Diagnostics.res.txt index a5df33b7107..d4c5ca2ae15 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/Diagnostics.res.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/Diagnostics.res.txt @@ -1,17 +1,27 @@ -[{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 6}}, - "message": "consecutive statements on a line must be separated by ';' or a newline", - "severity": 1, - "source": "ReScript" -}, { - "range": {"start": {"line": 1, "character": 9}, "end": {"line": 1, "character": 11}}, - "message": "This let-binding misses an expression", - "severity": 1, - "source": "ReScript" -}, { - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "message": "I was expecting a name for this let-binding. Example: `let message = \"hello\"`", - "severity": 1, - "source": "ReScript" -}] +[ + { + "message": "consecutive statements on a line must be separated by ';' or a newline", + "range": { + "end": { "character": 6, "line": 2 }, + "start": { "character": 4, "line": 2 } + }, + "severity": 1 + }, + { + "message": "This let-binding misses an expression", + "range": { + "end": { "character": 11, "line": 1 }, + "start": { "character": 9, "line": 1 } + }, + "severity": 1 + }, + { + "message": "I was expecting a name for this let-binding. Example: `let message = \"hello\"`", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "severity": 1 + } +] diff --git a/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.res.txt b/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.res.txt index f94561bdc53..2e222e81d67 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.res.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.res.txt @@ -3,7 +3,10 @@ can't find module DocTemplate Hit: Add Documentation template TextDocumentEdit: DocTemplate.res -{"start": {"line": 3, "character": 0}, "end": {"line": 5, "character": 9}} +{ + "end": { "character": 9, "line": 5 }, + "start": { "character": 0, "line": 3 } +} newText: <--here /** @@ -18,7 +21,10 @@ can't find module DocTemplate Hit: Add Documentation template TextDocumentEdit: DocTemplate.res -{"start": {"line": 6, "character": 0}, "end": {"line": 6, "character": 33}} +{ + "end": { "character": 33, "line": 6 }, + "start": { "character": 0, "line": 6 } +} newText: <--here /** @@ -31,7 +37,10 @@ can't find module DocTemplate Hit: Add Documentation template TextDocumentEdit: DocTemplate.res -{"start": {"line": 8, "character": 0}, "end": {"line": 8, "character": 9}} +{ + "end": { "character": 9, "line": 8 }, + "start": { "character": 0, "line": 8 } +} newText: <--here /** @@ -44,7 +53,10 @@ can't find module DocTemplate Hit: Add Documentation template TextDocumentEdit: DocTemplate.res -{"start": {"line": 10, "character": 0}, "end": {"line": 10, "character": 20}} +{ + "end": { "character": 20, "line": 10 }, + "start": { "character": 0, "line": 10 } +} newText: <--here /** @@ -57,7 +69,10 @@ can't find module DocTemplate Hit: Add Documentation template TextDocumentEdit: DocTemplate.res -{"start": {"line": 12, "character": 0}, "end": {"line": 16, "character": 1}} +{ + "end": { "character": 1, "line": 16 }, + "start": { "character": 0, "line": 12 } +} newText: <--here /** @@ -73,7 +88,10 @@ Hit: Extract local module "T" to file "T.res" CreateFile: T.res TextDocumentEdit: T.res -{"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 0}} +{ + "end": { "character": 1, "line": 16 }, + "start": { "character": 0, "line": 12 } +} newText: <--here // ^xfm @@ -81,8 +99,11 @@ let b = 1 // ^xfm -TextDocumentEdit: not_compiled/DocTemplate.res -{"start": {"line": 12, "character": 0}, "end": {"line": 16, "character": 1}} +TextDocumentEdit: DocTemplate.res +{ + "end": { "character": 1, "line": 16 }, + "start": { "character": 0, "line": 12 } +} newText: <--here @@ -92,7 +113,10 @@ can't find module DocTemplate Hit: Add Documentation template TextDocumentEdit: DocTemplate.res -{"start": {"line": 14, "character": 2}, "end": {"line": 14, "character": 11}} +{ + "end": { "character": 11, "line": 14 }, + "start": { "character": 2, "line": 14 } +} newText: <--here /** @@ -104,7 +128,10 @@ Hit: Extract local module "T" to file "T.res" CreateFile: T.res TextDocumentEdit: T.res -{"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 0}} +{ + "end": { "character": 1, "line": 16 }, + "start": { "character": 0, "line": 12 } +} newText: <--here // ^xfm @@ -112,8 +139,11 @@ let b = 1 // ^xfm -TextDocumentEdit: not_compiled/DocTemplate.res -{"start": {"line": 12, "character": 0}, "end": {"line": 16, "character": 1}} +TextDocumentEdit: DocTemplate.res +{ + "end": { "character": 1, "line": 16 }, + "start": { "character": 0, "line": 12 } +} newText: <--here @@ -123,7 +153,10 @@ can't find module DocTemplate Hit: Add Documentation template TextDocumentEdit: DocTemplate.res -{"start": {"line": 17, "character": 0}, "end": {"line": 18, "character": 46}} +{ + "end": { "character": 46, "line": 18 }, + "start": { "character": 0, "line": 17 } +} newText: <--here /** diff --git a/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.resi.txt b/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.resi.txt index aa8c9675901..3937e7937d5 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.resi.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/DocTemplate.resi.txt @@ -2,7 +2,10 @@ Xform not_compiled/DocTemplate.resi 3:3 Hit: Add Documentation template TextDocumentEdit: DocTemplate.resi -{"start": {"line": 3, "character": 0}, "end": {"line": 5, "character": 9}} +{ + "end": { "character": 9, "line": 5 }, + "start": { "character": 0, "line": 3 } +} newText: <--here /** @@ -16,7 +19,10 @@ Xform not_compiled/DocTemplate.resi 6:15 Hit: Add Documentation template TextDocumentEdit: DocTemplate.resi -{"start": {"line": 6, "character": 0}, "end": {"line": 6, "character": 33}} +{ + "end": { "character": 33, "line": 6 }, + "start": { "character": 0, "line": 6 } +} newText: <--here /** @@ -28,7 +34,10 @@ Xform not_compiled/DocTemplate.resi 8:4 Hit: Add Documentation template TextDocumentEdit: DocTemplate.resi -{"start": {"line": 8, "character": 0}, "end": {"line": 8, "character": 10}} +{ + "end": { "character": 10, "line": 8 }, + "start": { "character": 0, "line": 8 } +} newText: <--here /** @@ -40,7 +49,10 @@ Xform not_compiled/DocTemplate.resi 10:4 Hit: Add Documentation template TextDocumentEdit: DocTemplate.resi -{"start": {"line": 10, "character": 0}, "end": {"line": 10, "character": 19}} +{ + "end": { "character": 19, "line": 10 }, + "start": { "character": 0, "line": 10 } +} newText: <--here /** @@ -52,7 +64,10 @@ Xform not_compiled/DocTemplate.resi 12:7 Hit: Add Documentation template TextDocumentEdit: DocTemplate.resi -{"start": {"line": 12, "character": 0}, "end": {"line": 16, "character": 1}} +{ + "end": { "character": 1, "line": 16 }, + "start": { "character": 0, "line": 12 } +} newText: <--here /** @@ -68,7 +83,10 @@ Xform not_compiled/DocTemplate.resi 14:6 Hit: Add Documentation template TextDocumentEdit: DocTemplate.resi -{"start": {"line": 14, "character": 2}, "end": {"line": 14, "character": 12}} +{ + "end": { "character": 12, "line": 14 }, + "start": { "character": 2, "line": 14 } +} newText: <--here /** @@ -80,7 +98,10 @@ Xform not_compiled/DocTemplate.resi 18:2 Hit: Add Documentation template TextDocumentEdit: DocTemplate.resi -{"start": {"line": 17, "character": 0}, "end": {"line": 18, "character": 46}} +{ + "end": { "character": 46, "line": 18 }, + "start": { "character": 0, "line": 17 } +} newText: <--here /** diff --git a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokens.res.txt b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokens.res.txt index b21f43d7adb..dfd046f5352 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokens.res.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokens.res.txt @@ -1 +1,2 @@ -{"data":[0,4,4,1,0,1,2,1,3,0,0,1,4,7,0]} +{ "data": [ 0, 4, 4, 1, 0, 1, 2, 1, 3, 0, 0, 1, 4, 7, 0 ] } + diff --git a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArray.res.txt b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArray.res.txt index 92a36a99618..a2772d05e58 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArray.res.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArray.res.txt @@ -1 +1,2 @@ -{"data":[0,4,2,1,0,1,4,2,1,0,0,9,2,1,0]} +{ "data": [ 0, 4, 2, 1, 0, 1, 4, 2, 1, 0, 0, 9, 2, 1, 0 ] } + diff --git a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayAccess.res.txt b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayAccess.res.txt index 858e9ef372e..efa97a6d8a4 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayAccess.res.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayAccess.res.txt @@ -1 +1,6 @@ -{"data":[0,4,1,1,0,0,4,2,1,0,1,4,1,1,0,0,4,2,1,0,0,3,5,1,0]} +{ + "data": [ + 0, 4, 1, 1, 0, 0, 4, 2, 1, 0, 1, 4, 1, 1, 0, 0, 4, 2, 1, 0, 0, 3, 5, 1, 0 + ] +} + diff --git a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayMutation.res.txt b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayMutation.res.txt index 4d3810f43b4..7808688aac3 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayMutation.res.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensArrayMutation.res.txt @@ -1 +1,2 @@ -{"data":[0,0,2,1,0]} +{ "data": [ 0, 0, 2, 1, 0 ] } + diff --git a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensDict.res.txt b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensDict.res.txt index 747a90d8b35..8159fc2ad5c 100644 --- a/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensDict.res.txt +++ b/tests/analysis_tests/tests/not_compiled/expected/SemanticTokensDict.res.txt @@ -1 +1,2 @@ -{"data":[0,4,1,1,0,0,16,3,1,0]} +{ "data": [ 0, 4, 1, 1, 0, 0, 16, 3, 1, 0 ] } + diff --git a/tests/analysis_tests/tests/src/expected/Auto.res.txt b/tests/analysis_tests/tests/src/expected/Auto.res.txt index ae30d752338..bbb79db1a57 100644 --- a/tests/analysis_tests/tests/src/expected/Auto.res.txt +++ b/tests/analysis_tests/tests/src/expected/Auto.res.txt @@ -1,3 +1,8 @@ Hover src/Auto.res 2:13 -{"contents": {"kind": "markdown", "value": "```rescript\n('a => 'b, list<'a>) => list<'b>\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n('a => 'b, list<'a>) => list<'b>\n```" + } +} diff --git a/tests/analysis_tests/tests/src/expected/CodeLens.res.txt b/tests/analysis_tests/tests/src/expected/CodeLens.res.txt index e75a2865164..7b34a422b72 100644 --- a/tests/analysis_tests/tests/src/expected/CodeLens.res.txt +++ b/tests/analysis_tests/tests/src/expected/CodeLens.res.txt @@ -1,12 +1,31 @@ Code Lens src/CodeLens.res -[{ - "range": {"start": {"line": 4, "character": 4}, "end": {"line": 4, "character": 6}}, - "command": {"title": "(~opt1: int=?, ~a: int, ~b: int, unit, ~opt2: int=?, unit, ~c: int) => int", "command": ""} - }, { - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 7}}, - "command": {"title": "(~age: int, ~name: string) => string", "command": ""} - }, { - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 7}}, - "command": {"title": "(int, int) => int", "command": ""} - }] +[ + { + "command": { + "command": "", + "title": "(~opt1: int=?, ~a: int, ~b: int, unit, ~opt2: int=?, unit, ~c: int) => int" + }, + "range": { + "end": { "character": 6, "line": 4 }, + "start": { "character": 4, "line": 4 } + } + }, + { + "command": { + "command": "", + "title": "(~age: int, ~name: string) => string" + }, + "range": { + "end": { "character": 7, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + }, + { + "command": { "command": "", "title": "(int, int) => int" }, + "range": { + "end": { "character": 7, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt b/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt index 76eb966f013..ab1184c1d8d 100644 --- a/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletePrioritize1.res.txt @@ -9,11 +9,5 @@ Path a CPPipe pathFromEnv:Test found:true Path Test. Path -[{ - "label": "Test.name", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }] +[ { "detail": "t => int", "kind": 12, "label": "Test.name", "tags": [] } ] diff --git a/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt b/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt index 8c196abdd5d..bd6893d5c10 100644 --- a/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletePrioritize2.res.txt @@ -9,13 +9,7 @@ Path ax CPPipe pathFromEnv:Test found:true Path Test. Path -[{ - "label": "Test.add", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }] +[ { "detail": "t => int", "kind": 12, "label": "Test.add", "tags": [] } ] Complete src/CompletePrioritize2.res 12:5 posCursor:[12:5] posNoWhite:[12:4] Found expr:[12:3->12:5] @@ -25,11 +19,16 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[ax] Path ax -[{ - "label": "ax", - "kind": 12, - "tags": [], +[ + { "detail": "Test.t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = {name: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = {name: int}\n```" + }, + "kind": 12, + "label": "ax", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/Completion.res.txt b/tests/analysis_tests/tests/src/expected/Completion.res.txt index 33a37cf95bf..761f583a6e1 100644 --- a/tests/analysis_tests/tests/src/expected/Completion.res.txt +++ b/tests/analysis_tests/tests/src/expected/Completion.res.txt @@ -6,37 +6,58 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[MyList, m] Path MyList.m -[{ - "label": "mapReverse", - "kind": 12, - "tags": [], +[ + { "detail": "(list<'a>, 'a => 'b) => list<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapReverse(list, f)` is equivalent to `map` function.\n\n## Examples\n\n```rescript\nlet f = x => x * x\nlet l = list{3, 4, 5}\n\nlet withMap = List.map(l, f)->List.reverse\nlet withMapReverse = l->List.mapReverse(f)\n\nConsole.log(withMap == withMapReverse) // true\n```\n"} - }, { - "label": "mapReverse2", + "documentation": { + "kind": "markdown", + "value": "\n`mapReverse(list, f)` is equivalent to `map` function.\n\n## Examples\n\n```rescript\nlet f = x => x * x\nlet l = list{3, 4, 5}\n\nlet withMap = List.map(l, f)->List.reverse\nlet withMapReverse = l->List.mapReverse(f)\n\nConsole.log(withMap == withMapReverse) // true\n```\n" + }, "kind": 12, - "tags": [], + "label": "mapReverse", + "tags": [] + }, + { "detail": "(list<'a>, list<'b>, ('a, 'b) => 'c) => list<'c>", - "documentation": {"kind": "markdown", "value": "\n`mapReverse2(list1, list2, f)` is equivalent to `List.zipBy(list1, list2, f)->List.reverse`.\n\n## Examples\n\n```rescript\nList.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```\n"} - }, { - "label": "make", + "documentation": { + "kind": "markdown", + "value": "\n`mapReverse2(list1, list2, f)` is equivalent to `List.zipBy(list1, list2, f)->List.reverse`.\n\n## Examples\n\n```rescript\nList.mapReverse2(list{1, 2, 3}, list{1, 2}, (a, b) => a + b) == list{4, 2}\n```\n" + }, "kind": 12, - "tags": [], + "label": "mapReverse2", + "tags": [] + }, + { "detail": "(~length: int, 'a) => list<'a>", - "documentation": {"kind": "markdown", "value": "\n`make(length, value)` returns a list of length `length` with each element filled\nwith `value`. Returns an empty list if `value` is negative.\n\n## Examples\n\n```rescript\nList.make(~length=3, 1) == list{1, 1, 1}\n```\n"} - }, { - "label": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`make(length, value)` returns a list of length `length` with each element filled\nwith `value`. Returns an empty list if `value` is negative.\n\n## Examples\n\n```rescript\nList.make(~length=3, 1) == list{1, 1, 1}\n```\n" + }, "kind": 12, - "tags": [], + "label": "make", + "tags": [] + }, + { "detail": "(list<'a>, ('a, int) => 'b) => list<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(list, f)` applies `f` to each element of `list`. Function `f`\ntakes two arguments: the index starting from 0 and the element from `list`, in\nthat order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.mapWithIndex((x, index) => index + x) == list{1, 3, 5}\n```\n"} - }, { - "label": "map", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(list, f)` applies `f` to each element of `list`. Function `f`\ntakes two arguments: the index starting from 0 and the element from `list`, in\nthat order.\n\n## Examples\n\n```rescript\nlist{1, 2, 3}->List.mapWithIndex((x, index) => index + x) == list{1, 3, 5}\n```\n" + }, "kind": 12, - "tags": [], + "label": "mapWithIndex", + "tags": [] + }, + { "detail": "(list<'a>, 'a => 'b) => list<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) == list{2, 3}\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) == list{2, 3}\n```\n" + }, + "kind": 12, + "label": "map", + "tags": [] + } +] Complete src/Completion.res 3:9 posCursor:[3:9] posNoWhite:[3:8] Found expr:[3:3->3:9] @@ -46,613 +67,1024 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Array, ""] Path Array. -[{ - "label": "splice", - "kind": 12, - "tags": [], +[ + { "detail": "(\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => unit", - "documentation": {"kind": "markdown", "value": "\n`splice(array, ~start, ~remove, ~insert)` removes `remove` items starting at `start` and inserts the values from `insert`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) on MDN.\n\n## Examples\n\n```rescript\nlet items = [\"a\", \"b\", \"c\"]\nitems->Array.splice(~start=1, ~remove=1, ~insert=[\"x\"])\nitems == [\"a\", \"x\", \"c\"]\n```\n"} - }, { - "label": "concat", + "documentation": { + "kind": "markdown", + "value": "\n`splice(array, ~start, ~remove, ~insert)` removes `remove` items starting at `start` and inserts the values from `insert`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.splice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) on MDN.\n\n## Examples\n\n```rescript\nlet items = [\"a\", \"b\", \"c\"]\nitems->Array.splice(~start=1, ~remove=1, ~insert=[\"x\"])\nitems == [\"a\", \"x\", \"c\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "splice", + "tags": [] + }, + { "detail": "(array<'a>, array<'a>) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`concat(array1, array2)` concatenates the two arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\", \"wehoo\"]\n\nlet someArray = array1->Array.concat(array2)\n\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n"} - }, { - "label": "filterMap", + "documentation": { + "kind": "markdown", + "value": "\n`concat(array1, array2)` concatenates the two arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\", \"wehoo\"]\n\nlet someArray = array1->Array.concat(array2)\n\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "concat", + "tags": [] + }, + { "detail": "(array<'a>, 'a => option<'b>) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n) == [5]\n\n[1, 2, 3, 4, 5, 6]->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None) == [4, 16, 36]\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None) == []\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == []\n```\n"} - }, { - "label": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n) == [5]\n\n[1, 2, 3, 4, 5, 6]->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None) == [4, 16, 36]\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None) == []\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == []\n```\n" + }, "kind": 12, - "tags": [], + "label": "filterMap", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLastWithIndex((item, index) => index < 2 && item > 0) == Some(2)\n```\n"} - }, { - "label": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLastWithIndex((item, index) => index < 2 && item > 0) == Some(2)\n```\n" + }, "kind": 12, - "tags": [], + "label": "findLastWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLast(item => item > 0) == Some(3)\n```\n"} - }, { - "label": "shift", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(array, checker)` returns the last element of `array` where the provided `checker` function returns true.\n\nSee [`Array.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLast) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\n\narray->Array.findLast(item => item > 0) == Some(3)\n```\n" + }, "kind": 12, - "tags": [], + "label": "findLast", + "tags": [] + }, + { "detail": "array<'a> => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`shift(array)` removes the first item in the array, and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.shift == Some(\"hi\")\n\nsomeArray == [\"hello\"] // Notice first item is gone.\n```\n"} - }, { - "label": "findMap", + "documentation": { + "kind": "markdown", + "value": "\n`shift(array)` removes the first item in the array, and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.shift == Some(\"hi\")\n\nsomeArray == [\"hello\"] // Notice first item is gone.\n```\n" + }, "kind": 12, - "tags": [], + "label": "shift", + "tags": [] + }, + { "detail": "(array<'a>, 'a => option<'b>) => option<'b>", - "documentation": {"kind": "markdown", "value": "\n`findMap(arr, fn)`\n\nCalls `fn` for each element and returns the first value from `fn` that is `Some(_)`.\nOtherwise returns `None`\n\n## Examples\n\n```rescript\nArray.findMap([1, 2, 3], n => mod(n, 2) == 0 ? Some(n - 2) : None) == Some(0)\n\nArray.findMap([1, 2, 3, 4, 5, 6], n => mod(n, 2) == 0 ? Some(n - 8) : None) == Some(-6)\n\nArray.findMap([1, 2, 3, 4, 5, 6], _ => None) == None\n\nArray.findMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == None\n```\n"} - }, { - "label": "concatMany", + "documentation": { + "kind": "markdown", + "value": "\n`findMap(arr, fn)`\n\nCalls `fn` for each element and returns the first value from `fn` that is `Some(_)`.\nOtherwise returns `None`\n\n## Examples\n\n```rescript\nArray.findMap([1, 2, 3], n => mod(n, 2) == 0 ? Some(n - 2) : None) == Some(0)\n\nArray.findMap([1, 2, 3, 4, 5, 6], n => mod(n, 2) == 0 ? Some(n - 8) : None) == Some(-6)\n\nArray.findMap([1, 2, 3, 4, 5, 6], _ => None) == None\n\nArray.findMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == None\n```\n" + }, "kind": 12, - "tags": [], + "label": "findMap", + "tags": [] + }, + { "detail": "(array<'a>, array>) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`concatMany(array1, arrays)` concatenates array1 with several other arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\"]\nlet array3 = [\"wehoo\"]\n\nlet someArray = array1->Array.concatMany([array2, array3])\n\nConsole.log(someArray) // [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n"} - }, { - "label": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`concatMany(array1, arrays)` concatenates array1 with several other arrays, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet array1 = [\"hi\", \"hello\"]\nlet array2 = [\"yay\"]\nlet array3 = [\"wehoo\"]\n\nlet someArray = array1->Array.concatMany([array2, array3])\n\nConsole.log(someArray) // [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n" + }, "kind": 12, - "tags": [1], + "label": "concatMany", + "tags": [] + }, + { + "deprecated": true, "detail": "(array, string) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `join` instead\n\n\n`joinWith(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinWithUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.joinWith(\" -- \") == \"One -- Two -- Three\"\n```\n"} - }, { - "label": "joinWithUnsafe", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `join` instead\n\n\n`joinWith(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinWithUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.joinWith(\" -- \") == \"One -- Two -- Three\"\n```\n" + }, "kind": 12, - "tags": [1], + "label": "joinWith", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(array<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `joinUnsafe` instead\n\n\n`joinWithUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinWithUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```\n"} - }, { - "label": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `joinUnsafe` instead\n\n\n`joinWithUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinWithUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "joinWithUnsafe", + "tags": [ 1 ] + }, + { "detail": "(array<'a>, 'b, ('b, 'a) => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(xs, init, fn)`\n\nWorks like `Array.reduce`; except that function `fn` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nArray.reduceRight([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n\nArray.reduceRight([1, 2, 3], list{}, List.add) == list{1, 2, 3}\n\nArray.reduceRight([], list{}, List.add) == list{}\n```\n"} - }, { - "label": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(xs, init, fn)`\n\nWorks like `Array.reduce`; except that function `fn` is applied to each item of `xs` from the last back to the first.\n\n## Examples\n\n```rescript\nArray.reduceRight([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"dcba\"\n\nArray.reduceRight([1, 2, 3], list{}, List.add) == list{1, 2, 3}\n\nArray.reduceRight([], list{}, List.add) == list{}\n```\n" + }, "kind": 12, - "tags": [], + "label": "reduceRight", + "tags": [] + }, + { "detail": "(array<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(xs, init, fn)`\n\nLike `reduceRight`, but with an additional index argument on the callback function.\n\n## Examples\n\n```rescript\nArray.reduceRightWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceRightWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```\n"} - }, { - "label": "toShuffled", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(xs, init, fn)`\n\nLike `reduceRight`, but with an additional index argument on the callback function.\n\n## Examples\n\n```rescript\nArray.reduceRightWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceRightWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```\n" + }, "kind": 12, - "tags": [], + "label": "reduceRightWithIndex", + "tags": [] + }, + { "detail": "array<'a> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`toShuffled(array)` returns a new array with all items in `array` in a random order.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet shuffledArray = array->Array.toShuffled\nConsole.log(shuffledArray)\n\nArray.toShuffled([1, 2, 3])->Array.length == 3\n```\n"} - }, { - "label": "getSymbol", + "documentation": { + "kind": "markdown", + "value": "\n`toShuffled(array)` returns a new array with all items in `array` in a random order.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet shuffledArray = array->Array.toShuffled\nConsole.log(shuffledArray)\n\nArray.toShuffled([1, 2, 3])->Array.length == 3\n```\n" + }, "kind": 12, - "tags": [], + "label": "toShuffled", + "tags": [] + }, + { "detail": "(array<'a>, Symbol.t) => option<'b>", - "documentation": {"kind": "markdown", "value": "\n`getSymbol(array, key)` retrieves the value stored under the symbol `key`, if present.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN for more details about symbol keys.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbol(items, key) == Some(\"hello\")\n```\n"} - }, { - "label": "getSymbolUnsafe", + "documentation": { + "kind": "markdown", + "value": "\n`getSymbol(array, key)` retrieves the value stored under the symbol `key`, if present.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN for more details about symbol keys.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbol(items, key) == Some(\"hello\")\n```\n" + }, "kind": 12, - "tags": [], + "label": "getSymbol", + "tags": [] + }, + { "detail": "(array<'a>, Symbol.t) => 'b", - "documentation": {"kind": "markdown", "value": "\n`getSymbolUnsafe(array, key)` retrieves the value stored under the symbol `key` without any safety checks.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbolUnsafe(items, key) == \"hello\"\n```\n"} - }, { - "label": "findIndexOpt", + "documentation": { + "kind": "markdown", + "value": "\n`getSymbolUnsafe(array, key)` retrieves the value stored under the symbol `key` without any safety checks.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"meta\")\nlet items = []\nitems->Array.setSymbol(key, \"hello\")\nArray.getSymbolUnsafe(items, key) == \"hello\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "getSymbolUnsafe", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => option", - "documentation": {"kind": "markdown", "value": "\n`findIndexOpt(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.findIndexOpt(item => item == ReScript) == Some(0)\n```\n"} - }, { - "label": "shuffle", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexOpt(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.findIndexOpt(item => item == ReScript) == Some(0)\n```\n" + }, "kind": 12, - "tags": [], + "label": "findIndexOpt", + "tags": [] + }, + { "detail": "array<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`shuffle(array)` randomizes the position of all items in `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.shuffle\nConsole.log(array)\n\nlet array2 = [1, 2, 3]\narray2->Array.shuffle\n\narray2->Array.length == 3\n```\n"} - }, { - "label": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`shuffle(array)` randomizes the position of all items in `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.shuffle\nConsole.log(array)\n\nlet array2 = [1, 2, 3]\narray2->Array.shuffle\n\narray2->Array.length == 3\n```\n" + }, "kind": 12, - "tags": [], + "label": "shuffle", + "tags": [] + }, + { "detail": "array<'a> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(array)` makes a copy of the array with the items in it, but does not make copies of the items themselves.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3]\nlet copyOfMyArray = myArray->Array.copy\n\ncopyOfMyArray == [1, 2, 3]\n(myArray === copyOfMyArray) == false\n```\n"} - }, { - "label": "setUnsafe", + "documentation": { + "kind": "markdown", + "value": "\n`copy(array)` makes a copy of the array with the items in it, but does not make copies of the items themselves.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3]\nlet copyOfMyArray = myArray->Array.copy\n\ncopyOfMyArray == [1, 2, 3]\n(myArray === copyOfMyArray) == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "copy", + "tags": [] + }, + { "detail": "(array<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`setUnsafe(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array, and is *unsafe*.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.setUnsafe(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```\n"} - }, { - "label": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`setUnsafe(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array, and is *unsafe*.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.setUnsafe(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```\n" + }, "kind": 12, - "tags": [], + "label": "setUnsafe", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\nlet isReScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == ReScript)\nlet isTypeScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == TypeScript)\n\nisReScriptFirst == 0\nisTypeScriptFirst == -1\n```\n"} - }, { - "label": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\nlet isReScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == ReScript)\nlet isTypeScriptFirst =\n array->Array.findIndexWithIndex((item, index) => index === 0 && item == TypeScript)\n\nisReScriptFirst == 0\nisTypeScriptFirst == -1\n```\n" + }, "kind": 12, - "tags": [], + "label": "findIndexWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(array, checker)` returns true if running the provided `checker` function on any element in `array` returns true.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.someWithIndex((greeting, index) => greeting === \"Hello\" && index === 0) == true\n```\n"} - }, { - "label": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(array, checker)` returns true if running the provided `checker` function on any element in `array` returns true.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.someWithIndex((greeting, index) => greeting === \"Hello\" && index === 0) == true\n```\n" + }, "kind": 12, - "tags": [], + "label": "someWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, ~start: int=?, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(array, ~start, ~end)` creates a new array of items copied from `array` from `start` until (but not including) `end`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.slice(~start=1, ~end=3) == [2, 3]\n[1, 2, 3, 4]->Array.slice(~start=1) == [2, 3, 4]\n[1, 2, 3, 4]->Array.slice == [1, 2, 3, 4]\n```\n"} - }, { - "label": "zip", + "documentation": { + "kind": "markdown", + "value": "\n`slice(array, ~start, ~end)` creates a new array of items copied from `array` from `start` until (but not including) `end`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.slice(~start=1, ~end=3) == [2, 3]\n[1, 2, 3, 4]->Array.slice(~start=1) == [2, 3, 4]\n[1, 2, 3, 4]->Array.slice == [1, 2, 3, 4]\n```\n" + }, "kind": 12, - "tags": [], + "label": "slice", + "tags": [] + }, + { "detail": "(t<'a>, array<'b>) => array<('a, 'b)>", - "documentation": {"kind": "markdown", "value": "\n`zip(a, b)` create an array of pairs from corresponding elements of a and b.\nStop with the shorter array.\n\n## Examples\n\n```rescript\nArray.zip([1, 2], [3, 4, 5]) == [(1, 3), (2, 4)]\n```\n"} - }, { - "label": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "\n`zip(a, b)` create an array of pairs from corresponding elements of a and b.\nStop with the shorter array.\n\n## Examples\n\n```rescript\nArray.zip([1, 2], [3, 4, 5]) == [(1, 3), (2, 4)]\n```\n" + }, "kind": 12, - "tags": [1], + "label": "zip", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, 'a, ~start: int) => unit", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(array, value, ~start)` fills `array` with `value` from the `start` index.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillToEnd(9, ~start=1)\nmyArray == [1, 9, 9, 9]\n```\n"} - }, { - "label": "includes", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(array, value, ~start)` fills `array` with `value` from the `start` index.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillToEnd(9, ~start=1)\nmyArray == [1, 9, 9, 9]\n```\n" + }, "kind": 12, - "tags": [], + "label": "fillToEnd", + "tags": [ 1 ] + }, + { "detail": "(array<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(array, item)` checks whether `array` includes `item`, by doing a [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality).\n\nSee [`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.includes(1) == true\n[1, 2]->Array.includes(3) == false\n\n[{\"language\": \"ReScript\"}]->Array.includes({\"language\": \"ReScript\"}) == false // false, because of strict equality\n```\n"} - }, { - "label": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`includes(array, item)` checks whether `array` includes `item`, by doing a [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality).\n\nSee [`Array.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.includes(1) == true\n[1, 2]->Array.includes(3) == false\n\n[{\"language\": \"ReScript\"}]->Array.includes({\"language\": \"ReScript\"}) == false // false, because of strict equality\n```\n" + }, "kind": 12, - "tags": [], + "label": "includes", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, ReScript]\n\narray->Array.findLastIndex(item => item == ReScript) == 2\n\narray->Array.findLastIndex(item => item == TypeScript) == -1\n```\n"} - }, { - "label": "fromInitializer", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, ReScript]\n\narray->Array.findLastIndex(item => item == ReScript) == 2\n\narray->Array.findLastIndex(item => item == TypeScript) == -1\n```\n" + }, "kind": 12, - "tags": [], + "label": "findLastIndex", + "tags": [] + }, + { "detail": "(~length: int, int => 'a) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`fromInitializer(~length, f)`\n\nCreates an array of length `length` initialized with the value returned from `f ` for each index.\n\n## Examples\n\n```rescript\nArray.fromInitializer(~length=3, i => i + 3) == [3, 4, 5]\n\nArray.fromInitializer(~length=7, i => i + 3) == [3, 4, 5, 6, 7, 8, 9]\n```\n"} - }, { - "label": "find", + "documentation": { + "kind": "markdown", + "value": "\n`fromInitializer(~length, f)`\n\nCreates an array of length `length` initialized with the value returned from `f ` for each index.\n\n## Examples\n\n```rescript\nArray.fromInitializer(~length=3, i => i + 3) == [3, 4, 5]\n\nArray.fromInitializer(~length=7, i => i + 3) == [3, 4, 5, 6, 7, 8, 9]\n```\n" + }, "kind": 12, - "tags": [], + "label": "fromInitializer", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.find(item => item == ReScript) == Some(ReScript)\n```\n"} - }, { - "label": "make", + "documentation": { + "kind": "markdown", + "value": "\n`find(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.find(item => item == ReScript) == Some(ReScript)\n```\n" + }, "kind": 12, - "tags": [], + "label": "find", + "tags": [] + }, + { "detail": "(~length: int, 'a) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```\n"} - }, { - "label": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```\n" + }, "kind": 12, - "tags": [1], + "label": "make", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `lastIndexOf` instead\n\n"} - }, { - "label": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `lastIndexOf` instead\n\n" + }, "kind": 12, - "tags": [], + "label": "lastIndexOfFrom", + "tags": [ 1 ] + }, + { "detail": "array<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(array)` converts each element to a locale-aware string and joins them with commas.\n\nSee [`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n[\"apple\", \"banana\"]->Array.toLocaleString == \"apple,banana\"\n```\n"} - }, { - "label": "toSpliced", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(array)` converts each element to a locale-aware string and joins them with commas.\n\nSee [`Array.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n[\"apple\", \"banana\"]->Array.toLocaleString == \"apple,banana\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "toLocaleString", + "tags": [] + }, + { "detail": "(\n array<'a>,\n ~start: int,\n ~remove: int,\n ~insert: array<'a>,\n) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSpliced(array, ~start, ~remove, ~insert)` returns a new array with the same edits that `splice` would perform, leaving the original unchanged.\n\nSee [`Array.toSpliced`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced) on MDN.\n\n## Examples\n\n```rescript\nlet original = [1, 2, 3]\nlet updated = original->Array.toSpliced(~start=1, ~remove=1, ~insert=[10])\nupdated == [1, 10, 3]\noriginal == [1, 2, 3]\n```\n"} - }, { - "label": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`toSpliced(array, ~start, ~remove, ~insert)` returns a new array with the same edits that `splice` would perform, leaving the original unchanged.\n\nSee [`Array.toSpliced`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced) on MDN.\n\n## Examples\n\n```rescript\nlet original = [1, 2, 3]\nlet updated = original->Array.toSpliced(~start=1, ~remove=1, ~insert=[10])\nupdated == [1, 10, 3]\noriginal == [1, 2, 3]\n```\n" + }, "kind": 12, - "tags": [], + "label": "toSpliced", + "tags": [] + }, + { "detail": "(array<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(array, comparator)` sorts `array` in-place using the `comparator` function.\n\nBeware this will *mutate* the array.\n\nSee [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet array = [3, 2, 1]\narray->Array.sort((a, b) => float(a - b))\narray == [1, 2, 3]\n```\n"} - }, { - "label": "filterMapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`sort(array, comparator)` sorts `array` in-place using the `comparator` function.\n\nBeware this will *mutate* the array.\n\nSee [`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) on MDN.\n\n## Examples\n\n```rescript\nlet array = [3, 2, 1]\narray->Array.sort((a, b) => float(a - b))\narray == [1, 2, 3]\n```\n" + }, "kind": 12, - "tags": [], + "label": "sort", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => option<'b>) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```\n"} - }, { - "label": "length", + "documentation": { + "kind": "markdown", + "value": "\n`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```\n" + }, "kind": 12, - "tags": [], + "label": "filterMapWithIndex", + "tags": [] + }, + { "detail": "array<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(array)` returns the length of (i.e. number of items in) the array.\n\nSee [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.length == 2\n```\n"} - }, { - "label": "every", + "documentation": { + "kind": "markdown", + "value": "\n`length(array)` returns the length of (i.e. number of items in) the array.\n\nSee [`Array.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.length == 2\n```\n" + }, "kind": 12, - "tags": [], + "label": "length", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.every(num => num <= 4) == true\n\narray->Array.every(num => num === 1) == false\n```\n"} - }, { - "label": "flat", + "documentation": { + "kind": "markdown", + "value": "\n`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.every(num => num <= 4) == true\n\narray->Array.every(num => num === 1) == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "every", + "tags": [] + }, + { "detail": "array> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`flat(arrays)` concatenates an array of arrays into a single array.\n\nSee [`Array.flat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) on MDN.\n\n## Examples\n\n```rescript\n[[1], [2], [3, 4]]->Array.flat == [1, 2, 3, 4]\n```\n"} - }, { - "label": "map", + "documentation": { + "kind": "markdown", + "value": "\n`flat(arrays)` concatenates an array of arrays into a single array.\n\nSee [`Array.flat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) on MDN.\n\n## Examples\n\n```rescript\n[[1], [2], [3, 4]]->Array.flat == [1, 2, 3, 4]\n```\n" + }, "kind": 12, - "tags": [], + "label": "flat", + "tags": [] + }, + { "detail": "(array<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }, { - "label": "zipBy", + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "map", + "tags": [] + }, + { "detail": "(t<'a>, array<'b>, ('a, 'b) => 'c) => array<'c>", - "documentation": {"kind": "markdown", "value": "\n`zipBy(xs, ys, f)` create an array by applying `f` to corresponding elements of\n`xs` and `ys`. Stops with shorter array.\n\nEquivalent to `map(zip(xs, ys), ((a, b)) => f(a, b))`\n\n## Examples\n\n```rescript\nArray.zipBy([1, 2, 3], [4, 5], (a, b) => 2 * a + b) == [6, 9]\n```\n"} - }, { - "label": "with", + "documentation": { + "kind": "markdown", + "value": "\n`zipBy(xs, ys, f)` create an array by applying `f` to corresponding elements of\n`xs` and `ys`. Stops with shorter array.\n\nEquivalent to `map(zip(xs, ys), ((a, b)) => f(a, b))`\n\n## Examples\n\n```rescript\nArray.zipBy([1, 2, 3], [4, 5], (a, b) => 2 * a + b) == [6, 9]\n```\n" + }, "kind": 12, - "tags": [], + "label": "zipBy", + "tags": [] + }, + { "detail": "(array<'a>, int, 'a) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(array, index, value)` returns a copy of `array` where the element at `index` is replaced with `value`.\n\nSee [`Array.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/with) on MDN.\n\n## Examples\n\n```rescript\nlet original = [\"a\", \"b\", \"c\"]\nlet replaced = original->Array.with(1, \"x\")\nreplaced == [\"a\", \"x\", \"c\"]\noriginal == [\"a\", \"b\", \"c\"]\n```\n"} - }, { - "label": "lastIndexOfOpt", + "documentation": { + "kind": "markdown", + "value": "\n`with(array, index, value)` returns a copy of `array` where the element at `index` is replaced with `value`.\n\nSee [`Array.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/with) on MDN.\n\n## Examples\n\n```rescript\nlet original = [\"a\", \"b\", \"c\"]\nlet replaced = original->Array.with(1, \"x\")\nreplaced == [\"a\", \"x\", \"c\"]\noriginal == [\"a\", \"b\", \"c\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "with", + "tags": [] + }, + { "detail": "(array<'a>, 'a) => option", - "documentation": null - }, { - "label": "toReversed", "kind": 12, - "tags": [], + "label": "lastIndexOfOpt", + "tags": [] + }, + { "detail": "array<'a> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(array)` creates a new array with all items from `array` in reversed order.\n\nSee [`Array.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nlet reversed = someArray->Array.toReversed\n\nreversed == [\"hello\", \"hi\"]\nsomeArray == [\"hi\", \"hello\"] // Original unchanged\n```\n"} - }, { - "label": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(array)` creates a new array with all items from `array` in reversed order.\n\nSee [`Array.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nlet reversed = someArray->Array.toReversed\n\nreversed == [\"hello\", \"hi\"]\nsomeArray == [\"hi\", \"hello\"] // Original unchanged\n```\n" + }, "kind": 12, - "tags": [], + "label": "toReversed", + "tags": [] + }, + { "detail": "(\n array<'a>,\n ~target: int,\n ~start: int,\n ~end: int=?,\n) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(array, ~target, ~start, ~end)` copies starting at element `start` in the given array up to but not including `end` to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\narr->Array.copyWithin(~target=1, ~start=2, ~end=5) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```\n"} - }, { - "label": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(array, ~target, ~start, ~end)` copies starting at element `start` in the given array up to but not including `end` to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104, 105]\narr->Array.copyWithin(~target=1, ~start=2, ~end=5) == [100, 102, 103, 104, 104, 105]\narr == [100, 102, 103, 104, 104, 105]\n```\n" + }, "kind": 12, - "tags": [], + "label": "copyWithin", + "tags": [] + }, + { "detail": "array<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(array)` stringifies `array` by running `toString` on all of the array elements and joining them with \",\".\n\nSee [`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.toString == \"1,2,3,4\"\n```\n"} - }, { - "label": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`toString(array)` stringifies `array` by running `toString` on all of the array elements and joining them with \",\".\n\nSee [`Array.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.toString == \"1,2,3,4\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "toString", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(array, checker)` returns true if all items in `array` returns true when running the provided `checker` function.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.everyWithIndex((num, index) => index < 5 && num <= 4) == true\n\narray->Array.everyWithIndex((num, index) => index < 2 && num >= 2) == false\n```\n"} - }, { - "label": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(array, checker)` returns true if all items in `array` returns true when running the provided `checker` function.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3, 4]\n\narray->Array.everyWithIndex((num, index) => index < 5 && num <= 4) == true\n\narray->Array.everyWithIndex((num, index) => index < 2 && num >= 2) == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "everyWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, 'a, ~start: int=?, ~end: int=?) => unit", - "documentation": {"kind": "markdown", "value": "\n`fill(array, value, ~start, ~end)` fills `array` with `value` from `start` to `end`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\n\nmyArray->Array.fill(9)\nmyArray == [9, 9, 9, 9]\n\nmyArray->Array.fill(0, ~start=1)\nmyArray == [9, 0, 0, 0]\n\nmyArray->Array.fill(5, ~start=1, ~end=3)\nmyArray == [9, 5, 5, 0]\n```\n"} - }, { - "label": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`fill(array, value, ~start, ~end)` fills `array` with `value` from `start` to `end`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\n\nmyArray->Array.fill(9)\nmyArray == [9, 9, 9, 9]\n\nmyArray->Array.fill(0, ~start=1)\nmyArray == [9, 0, 0, 0]\n\nmyArray->Array.fill(5, ~start=1, ~end=3)\nmyArray == [9, 5, 5, 0]\n```\n" + }, "kind": 12, - "tags": [], + "label": "fill", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [TypeScript, JavaScript, ReScript]\n\narray->Array.findWithIndex((item, index) => index > 1 && item == ReScript) == Some(ReScript)\n```\n"} - }, { - "label": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(array, checker)` returns the first element of `array` where the provided `checker` function returns true.\n\nSee [`Array.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [TypeScript, JavaScript, ReScript]\n\narray->Array.findWithIndex((item, index) => index > 1 && item == ReScript) == Some(ReScript)\n```\n" + }, "kind": 12, - "tags": [], + "label": "findWithIndex", + "tags": [] + }, + { "detail": "array<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(array)` reverses the order of the items in `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.reverse\n\nsomeArray == [\"hello\", \"hi\"]\n```\n"} - }, { - "label": "fromString", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(array)` reverses the order of the items in `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.reverse\n\nsomeArray == [\"hello\", \"hi\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "reverse", + "tags": [] + }, + { "detail": "string => array", - "documentation": {"kind": "markdown", "value": "\n`fromString(str)` creates an array of each character as a separate string from the provided `str`.\n\n## Examples\n\n```rescript\nArray.fromString(\"abcde\") == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```\n"} - }, { - "label": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`fromString(str)` creates an array of each character as a separate string from the provided `str`.\n\n## Examples\n\n```rescript\nArray.fromString(\"abcde\") == [\"a\", \"b\", \"c\", \"d\", \"e\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "fromString", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, JavaScript, ReScript]\n\nlet isReScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == ReScript)\nlet isTypeScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == TypeScript)\n\nisReScriptLast == 3\nisTypeScriptLast == -1\n```\n"} - }, { - "label": "getUnsafe", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findLastIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript, JavaScript, ReScript]\n\nlet isReScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == ReScript)\nlet isTypeScriptLast =\n array->Array.findLastIndexWithIndex((item, index) => index === 3 && item == TypeScript)\n\nisReScriptLast == 3\nisTypeScriptLast == -1\n```\n" + }, "kind": 12, - "tags": [], + "label": "findLastIndexWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, int) => 'a", - "documentation": {"kind": "markdown", "value": "\n`getUnsafe(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.getUnsafe` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.getUnsafe(index)\n Console.log(value)\n}\n```\n"} - }, { - "label": "entries", + "documentation": { + "kind": "markdown", + "value": "\n`getUnsafe(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.getUnsafe` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.getUnsafe(index)\n Console.log(value)\n}\n```\n" + }, "kind": 12, - "tags": [], + "label": "getUnsafe", + "tags": [] + }, + { "detail": "array<'a> => IteratorObject.t<(int, 'a), unit, unknown>", - "documentation": {"kind": "markdown", "value": "\n`entries(array)` returns a new array iterator object that contains the key/value pairs for each index in the array.\n\nSee [Array.prototype.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: IteratorObject.t<(int, int), unit, unknown> = array->Array.entries\niterator->IteratorObject.toArray == [(0, 5), (1, 6), (2, 7)]\n```\n"} - }, { - "label": "unshiftMany", + "documentation": { + "kind": "markdown", + "value": "\n`entries(array)` returns a new array iterator object that contains the key/value pairs for each index in the array.\n\nSee [Array.prototype.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: IteratorObject.t<(int, int), unit, unknown> = array->Array.entries\niterator->IteratorObject.toArray == [(0, 5), (1, 6), (2, 7)]\n```\n" + }, "kind": 12, - "tags": [], + "label": "entries", + "tags": [] + }, + { "detail": "(array<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray == [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```\n"} - }, { - "label": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray == [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "unshiftMany", + "tags": [] + }, + { "detail": "(array<'a>, 'a, ~from: int=?) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(array, item, ~from)` returns the last index of the provided `item` in `array`, searching backwards from `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.lastIndexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 1, 2]->Array.lastIndexOf(2) == 3\n[1, 2]->Array.lastIndexOf(3) == -1\n[1, 2, 1, 2]->Array.lastIndexOf(2, ~from=2) == 1\n\n[{\"language\": \"ReScript\"}]->Array.lastIndexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```\n"} - }, { - "label": "fromIterable", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(array, item, ~from)` returns the last index of the provided `item` in `array`, searching backwards from `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.lastIndexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 1, 2]->Array.lastIndexOf(2) == 3\n[1, 2]->Array.lastIndexOf(3) == -1\n[1, 2, 1, 2]->Array.lastIndexOf(2, ~from=2) == 1\n\n[{\"language\": \"ReScript\"}]->Array.lastIndexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```\n" + }, "kind": 12, - "tags": [], + "label": "lastIndexOf", + "tags": [] + }, + { "detail": "Iterable.t<'a> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`fromIterable(iterable)` creates an array from the provided `iterable`\n\n## Examples\n\n```rescript\nMap.fromArray([(\"foo\", 1), (\"bar\", 2)])\n->Map.values\n->IteratorObject.asIterable\n->Array.fromIterable == [1, 2]\n```\n"} - }, { - "label": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`fromIterable(iterable)` creates an array from the provided `iterable`\n\n## Examples\n\n```rescript\nMap.fromArray([(\"foo\", 1), (\"bar\", 2)])\n->Map.values\n->IteratorObject.asIterable\n->Array.fromIterable == [1, 2]\n```\n" + }, "kind": 12, - "tags": [], + "label": "fromIterable", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filter(num => num > 2) == [3, 4]\n```\n"} - }, { - "label": "compare", + "documentation": { + "kind": "markdown", + "value": "\n`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filter(num => num > 2) == [3, 4]\n```\n" + }, "kind": 12, - "tags": [], + "label": "filter", + "tags": [] + }, + { "detail": "(array<'a>, array<'a>, ('a, 'a) => Ordering.t) => Ordering.t", - "documentation": {"kind": "markdown", "value": "\n`compare(left, right, comparator)` compares two arrays element by element using `comparator` and returns an `Ordering`.\n\n## Examples\n\n```rescript\nArray.compare([1, 3], [1, 2], Int.compare) == Ordering.greater\nArray.compare([1, 2], [1, 2], Int.compare) == Ordering.equal\n```\n"} - }, { - "label": "join", + "documentation": { + "kind": "markdown", + "value": "\n`compare(left, right, comparator)` compares two arrays element by element using `comparator` and returns an `Ordering`.\n\n## Examples\n\n```rescript\nArray.compare([1, 3], [1, 2], Int.compare) == Ordering.greater\nArray.compare([1, 2], [1, 2], Int.compare) == Ordering.equal\n```\n" + }, "kind": 12, - "tags": [], + "label": "compare", + "tags": [] + }, + { "detail": "(array, string) => string", - "documentation": {"kind": "markdown", "value": "\n`join(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.join(\" -- \") == \"One -- Two -- Three\"\n```\n"} - }, { - "label": "last", + "documentation": { + "kind": "markdown", + "value": "\n`join(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Array items must be strings, to join number or other arrays, use `joinUnsafe`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[\"One\", \"Two\", \"Three\"]->Array.join(\" -- \") == \"One -- Two -- Three\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "join", + "tags": [] + }, + { "detail": "array<'a> => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`last(array)` returns the last element of `array`.\n\nReturns `None` if the array is empty.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.last == Some(\"Good bye\")\n\n[]->Array.last == None\n```\n"} - }, { - "label": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n`last(array)` returns the last element of `array`.\n\nReturns `None` if the array is empty.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.last == Some(\"Good bye\")\n\n[]->Array.last == None\n```\n" + }, "kind": 12, - "tags": [], + "label": "last", + "tags": [] + }, + { "detail": "array<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(array)` ignores the provided array and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"} - }, { - "label": "isArray", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(array)` ignores the provided array and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "kind": 12, - "tags": [], + "label": "ignore", + "tags": [] + }, + { "detail": "'a => bool", - "documentation": {"kind": "markdown", "value": "\n`isArray(value)` returns `true` when `value` is a JavaScript array and `false` otherwise.\n\nSee [`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) on MDN.\n\n## Examples\n\n```rescript\nArray.isArray([1, 2, 3]) == true\nArray.isArray(\"not an array\") == false\n```\n"} - }, { - "label": "values", + "documentation": { + "kind": "markdown", + "value": "\n`isArray(value)` returns `true` when `value` is a JavaScript array and `false` otherwise.\n\nSee [`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) on MDN.\n\n## Examples\n\n```rescript\nArray.isArray([1, 2, 3]) == true\nArray.isArray(\"not an array\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "isArray", + "tags": [] + }, + { "detail": "array<'a> => IteratorObject.t<'a, unit, unknown>", - "documentation": {"kind": "markdown", "value": "\n`values(array)` returns a new array iterator object that contains the values for each index in the array.\n\nSee [Array.prototype.values](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: IteratorObject.t = array->Array.values\niterator->IteratorObject.toArray == [5, 6, 7]\n```\n "} - }, { - "label": "indexOfOpt", + "documentation": { + "kind": "markdown", + "value": "\n`values(array)` returns a new array iterator object that contains the values for each index in the array.\n\nSee [Array.prototype.values](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values) on MDN.\n\n## Examples\n\n```rescript\nlet array = [5, 6, 7]\nlet iterator: IteratorObject.t = array->Array.values\niterator->IteratorObject.toArray == [5, 6, 7]\n```\n " + }, "kind": 12, - "tags": [], + "label": "values", + "tags": [] + }, + { "detail": "(array<'a>, 'a) => option", - "documentation": {"kind": "markdown", "value": "\n`indexOfOpt(array, item)` returns an option of the index of the provided `item` in `array`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOfOpt(2) == Some(1)\n[1, 2]->Array.indexOfOpt(3) == None\n[{\"language\": \"ReScript\"}]->Array.indexOfOpt({\"language\": \"ReScript\"}) == None // None, because of strict equality\n```\n"} - }, { - "label": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfOpt(array, item)` returns an option of the index of the provided `item` in `array`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOfOpt(2) == Some(1)\n[1, 2]->Array.indexOfOpt(3) == None\n[{\"language\": \"ReScript\"}]->Array.indexOfOpt({\"language\": \"ReScript\"}) == None // None, because of strict equality\n```\n" + }, "kind": 12, - "tags": [], + "label": "indexOfOpt", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEachWithIndex((item, index) => {\n Console.log(\"At item \" ++ Int.toString(index) ++ \": \" ++ item)\n})\n```\n"} - }, { - "label": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEachWithIndex((item, index) => {\n Console.log(\"At item \" ++ Int.toString(index) ++ \": \" ++ item)\n})\n```\n" + }, "kind": 12, - "tags": [], + "label": "forEachWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, 'b, ('b, 'a) => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(xs, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has two parameters: the item from the list and an \"accumulator\"; which starts with a value of `init`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nArray.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n\n[1, 2, 3]->Array.reduce(list{}, List.add) == list{3, 2, 1}\n\nArray.reduce([], list{}, List.add) == list{}\n```\n"} - }, { - "label": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(xs, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has two parameters: the item from the list and an \"accumulator\"; which starts with a value of `init`. `reduce` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduce([2, 3, 4], 1, (a, b) => a + b) == 10\n\nArray.reduce([\"a\", \"b\", \"c\", \"d\"], \"\", (a, b) => a ++ b) == \"abcd\"\n\n[1, 2, 3]->Array.reduce(list{}, List.add) == list{3, 2, 1}\n\nArray.reduce([], list{}, List.add) == list{}\n```\n" + }, "kind": 12, - "tags": [1], + "label": "reduce", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(array, start)` creates a new array from `array`, with all items from `array` starting from `start`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.sliceToEnd(~start=1) == [2, 3, 4]\n```\n"} - }, { - "label": "fromArrayLikeWithMap", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(array, start)` creates a new array from `array`, with all items from `array` starting from `start`.\n\nSee [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.sliceToEnd(~start=1) == [2, 3, 4]\n```\n" + }, "kind": 12, - "tags": [], + "label": "sliceToEnd", + "tags": [ 1 ] + }, + { "detail": "(arrayLike<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`fromArrayLikeWithMap(source, map)` converts an array-like value into an array and applies `map` to every element.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 1, 1: 2, length: 2}`)\nArray.fromArrayLikeWithMap(source, x => x * 10) == [10, 20]\n```\n"} - }, { - "label": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fromArrayLikeWithMap(source, map)` converts an array-like value into an array and applies `map` to every element.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 1, 1: 2, length: 2}`)\nArray.fromArrayLikeWithMap(source, x => x * 10) == [10, 20]\n```\n" + }, "kind": 12, - "tags": [1], + "label": "fromArrayLikeWithMap", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, 'a) => unit", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillAll(array, value)` fills the entire `array` with `value`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillAll(9)\nmyArray == [9, 9, 9, 9]\n```\n"} - }, { - "label": "set", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillAll(array, value)` fills the entire `array` with `value`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.\n\n## Examples\n\n```rescript\nlet myArray = [1, 2, 3, 4]\nmyArray->Array.fillAll(9)\nmyArray == [9, 9, 9, 9]\n```\n" + }, "kind": 12, - "tags": [], + "label": "fillAll", + "tags": [ 1 ] + }, + { "detail": "(array<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.set(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```\n"} - }, { - "label": "isEmpty", + "documentation": { + "kind": "markdown", + "value": "\n`set(array, index, item)` sets the provided `item` at `index` of `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\narray->Array.set(1, \"Hello\")\n\narray[1] == Some(\"Hello\")\n```\n" + }, "kind": 12, - "tags": [], + "label": "set", + "tags": [] + }, + { "detail": "array<'a> => bool", - "documentation": {"kind": "markdown", "value": "\n`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\n[]->Array.isEmpty->assertEqual(true)\n[1, 2, 3]->Array.isEmpty->assertEqual(false)\n\nlet emptyArray = []\nemptyArray->Array.isEmpty->assertEqual(true)\n\nlet nonEmptyArray = [\"hello\"]\nnonEmptyArray->Array.isEmpty->assertEqual(false)\n```\n"} - }, { - "label": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\n[]->Array.isEmpty->assertEqual(true)\n[1, 2, 3]->Array.isEmpty->assertEqual(false)\n\nlet emptyArray = []\nemptyArray->Array.isEmpty->assertEqual(true)\n\nlet nonEmptyArray = [\"hello\"]\nnonEmptyArray->Array.isEmpty->assertEqual(false)\n```\n" + }, "kind": 12, - "tags": [], + "label": "isEmpty", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => bool) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filterWithIndex((num, index) => index === 0 || num === 2) == [1, 2]\n```\n"} - }, { - "label": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filterWithIndex((num, index) => index === 0 || num === 2) == [1, 2]\n```\n" + }, "kind": 12, - "tags": [], + "label": "filterWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\narray->Array.findIndex(item => item == ReScript) == 0\n\narray->Array.findIndex(item => item == TypeScript) == -1\n```\n"} - }, { - "label": "setSymbol", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(array, checker)` returns the index of the first element of `array` where the provided `checker` function returns true.\n\nReturns `-1` if the item does not exist. Consider using `Array.findIndexOpt` if you want an option instead (where `-1` would be `None`).\n\nSee [`Array.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) on MDN.\n\n## Examples\n\n```rescript\ntype languages = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, JavaScript]\n\narray->Array.findIndex(item => item == ReScript) == 0\n\narray->Array.findIndex(item => item == TypeScript) == -1\n```\n" + }, "kind": 12, - "tags": [], + "label": "findIndex", + "tags": [] + }, + { "detail": "(array<'a>, Symbol.t, 'b) => unit", - "documentation": {"kind": "markdown", "value": "\n`setSymbol(array, key, value)` stores `value` under the symbol `key` on `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet items = []\nitems->Array.setSymbol(key, 5)\nArray.getSymbol(items, key) == Some(5)\n```\n"} - }, { - "label": "equal", + "documentation": { + "kind": "markdown", + "value": "\n`setSymbol(array, key, value)` stores `value` under the symbol `key` on `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) on MDN.\n\n## Examples\n\n```rescript\nlet key = Symbol.make(\"count\")\nlet items = []\nitems->Array.setSymbol(key, 5)\nArray.getSymbol(items, key) == Some(5)\n```\n" + }, "kind": 12, - "tags": [], + "label": "setSymbol", + "tags": [] + }, + { "detail": "(array<'a>, array<'a>, ('a, 'a) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`equal(left, right, predicate)` checks if the two arrays contain the same elements according to the equality `predicate`.\n\n## Examples\n\n```rescript\nArray.equal([1, 2, 3], [1, 2, 3], Int.equal) == true\nArray.equal([1, 2, 3], [1, 3, 2], Int.equal) == false\n```\n"} - }, { - "label": "concatAll", + "documentation": { + "kind": "markdown", + "value": "\n`equal(left, right, predicate)` checks if the two arrays contain the same elements according to the equality `predicate`.\n\n## Examples\n\n```rescript\nArray.equal([1, 2, 3], [1, 2, 3], Int.equal) == true\nArray.equal([1, 2, 3], [1, 3, 2], Int.equal) == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "equal", + "tags": [] + }, + { "detail": "array> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`concatAll(arrays)` concatenates all arrays in `arrays`, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet arrays = [[\"hi\", \"hello\"], [\"yay\"], [\"wehoo\"]]\n\nlet result = Array.concatAll(arrays)\n\narrays == [[\"hi\", \"hello\"], [\"yay\"], [\"wehoo\"]]\nresult == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n"} - }, { - "label": "joinUnsafe", + "documentation": { + "kind": "markdown", + "value": "\n`concatAll(arrays)` concatenates all arrays in `arrays`, creating a new array.\n\nSee [`Array.concat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) on MDN.\n\n## Examples\n```rescript\nlet arrays = [[\"hi\", \"hello\"], [\"yay\"], [\"wehoo\"]]\n\nlet result = Array.concatAll(arrays)\n\narrays == [[\"hi\", \"hello\"], [\"yay\"], [\"wehoo\"]]\nresult == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "concatAll", + "tags": [] + }, + { "detail": "(array<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```\n"} - }, { - "label": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`joinUnsafe(array, separator)` produces a string where all items of `array` are printed, separated by `separator`. Under the hood this will run JavaScript's `toString` on all the array items.\n\nSee [Array.join](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join)\n\n## Examples\n\n```rescript\n[1, 2, 3]->Array.joinUnsafe(\" -- \") == \"1 -- 2 -- 3\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "joinUnsafe", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"} - }, { - "label": "flatMapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "mapWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => array<'b>) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`flatMapWithIndex(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMapWithIndex((item, index) =>\n switch item {\n | ReScript => [index]\n | TypeScript => [index, index + 1]\n | JavaScript => [index, index + 1, index + 2]\n }\n) == [0, 1, 2, 2, 3, 4]\n```\n"} - }, { - "label": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "\n`flatMapWithIndex(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMapWithIndex((item, index) =>\n switch item {\n | ReScript => [index]\n | TypeScript => [index, index + 1]\n | JavaScript => [index, index + 1, index + 2]\n }\n) == [0, 1, 2, 2, 3, 4]\n```\n" + }, "kind": 12, - "tags": [1], + "label": "flatMapWithIndex", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(array, ~target, ~start)` copies starting at element `start` in the given array to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyWithinToEnd(~target=0, ~start=2) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```\n"} - }, { - "label": "unshift", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(array, ~target, ~start)` copies starting at element `start` in the given array to the designated `target` position, returning the resulting array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyWithinToEnd(~target=0, ~start=2) == [102, 103, 104, 103, 104]\narr == [102, 103, 104, 103, 104]\n```\n" + }, "kind": 12, - "tags": [], + "label": "copyWithinToEnd", + "tags": [ 1 ] + }, + { "detail": "(array<'a>, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray == [\"yay\", \"hi\", \"hello\"]\n```\n"} - }, { - "label": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray == [\"yay\", \"hi\", \"hello\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "unshift", + "tags": [] + }, + { "detail": "(array<'a>, 'a, ~from: int=?) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(array, item, ~from)` returns the index of the provided `item` in `array`, starting the search at `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.indexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOf(2) == 1\n[1, 2]->Array.indexOf(3) == -1\n[1, 2, 1, 2]->Array.indexOf(2, ~from=2) == 3\n\n[{\"language\": \"ReScript\"}]->Array.indexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```\n"} - }, { - "label": "push", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(array, item, ~from)` returns the index of the provided `item` in `array`, starting the search at `from`. Uses [strict check for equality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality) when comparing items.\n\nReturns `-1` if the item isn't found. Check out `Array.indexOfOpt` for a version that returns `None` instead of `-1` if the item does not exist.\n\nSee [`Array.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) on MDN.\n\n## Examples\n\n```rescript\n[1, 2]->Array.indexOf(2) == 1\n[1, 2]->Array.indexOf(3) == -1\n[1, 2, 1, 2]->Array.indexOf(2, ~from=2) == 3\n\n[{\"language\": \"ReScript\"}]->Array.indexOf({\"language\": \"ReScript\"}) == -1 // -1, because of strict equality\n```\n" + }, "kind": 12, - "tags": [], + "label": "indexOf", + "tags": [] + }, + { "detail": "(array<'a>, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`push(array, item)` appends `item` to the end of `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.push(\"yay\")\n\nsomeArray == [\"hi\", \"hello\", \"yay\"]\n```\n"} - }, { - "label": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`push(array, item)` appends `item` to the end of `array`.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.push(\"yay\")\n\nsomeArray == [\"hi\", \"hello\", \"yay\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "push", + "tags": [] + }, + { "detail": "(array<'a>, ('a, 'a) => Ordering.t) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(array, comparator)` returns a new, sorted array from `array`, using the `comparator` function.\n\nSee [`Array.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [3, 2, 1]\n\nsomeArray->Array.toSorted(Int.compare) == [1, 2, 3]\n\nsomeArray == [3, 2, 1] // Original unchanged\n```\n"} - }, { - "label": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(array, comparator)` returns a new, sorted array from `array`, using the `comparator` function.\n\nSee [`Array.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [3, 2, 1]\n\nsomeArray->Array.toSorted(Int.compare) == [1, 2, 3]\n\nsomeArray == [3, 2, 1] // Original unchanged\n```\n" + }, "kind": 12, - "tags": [], + "label": "toSorted", + "tags": [] + }, + { "detail": "(array<'a>, 'b, ('b, 'a, int) => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(x, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has three parameters: the item from the array and an \"accumulator\", which starts with a value of `init` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceWithIndex([1, 2, 3], list{}, (acc, v, i) => list{v + i, ...acc}) == list{5, 3, 1}\n\nArray.reduceWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```\n"} - }, { - "label": "some", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(x, init, fn)`\n\nApplies `fn` to each element of `xs` from beginning to end. Function `fn` has three parameters: the item from the array and an \"accumulator\", which starts with a value of `init` and the index of each element. `reduceWithIndex` returns the final value of the accumulator.\n\n## Examples\n\n```rescript\nArray.reduceWithIndex([1, 2, 3, 4], 0, (acc, x, i) => acc + x + i) == 16\n\nArray.reduceWithIndex([1, 2, 3], list{}, (acc, v, i) => list{v + i, ...acc}) == list{5, 3, 1}\n\nArray.reduceWithIndex([], list{}, (acc, v, i) => list{v + i, ...acc}) == list{}\n```\n" + }, "kind": 12, - "tags": [], + "label": "reduceWithIndex", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(array, predicate)` returns true if `predicate` returns true for any element in `array`.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.some(greeting => greeting === \"Hello\") == true\n```\n"} - }, { - "label": "unsafe_get", + "documentation": { + "kind": "markdown", + "value": "\n`some(array, predicate)` returns true if `predicate` returns true for any element in `array`.\n\nSee [`Array.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.some(greeting => greeting === \"Hello\") == true\n```\n" + }, "kind": 12, - "tags": [1], + "label": "some", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, int) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use getUnsafe instead. This will be removed in v13\n\n\n`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```\n"} - }, { - "label": "partition", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use getUnsafe instead. This will be removed in v13\n\n\n`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```\n" + }, "kind": 12, - "tags": [], + "label": "unsafe_get", + "tags": [ 1 ] + }, + { "detail": "(t<'a>, 'a => bool) => (t<'a>, t<'a>)", - "documentation": {"kind": "markdown", "value": "\n`partition(f, a)` split array into tuple of two arrays based on predicate `f`;\nfirst of tuple where predicate cause true, second where predicate cause false\n\n## Examples\n\n```rescript\nArray.partition([1, 2, 3, 4, 5], x => mod(x, 2) == 0) == ([2, 4], [1, 3, 5])\n\nArray.partition([1, 2, 3, 4, 5], x => mod(x, 2) != 0) == ([1, 3, 5], [2, 4])\n```\n"} - }, { - "label": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`partition(f, a)` split array into tuple of two arrays based on predicate `f`;\nfirst of tuple where predicate cause true, second where predicate cause false\n\n## Examples\n\n```rescript\nArray.partition([1, 2, 3, 4, 5], x => mod(x, 2) == 0) == ([2, 4], [1, 3, 5])\n\nArray.partition([1, 2, 3, 4, 5], x => mod(x, 2) != 0) == ([1, 3, 5], [2, 4])\n```\n" + }, "kind": 12, - "tags": [1], + "label": "partition", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyAllWithin(~target=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```\n"} - }, { - "label": "keepSome", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`isEmpty(array)` returns `true` if the array is empty (has length 0), `false` otherwise.\n\n## Examples\n\n```rescript\nlet arr = [100, 101, 102, 103, 104]\narr->Array.copyAllWithin(~target=2) == [100, 101, 100, 101, 102]\narr == [100, 101, 100, 101, 102]\n```\n" + }, "kind": 12, - "tags": [], + "label": "copyAllWithin", + "tags": [ 1 ] + }, + { "detail": "array> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`keepSome(arr)`\n\nReturns a new array containing `value` for all elements that are `Some(value)`\nand ignoring every value that is `None`\n\n## Examples\n\n```rescript\nArray.keepSome([Some(1), None, Some(3)]) == [1, 3]\n\nArray.keepSome([Some(1), Some(2), Some(3)]) == [1, 2, 3]\n\nArray.keepSome([None, None, None]) == []\n\nArray.keepSome([]) == []\n```\n"} - }, { - "label": "at", + "documentation": { + "kind": "markdown", + "value": "\n`keepSome(arr)`\n\nReturns a new array containing `value` for all elements that are `Some(value)`\nand ignoring every value that is `None`\n\n## Examples\n\n```rescript\nArray.keepSome([Some(1), None, Some(3)]) == [1, 3]\n\nArray.keepSome([Some(1), Some(2), Some(3)]) == [1, 2, 3]\n\nArray.keepSome([None, None, None]) == []\n\nArray.keepSome([]) == []\n```\n" + }, "kind": 12, - "tags": [], + "label": "keepSome", + "tags": [] + }, + { "detail": "(array<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(2) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(3) == None\n[\"a\", \"b\", \"c\"]->Array.at(-1) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(-3) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(-4) == None\n```\n"} - }, { - "label": "pop", + "documentation": { + "kind": "markdown", + "value": "\n`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(2) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(3) == None\n[\"a\", \"b\", \"c\"]->Array.at(-1) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(-3) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(-4) == None\n```\n" + }, "kind": 12, - "tags": [], + "label": "at", + "tags": [] + }, + { "detail": "array<'a> => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`pop(array)` removes the last item from `array` and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pop == Some(\"hello\")\n\nsomeArray == [\"hi\"] // Notice last item is gone.\n```\n"} - }, { - "label": "get", + "documentation": { + "kind": "markdown", + "value": "\n`pop(array)` removes the last item from `array` and returns it.\n\nBeware this will *mutate* the array.\n\nSee [`Array.pop`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pop == Some(\"hello\")\n\nsomeArray == [\"hi\"] // Notice last item is gone.\n```\n" + }, "kind": 12, - "tags": [], + "label": "pop", + "tags": [] + }, + { "detail": "(array<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(array, index)` returns the element at `index` of `array`.\n\nReturns `None` if the index does not exist in the array. Equivalent to doing `array[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.get(0) == Some(\"Hello\")\n\narray->Array.get(3) == None\n```\n"} - }, { - "label": "asIterable", + "documentation": { + "kind": "markdown", + "value": "\n`get(array, index)` returns the element at `index` of `array`.\n\nReturns `None` if the index does not exist in the array. Equivalent to doing `array[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.get(0) == Some(\"Hello\")\n\narray->Array.get(3) == None\n```\n" + }, "kind": 12, - "tags": [], + "label": "get", + "tags": [] + }, + { "detail": "array<'a> => Iterable.t<'a>", - "documentation": {"kind": "markdown", "value": "\n`asIterable(array)` views `array` as an `Iterable.t`.\n\nThis is useful when passing an array to APIs that consume iterables, such as\n`Array.from` or `for...of` in JavaScript.\n"} - }, { - "label": "removeInPlace", + "documentation": { + "kind": "markdown", + "value": "\n`asIterable(array)` views `array` as an `Iterable.t`.\n\nThis is useful when passing an array to APIs that consume iterables, such as\n`Array.from` or `for...of` in JavaScript.\n" + }, "kind": 12, - "tags": [], + "label": "asIterable", + "tags": [] + }, + { "detail": "(array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`removeInPlace(array, index)` removes the item at the specified `index` from `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = []\narray->Array.removeInPlace(0)\narray == [] // Removing from an empty array does nothing\n\nlet array2 = [\"Hello\", \"Hi\", \"Good bye\"]\narray2->Array.removeInPlace(1)\narray2 == [\"Hello\", \"Good bye\"] // Removes the item at index 1\n```\n "} - }, { - "label": "findLastIndexOpt", + "documentation": { + "kind": "markdown", + "value": "\n`removeInPlace(array, index)` removes the item at the specified `index` from `array`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet array = []\narray->Array.removeInPlace(0)\narray == [] // Removing from an empty array does nothing\n\nlet array2 = [\"Hello\", \"Hi\", \"Good bye\"]\narray2->Array.removeInPlace(1)\narray2 == [\"Hello\", \"Good bye\"] // Removes the item at index 1\n```\n " + }, "kind": 12, - "tags": [], + "label": "removeInPlace", + "tags": [] + }, + { "detail": "(array<'a>, 'a => bool) => option", - "documentation": {"kind": "markdown", "value": "\n`findIndexOpt(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"hello\", \"world\", \"!\"]\n\narray->Array.findLastIndexOpt(item => item->String.includes(\"o\")) == Some(1)\n```\n"} - }, { - "label": "pushMany", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexOpt(array, checker)` returns the index of the last element of `array` where the provided `checker` function returns true.\n\nReturns `None` if no item matches.\n\nSee [`Array.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findLastIndex) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"hello\", \"world\", \"!\"]\n\narray->Array.findLastIndexOpt(item => item->String.includes(\"o\")) == Some(1)\n```\n" + }, "kind": 12, - "tags": [], + "label": "findLastIndexOpt", + "tags": [] + }, + { "detail": "(array<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`pushMany(array, itemsArray)` appends many new items to the end of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pushMany([\"yay\", \"wehoo\"])\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n"} - }, { - "label": "unzip", + "documentation": { + "kind": "markdown", + "value": "\n`pushMany(array, itemsArray)` appends many new items to the end of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\n\nsomeArray->Array.pushMany([\"yay\", \"wehoo\"])\nsomeArray == [\"hi\", \"hello\", \"yay\", \"wehoo\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "pushMany", + "tags": [] + }, + { "detail": "array<('a, 'b)> => (t<'a>, array<'b>)", - "documentation": {"kind": "markdown", "value": "\n`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nArray.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nArray.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```\n"} - }, { - "label": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nArray.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nArray.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```\n" + }, "kind": 12, - "tags": [], + "label": "unzip", + "tags": [] + }, + { "detail": "(array<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEach(item => {\n Console.log(item)\n})\n```\n"} - }, { - "label": "flatMap", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(array, fn)` runs the provided `fn` on every element of `array`.\n\nSee [`Array.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) on MDN.\n\n## Examples\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\n\narray->Array.forEach(item => {\n Console.log(item)\n})\n```\n" + }, "kind": 12, - "tags": [], + "label": "forEach", + "tags": [] + }, + { "detail": "(array<'a>, 'a => array<'b>) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`flatMap(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMap(item =>\n switch item {\n | ReScript => [1, 2, 3]\n | TypeScript => [4, 5, 6]\n | JavaScript => [7, 8, 9]\n }\n) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\n```\n"} - }, { - "label": "fromArrayLike", + "documentation": { + "kind": "markdown", + "value": "\n`flatMap(array, mapper)` returns a new array concatenating the arrays returned from running `mapper` on all items in `array`.\n\n## Examples\n\n```rescript\ntype language = ReScript | TypeScript | JavaScript\n\nlet array = [ReScript, TypeScript, JavaScript]\n\narray->Array.flatMap(item =>\n switch item {\n | ReScript => [1, 2, 3]\n | TypeScript => [4, 5, 6]\n | JavaScript => [7, 8, 9]\n }\n) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\n```\n" + }, "kind": 12, - "tags": [], + "label": "flatMap", + "tags": [] + }, + { "detail": "arrayLike<'a> => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`fromArrayLike(source)` converts an array-like value (anything with indexed items and a `length`) into a regular array.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 10, 1: 20, length: 2}`)\nArray.fromArrayLike(source) == [10, 20]\n```\n"} - }, { - "label": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`fromArrayLike(source)` converts an array-like value (anything with indexed items and a `length`) into a regular array.\n\nSee [`Array.from`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) on MDN.\n\n## Examples\n\n```rescript\nlet source: Array.arrayLike = %raw(`{0: 10, 1: 20, length: 2}`)\nArray.fromArrayLike(source) == [10, 20]\n```\n" + }, "kind": 12, - "tags": [1], + "label": "fromArrayLike", + "tags": [] + }, + { + "deprecated": true, "detail": "(array<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `indexOf` instead\n\n"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `indexOf` instead\n\n" + }, + "kind": 12, + "label": "indexOfFrom", + "tags": [ 1 ] + } +] Complete src/Completion.res 5:10 posCursor:[5:10] posNoWhite:[5:9] Found expr:[5:3->5:10] @@ -662,25 +1094,38 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Array, m] Path Array.m -[{ - "label": "make", - "kind": 12, - "tags": [], +[ + { "detail": "(~length: int, 'a) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```\n"} - }, { - "label": "map", + "documentation": { + "kind": "markdown", + "value": "\n`make(~length, init)` creates an array of length `length` initialized with the value of `init`.\n\n## Examples\n\n```rescript\nArray.make(~length=3, #apple) == [#apple, #apple, #apple]\nArray.make(~length=6, 7) == [7, 7, 7, 7, 7, 7]\n```\n" + }, "kind": 12, - "tags": [], + "label": "make", + "tags": [] + }, + { "detail": "(array<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }, { - "label": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "map", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n" + }, + "kind": 12, + "label": "mapWithIndex", + "tags": [] + } +] Complete src/Completion.res 15:17 posCursor:[15:17] posNoWhite:[15:16] Found expr:[15:12->15:17] @@ -690,13 +1135,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Dep, c] Path Dep.c -[{ - "label": "customDouble", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "int => int", - "documentation": {"kind": "markdown", "value": "Deprecated: Use customDouble instead\n\nSome doc comment"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use customDouble instead\n\nSome doc comment" + }, + "kind": 12, + "label": "customDouble", + "tags": [ 1 ] + } +] Complete src/Completion.res 23:20 posCursor:[23:20] posNoWhite:[23:19] Found expr:[23:11->23:20] @@ -707,19 +1158,10 @@ Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo Found type for function (~age: int, ~name: string) => string -[{ - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "age", "tags": [] }, + { "detail": "string", "kind": 4, "label": "name", "tags": [] } +] Complete src/Completion.res 26:13 posCursor:[26:13] posNoWhite:[26:12] Found expr:[26:3->26:13] @@ -731,19 +1173,28 @@ ContextPath array Path Stdlib.Array.m Path ArrayUtils.m Path m -[{ - "label": "Array.map", - "kind": 12, - "tags": [], +[ + { "detail": "(array<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }, { - "label": "Array.mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "Array.map", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n" + }, + "kind": 12, + "label": "Array.mapWithIndex", + "tags": [] + } +] Complete src/Completion.res 29:13 posCursor:[29:13] posNoWhite:[29:12] Found expr:[29:3->29:13] @@ -754,13 +1205,18 @@ ContextPath string->toU ContextPath string Path Stdlib.String.toU Path toU -[{ - "label": "String.toUpperCase", - "kind": 12, - "tags": [], +[ + { "detail": "string => string", - "documentation": {"kind": "markdown", "value": "\n`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```\n" + }, + "kind": 12, + "label": "String.toUpperCase", + "tags": [] + } +] Complete src/Completion.res 34:8 posCursor:[34:8] posNoWhite:[34:7] Found expr:[34:3->34:8] @@ -772,13 +1228,18 @@ ContextPath Value[op] Path op Path Stdlib.Option.e Path e -[{ - "label": "Option.equal", - "kind": 12, - "tags": [], +[ + { "detail": "(option<'a>, option<'b>, ('a, 'b) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`equal(opt1, opt2, f)` evaluates two optional values for equality with respect to a predicate function `f`. If both `opt1` and `opt2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, the predicate function `f` must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Option\n\nequal(Some(3), Some(15), clockEqual) // true\nequal(Some(3), None, clockEqual) // false\nequal(None, Some(3), clockEqual) // false\nequal(None, None, clockEqual) // true\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`equal(opt1, opt2, f)` evaluates two optional values for equality with respect to a predicate function `f`. If both `opt1` and `opt2` are `None`, returns `true`.\nIf one of the arguments is `Some(value)` and the other is `None`, returns\n`false`.\nIf arguments are `Some(value1)` and `Some(value2)`, returns the result of\n`f(value1, value2)`, the predicate function `f` must return a bool.\n\n## Examples\n\n```rescript\nlet clockEqual = (a, b) => mod(a, 12) == mod(b, 12)\n\nopen Option\n\nequal(Some(3), Some(15), clockEqual) // true\nequal(Some(3), None, clockEqual) // false\nequal(None, Some(3), clockEqual) // false\nequal(None, None, clockEqual) // true\n```\n" + }, + "kind": 12, + "label": "Option.equal", + "tags": [] + } +] Complete src/Completion.res 44:7 posCursor:[44:7] posNoWhite:[44:6] Found expr:[44:3->54:3] @@ -793,19 +1254,20 @@ Path fa CPPipe pathFromEnv:ForAuto found:true Path ForAuto. Path -[{ - "label": "ForAuto.abc", - "kind": 12, - "tags": [], +[ + { "detail": "(t, int) => t", - "documentation": null - }, { - "label": "ForAuto.abd", "kind": 12, - "tags": [], + "label": "ForAuto.abc", + "tags": [] + }, + { "detail": "(t, int) => t", - "documentation": null - }] + "kind": 12, + "label": "ForAuto.abd", + "tags": [] + } +] Complete src/Completion.res 47:21 XXX Not found! @@ -819,13 +1281,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [O, Comp] second Path O.Comp.make -[{ - "label": "zzz", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 12, "label": "zzz", "tags": [] } ] Complete src/Completion.res 62:23 posCursor:[62:23] posNoWhite:[62:22] Found expr:[62:14->62:23] @@ -834,34 +1290,37 @@ Completable: Cjsx([O, Comp], z, [z]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path O.Comp.make -[{ - "label": "zoo", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[ { "detail": "option", "kind": 4, "label": "zoo", "tags": [] } ] Complete src/Completion.res 65:8 Attribute id:reac:[65:3->65:8] label:reac Completable: Cdecorator(reac) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "react.component", - "kind": 4, - "tags": [], +[ + { "detail": "", - "documentation": {"kind": "markdown", "value": "The `@react.component` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.component` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator)."}, - "insertTextFormat": 2 - }, { - "label": "react.componentWithProps", + "documentation": { + "kind": "markdown", + "value": "The `@react.component` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.component` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator)." + }, + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "react.component", + "tags": [] + }, + { "detail": "", - "documentation": {"kind": "markdown", "value": "The `@react.componentWithProps` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.componentWithProps` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-with-props-decorator)."}, - "insertTextFormat": 2 - }] + "documentation": { + "kind": "markdown", + "value": "The `@react.componentWithProps` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.componentWithProps` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-with-props-decorator)." + }, + "insertTextFormat": 2, + "kind": 4, + "label": "react.componentWithProps", + "tags": [] + } +] Complete src/Completion.res 68:10 posCursor:[68:10] posNoWhite:[68:9] Found expr:[0:-1->86:1] @@ -870,21 +1329,30 @@ Attribute id:react.let:[68:3->80:3] label:react. Completable: Cdecorator(react.) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "component", - "kind": 4, - "tags": [], +[ + { "detail": "", - "documentation": {"kind": "markdown", "value": "The `@react.component` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.component` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator)."}, - "insertTextFormat": 2 - }, { - "label": "componentWithProps", + "documentation": { + "kind": "markdown", + "value": "The `@react.component` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.component` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator)." + }, + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "component", + "tags": [] + }, + { "detail": "", - "documentation": {"kind": "markdown", "value": "The `@react.componentWithProps` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.componentWithProps` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-with-props-decorator)."}, - "insertTextFormat": 2 - }] + "documentation": { + "kind": "markdown", + "value": "The `@react.componentWithProps` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.componentWithProps` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-with-props-decorator)." + }, + "insertTextFormat": 2, + "kind": 4, + "label": "componentWithProps", + "tags": [] + } +] Complete src/Completion.res 71:27 posCursor:[71:27] posNoWhite:[71:26] Found expr:[71:11->71:27] @@ -895,13 +1363,7 @@ Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo Found type for function (~age: int, ~name: string) => string -[{ - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 4, "label": "age", "tags": [] } ] Complete src/Completion.res 74:26 posCursor:[74:26] posNoWhite:[74:25] Found expr:[74:11->74:26] @@ -912,13 +1374,7 @@ Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo Found type for function (~age: int, ~name: string) => string -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "name", "tags": [] } ] Complete src/Completion.res 77:32 posCursor:[77:32] posNoWhite:[77:31] Found expr:[77:11->77:32] @@ -929,13 +1385,7 @@ Resolved opens 1 Stdlib ContextPath Value[Lib, foo] Path Lib.foo Found type for function (~age: int, ~name: string) => string -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "name", "tags": [] } ] Complete src/Completion.res 82:5 posCursor:[82:5] posNoWhite:[82:4] Found expr:[80:8->86:1] @@ -957,13 +1407,7 @@ Resolved opens 1 Stdlib ContextPath Value[someObj]["a"] ContextPath Value[someObj] Path someObj -[{ - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 4, "label": "age", "tags": [] } ] Complete src/Completion.res 95:24 posCursor:[95:24] posNoWhite:[95:23] Found expr:[95:3->99:6] @@ -976,19 +1420,10 @@ ContextPath Value[nestedObj]["x"]["y"] ContextPath Value[nestedObj]["x"] ContextPath Value[nestedObj] Path nestedObj -[{ - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "age", "tags": [] }, + { "detail": "string", "kind": 4, "label": "name", "tags": [] } +] Complete src/Completion.res 99:7 posCursor:[99:7] posNoWhite:[99:6] Found expr:[99:3->102:20] @@ -999,13 +1434,7 @@ Resolved opens 1 Stdlib ContextPath Value[o]["a"] ContextPath Value[o] Path o -[{ - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 4, "label": "age", "tags": [] } ] Complete src/Completion.res 104:17 posCursor:[104:17] posNoWhite:[104:16] Found expr:[104:3->125:19] @@ -1018,19 +1447,10 @@ ContextPath Value[no]["x"]["y"] ContextPath Value[no]["x"] ContextPath Value[no] Path no -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }, { - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "string", "kind": 4, "label": "name", "tags": [] }, + { "detail": "int", "kind": 4, "label": "age", "tags": [] } +] Complete src/Completion.res 110:5 posCursor:[110:5] posNoWhite:[110:4] Found expr:[110:3->110:5] @@ -1047,19 +1467,28 @@ Path r CPPipe pathFromEnv: found:true Path Completion. Path -[{ - "label": "x", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nx: int\n```\n\n```rescript\ntype r = {x: int, y: string}\n```"} - }, { - "label": "y", + "documentation": { + "kind": "markdown", + "value": "```rescript\nx: int\n```\n\n```rescript\ntype r = {x: int, y: string}\n```" + }, "kind": 5, - "tags": [], + "label": "x", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\ny: string\n```\n\n```rescript\ntype r = {x: int, y: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ny: string\n```\n\n```rescript\ntype r = {x: int, y: string}\n```" + }, + "kind": 5, + "label": "y", + "tags": [] + } +] Complete src/Completion.res 113:25 posCursor:[113:25] posNoWhite:[113:24] Found expr:[113:3->113:25] @@ -1076,19 +1505,28 @@ Path Objects.Rec.recordVal CPPipe pathFromEnv:Rec found:true Path Objects.Rec. Path -[{ - "label": "xx", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nxx: int\n```\n\n```rescript\ntype recordt = {xx: int, ss: string}\n```"} - }, { - "label": "ss", + "documentation": { + "kind": "markdown", + "value": "```rescript\nxx: int\n```\n\n```rescript\ntype recordt = {xx: int, ss: string}\n```" + }, "kind": 5, - "tags": [], + "label": "xx", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nss: string\n```\n\n```rescript\ntype recordt = {xx: int, ss: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nss: string\n```\n\n```rescript\ntype recordt = {xx: int, ss: string}\n```" + }, + "kind": 5, + "label": "ss", + "tags": [] + } +] Complete src/Completion.res 120:7 posCursor:[120:7] posNoWhite:[120:6] Found expr:[119:11->123:1] @@ -1100,13 +1538,14 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[my] Path my -[{ - "label": "myAmazingFunction", - "kind": 12, - "tags": [], +[ + { "detail": "(int, int) => int", - "documentation": null - }] + "kind": 12, + "label": "myAmazingFunction", + "tags": [] + } +] Complete src/Completion.res 125:19 posCursor:[125:19] posNoWhite:[125:18] Found expr:[125:3->145:32] @@ -1117,19 +1556,10 @@ Resolved opens 1 Stdlib ContextPath Value[Objects, object][""] ContextPath Value[Objects, object] Path Objects.object -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }, { - "label": "age", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "string", "kind": 4, "label": "name", "tags": [] }, + { "detail": "int", "kind": 4, "label": "age", "tags": [] } +] Complete src/Completion.res 151:6 posCursor:[151:6] posNoWhite:[151:5] Found expr:[151:3->151:6] @@ -1165,19 +1595,28 @@ Path aa CPPipe pathFromEnv: found:true Path Completion. Path -[{ - "label": "x", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nx: int\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```"} - }, { - "label": "name", + "documentation": { + "kind": "markdown", + "value": "```rescript\nx: int\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```" + }, "kind": 5, - "tags": [], + "label": "x", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + } +] Complete src/Completion.res 159:9 posCursor:[159:9] posNoWhite:[159:8] Found expr:[159:3->159:9] @@ -1208,13 +1647,18 @@ Path aa CPPipe pathFromEnv: found:true Path Completion.n Path n -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + } +] Complete src/Completion.res 162:6 posCursor:[162:6] posNoWhite:[162:5] Found expr:[162:3->162:6] @@ -1224,13 +1668,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Lis] Path Lis -[{ - "label": "List", - "kind": 9, - "tags": [], - "detail": "module List", - "documentation": null - }] +[ { "detail": "module List", "kind": 9, "label": "List", "tags": [] } ] Complete src/Completion.res 169:16 posCursor:[169:16] posNoWhite:[169:15] Found expr:[169:3->169:16] @@ -1240,13 +1678,14 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[WithChildren] Path WithChildren -[{ - "label": "WithChildren", - "kind": 9, - "tags": [], +[ + { "detail": "module WithChildren", - "documentation": null - }] + "kind": 9, + "label": "WithChildren", + "tags": [] + } +] Complete src/Completion.res 172:17 posCursor:[172:17] posNoWhite:[172:16] Found type:[172:12->172:17] @@ -1256,13 +1695,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[Null, ""] Path Null. -[{ - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "\nA type representing a value that can be either `'a` or `null`.\n\n\n```rescript\n@unboxed\ntype t<'a> = Primitive_js_extern.null<'a> =\n | Value('a)\n | @as(null) Null\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "\nA type representing a value that can be either `'a` or `null`.\n\n\n```rescript\n@unboxed\ntype t<'a> = Primitive_js_extern.null<'a> =\n | Value('a)\n | @as(null) Null\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + } +] Complete src/Completion.res 174:20 posCursor:[174:20] posNoWhite:[174:19] Found type:[174:12->174:20] @@ -1272,13 +1716,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[ForAuto, ""] Path ForAuto. -[{ - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = int\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = int\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + } +] Complete src/Completion.res 179:13 posCursor:[179:13] posNoWhite:[179:12] Found expr:[179:11->179:13] @@ -1288,37 +1737,42 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[As] Path As -[{ - "label": "Asterix", - "kind": 4, - "tags": [], +[ + { "detail": "Asterix", - "documentation": {"kind": "markdown", "value": "```rescript\nAsterix\n```\n\n```rescript\ntype z = Allo | Asterix | Baba\n```"} - }, { - "label": "AsyncIterable", - "kind": 9, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nAsterix\n```\n\n```rescript\ntype z = Allo | Asterix | Baba\n```" + }, + "kind": 4, + "label": "Asterix", + "tags": [] + }, + { "detail": "module AsyncIterable", - "documentation": null - }, { - "label": "AsyncIterator", "kind": 9, - "tags": [], + "label": "AsyncIterable", + "tags": [] + }, + { "detail": "module AsyncIterator", - "documentation": null - }, { - "label": "AsyncGenerator", "kind": 9, - "tags": [], + "label": "AsyncIterator", + "tags": [] + }, + { "detail": "module AsyncGenerator", - "documentation": null - }, { - "label": "AsyncIterableIterator", "kind": 9, - "tags": [], + "label": "AsyncGenerator", + "tags": [] + }, + { "detail": "module AsyncIterableIterator", - "documentation": null - }] + "kind": 9, + "label": "AsyncIterableIterator", + "tags": [] + } +] Complete src/Completion.res 182:17 Pmod_ident For:[182:14->182:17] @@ -1327,13 +1781,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[For] Path For -[{ - "label": "ForAuto", - "kind": 9, - "tags": [], - "detail": "module ForAuto", - "documentation": null - }] +[ { "detail": "module ForAuto", "kind": 9, "label": "ForAuto", "tags": [] } ] Complete src/Completion.res 190:11 posCursor:[190:11] posNoWhite:[190:10] Found expr:[190:3->190:11] @@ -1343,13 +1791,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Private, ""] Path Private. -[{ - "label": "b", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 12, "label": "b", "tags": [] } ] Complete src/Completion.res 202:6 posCursor:[202:6] posNoWhite:[202:5] Found expr:[202:3->202:6] @@ -1370,13 +1812,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 2 Stdlib Completion ContextPath Value[sha] Path sha -[{ - "label": "shadowed", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 12, "label": "shadowed", "tags": [] } ] Complete src/Completion.res 208:6 posCursor:[208:6] posNoWhite:[208:5] Found expr:[208:3->208:6] @@ -1387,13 +1823,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[sha] Path sha -[{ - "label": "shadowed", - "kind": 12, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 12, "label": "shadowed", "tags": [] } ] Complete src/Completion.res 221:22 posCursor:[221:22] posNoWhite:[221:21] Found expr:[221:3->224:22] @@ -1405,19 +1835,15 @@ Resolved opens 3 Stdlib Completion Completion ContextPath Value[FAO, forAutoObject][""] ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject -[{ - "label": "age", +[ + { "detail": "int", "kind": 4, "label": "age", "tags": [] }, + { + "detail": "FAR.forAutoRecord", "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { "label": "forAutoLabel", - "kind": 4, - "tags": [], - "detail": "FAR.forAutoRecord", - "documentation": null - }] + "tags": [] + } +] Complete src/Completion.res 224:37 posCursor:[224:37] posNoWhite:[224:36] Found expr:[224:3->224:37] @@ -1437,19 +1863,28 @@ Path FAO.forAutoObject CPPipe pathFromEnv:FAR found:true Path FAR. Path -[{ - "label": "forAuto", - "kind": 5, - "tags": [], +[ + { "detail": "ForAuto.t", - "documentation": {"kind": "markdown", "value": "```rescript\nforAuto: ForAuto.t\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} - }, { - "label": "something", + "documentation": { + "kind": "markdown", + "value": "```rescript\nforAuto: ForAuto.t\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```" + }, "kind": 5, - "tags": [], + "label": "forAuto", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nsomething: option\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomething: option\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```" + }, + "kind": 5, + "label": "something", + "tags": [] + } +] Complete src/Completion.res 227:46 posCursor:[227:46] posNoWhite:[227:45] Found expr:[227:3->0:-1] @@ -1472,25 +1907,26 @@ Path forAuto CPPipe pathFromEnv:ForAuto found:false Path ForAuto. Path -[{ - "label": "ForAuto.abc", - "kind": 12, - "tags": [], +[ + { "detail": "(t, int) => t", - "documentation": null - }, { - "label": "ForAuto.abd", "kind": 12, - "tags": [], + "label": "ForAuto.abc", + "tags": [] + }, + { "detail": "(t, int) => t", - "documentation": null - }, { - "label": "myAmazingFunction", "kind": 12, - "tags": [], + "label": "ForAuto.abd", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": null - }] + "kind": 12, + "label": "myAmazingFunction", + "tags": [] + } +] Complete src/Completion.res 230:55 posCursor:[230:55] posNoWhite:[230:54] Found expr:[230:3->230:55] @@ -1502,19 +1938,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[ForAuto, a] Path ForAuto.a -[{ - "label": "abc", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { - "label": "abd", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }] +[ + { "detail": "(t, int) => t", "kind": 12, "label": "abc", "tags": [] }, + { "detail": "(t, int) => t", "kind": 12, "label": "abd", "tags": [] } +] Complete src/Completion.res 234:34 posCursor:[234:34] posNoWhite:[234:33] Found expr:[234:18->234:36] @@ -1529,13 +1956,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[na] Path na -[{ - "label": "name", - "kind": 12, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 12, "label": "name", "tags": [] } ] Complete src/Completion.res 237:17 posCursor:[237:17] posNoWhite:[237:14] Found expr:[237:14->237:22] @@ -1563,19 +1984,28 @@ Path _z CPPipe pathFromEnv: found:true Path Completion. Path -[{ - "label": "x", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nx: int\n```\n\n```rescript\ntype r = {x: int, y: string}\n```"} - }, { - "label": "y", + "documentation": { + "kind": "markdown", + "value": "```rescript\nx: int\n```\n\n```rescript\ntype r = {x: int, y: string}\n```" + }, "kind": 5, - "tags": [], + "label": "x", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\ny: string\n```\n\n```rescript\ntype r = {x: int, y: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ny: string\n```\n\n```rescript\ntype r = {x: int, y: string}\n```" + }, + "kind": 5, + "label": "y", + "tags": [] + } +] Complete src/Completion.res 254:17 posCursor:[254:17] posNoWhite:[254:16] Found expr:[254:11->254:17] @@ -1586,13 +2016,14 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLo] Path SomeLo -[{ - "label": "SomeLocalModule", - "kind": 9, - "tags": [], +[ + { "detail": "module SomeLocalModule", - "documentation": null - }] + "kind": 9, + "label": "SomeLocalModule", + "tags": [] + } +] Complete src/Completion.res 256:29 posCursor:[256:29] posNoWhite:[256:28] Found type:[256:13->256:29] @@ -1603,13 +2034,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[SomeLocalModule, ""] Path SomeLocalModule. -[{ - "label": "zz", - "kind": 22, - "tags": [], +[ + { "detail": "type zz", - "documentation": {"kind": "markdown", "value": "```rescript\ntype zz = int\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype zz = int\n```" + }, + "kind": 22, + "label": "zz", + "tags": [] + } +] Complete src/Completion.res 261:33 posCursor:[261:33] posNoWhite:[261:32] Found type:[261:17->263:11] @@ -1620,13 +2056,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[SomeLocalModule, ""] Path SomeLocalModule. -[{ - "label": "zz", - "kind": 22, - "tags": [], +[ + { "detail": "type zz", - "documentation": {"kind": "markdown", "value": "```rescript\ntype zz = int\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype zz = int\n```" + }, + "kind": 22, + "label": "zz", + "tags": [] + } +] Complete src/Completion.res 268:21 Ptype_variant unary SomeLocal:[268:12->268:21] @@ -1636,19 +2077,24 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLocal] Path SomeLocal -[{ - "label": "SomeLocalVariantItem", - "kind": 4, - "tags": [], +[ + { "detail": "SomeLocalVariantItem", - "documentation": {"kind": "markdown", "value": "```rescript\nSomeLocalVariantItem\n```\n\n```rescript\ntype someLocalVariant = SomeLocalVariantItem\n```"} - }, { - "label": "SomeLocalModule", - "kind": 9, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nSomeLocalVariantItem\n```\n\n```rescript\ntype someLocalVariant = SomeLocalVariantItem\n```" + }, + "kind": 4, + "label": "SomeLocalVariantItem", + "tags": [] + }, + { "detail": "module SomeLocalModule", - "documentation": null - }] + "kind": 9, + "label": "SomeLocalModule", + "tags": [] + } +] Complete src/Completion.res 271:20 posCursor:[271:20] posNoWhite:[271:19] Found pattern:[271:7->274:3] @@ -1660,13 +2106,14 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[SomeLocal] Path SomeLocal -[{ - "label": "SomeLocalModule", - "kind": 9, - "tags": [], +[ + { "detail": "module SomeLocalModule", - "documentation": null - }] + "kind": 9, + "label": "SomeLocalModule", + "tags": [] + } +] Complete src/Completion.res 275:15 posCursor:[275:15] posNoWhite:[275:14] Found expr:[274:11->278:1] @@ -1679,13 +2126,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[_w] Path _w -[{ - "label": "_world", - "kind": 12, - "tags": [], - "detail": "'a", - "documentation": null - }] +[ { "detail": "'a", "kind": 12, "label": "_world", "tags": [] } ] Complete src/Completion.res 281:22 posCursor:[281:22] posNoWhite:[281:21] Found type:[281:21->281:22] @@ -1696,19 +2137,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[s] Path s -[{ - "label": "someType", - "kind": 22, - "tags": [], +[ + { "detail": "type someType", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someType = {hello: string}\n```"} - }, { - "label": "someLocalVariant", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someType = {hello: string}\n```" + }, "kind": 22, - "tags": [], + "label": "someType", + "tags": [] + }, + { "detail": "type someLocalVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someLocalVariant = SomeLocalVariantItem\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someLocalVariant = SomeLocalVariantItem\n```" + }, + "kind": 22, + "label": "someLocalVariant", + "tags": [] + } +] Complete src/Completion.res 291:30 posCursor:[291:30] posNoWhite:[291:29] Found expr:[291:11->291:32] @@ -1727,13 +2177,7 @@ CPPipe pathFromEnv: found:true Path Completion.someFun Path someFun Found type for function (~name: string) => unit -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "name", "tags": [] } ] Complete src/Completion.res 296:11 posCursor:[296:11] posNoWhite:[296:10] Found expr:[296:3->296:11] @@ -1753,19 +2197,28 @@ Path retAA CPPipe pathFromEnv: found:true Path Completion. Path -[{ - "label": "x", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nx: int\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```"} - }, { - "label": "name", + "documentation": { + "kind": "markdown", + "value": "```rescript\nx: int\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```" + }, "kind": 5, - "tags": [], + "label": "x", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype aa = {x: int, name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + } +] Complete src/Completion.res 301:13 posCursor:[301:13] posNoWhite:[301:12] Found expr:[301:3->301:13] @@ -1781,35 +2234,16 @@ Found type for function ( ~opt1: int=?, ~a: int, ~b: int, - unit, - ~opt2: int=?, - unit, -) => int -[{ - "label": "opt1", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }, { - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "b", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "opt2", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] + unit, + ~opt2: int=?, + unit, +) => int +[ + { "detail": "option", "kind": 4, "label": "opt1", "tags": [] }, + { "detail": "int", "kind": 4, "label": "a", "tags": [] }, + { "detail": "int", "kind": 4, "label": "b", "tags": [] }, + { "detail": "option", "kind": 4, "label": "opt2", "tags": [] } +] Complete src/Completion.res 304:15 posCursor:[304:15] posNoWhite:[304:14] Found expr:[304:3->304:15] @@ -1823,25 +2257,11 @@ ContextPath Value[ff](~c) ContextPath Value[ff] Path ff Found type for function (~a: int, ~b: int, ~opt2: int=?, unit) => int -[{ - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "b", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "opt2", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "a", "tags": [] }, + { "detail": "int", "kind": 4, "label": "b", "tags": [] }, + { "detail": "option", "kind": 4, "label": "opt2", "tags": [] } +] Complete src/Completion.res 307:17 posCursor:[307:17] posNoWhite:[307:16] Found expr:[307:3->307:17] @@ -1854,25 +2274,11 @@ ContextPath Value[ff](~c, Nolabel) ContextPath Value[ff] Path ff Found type for function (~a: int, ~b: int, ~opt2: int=?, unit) => int -[{ - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "b", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "opt2", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "a", "tags": [] }, + { "detail": "int", "kind": 4, "label": "b", "tags": [] }, + { "detail": "option", "kind": 4, "label": "opt2", "tags": [] } +] Complete src/Completion.res 310:21 posCursor:[310:21] posNoWhite:[310:20] Found expr:[310:3->310:21] @@ -1885,19 +2291,10 @@ ContextPath Value[ff](~c, Nolabel, Nolabel) ContextPath Value[ff] Path ff Found type for function (~a: int, ~b: int) => int -[{ - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "b", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "a", "tags": [] }, + { "detail": "int", "kind": 4, "label": "b", "tags": [] } +] Complete src/Completion.res 313:23 posCursor:[313:23] posNoWhite:[313:22] Found expr:[313:3->313:23] @@ -1910,19 +2307,10 @@ ContextPath Value[ff](~c, Nolabel, ~b) ContextPath Value[ff] Path ff Found type for function (~a: int, ~opt2: int=?, unit) => int -[{ - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "opt2", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "a", "tags": [] }, + { "detail": "option", "kind": 4, "label": "opt2", "tags": [] } +] Complete src/Completion.res 316:16 posCursor:[316:16] posNoWhite:[316:15] Found expr:[316:3->316:16] @@ -1935,31 +2323,12 @@ ContextPath Value[ff](~opt2) ContextPath Value[ff] Path ff Found type for function (~opt1: int=?, ~a: int, ~b: int, unit, unit, ~c: int) => int -[{ - "label": "opt1", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }, { - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "b", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "c", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "option", "kind": 4, "label": "opt1", "tags": [] }, + { "detail": "int", "kind": 4, "label": "a", "tags": [] }, + { "detail": "int", "kind": 4, "label": "b", "tags": [] }, + { "detail": "int", "kind": 4, "label": "c", "tags": [] } +] Complete src/Completion.res 326:17 posCursor:[326:17] posNoWhite:[326:16] Found expr:[326:3->326:17] @@ -1971,19 +2340,10 @@ Resolved opens 3 Stdlib Completion Completion ContextPath Value[withCallback] Path withCallback Found type for function (~b: int) => callback -[{ - "label": "b", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "b", "tags": [] }, + { "detail": "int", "kind": 4, "label": "a", "tags": [] } +] Complete src/Completion.res 329:21 posCursor:[329:21] posNoWhite:[329:20] Found expr:[329:3->329:21] @@ -1996,19 +2356,10 @@ ContextPath Value[withCallback](~a) ContextPath Value[withCallback] Path withCallback Found type for function (~b: int) => callback -[{ - "label": "b", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "int", "kind": 4, "label": "b", "tags": [] }, + { "detail": "int", "kind": 4, "label": "a", "tags": [] } +] Complete src/Completion.res 332:21 posCursor:[332:21] posNoWhite:[332:20] Found expr:[332:3->332:21] @@ -2021,13 +2372,7 @@ ContextPath Value[withCallback](~b) ContextPath Value[withCallback] Path withCallback Found type for function callback -[{ - "label": "a", - "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 4, "label": "a", "tags": [] } ] Complete src/Completion.res 339:26 posCursor:[339:26] posNoWhite:[339:25] Found expr:[336:2->349:23] @@ -2048,63 +2393,59 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[Res] Path Res -[{ - "label": "Result", - "kind": 9, - "tags": [], - "detail": "module Result", - "documentation": null - }, { - "label": "RescriptReactErrorBoundary", - "kind": 9, - "tags": [], - "detail": "module RescriptReactErrorBoundary", - "documentation": null, +[ + { "detail": "module Result", "kind": 9, "label": "Result", "tags": [] }, + { "data": { "modulePath": "RescriptReactErrorBoundary", "filePath": "src/Completion.res" - } - }, { - "label": "RescriptReactRouter", + }, + "detail": "module RescriptReactErrorBoundary", "kind": 9, - "tags": [], - "detail": "module RescriptReactRouter", - "documentation": null, + "label": "RescriptReactErrorBoundary", + "tags": [] + }, + { "data": { "modulePath": "RescriptReactRouter", "filePath": "src/Completion.res" - } - }, { - "label": "RescriptTools", + }, + "detail": "module RescriptReactRouter", "kind": 9, - "tags": [], - "detail": "module RescriptTools", - "documentation": null, + "label": "RescriptReactRouter", + "tags": [] + }, + { "data": { "modulePath": "RescriptTools", "filePath": "src/Completion.res" - } - }, { - "label": "RescriptTools_Docgen", + }, + "detail": "module RescriptTools", "kind": 9, - "tags": [], - "detail": "module RescriptTools_Docgen", - "documentation": null, + "label": "RescriptTools", + "tags": [] + }, + { "data": { "modulePath": "RescriptTools_Docgen", "filePath": "src/Completion.res" - } - }, { - "label": "RescriptTools_ExtractCodeBlocks", + }, + "detail": "module RescriptTools_Docgen", "kind": 9, - "tags": [], - "detail": "module RescriptTools_ExtractCodeBlocks", - "documentation": null, + "label": "RescriptTools_Docgen", + "tags": [] + }, + { "data": { "modulePath": "RescriptTools_ExtractCodeBlocks", "filePath": "src/Completion.res" - } - }] + }, + "detail": "module RescriptTools_ExtractCodeBlocks", + "kind": 9, + "label": "RescriptTools_ExtractCodeBlocks", + "tags": [] + } +] Complete src/Completion.res 346:57 posCursor:[346:57] posNoWhite:[346:56] Found expr:[346:53->349:23] @@ -2116,16 +2457,22 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[this] Path this -[{ - "label": "thisIsNotSaved", - "kind": 12, - "tags": [], +[ + { "detail": "\\\"Type Not Known\"", - "documentation": null - }] + "kind": 12, + "label": "thisIsNotSaved", + "tags": [] + } +] Hover src/Completion.res 349:14 -{"contents": {"kind": "markdown", "value": "```rescript\nJsxDOM.domProps\n```\n\n---\n\n```\n \n```\n```rescript\ntype JsxDOM.domProps = {\n key?: string,\n children?: Jsx.element,\n ref?: domRef,\n allow?: string,\n ariaCurrent?: [\n | #date\n | #\"false\"\n | #location\n | #page\n | #step\n | #time\n | #\"true\"\n ],\n ariaDetails?: string,\n ariaDisabled?: bool,\n ariaHidden?: bool,\n ariaInvalid?: [#\"false\" | #grammar | #spelling | #\"true\"],\n ariaKeyshortcuts?: string,\n ariaLabel?: string,\n ariaRoledescription?: string,\n ariaAutocomplete?: [#both | #inline | #list | #none],\n ariaChecked?: [#\"false\" | #mixed | #\"true\"],\n ariaExpanded?: bool,\n ariaHaspopup?: [\n | #dialog\n | #\"false\"\n | #grid\n | #listbox\n | #menu\n | #tree\n | #\"true\"\n ],\n ariaLevel?: int,\n ariaModal?: bool,\n ariaMultiline?: bool,\n ariaMultiselectable?: bool,\n ariaOrientation?: [#horizontal | #undefined | #vertical],\n ariaPlaceholder?: string,\n ariaPressed?: [#\"false\" | #mixed | #\"true\"],\n ariaReadonly?: bool,\n ariaRequired?: bool,\n ariaSelected?: bool,\n ariaSort?: string,\n ariaValuemax?: float,\n ariaValuemin?: float,\n ariaValuenow?: float,\n ariaValuetext?: string,\n ariaAtomic?: bool,\n ariaBusy?: bool,\n ariaLive?: [#assertive | #off | #polite | #rude],\n ariaRelevant?: string,\n ariaDropeffect?: [\n | #copy\n | #execute\n | #link\n | #move\n | #none\n | #popup\n ],\n ariaGrabbed?: bool,\n ariaActivedescendant?: string,\n ariaColcount?: int,\n ariaColindex?: int,\n ariaColspan?: int,\n ariaControls?: string,\n ariaDescribedby?: string,\n ariaErrormessage?: string,\n ariaFlowto?: string,\n ariaLabelledby?: string,\n ariaOwns?: string,\n ariaPosinset?: int,\n ariaRowcount?: int,\n ariaRowindex?: int,\n ariaRowspan?: int,\n ariaSetsize?: int,\n defaultChecked?: bool,\n defaultValue?: string,\n accessKey?: string,\n capture?: [#environment | #user],\n className?: string,\n contentEditable?: bool,\n contextMenu?: string,\n dataTestId?: string,\n dir?: string,\n draggable?: bool,\n hidden?: bool,\n id?: string,\n inert?: bool,\n lang?: string,\n popover?: popover,\n popoverTarget?: string,\n popoverTargetAction?: popoverTargetAction,\n role?: string,\n style?: style,\n spellCheck?: bool,\n tabIndex?: int,\n title?: string,\n itemID?: string,\n itemProp?: string,\n itemRef?: string,\n itemScope?: bool,\n itemType?: string,\n accept?: string,\n acceptCharset?: string,\n action?: string,\n allowFullScreen?: bool,\n alt?: string,\n as_?: string,\n async?: bool,\n autoComplete?: string,\n autoCapitalize?: string,\n autoFocus?: bool,\n autoPlay?: bool,\n challenge?: string,\n charSet?: string,\n checked?: bool,\n cite?: string,\n crossOrigin?: string,\n cols?: int,\n colSpan?: int,\n content?: string,\n controls?: bool,\n coords?: string,\n data?: string,\n dateTime?: string,\n default?: bool,\n defer?: bool,\n disabled?: bool,\n download?: string,\n encType?: string,\n form?: string,\n formAction?: string,\n formTarget?: string,\n formMethod?: string,\n frameBorder?: int,\n headers?: string,\n height?: string,\n high?: int,\n href?: string,\n hrefLang?: string,\n htmlFor?: string,\n httpEquiv?: string,\n icon?: string,\n inputMode?: string,\n integrity?: string,\n keyType?: string,\n kind?: string,\n label?: string,\n list?: string,\n loading?: [#eager | #lazy],\n loop?: bool,\n low?: int,\n manifest?: string,\n max?: string,\n maxLength?: int,\n media?: string,\n mediaGroup?: string,\n method?: string,\n min?: string,\n minLength?: int,\n multiple?: bool,\n muted?: bool,\n name?: string,\n nonce?: string,\n noValidate?: bool,\n open_?: bool,\n optimum?: int,\n pattern?: string,\n placeholder?: string,\n playsInline?: bool,\n poster?: string,\n preload?: string,\n radioGroup?: string,\n readOnly?: bool,\n rel?: string,\n required?: bool,\n reversed?: bool,\n rows?: int,\n rowSpan?: int,\n sandbox?: string,\n scope?: string,\n scoped?: bool,\n scrolling?: string,\n selected?: bool,\n shape?: string,\n size?: int,\n sizes?: string,\n span?: int,\n src?: string,\n srcDoc?: string,\n srcLang?: string,\n srcSet?: string,\n start?: int,\n step?: float,\n summary?: string,\n target?: string,\n type_?: string,\n useMap?: string,\n value?: string,\n width?: string,\n wrap?: string,\n onCopy?: JsxEvent.Clipboard.t => unit,\n onCut?: JsxEvent.Clipboard.t => unit,\n onPaste?: JsxEvent.Clipboard.t => unit,\n onCompositionEnd?: JsxEvent.Composition.t => unit,\n onCompositionStart?: JsxEvent.Composition.t => unit,\n onCompositionUpdate?: JsxEvent.Composition.t => unit,\n onKeyDown?: JsxEvent.Keyboard.t => unit,\n onKeyPress?: JsxEvent.Keyboard.t => unit,\n onKeyUp?: JsxEvent.Keyboard.t => unit,\n onFocus?: JsxEvent.Focus.t => unit,\n onBlur?: JsxEvent.Focus.t => unit,\n onBeforeInput?: JsxEvent.Form.t => unit,\n onChange?: JsxEvent.Form.t => unit,\n onInput?: JsxEvent.Form.t => unit,\n onReset?: JsxEvent.Form.t => unit,\n onSubmit?: JsxEvent.Form.t => unit,\n onInvalid?: JsxEvent.Form.t => unit,\n onClick?: JsxEvent.Mouse.t => unit,\n onContextMenu?: JsxEvent.Mouse.t => unit,\n onDoubleClick?: JsxEvent.Mouse.t => unit,\n onDrag?: JsxEvent.Mouse.t => unit,\n onDragEnd?: JsxEvent.Mouse.t => unit,\n onDragEnter?: JsxEvent.Mouse.t => unit,\n onDragExit?: JsxEvent.Mouse.t => unit,\n onDragLeave?: JsxEvent.Mouse.t => unit,\n onDragOver?: JsxEvent.Mouse.t => unit,\n onDragStart?: JsxEvent.Mouse.t => unit,\n onDrop?: JsxEvent.Mouse.t => unit,\n onMouseDown?: JsxEvent.Mouse.t => unit,\n onMouseEnter?: JsxEvent.Mouse.t => unit,\n onMouseLeave?: JsxEvent.Mouse.t => unit,\n onMouseMove?: JsxEvent.Mouse.t => unit,\n onMouseOut?: JsxEvent.Mouse.t => unit,\n onMouseOver?: JsxEvent.Mouse.t => unit,\n onMouseUp?: JsxEvent.Mouse.t => unit,\n onSelect?: JsxEvent.Selection.t => unit,\n onTouchCancel?: JsxEvent.Touch.t => unit,\n onTouchEnd?: JsxEvent.Touch.t => unit,\n onTouchMove?: JsxEvent.Touch.t => unit,\n onTouchStart?: JsxEvent.Touch.t => unit,\n onPointerOver?: JsxEvent.Pointer.t => unit,\n onPointerEnter?: JsxEvent.Pointer.t => unit,\n onPointerDown?: JsxEvent.Pointer.t => unit,\n onPointerMove?: JsxEvent.Pointer.t => unit,\n onPointerUp?: JsxEvent.Pointer.t => unit,\n onPointerCancel?: JsxEvent.Pointer.t => unit,\n onPointerOut?: JsxEvent.Pointer.t => unit,\n onPointerLeave?: JsxEvent.Pointer.t => unit,\n onGotPointerCapture?: JsxEvent.Pointer.t => unit,\n onLostPointerCapture?: JsxEvent.Pointer.t => unit,\n onScroll?: JsxEvent.UI.t => unit,\n onWheel?: JsxEvent.Wheel.t => unit,\n onAbort?: JsxEvent.Media.t => unit,\n onCanPlay?: JsxEvent.Media.t => unit,\n onCanPlayThrough?: JsxEvent.Media.t => unit,\n onDurationChange?: JsxEvent.Media.t => unit,\n onEmptied?: JsxEvent.Media.t => unit,\n onEncrypted?: JsxEvent.Media.t => unit,\n onEnded?: JsxEvent.Media.t => unit,\n onError?: JsxEvent.Media.t => unit,\n onLoadedData?: JsxEvent.Media.t => unit,\n onLoadedMetadata?: JsxEvent.Media.t => unit,\n onLoadStart?: JsxEvent.Media.t => unit,\n onPause?: JsxEvent.Media.t => unit,\n onPlay?: JsxEvent.Media.t => unit,\n onPlaying?: JsxEvent.Media.t => unit,\n onProgress?: JsxEvent.Media.t => unit,\n onRateChange?: JsxEvent.Media.t => unit,\n onSeeked?: JsxEvent.Media.t => unit,\n onSeeking?: JsxEvent.Media.t => unit,\n onStalled?: JsxEvent.Media.t => unit,\n onSuspend?: JsxEvent.Media.t => unit,\n onTimeUpdate?: JsxEvent.Media.t => unit,\n onVolumeChange?: JsxEvent.Media.t => unit,\n onWaiting?: JsxEvent.Media.t => unit,\n onLoad?: JsxEvent.Image.t => unit,\n onAnimationStart?: JsxEvent.Animation.t => unit,\n onAnimationEnd?: JsxEvent.Animation.t => unit,\n onAnimationIteration?: JsxEvent.Animation.t => unit,\n onTransitionEnd?: JsxEvent.Transition.t => unit,\n accentHeight?: string,\n accumulate?: string,\n additive?: string,\n alignmentBaseline?: string,\n allowReorder?: string,\n alphabetic?: string,\n amplitude?: string,\n arabicForm?: string,\n ascent?: string,\n attributeName?: string,\n attributeType?: string,\n autoReverse?: string,\n azimuth?: string,\n baseFrequency?: string,\n baseProfile?: string,\n baselineShift?: string,\n bbox?: string,\n begin?: string,\n begin_?: string,\n bias?: string,\n by?: string,\n calcMode?: string,\n capHeight?: string,\n clip?: string,\n clipPath?: string,\n clipPathUnits?: string,\n clipRule?: string,\n colorInterpolation?: string,\n colorInterpolationFilters?: string,\n colorProfile?: string,\n colorRendering?: string,\n contentScriptType?: string,\n contentStyleType?: string,\n cursor?: string,\n cx?: string,\n cy?: string,\n d?: string,\n decelerate?: string,\n descent?: string,\n diffuseConstant?: string,\n direction?: string,\n display?: string,\n divisor?: string,\n dominantBaseline?: string,\n dur?: string,\n dx?: string,\n dy?: string,\n edgeMode?: string,\n elevation?: string,\n enableBackground?: string,\n end?: string,\n end_?: string,\n exponent?: string,\n externalResourcesRequired?: string,\n fill?: string,\n fillOpacity?: string,\n fillRule?: string,\n filter?: string,\n filterRes?: string,\n filterUnits?: string,\n floodColor?: string,\n floodOpacity?: string,\n focusable?: string,\n fontFamily?: string,\n fontSize?: string,\n fontSizeAdjust?: string,\n fontStretch?: string,\n fontStyle?: string,\n fontVariant?: string,\n fontWeight?: string,\n fomat?: string,\n from?: string,\n fx?: string,\n fy?: string,\n g1?: string,\n g2?: string,\n glyphName?: string,\n glyphOrientationHorizontal?: string,\n glyphOrientationVertical?: string,\n glyphRef?: string,\n gradientTransform?: string,\n gradientUnits?: string,\n hanging?: string,\n horizAdvX?: string,\n horizOriginX?: string,\n ideographic?: string,\n imageRendering?: string,\n in_?: string,\n in2?: string,\n intercept?: string,\n k?: string,\n k1?: string,\n k2?: string,\n k3?: string,\n k4?: string,\n kernelMatrix?: string,\n kernelUnitLength?: string,\n kerning?: string,\n keyPoints?: string,\n keySplines?: string,\n keyTimes?: string,\n lengthAdjust?: string,\n letterSpacing?: string,\n lightingColor?: string,\n limitingConeAngle?: string,\n local?: string,\n markerEnd?: string,\n markerHeight?: string,\n markerMid?: string,\n markerStart?: string,\n markerUnits?: string,\n markerWidth?: string,\n mask?: string,\n maskContentUnits?: string,\n maskUnits?: string,\n mathematical?: string,\n mode?: string,\n numOctaves?: string,\n offset?: string,\n opacity?: string,\n operator?: string,\n order?: string,\n orient?: string,\n orientation?: string,\n origin?: string,\n overflow?: string,\n overflowX?: string,\n overflowY?: string,\n overlinePosition?: string,\n overlineThickness?: string,\n paintOrder?: string,\n panose1?: string,\n pathLength?: string,\n patternContentUnits?: string,\n patternTransform?: string,\n patternUnits?: string,\n pointerEvents?: string,\n points?: string,\n pointsAtX?: string,\n pointsAtY?: string,\n pointsAtZ?: string,\n preserveAlpha?: string,\n preserveAspectRatio?: string,\n primitiveUnits?: string,\n r?: string,\n radius?: string,\n referrerPolicy?: string,\n refX?: string,\n refY?: string,\n renderingIntent?: string,\n repeatCount?: string,\n repeatDur?: string,\n requiredExtensions?: string,\n requiredFeatures?: string,\n restart?: string,\n result?: string,\n rotate?: string,\n rx?: string,\n ry?: string,\n scale?: string,\n seed?: string,\n shapeRendering?: string,\n slope?: string,\n slot?: string,\n spacing?: string,\n specularConstant?: string,\n specularExponent?: string,\n speed?: string,\n spreadMethod?: string,\n startOffset?: string,\n stdDeviation?: string,\n stemh?: string,\n stemv?: string,\n stitchTiles?: string,\n stopColor?: string,\n stopOpacity?: string,\n strikethroughPosition?: string,\n strikethroughThickness?: string,\n string?: string,\n stroke?: string,\n strokeDasharray?: string,\n strokeDashoffset?: string,\n strokeLinecap?: string,\n strokeLinejoin?: string,\n strokeMiterlimit?: string,\n strokeOpacity?: string,\n strokeWidth?: string,\n surfaceScale?: string,\n systemLanguage?: string,\n tableValues?: string,\n targetX?: string,\n targetY?: string,\n textAnchor?: string,\n textDecoration?: string,\n textLength?: string,\n textRendering?: string,\n to?: string,\n to_?: string,\n transform?: string,\n u1?: string,\n u2?: string,\n underlinePosition?: string,\n underlineThickness?: string,\n unicode?: string,\n unicodeBidi?: string,\n unicodeRange?: string,\n unitsPerEm?: string,\n vAlphabetic?: string,\n vHanging?: string,\n vIdeographic?: string,\n vMathematical?: string,\n values?: string,\n vectorEffect?: string,\n version?: string,\n vertAdvX?: string,\n vertAdvY?: string,\n vertOriginX?: string,\n vertOriginY?: string,\n viewBox?: string,\n viewTarget?: string,\n visibility?: string,\n widths?: string,\n wordSpacing?: string,\n writingMode?: string,\n x?: string,\n x1?: string,\n x2?: string,\n xChannelSelector?: string,\n xHeight?: string,\n xlinkActuate?: string,\n xlinkArcrole?: string,\n xlinkHref?: string,\n xlinkRole?: string,\n xlinkShow?: string,\n xlinkTitle?: string,\n xlinkType?: string,\n xmlns?: string,\n xmlnsXlink?: string,\n xmlBase?: string,\n xmlLang?: string,\n xmlSpace?: string,\n y?: string,\n y1?: string,\n y2?: string,\n yChannelSelector?: string,\n z?: string,\n zoomAndPan?: string,\n about?: string,\n datatype?: string,\n inlist?: string,\n prefix?: string,\n property?: string,\n resource?: string,\n typeof?: string,\n vocab?: string,\n dangerouslySetInnerHTML?: {\"__html\": string},\n suppressContentEditableWarning?: bool,\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C20%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype Jsx.element\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx.res%22%2C7%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype domRef\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C7%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype popover =\n | @as(\"auto\") Auto\n | @as(\"manual\") Manual\n | @as(\"hint\") Hint\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C11%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype popoverTargetAction =\n | @as(\"toggle\") Toggle\n | @as(\"show\") Show\n | @as(\"hide\") Hide\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C15%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype style = JsxDOMStyle.t\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C6%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Clipboard.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C77%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Composition.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C87%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Keyboard.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C96%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Focus.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C118%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Form.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C128%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Mouse.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C135%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Selection.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C212%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Touch.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C219%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Pointer.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C164%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.UI.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C242%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Wheel.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C253%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Media.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C265%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Image.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C272%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Animation.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C279%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Transition.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C290%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nJsxDOM.domProps\n```\n\n---\n\n```\n \n```\n```rescript\ntype JsxDOM.domProps = {\n key?: string,\n children?: Jsx.element,\n ref?: domRef,\n allow?: string,\n ariaCurrent?: [\n | #date\n | #\"false\"\n | #location\n | #page\n | #step\n | #time\n | #\"true\"\n ],\n ariaDetails?: string,\n ariaDisabled?: bool,\n ariaHidden?: bool,\n ariaInvalid?: [#\"false\" | #grammar | #spelling | #\"true\"],\n ariaKeyshortcuts?: string,\n ariaLabel?: string,\n ariaRoledescription?: string,\n ariaAutocomplete?: [#both | #inline | #list | #none],\n ariaChecked?: [#\"false\" | #mixed | #\"true\"],\n ariaExpanded?: bool,\n ariaHaspopup?: [\n | #dialog\n | #\"false\"\n | #grid\n | #listbox\n | #menu\n | #tree\n | #\"true\"\n ],\n ariaLevel?: int,\n ariaModal?: bool,\n ariaMultiline?: bool,\n ariaMultiselectable?: bool,\n ariaOrientation?: [#horizontal | #undefined | #vertical],\n ariaPlaceholder?: string,\n ariaPressed?: [#\"false\" | #mixed | #\"true\"],\n ariaReadonly?: bool,\n ariaRequired?: bool,\n ariaSelected?: bool,\n ariaSort?: string,\n ariaValuemax?: float,\n ariaValuemin?: float,\n ariaValuenow?: float,\n ariaValuetext?: string,\n ariaAtomic?: bool,\n ariaBusy?: bool,\n ariaLive?: [#assertive | #off | #polite | #rude],\n ariaRelevant?: string,\n ariaDropeffect?: [\n | #copy\n | #execute\n | #link\n | #move\n | #none\n | #popup\n ],\n ariaGrabbed?: bool,\n ariaActivedescendant?: string,\n ariaColcount?: int,\n ariaColindex?: int,\n ariaColspan?: int,\n ariaControls?: string,\n ariaDescribedby?: string,\n ariaErrormessage?: string,\n ariaFlowto?: string,\n ariaLabelledby?: string,\n ariaOwns?: string,\n ariaPosinset?: int,\n ariaRowcount?: int,\n ariaRowindex?: int,\n ariaRowspan?: int,\n ariaSetsize?: int,\n defaultChecked?: bool,\n defaultValue?: string,\n accessKey?: string,\n capture?: [#environment | #user],\n className?: string,\n contentEditable?: bool,\n contextMenu?: string,\n dataTestId?: string,\n dir?: string,\n draggable?: bool,\n hidden?: bool,\n id?: string,\n inert?: bool,\n lang?: string,\n popover?: popover,\n popoverTarget?: string,\n popoverTargetAction?: popoverTargetAction,\n role?: string,\n style?: style,\n spellCheck?: bool,\n tabIndex?: int,\n title?: string,\n itemID?: string,\n itemProp?: string,\n itemRef?: string,\n itemScope?: bool,\n itemType?: string,\n accept?: string,\n acceptCharset?: string,\n action?: string,\n allowFullScreen?: bool,\n alt?: string,\n as_?: string,\n async?: bool,\n autoComplete?: string,\n autoCapitalize?: string,\n autoFocus?: bool,\n autoPlay?: bool,\n challenge?: string,\n charSet?: string,\n checked?: bool,\n cite?: string,\n crossOrigin?: string,\n cols?: int,\n colSpan?: int,\n content?: string,\n controls?: bool,\n coords?: string,\n data?: string,\n dateTime?: string,\n default?: bool,\n defer?: bool,\n disabled?: bool,\n download?: string,\n encType?: string,\n form?: string,\n formAction?: string,\n formTarget?: string,\n formMethod?: string,\n frameBorder?: int,\n headers?: string,\n height?: string,\n high?: int,\n href?: string,\n hrefLang?: string,\n htmlFor?: string,\n httpEquiv?: string,\n icon?: string,\n inputMode?: string,\n integrity?: string,\n keyType?: string,\n kind?: string,\n label?: string,\n list?: string,\n loading?: [#eager | #lazy],\n loop?: bool,\n low?: int,\n manifest?: string,\n max?: string,\n maxLength?: int,\n media?: string,\n mediaGroup?: string,\n method?: string,\n min?: string,\n minLength?: int,\n multiple?: bool,\n muted?: bool,\n name?: string,\n nonce?: string,\n noValidate?: bool,\n open_?: bool,\n optimum?: int,\n pattern?: string,\n placeholder?: string,\n playsInline?: bool,\n poster?: string,\n preload?: string,\n radioGroup?: string,\n readOnly?: bool,\n rel?: string,\n required?: bool,\n reversed?: bool,\n rows?: int,\n rowSpan?: int,\n sandbox?: string,\n scope?: string,\n scoped?: bool,\n scrolling?: string,\n selected?: bool,\n shape?: string,\n size?: int,\n sizes?: string,\n span?: int,\n src?: string,\n srcDoc?: string,\n srcLang?: string,\n srcSet?: string,\n start?: int,\n step?: float,\n summary?: string,\n target?: string,\n type_?: string,\n useMap?: string,\n value?: string,\n width?: string,\n wrap?: string,\n onCopy?: JsxEvent.Clipboard.t => unit,\n onCut?: JsxEvent.Clipboard.t => unit,\n onPaste?: JsxEvent.Clipboard.t => unit,\n onCompositionEnd?: JsxEvent.Composition.t => unit,\n onCompositionStart?: JsxEvent.Composition.t => unit,\n onCompositionUpdate?: JsxEvent.Composition.t => unit,\n onKeyDown?: JsxEvent.Keyboard.t => unit,\n onKeyPress?: JsxEvent.Keyboard.t => unit,\n onKeyUp?: JsxEvent.Keyboard.t => unit,\n onFocus?: JsxEvent.Focus.t => unit,\n onBlur?: JsxEvent.Focus.t => unit,\n onBeforeInput?: JsxEvent.Form.t => unit,\n onChange?: JsxEvent.Form.t => unit,\n onInput?: JsxEvent.Form.t => unit,\n onReset?: JsxEvent.Form.t => unit,\n onSubmit?: JsxEvent.Form.t => unit,\n onInvalid?: JsxEvent.Form.t => unit,\n onClick?: JsxEvent.Mouse.t => unit,\n onContextMenu?: JsxEvent.Mouse.t => unit,\n onDoubleClick?: JsxEvent.Mouse.t => unit,\n onDrag?: JsxEvent.Mouse.t => unit,\n onDragEnd?: JsxEvent.Mouse.t => unit,\n onDragEnter?: JsxEvent.Mouse.t => unit,\n onDragExit?: JsxEvent.Mouse.t => unit,\n onDragLeave?: JsxEvent.Mouse.t => unit,\n onDragOver?: JsxEvent.Mouse.t => unit,\n onDragStart?: JsxEvent.Mouse.t => unit,\n onDrop?: JsxEvent.Mouse.t => unit,\n onMouseDown?: JsxEvent.Mouse.t => unit,\n onMouseEnter?: JsxEvent.Mouse.t => unit,\n onMouseLeave?: JsxEvent.Mouse.t => unit,\n onMouseMove?: JsxEvent.Mouse.t => unit,\n onMouseOut?: JsxEvent.Mouse.t => unit,\n onMouseOver?: JsxEvent.Mouse.t => unit,\n onMouseUp?: JsxEvent.Mouse.t => unit,\n onSelect?: JsxEvent.Selection.t => unit,\n onTouchCancel?: JsxEvent.Touch.t => unit,\n onTouchEnd?: JsxEvent.Touch.t => unit,\n onTouchMove?: JsxEvent.Touch.t => unit,\n onTouchStart?: JsxEvent.Touch.t => unit,\n onPointerOver?: JsxEvent.Pointer.t => unit,\n onPointerEnter?: JsxEvent.Pointer.t => unit,\n onPointerDown?: JsxEvent.Pointer.t => unit,\n onPointerMove?: JsxEvent.Pointer.t => unit,\n onPointerUp?: JsxEvent.Pointer.t => unit,\n onPointerCancel?: JsxEvent.Pointer.t => unit,\n onPointerOut?: JsxEvent.Pointer.t => unit,\n onPointerLeave?: JsxEvent.Pointer.t => unit,\n onGotPointerCapture?: JsxEvent.Pointer.t => unit,\n onLostPointerCapture?: JsxEvent.Pointer.t => unit,\n onScroll?: JsxEvent.UI.t => unit,\n onWheel?: JsxEvent.Wheel.t => unit,\n onAbort?: JsxEvent.Media.t => unit,\n onCanPlay?: JsxEvent.Media.t => unit,\n onCanPlayThrough?: JsxEvent.Media.t => unit,\n onDurationChange?: JsxEvent.Media.t => unit,\n onEmptied?: JsxEvent.Media.t => unit,\n onEncrypted?: JsxEvent.Media.t => unit,\n onEnded?: JsxEvent.Media.t => unit,\n onError?: JsxEvent.Media.t => unit,\n onLoadedData?: JsxEvent.Media.t => unit,\n onLoadedMetadata?: JsxEvent.Media.t => unit,\n onLoadStart?: JsxEvent.Media.t => unit,\n onPause?: JsxEvent.Media.t => unit,\n onPlay?: JsxEvent.Media.t => unit,\n onPlaying?: JsxEvent.Media.t => unit,\n onProgress?: JsxEvent.Media.t => unit,\n onRateChange?: JsxEvent.Media.t => unit,\n onSeeked?: JsxEvent.Media.t => unit,\n onSeeking?: JsxEvent.Media.t => unit,\n onStalled?: JsxEvent.Media.t => unit,\n onSuspend?: JsxEvent.Media.t => unit,\n onTimeUpdate?: JsxEvent.Media.t => unit,\n onVolumeChange?: JsxEvent.Media.t => unit,\n onWaiting?: JsxEvent.Media.t => unit,\n onLoad?: JsxEvent.Image.t => unit,\n onAnimationStart?: JsxEvent.Animation.t => unit,\n onAnimationEnd?: JsxEvent.Animation.t => unit,\n onAnimationIteration?: JsxEvent.Animation.t => unit,\n onTransitionEnd?: JsxEvent.Transition.t => unit,\n accentHeight?: string,\n accumulate?: string,\n additive?: string,\n alignmentBaseline?: string,\n allowReorder?: string,\n alphabetic?: string,\n amplitude?: string,\n arabicForm?: string,\n ascent?: string,\n attributeName?: string,\n attributeType?: string,\n autoReverse?: string,\n azimuth?: string,\n baseFrequency?: string,\n baseProfile?: string,\n baselineShift?: string,\n bbox?: string,\n begin?: string,\n begin_?: string,\n bias?: string,\n by?: string,\n calcMode?: string,\n capHeight?: string,\n clip?: string,\n clipPath?: string,\n clipPathUnits?: string,\n clipRule?: string,\n colorInterpolation?: string,\n colorInterpolationFilters?: string,\n colorProfile?: string,\n colorRendering?: string,\n contentScriptType?: string,\n contentStyleType?: string,\n cursor?: string,\n cx?: string,\n cy?: string,\n d?: string,\n decelerate?: string,\n descent?: string,\n diffuseConstant?: string,\n direction?: string,\n display?: string,\n divisor?: string,\n dominantBaseline?: string,\n dur?: string,\n dx?: string,\n dy?: string,\n edgeMode?: string,\n elevation?: string,\n enableBackground?: string,\n end?: string,\n end_?: string,\n exponent?: string,\n externalResourcesRequired?: string,\n fill?: string,\n fillOpacity?: string,\n fillRule?: string,\n filter?: string,\n filterRes?: string,\n filterUnits?: string,\n floodColor?: string,\n floodOpacity?: string,\n focusable?: string,\n fontFamily?: string,\n fontSize?: string,\n fontSizeAdjust?: string,\n fontStretch?: string,\n fontStyle?: string,\n fontVariant?: string,\n fontWeight?: string,\n fomat?: string,\n from?: string,\n fx?: string,\n fy?: string,\n g1?: string,\n g2?: string,\n glyphName?: string,\n glyphOrientationHorizontal?: string,\n glyphOrientationVertical?: string,\n glyphRef?: string,\n gradientTransform?: string,\n gradientUnits?: string,\n hanging?: string,\n horizAdvX?: string,\n horizOriginX?: string,\n ideographic?: string,\n imageRendering?: string,\n in_?: string,\n in2?: string,\n intercept?: string,\n k?: string,\n k1?: string,\n k2?: string,\n k3?: string,\n k4?: string,\n kernelMatrix?: string,\n kernelUnitLength?: string,\n kerning?: string,\n keyPoints?: string,\n keySplines?: string,\n keyTimes?: string,\n lengthAdjust?: string,\n letterSpacing?: string,\n lightingColor?: string,\n limitingConeAngle?: string,\n local?: string,\n markerEnd?: string,\n markerHeight?: string,\n markerMid?: string,\n markerStart?: string,\n markerUnits?: string,\n markerWidth?: string,\n mask?: string,\n maskContentUnits?: string,\n maskUnits?: string,\n mathematical?: string,\n mode?: string,\n numOctaves?: string,\n offset?: string,\n opacity?: string,\n operator?: string,\n order?: string,\n orient?: string,\n orientation?: string,\n origin?: string,\n overflow?: string,\n overflowX?: string,\n overflowY?: string,\n overlinePosition?: string,\n overlineThickness?: string,\n paintOrder?: string,\n panose1?: string,\n pathLength?: string,\n patternContentUnits?: string,\n patternTransform?: string,\n patternUnits?: string,\n pointerEvents?: string,\n points?: string,\n pointsAtX?: string,\n pointsAtY?: string,\n pointsAtZ?: string,\n preserveAlpha?: string,\n preserveAspectRatio?: string,\n primitiveUnits?: string,\n r?: string,\n radius?: string,\n referrerPolicy?: string,\n refX?: string,\n refY?: string,\n renderingIntent?: string,\n repeatCount?: string,\n repeatDur?: string,\n requiredExtensions?: string,\n requiredFeatures?: string,\n restart?: string,\n result?: string,\n rotate?: string,\n rx?: string,\n ry?: string,\n scale?: string,\n seed?: string,\n shapeRendering?: string,\n slope?: string,\n slot?: string,\n spacing?: string,\n specularConstant?: string,\n specularExponent?: string,\n speed?: string,\n spreadMethod?: string,\n startOffset?: string,\n stdDeviation?: string,\n stemh?: string,\n stemv?: string,\n stitchTiles?: string,\n stopColor?: string,\n stopOpacity?: string,\n strikethroughPosition?: string,\n strikethroughThickness?: string,\n string?: string,\n stroke?: string,\n strokeDasharray?: string,\n strokeDashoffset?: string,\n strokeLinecap?: string,\n strokeLinejoin?: string,\n strokeMiterlimit?: string,\n strokeOpacity?: string,\n strokeWidth?: string,\n surfaceScale?: string,\n systemLanguage?: string,\n tableValues?: string,\n targetX?: string,\n targetY?: string,\n textAnchor?: string,\n textDecoration?: string,\n textLength?: string,\n textRendering?: string,\n to?: string,\n to_?: string,\n transform?: string,\n u1?: string,\n u2?: string,\n underlinePosition?: string,\n underlineThickness?: string,\n unicode?: string,\n unicodeBidi?: string,\n unicodeRange?: string,\n unitsPerEm?: string,\n vAlphabetic?: string,\n vHanging?: string,\n vIdeographic?: string,\n vMathematical?: string,\n values?: string,\n vectorEffect?: string,\n version?: string,\n vertAdvX?: string,\n vertAdvY?: string,\n vertOriginX?: string,\n vertOriginY?: string,\n viewBox?: string,\n viewTarget?: string,\n visibility?: string,\n widths?: string,\n wordSpacing?: string,\n writingMode?: string,\n x?: string,\n x1?: string,\n x2?: string,\n xChannelSelector?: string,\n xHeight?: string,\n xlinkActuate?: string,\n xlinkArcrole?: string,\n xlinkHref?: string,\n xlinkRole?: string,\n xlinkShow?: string,\n xlinkTitle?: string,\n xlinkType?: string,\n xmlns?: string,\n xmlnsXlink?: string,\n xmlBase?: string,\n xmlLang?: string,\n xmlSpace?: string,\n y?: string,\n y1?: string,\n y2?: string,\n yChannelSelector?: string,\n z?: string,\n zoomAndPan?: string,\n about?: string,\n datatype?: string,\n inlist?: string,\n prefix?: string,\n property?: string,\n resource?: string,\n typeof?: string,\n vocab?: string,\n dangerouslySetInnerHTML?: {\"__html\": string},\n suppressContentEditableWarning?: bool,\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C20%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype Jsx.element\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx.res%22%2C7%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype domRef\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C7%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype popover =\n | @as(\"auto\") Auto\n | @as(\"manual\") Manual\n | @as(\"hint\") Hint\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C11%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype popoverTargetAction =\n | @as(\"toggle\") Toggle\n | @as(\"show\") Show\n | @as(\"hide\") Hide\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C15%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype style = JsxDOMStyle.t\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxDOM.res%22%2C6%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Clipboard.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C77%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Composition.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C87%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Keyboard.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C96%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Focus.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C118%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Form.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C128%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Mouse.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C135%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Selection.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C212%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Touch.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C219%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Pointer.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C164%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.UI.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C242%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Wheel.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C253%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Media.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C265%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Image.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C272%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Animation.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C279%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype JsxEvent.Transition.t = synthetic\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxEvent.res%22%2C290%2C2%5D)\n" + } +} Hover src/Completion.res 352:17 Nothing at that position. Now trying to use completion. @@ -2142,7 +2489,12 @@ Path FAO.forAutoObject Raw opens: 2 Shadow.B.place holder ... Shadow.A.place holder Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "```rescript\n{\"age\": int, \"forAutoLabel\": FAR.forAutoRecord}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n{\"age\": int, \"forAutoLabel\": FAR.forAutoRecord}\n```" + } +} Hover src/Completion.res 355:17 Nothing at that position. Now trying to use completion. @@ -2163,7 +2515,12 @@ Found type for function ( unit, ~c: int, ) => int -{"contents": {"kind": "markdown", "value": "```rescript\noption\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\noption\n```" + } +} Complete src/Completion.res 358:23 posCursor:[358:23] posNoWhite:[358:22] Found expr:[0:-1->358:23] @@ -2187,87 +2544,88 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[T] Path T -[{ - "label": "That", - "kind": 4, - "tags": [], +[ + { "detail": "That", - "documentation": {"kind": "markdown", "value": "```rescript\nThat\n```\n\n```rescript\ntype v = This | That\n```"} - }, { - "label": "This", + "documentation": { + "kind": "markdown", + "value": "```rescript\nThat\n```\n\n```rescript\ntype v = This | That\n```" + }, "kind": 4, - "tags": [], + "label": "That", + "tags": [] + }, + { "detail": "This", - "documentation": {"kind": "markdown", "value": "```rescript\nThis\n```\n\n```rescript\ntype v = This | That\n```"} - }, { - "label": "TypedArray", - "kind": 9, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nThis\n```\n\n```rescript\ntype v = This | That\n```" + }, + "kind": 4, + "label": "This", + "tags": [] + }, + { "detail": "module TypedArray", - "documentation": null - }, { - "label": "TimeoutId", "kind": 9, - "tags": [], + "label": "TypedArray", + "tags": [] + }, + { "detail": "module TimeoutId", - "documentation": null - }, { - "label": "Type", - "kind": 9, - "tags": [], - "detail": "module Type", - "documentation": null - }, { - "label": "TableclothMap", "kind": 9, - "tags": [], - "detail": "module TableclothMap", - "documentation": null, + "label": "TimeoutId", + "tags": [] + }, + { "detail": "module Type", "kind": 9, "label": "Type", "tags": [] }, + { "data": { "modulePath": "TableclothMap", "filePath": "src/Completion.res" - } - }, { - "label": "TypeArgCtx", + }, + "detail": "module TableclothMap", "kind": 9, - "tags": [], + "label": "TableclothMap", + "tags": [] + }, + { + "data": { "modulePath": "TypeArgCtx", "filePath": "src/Completion.res" }, "detail": "module TypeArgCtx", - "documentation": null, - "data": { - "modulePath": "TypeArgCtx", - "filePath": "src/Completion.res" - } - }, { - "label": "TypeAtPosCompletion", "kind": 9, - "tags": [], - "detail": "module TypeAtPosCompletion", - "documentation": null, + "label": "TypeArgCtx", + "tags": [] + }, + { "data": { "modulePath": "TypeAtPosCompletion", "filePath": "src/Completion.res" - } - }, { - "label": "TypeConstraint", + }, + "detail": "module TypeAtPosCompletion", "kind": 9, - "tags": [], - "detail": "module TypeConstraint", - "documentation": null, + "label": "TypeAtPosCompletion", + "tags": [] + }, + { "data": { "modulePath": "TypeConstraint", "filePath": "src/Completion.res" - } - }, { - "label": "TypeDefinition", + }, + "detail": "module TypeConstraint", "kind": 9, - "tags": [], - "detail": "module TypeDefinition", - "documentation": null, + "label": "TypeConstraint", + "tags": [] + }, + { "data": { "modulePath": "TypeDefinition", "filePath": "src/Completion.res" - } - }] + }, + "detail": "module TypeDefinition", + "kind": 9, + "label": "TypeDefinition", + "tags": [] + } +] Complete src/Completion.res 376:21 posCursor:[376:21] posNoWhite:[376:20] Found expr:[374:8->379:3] @@ -2280,13 +2638,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[AndThatOther, T] Path AndThatOther.T -[{ - "label": "ThatOther", - "kind": 4, - "tags": [], +[ + { "detail": "ThatOther", - "documentation": {"kind": "markdown", "value": "```rescript\nThatOther\n```\n\n```rescript\ntype v = And | ThatOther\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nThatOther\n```\n\n```rescript\ntype v = And | ThatOther\n```" + }, + "kind": 4, + "label": "ThatOther", + "tags": [] + } +] Complete src/Completion.res 381:24 posCursor:[381:24] posNoWhite:[381:23] Found expr:[381:12->381:26] @@ -2301,19 +2664,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[ForAuto, ""] Path ForAuto. -[{ - "label": "abc", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { - "label": "abd", - "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }] +[ + { "detail": "(t, int) => t", "kind": 12, "label": "abc", "tags": [] }, + { "detail": "(t, int) => t", "kind": 12, "label": "abd", "tags": [] } +] Complete src/Completion.res 384:38 posCursor:[384:38] posNoWhite:[384:37] Found expr:[384:12->384:41] @@ -2329,19 +2683,15 @@ Resolved opens 3 Stdlib Completion Completion ContextPath Value[FAO, forAutoObject][""] ContextPath Value[FAO, forAutoObject] Path FAO.forAutoObject -[{ - "label": "age", +[ + { "detail": "int", "kind": 4, "label": "age", "tags": [] }, + { + "detail": "FAR.forAutoRecord", "kind": 4, - "tags": [], - "detail": "int", - "documentation": null - }, { "label": "forAutoLabel", - "kind": 4, - "tags": [], - "detail": "FAR.forAutoRecord", - "documentation": null - }] + "tags": [] + } +] Complete src/Completion.res 387:24 posCursor:[387:24] posNoWhite:[387:23] Found expr:[387:11->387:26] @@ -2363,19 +2713,28 @@ Path funRecord CPPipe pathFromEnv: found:true Path Completion. Path -[{ - "label": "someFun", - "kind": 5, - "tags": [], +[ + { "detail": "(~name: string) => unit", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeFun: (~name: string) => unit\n```\n\n```rescript\ntype funRecord = {\n someFun: (~name: string) => unit,\n stuff: string,\n}\n```"} - }, { - "label": "stuff", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeFun: (~name: string) => unit\n```\n\n```rescript\ntype funRecord = {\n someFun: (~name: string) => unit,\n stuff: string,\n}\n```" + }, "kind": 5, - "tags": [], + "label": "someFun", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nstuff: string\n```\n\n```rescript\ntype funRecord = {\n someFun: (~name: string) => unit,\n stuff: string,\n}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nstuff: string\n```\n\n```rescript\ntype funRecord = {\n someFun: (~name: string) => unit,\n stuff: string,\n}\n```" + }, + "kind": 5, + "label": "stuff", + "tags": [] + } +] Complete src/Completion.res 391:12 posCursor:[391:12] posNoWhite:[391:11] Found expr:[390:8->394:1] @@ -2390,19 +2749,28 @@ ContextPath array Path Stdlib.Array.ma Path ArrayUtils.ma Path ma -[{ - "label": "Array.map", - "kind": 12, - "tags": [], +[ + { "detail": "(array<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }, { - "label": "Array.mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "Array.map", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n" + }, + "kind": 12, + "label": "Array.mapWithIndex", + "tags": [] + } +] Complete src/Completion.res 399:14 posCursor:[399:14] posNoWhite:[399:13] Found expr:[398:14->399:20] @@ -2417,13 +2785,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[red] Path red -[{ - "label": "red", - "kind": 12, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 12, "label": "red", "tags": [] } ] Complete src/Completion.res 404:25 posCursor:[404:25] posNoWhite:[404:24] Found expr:[402:14->404:31] @@ -2438,13 +2800,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[red] Path red -[{ - "label": "red", - "kind": 12, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 12, "label": "red", "tags": [] } ] Complete src/Completion.res 407:22 posCursor:[407:22] posNoWhite:[407:21] Found expr:[407:11->485:0] @@ -2460,25 +2816,20 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[r] Path r -[{ - "label": "red", +[ + { "detail": "string", "kind": 12, "label": "red", "tags": [] }, + { "detail": "unit => aa", "kind": 12, "label": "retAA", "tags": [] }, + { + "detail": "rAlias", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype r = {x: int, y: string}\n```" + }, "kind": 12, - "tags": [], - "detail": "string", - "documentation": null - }, { - "label": "retAA", - "kind": 12, - "tags": [], - "detail": "unit => aa", - "documentation": null - }, { "label": "r", - "kind": 12, - "tags": [], - "detail": "rAlias", - "documentation": {"kind": "markdown", "value": "```rescript\ntype r = {x: int, y: string}\n```"} - }] + "tags": [] + } +] Complete src/Completion.res 411:21 posCursor:[411:21] posNoWhite:[411:20] Found expr:[410:14->417:1] @@ -2492,19 +2843,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLocalModule, ""] Path SomeLocalModule. -[{ - "label": "bb", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "aa", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "int", "kind": 12, "label": "bb", "tags": [] }, + { "detail": "int", "kind": 12, "label": "aa", "tags": [] } +] Complete src/Completion.res 414:21 posCursor:[414:21] posNoWhite:[414:20] Found expr:[410:14->417:1] @@ -2519,19 +2861,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Value[SomeLocalModule, ""] Path SomeLocalModule. -[{ - "label": "bb", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "aa", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ + { "detail": "int", "kind": 12, "label": "bb", "tags": [] }, + { "detail": "int", "kind": 12, "label": "aa", "tags": [] } +] Complete src/Completion.res 419:17 posCursor:[419:17] posNoWhite:[419:16] Found expr:[419:11->419:17] @@ -2543,67 +2876,112 @@ ContextPath int->t ContextPath int Path Stdlib.Int.t Path t -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toExponentialWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixedWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toExponentialWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }, { - "label": "Int.toPrecisionWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toFixedWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecisionWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecision", + "tags": [] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toFloat", + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toString", + "tags": [] + }, + { "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n"} - }, { - "label": "Int.toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toFloat", + "tags": [] + }, + { "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n"} - }, { - "label": "Int.toExponential", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toLocaleString", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixed", + "documentation": { + "kind": "markdown", + "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponential", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, + "kind": 12, + "label": "Int.toFixed", + "tags": [] + } +] Complete src/Completion.res 422:19 posCursor:[422:19] posNoWhite:[422:18] Found expr:[422:11->422:19] @@ -2615,67 +2993,112 @@ ContextPath float->t ContextPath float Path Stdlib.Float.t Path t -[{ - "label": "Float.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(float, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` with `~radix` instead\n\n\n`toStringWithRadix(v, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toStringWithRadix(6.0, ~radix=2) == \"110\"\nFloat.toStringWithRadix(3735928559.0, ~radix=16) == \"deadbeef\"\nFloat.toStringWithRadix(123456.0, ~radix=36) == \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Float.toExponentialWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` with `~radix` instead\n\n\n`toStringWithRadix(v, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toStringWithRadix(6.0, ~radix=2) == \"110\"\nFloat.toStringWithRadix(3735928559.0, ~radix=16) == \"deadbeef\"\nFloat.toStringWithRadix(123456.0, ~radix=36) == \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [1], + "label": "Float.toStringWithRadix", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(float, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(v, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponentialWithPrecision(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponentialWithPrecision(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Float.toInt", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(v, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponentialWithPrecision(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponentialWithPrecision(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Float.toExponentialWithPrecision", + "tags": [ 1 ] + }, + { "detail": "float => int", - "documentation": {"kind": "markdown", "value": "\n`toInt(v)` returns an int to given float `v`.\n\n## Examples\n\n```rescript\nFloat.toInt(2.0) == 2\nFloat.toInt(1.0) == 1\nFloat.toInt(1.1) == 1\nFloat.toInt(1.6) == 1\n```\n"} - }, { - "label": "Float.toFixedWithPrecision", + "documentation": { + "kind": "markdown", + "value": "\n`toInt(v)` returns an int to given float `v`.\n\n## Examples\n\n```rescript\nFloat.toInt(2.0) == 2\nFloat.toInt(1.0) == 1\nFloat.toInt(1.1) == 1\nFloat.toInt(1.6) == 1\n```\n" + }, "kind": 12, - "tags": [1], + "label": "Float.toInt", + "tags": [] + }, + { + "deprecated": true, "detail": "(float, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(v, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixedWithPrecision(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixedWithPrecision(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }, { - "label": "Float.toPrecisionWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(v, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixedWithPrecision(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixedWithPrecision(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, "kind": 12, - "tags": [1], + "label": "Float.toFixedWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(float, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(v, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecisionWithPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecisionWithPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n \n"} - }, { - "label": "Float.toPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(v, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecisionWithPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecisionWithPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n \n" + }, "kind": 12, - "tags": [], + "label": "Float.toPrecisionWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(float, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toPrecision(v, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecision(100.0) == \"100\"\nFloat.toPrecision(1.0) == \"1\"\nFloat.toPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Float.toString", + "documentation": { + "kind": "markdown", + "value": "\n`toPrecision(v, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits.\nSee [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nFloat.toPrecision(100.0) == \"100\"\nFloat.toPrecision(1.0) == \"1\"\nFloat.toPrecision(100.0, ~digits=2) == \"1.0e+2\"\nFloat.toPrecision(1.0, ~digits=1) == \"1\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Float.toPrecision", + "tags": [] + }, + { "detail": "(float, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(v)` return a `string` representing the given value.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toString(1000.0) == \"1000\"\nFloat.toString(-1000.0) == \"-1000\"\n```\n"} - }, { - "label": "Float.toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(v)` return a `string` representing the given value.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) on MDN.\n\n## Examples\n\n```rescript\nFloat.toString(1000.0) == \"1000\"\nFloat.toString(-1000.0) == \"-1000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Float.toString", + "tags": [] + }, + { "detail": "float => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(v)` return a `string` with language-sensitive representing the\ngiven value.\nSee [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nFloat.toLocaleString(1000.0) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nFloat.toLocaleString(1000.0) // \"1.000\"\n```\n"} - }, { - "label": "Float.toExponential", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(v)` return a `string` with language-sensitive representing the\ngiven value.\nSee [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nFloat.toLocaleString(1000.0) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nFloat.toLocaleString(1000.0) // \"1.000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Float.toLocaleString", + "tags": [] + }, + { "detail": "(float, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toExponential(v, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponential(1000.0) == \"1e+3\"\nFloat.toExponential(-1000.0) == \"-1e+3\"\nFloat.toExponential(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponential(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Float.toFixed", + "documentation": { + "kind": "markdown", + "value": "\n`toExponential(v, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point.\nSee [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential) on MDN.\n\n## Examples\n\n```rescript\nFloat.toExponential(1000.0) == \"1e+3\"\nFloat.toExponential(-1000.0) == \"-1e+3\"\nFloat.toExponential(77.0, ~digits=2) == \"7.70e+1\"\nFloat.toExponential(5678.0, ~digits=2) == \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Float.toExponential", + "tags": [] + }, + { "detail": "(float, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toFixed(v, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixed(123456.0) == \"123456\"\nFloat.toFixed(10.0) == \"10\"\nFloat.toFixed(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixed(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toFixed(v, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point.\nSee [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed) on MDN.\n\n## Examples\n\n```rescript\nFloat.toFixed(123456.0) == \"123456\"\nFloat.toFixed(10.0) == \"10\"\nFloat.toFixed(300.0, ~digits=4) == \"300.0000\"\nFloat.toFixed(300.0, ~digits=1) == \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, + "kind": 12, + "label": "Float.toFixed", + "tags": [] + } +] Complete src/Completion.res 427:8 posCursor:[427:8] posNoWhite:[427:7] Found expr:[427:3->427:8] @@ -2688,31 +3111,50 @@ ContextPath Value[ok] Path ok Path Stdlib.Result.g Path g -[{ - "label": "Result.getExn", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(result<'a, 'b>, ~message: string=?) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use 'getOrThrow' instead\n\n\n `getExn(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getExn(Result.Ok(42)) == 42\n \n switch Result.getExn(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getExn(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```\n"} - }, { - "label": "Result.getOrThrow", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use 'getOrThrow' instead\n\n\n `getExn(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getExn(Result.Ok(42)) == 42\n \n switch Result.getExn(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getExn(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```\n" + }, "kind": 12, - "tags": [], + "label": "Result.getExn", + "tags": [ 1 ] + }, + { "detail": "(result<'a, 'b>, ~message: string=?) => 'a", - "documentation": {"kind": "markdown", "value": "\n `getOrThrow(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getOrThrow(Result.Ok(42)) == 42\n \n switch Result.getOrThrow(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getOrThrow(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```\n"} - }, { - "label": "Result.getOr", + "documentation": { + "kind": "markdown", + "value": "\n `getOrThrow(res, ~message=?)` returns `n` if `res` is `Ok(n)`, otherwise throws an exception with the message provided, or a generic message if no message was provided.\n\n ```res example\n Result.getOrThrow(Result.Ok(42)) == 42\n \n switch Result.getOrThrow(Error(\"Invalid data\")) {\n | exception _ => true\n | _ => false\n } == true\n\n switch Result.getOrThrow(Error(\"Invalid data\"), ~message=\"was Error!\") {\n | exception _ => true // Throws a JsError with the message \"was Error!\"\n | _ => false\n } == true\n ```\n" + }, "kind": 12, - "tags": [], + "label": "Result.getOrThrow", + "tags": [] + }, + { "detail": "(result<'a, 'b>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "\n`getOr(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`, otherwise `default`\n\n## Examples\n\n```rescript\nResult.getOr(Ok(42), 0) == 42\n\nResult.getOr(Error(\"Invalid Data\"), 0) == 0\n```\n"} - }, { - "label": "Result.getWithDefault", + "documentation": { + "kind": "markdown", + "value": "\n`getOr(res, defaultValue)`: If `res` is `Ok(n)`, returns `n`, otherwise `default`\n\n## Examples\n\n```rescript\nResult.getOr(Ok(42), 0) == 42\n\nResult.getOr(Error(\"Invalid Data\"), 0) == 0\n```\n" + }, "kind": 12, - "tags": [1], + "label": "Result.getOr", + "tags": [] + }, + { + "deprecated": true, "detail": "(result<'a, 'b>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use getOr instead\n\n"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use getOr instead\n\n" + }, + "kind": 12, + "label": "Result.getWithDefault", + "tags": [ 1 ] + } +] Complete src/Completion.res 445:15 posCursor:[445:15] posNoWhite:[445:14] Found expr:[445:3->445:15] @@ -2730,19 +3172,30 @@ Path rWithDepr CPPipe pathFromEnv: found:true Path Completion.so Path so -[{ - "label": "someInt", - "kind": 5, - "tags": [1], +[ + { + "deprecated": true, "detail": "int", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n```rescript\nsomeInt: int\n```\n\n```rescript\ntype someRecordWithDeprecatedField = {\n name: string,\n someInt: int,\n someFloat: float,\n}\n```"} - }, { - "label": "someFloat", + "documentation": { + "kind": "markdown", + "value": "Deprecated: \n\n```rescript\nsomeInt: int\n```\n\n```rescript\ntype someRecordWithDeprecatedField = {\n name: string,\n someInt: int,\n someFloat: float,\n}\n```" + }, "kind": 5, - "tags": [1], + "label": "someInt", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "float", - "documentation": {"kind": "markdown", "value": "Deprecated: Use 'someInt'.\n\n```rescript\nsomeFloat: float\n```\n\n```rescript\ntype someRecordWithDeprecatedField = {\n name: string,\n someInt: int,\n someFloat: float,\n}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use 'someInt'.\n\n```rescript\nsomeFloat: float\n```\n\n```rescript\ntype someRecordWithDeprecatedField = {\n name: string,\n someInt: int,\n someFloat: float,\n}\n```" + }, + "kind": 5, + "label": "someFloat", + "tags": [ 1 ] + } +] Complete src/Completion.res 452:37 XXX Not found! @@ -2752,31 +3205,46 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[someVariantWithDeprecated] Path someVariantWithDeprecated -[{ - "label": "DoNotUseMe", - "kind": 4, - "tags": [1], +[ + { + "deprecated": true, "detail": "DoNotUseMe", - "documentation": {"kind": "markdown", "value": "Deprecated: \n\n```rescript\nDoNotUseMe\n```\n\n```rescript\ntype someVariantWithDeprecated =\n | DoNotUseMe\n | UseMeInstead\n | AndNotMe\n```"}, + "documentation": { + "kind": "markdown", + "value": "Deprecated: \n\n```rescript\nDoNotUseMe\n```\n\n```rescript\ntype someVariantWithDeprecated =\n | DoNotUseMe\n | UseMeInstead\n | AndNotMe\n```" + }, "insertText": "DoNotUseMe", - "insertTextFormat": 2 - }, { - "label": "UseMeInstead", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "DoNotUseMe", + "tags": [ 1 ] + }, + { "detail": "UseMeInstead", - "documentation": {"kind": "markdown", "value": "```rescript\nUseMeInstead\n```\n\n```rescript\ntype someVariantWithDeprecated =\n | DoNotUseMe\n | UseMeInstead\n | AndNotMe\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nUseMeInstead\n```\n\n```rescript\ntype someVariantWithDeprecated =\n | DoNotUseMe\n | UseMeInstead\n | AndNotMe\n```" + }, "insertText": "UseMeInstead", - "insertTextFormat": 2 - }, { - "label": "AndNotMe", + "insertTextFormat": 2, "kind": 4, - "tags": [1], + "label": "UseMeInstead", + "tags": [] + }, + { + "deprecated": true, "detail": "AndNotMe", - "documentation": {"kind": "markdown", "value": "Deprecated: Use 'UseMeInstead'\n\n```rescript\nAndNotMe\n```\n\n```rescript\ntype someVariantWithDeprecated =\n | DoNotUseMe\n | UseMeInstead\n | AndNotMe\n```"}, + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use 'UseMeInstead'\n\n```rescript\nAndNotMe\n```\n\n```rescript\ntype someVariantWithDeprecated =\n | DoNotUseMe\n | UseMeInstead\n | AndNotMe\n```" + }, "insertText": "AndNotMe", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "AndNotMe", + "tags": [ 1 ] + } +] Complete src/Completion.res 457:28 posCursor:[457:28] posNoWhite:[457:27] Found expr:[457:11->457:28] @@ -2790,19 +3258,29 @@ ContextPath Value[uncurried] Path uncurried Path Stdlib.Int.toS Path toS -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, + "kind": 12, + "label": "Int.toString", + "tags": [] + } +] Complete src/Completion.res 462:30 XXX Not found! @@ -2812,16 +3290,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[withUncurried] Path withUncurried -[{ - "label": "v => v", - "kind": 12, - "tags": [], +[ + { "detail": "int => unit", - "documentation": null, - "sortText": "A", "insertText": "${1:v} => ${0:v}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "v => v", + "sortText": "A", + "tags": [] + } +] Complete src/Completion.res 465:26 posCursor:[465:26] posNoWhite:[465:25] Found expr:[465:22->465:26] @@ -2832,25 +3311,38 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath ValueOrField[FAR, ""] Path FAR. -[{ - "label": "forAutoRecord", - "kind": 12, - "tags": [], +[ + { "detail": "forAutoRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} - }, { - "label": "forAuto", - "kind": 5, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```" + }, + "kind": 12, + "label": "forAutoRecord", + "tags": [] + }, + { "detail": "ForAuto.t", - "documentation": {"kind": "markdown", "value": "```rescript\nforAuto: ForAuto.t\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} - }, { - "label": "something", + "documentation": { + "kind": "markdown", + "value": "```rescript\nforAuto: ForAuto.t\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```" + }, "kind": 5, - "tags": [], + "label": "forAuto", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nsomething: option\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomething: option\n```\n\n```rescript\ntype forAutoRecord = {\n forAuto: ForAuto.t,\n something: option,\n}\n```" + }, + "kind": 5, + "label": "something", + "tags": [] + } +] Complete src/Completion.res 471:45 XXX Not found! @@ -2860,19 +3352,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[someVariantWithRecord] Path someVariantWithRecord -[{ - "label": "field1", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nfield1: string\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```"} - }, { - "label": "field2", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield1: string\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```" + }, "kind": 5, - "tags": [], + "label": "field1", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfield2: int\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield2: int\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```" + }, + "kind": 5, + "label": "field2", + "tags": [] + } +] Complete src/Completion.res 474:48 XXX Not found! @@ -2882,19 +3383,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[someVariantWithRecord] Path someVariantWithRecord -[{ - "label": "field1", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nfield1: string\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```"} - }, { - "label": "field2", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield1: string\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```" + }, "kind": 5, - "tags": [], + "label": "field1", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfield2: int\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield2: int\n```\n\n```rescript\ntype someRecord = {field1: string, field2: int}\n```" + }, + "kind": 5, + "label": "field2", + "tags": [] + } +] Complete src/Completion.res 479:57 XXX Not found! @@ -2904,19 +3414,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[someVariantWithInlineRecord] Path someVariantWithInlineRecord -[{ - "label": "field1", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nfield1: string\n```\n\n```rescript\n{field1: string, field2: int}\n```"} - }, { - "label": "field2", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield1: string\n```\n\n```rescript\n{field1: string, field2: int}\n```" + }, "kind": 5, - "tags": [], + "label": "field1", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfield2: int\n```\n\n```rescript\n{field1: string, field2: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield2: int\n```\n\n```rescript\n{field1: string, field2: int}\n```" + }, + "kind": 5, + "label": "field2", + "tags": [] + } +] Complete src/Completion.res 482:60 XXX Not found! @@ -2926,17 +3445,26 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 3 Stdlib Completion Completion ContextPath Type[someVariantWithInlineRecord] Path someVariantWithInlineRecord -[{ - "label": "field1", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nfield1: string\n```\n\n```rescript\n{field1: string, field2: int}\n```"} - }, { - "label": "field2", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield1: string\n```\n\n```rescript\n{field1: string, field2: int}\n```" + }, "kind": 5, - "tags": [], + "label": "field1", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfield2: int\n```\n\n```rescript\n{field1: string, field2: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nfield2: int\n```\n\n```rescript\n{field1: string, field2: int}\n```" + }, + "kind": 5, + "label": "field2", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt b/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt index 1c7c3fb9df5..ee833853eec 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt @@ -3,252 +3,272 @@ Attribute id:modu:[0:3->0:8] label:modu Completable: Cdecorator(modu) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "module", - "kind": 4, - "tags": [], +[ + { "detail": "", - "documentation": {"kind": "markdown", "value": "The `@module` decorator is used to bind to a JavaScript module.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#module-decorator)."}, + "documentation": { + "kind": "markdown", + "value": "The `@module` decorator is used to bind to a JavaScript module.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#module-decorator)." + }, "insertText": "module(\"$0\")", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "module", + "tags": [] + } +] Complete src/CompletionAttributes.res 3:12 XXX Not found! Completable: CdecoratorPayload(module=) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "@rescript/react", - "kind": 4, - "tags": [], - "detail": "Package", - "documentation": null - }, { - "label": "./test.json", - "kind": 4, - "tags": [], - "detail": "Local file", - "documentation": null - }, { - "label": "./tst.js", - "kind": 4, - "tags": [], - "detail": "Local file", - "documentation": null - }] +[ + { "detail": "Package", "kind": 4, "label": "@rescript/react", "tags": [] }, + { "detail": "Local file", "kind": 4, "label": "./test.json", "tags": [] }, + { "detail": "Local file", "kind": 4, "label": "./tst.js", "tags": [] } +] Complete src/CompletionAttributes.res 6:7 Attribute id:js:[6:3->6:7] label:@js Completable: Cdecorator(@js) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "jsxConfig", - "kind": 4, - "tags": [], +[ + { "detail": "", - "documentation": {"kind": "markdown", "value": "The `@@jsxConfig` decorator is used to change the config for JSX on the fly.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/docs/manual/latest/jsx#file-level-configuration)."}, + "documentation": { + "kind": "markdown", + "value": "The `@@jsxConfig` decorator is used to change the config for JSX on the fly.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/docs/manual/latest/jsx#file-level-configuration)." + }, "insertText": "jsxConfig({$0})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "jsxConfig", + "tags": [] + } +] Complete src/CompletionAttributes.res 9:16 XXX Not found! Completable: JsxConfig Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "version", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nversion?: int\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```"} - }, { - "label": "module_", + "documentation": { + "kind": "markdown", + "value": "```rescript\nversion?: int\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```" + }, "kind": 5, - "tags": [], + "label": "version", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nmodule_?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```"} - }, { - "label": "mode", + "documentation": { + "kind": "markdown", + "value": "```rescript\nmodule_?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```" + }, "kind": 5, - "tags": [], + "label": "module_", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nmode?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nmode?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```" + }, + "kind": 5, + "label": "mode", + "tags": [] + } +] Complete src/CompletionAttributes.res 12:17 XXX Not found! Completable: JsxConfig Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "module_", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nmodule_?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```"} - }, { - "label": "mode", + "documentation": { + "kind": "markdown", + "value": "```rescript\nmodule_?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```" + }, "kind": 5, - "tags": [], + "label": "module_", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nmode?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nmode?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```" + }, + "kind": 5, + "label": "mode", + "tags": [] + } +] Complete src/CompletionAttributes.res 15:25 XXX Not found! Completable: JsxConfig Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "\"\"", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": null, - "sortText": "A", "insertText": "\"$0\"", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "\"\"", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionAttributes.res 18:29 XXX Not found! Completable: JsxConfig Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "version", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nversion?: int\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```"} - }, { - "label": "mode", + "documentation": { + "kind": "markdown", + "value": "```rescript\nversion?: int\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```" + }, "kind": 5, - "tags": [], + "label": "version", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nmode?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nmode?: string\n```\n\n```rescript\ntype jsxConfig = {version: int, module_: string, mode: string}\n```" + }, + "kind": 5, + "label": "mode", + "tags": [] + } +] Complete src/CompletionAttributes.res 21:12 XXX Not found! Completable: CdecoratorPayload(moduleWithImportAttributes) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "from", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nfrom?: string\n```\n\n```rescript\ntype moduleConfig = {from: string, with: string}\n```"} - }, { - "label": "with", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfrom?: string\n```\n\n```rescript\ntype moduleConfig = {from: string, with: string}\n```" + }, "kind": 5, - "tags": [], + "label": "from", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nwith?: string\n```\n\n```rescript\ntype moduleConfig = {from: string, with: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nwith?: string\n```\n\n```rescript\ntype moduleConfig = {from: string, with: string}\n```" + }, + "kind": 5, + "label": "with", + "tags": [] + } +] Complete src/CompletionAttributes.res 24:17 XXX Not found! Completable: CdecoratorPayload(moduleWithImportAttributes) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "importAttributesConfig", - "documentation": {"kind": "markdown", "value": "```rescript\ntype importAttributesConfig = {type_: string}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype importAttributesConfig = {type_: string}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionAttributes.res 27:19 XXX Not found! Completable: CdecoratorPayload(moduleWithImportAttributes) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "type_", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\ntype_?: string\n```\n\n```rescript\ntype importAttributesConfig = {type_: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype_?: string\n```\n\n```rescript\ntype importAttributesConfig = {type_: string}\n```" + }, + "kind": 5, + "label": "type_", + "tags": [] + } +] Complete src/CompletionAttributes.res 30:19 XXX Not found! Completable: CdecoratorPayload(module=) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "@rescript/react", - "kind": 4, - "tags": [], - "detail": "Package", - "documentation": null - }, { - "label": "./test.json", - "kind": 4, - "tags": [], - "detail": "Local file", - "documentation": null - }, { - "label": "./tst.js", - "kind": 4, - "tags": [], - "detail": "Local file", - "documentation": null - }] +[ + { "detail": "Package", "kind": 4, "label": "@rescript/react", "tags": [] }, + { "detail": "Local file", "kind": 4, "label": "./test.json", "tags": [] }, + { "detail": "Local file", "kind": 4, "label": "./tst.js", "tags": [] } +] Complete src/CompletionAttributes.res 33:17 XXX Not found! Completable: CdecoratorPayload(module=) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "@rescript/react", - "kind": 4, - "tags": [], - "detail": "Package", - "documentation": null - }, { - "label": "./test.json", - "kind": 4, - "tags": [], - "detail": "Local file", - "documentation": null - }, { - "label": "./tst.js", - "kind": 4, - "tags": [], - "detail": "Local file", - "documentation": null - }] +[ + { "detail": "Package", "kind": 4, "label": "@rescript/react", "tags": [] }, + { "detail": "Local file", "kind": 4, "label": "./test.json", "tags": [] }, + { "detail": "Local file", "kind": 4, "label": "./tst.js", "tags": [] } +] Complete src/CompletionAttributes.res 36:14 posCursor:[36:14] posNoWhite:[36:13] Found expr:[36:12->36:14] Completable: CextensionNode(t) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -[{ - "label": "todo", - "kind": 4, - "tags": [], +[ + { "detail": "`%todo` is used to tell the compiler that some code still needs to be implemented.", - "documentation": null, - "insertText": "todo" - }, { - "label": "todo (with payload)", + "insertText": "todo", "kind": 4, - "tags": [], + "label": "todo", + "tags": [] + }, + { "detail": "`%todo` is used to tell the compiler that some code still needs to be implemented. With a payload.", - "documentation": null, "insertText": "todo(\"${0:TODO}\")", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "todo (with payload)", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt b/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt index bb2bf05e4e4..16b2766451f 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionConfiguredBuiltins.res.txt @@ -9,13 +9,14 @@ Path x Path Stdlib.Array.em Path ArrayUtils.em Path em -[{ - "label": "ArrayUtils.empty", - "kind": 12, - "tags": [], +[ + { "detail": "array<'a> => bool", - "documentation": null - }] + "kind": 12, + "label": "ArrayUtils.empty", + "tags": [] + } +] Complete src/CompletionConfiguredBuiltins.res 7:16 posCursor:[7:16] posNoWhite:[7:15] Found expr:[7:3->7:16] @@ -29,11 +30,12 @@ CPPipe pathFromEnv:Fastify found:false Path Fastify.doSt Path FastifyExt.doSt Path doSt -[{ - "label": "FastifyExt.doStuff", - "kind": 12, - "tags": [], +[ + { "detail": "Fastify.t => unit", - "documentation": null - }] + "kind": 12, + "label": "FastifyExt.doStuff", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionDicts.res.txt b/tests/analysis_tests/tests/src/expected/CompletionDicts.res.txt index 60614d70457..86f52b8c81c 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionDicts.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionDicts.res.txt @@ -7,15 +7,16 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[Dict, fromArray]($0) ContextPath Value[Dict, fromArray] Path Dict.fromArray -[{ - "label": "(_, _)", - "kind": 12, - "tags": [], +[ + { "detail": "(string, 'a)", - "documentation": null, "insertText": "(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(_, _)", + "tags": [] + } +] Complete src/CompletionDicts.res 3:31 posCursor:[3:31] posNoWhite:[3:30] Found expr:[3:14->3:34] @@ -26,15 +27,16 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[Dict, fromArray]($0) ContextPath Value[Dict, fromArray] Path Dict.fromArray -[{ - "label": "(_, _)", - "kind": 12, - "tags": [], +[ + { "detail": "(string, 'a)", - "documentation": null, "insertText": "(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(_, _)", + "tags": [] + } +] Complete src/CompletionDicts.res 6:37 posCursor:[6:37] posNoWhite:[6:36] Found expr:[6:14->6:41] @@ -57,18 +59,9 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[Dict, fromArray]($0) ContextPath Value[Dict, fromArray] Path Dict.fromArray -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt b/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt index 2e1b28d5f57..9c6b1137266 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt @@ -8,15 +8,16 @@ ContextPath Value[s] Path s ContextPath Value[f] Path f -[{ - "label": "(_, _)", - "kind": 12, - "tags": [], +[ + { "detail": "(bool, option>)", - "documentation": null, "insertText": "(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(_, _)", + "tags": [] + } +] Complete src/CompletionExpressions.res 26:27 posCursor:[26:27] posNoWhite:[26:26] Found expr:[26:11->26:29] @@ -27,43 +28,68 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "offline", + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "age", + "tags": [] + }, + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\noffline: bool\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "online", + "documentation": { + "kind": "markdown", + "value": "```rescript\noffline: bool\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "offline", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "variant", + "documentation": { + "kind": "markdown", + "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "online", + "tags": [] + }, + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\nvariant: someVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "polyvariant", + "documentation": { + "kind": "markdown", + "value": "```rescript\nvariant: someVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "variant", + "tags": [] + }, + { "detail": "somePolyVariant", - "documentation": {"kind": "markdown", "value": "```rescript\npolyvariant: somePolyVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "nested", + "documentation": { + "kind": "markdown", + "value": "```rescript\npolyvariant: somePolyVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "polyvariant", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, + "kind": 5, + "label": "nested", + "tags": [] + } +] Complete src/CompletionExpressions.res 29:28 posCursor:[29:28] posNoWhite:[29:27] Found expr:[29:11->29:30] @@ -74,13 +100,18 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "nested", - "kind": 5, - "tags": [], +[ + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, + "kind": 5, + "label": "nested", + "tags": [] + } +] Complete src/CompletionExpressions.res 32:35 posCursor:[32:35] posNoWhite:[32:34] Found expr:[32:11->32:38] @@ -91,19 +122,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionExpressions.res 35:36 posCursor:[35:36] posNoWhite:[35:35] Found expr:[35:11->35:39] @@ -114,37 +136,58 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "offline", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\noffline: bool\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "online", + "documentation": { + "kind": "markdown", + "value": "```rescript\noffline: bool\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "offline", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "variant", + "documentation": { + "kind": "markdown", + "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "online", + "tags": [] + }, + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\nvariant: someVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "polyvariant", + "documentation": { + "kind": "markdown", + "value": "```rescript\nvariant: someVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "variant", + "tags": [] + }, + { "detail": "somePolyVariant", - "documentation": {"kind": "markdown", "value": "```rescript\npolyvariant: somePolyVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "nested", + "documentation": { + "kind": "markdown", + "value": "```rescript\npolyvariant: somePolyVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "polyvariant", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, + "kind": 5, + "label": "nested", + "tags": [] + } +] Complete src/CompletionExpressions.res 38:37 posCursor:[38:37] posNoWhite:[38:35] Found expr:[38:11->38:53] @@ -155,31 +198,48 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "online", - "kind": 5, - "tags": [], +[ + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "variant", + "documentation": { + "kind": "markdown", + "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "online", + "tags": [] + }, + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\nvariant: someVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "polyvariant", + "documentation": { + "kind": "markdown", + "value": "```rescript\nvariant: someVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "variant", + "tags": [] + }, + { "detail": "somePolyVariant", - "documentation": {"kind": "markdown", "value": "```rescript\npolyvariant: somePolyVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }, { - "label": "nested", + "documentation": { + "kind": "markdown", + "value": "```rescript\npolyvariant: somePolyVariant\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "kind": 5, - "tags": [], + "label": "polyvariant", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnested: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, + "kind": 5, + "label": "nested", + "tags": [] + } +] Complete src/CompletionExpressions.res 41:44 posCursor:[41:44] posNoWhite:[41:43] Found expr:[41:11->41:47] @@ -190,37 +250,54 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "Some(nested)", - "kind": 12, - "tags": [], +[ + { "detail": "otherRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, "insertText": "Some(nested)$0", - "insertTextFormat": 2 - }, { - "label": "Some(_)", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Some(nested)", + "tags": [] + }, + { "detail": "otherRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, "insertText": "Some($0)", - "insertTextFormat": 2 - }, { - "label": "None", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Some(_)", + "tags": [] + }, + { "detail": "otherRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"} - }, { - "label": "Some({})", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, "kind": 12, - "tags": [], + "label": "None", + "tags": [] + }, + { "detail": "otherRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, "insertText": "Some({$0})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some({})", + "tags": [] + } +] Complete src/CompletionExpressions.res 44:46 posCursor:[44:46] posNoWhite:[44:45] Found expr:[44:11->44:49] @@ -242,19 +319,28 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "someField", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeField: int\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"} - }, { - "label": "otherField", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeField: int\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, "kind": 5, - "tags": [], + "label": "someField", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\notherField: string\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\notherField: string\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, + "kind": 5, + "label": "otherField", + "tags": [] + } +] Complete src/CompletionExpressions.res 50:45 posCursor:[50:45] posNoWhite:[50:44] Found expr:[50:11->50:48] @@ -265,31 +351,44 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Two", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two", + "tags": [] + }, + { "detail": "Three(int, string)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(int, string)\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(int, string)\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] Complete src/CompletionExpressions.res 53:47 posCursor:[53:47] posNoWhite:[53:46] Found expr:[53:11->53:50] @@ -300,15 +399,20 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "One", + "tags": [] + } +] Complete src/CompletionExpressions.res 56:57 posCursor:[56:57] posNoWhite:[56:56] Found expr:[56:11->56:61] @@ -319,16 +423,21 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "someRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someRecord = {age: int, offline: bool, online: option, variant: someVariant, polyvariant: somePolyVariant, nested: option}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 59:60 posCursor:[59:60] posNoWhite:[59:59] Found expr:[59:11->59:65] @@ -339,19 +448,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionExpressions.res 62:62 posCursor:[62:62] posNoWhite:[62:61] Found expr:[62:11->62:66] @@ -362,20 +462,25 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "true", - "kind": 4, - "tags": [], +[ + { "detail": "bool", - "documentation": null, - "sortText": "A true" - }, { - "label": "typeof", - "kind": 12, - "tags": [], + "kind": 4, + "label": "true", + "sortText": "A true", + "tags": [] + }, + { "detail": "'a => Type.t", - "documentation": {"kind": "markdown", "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n" + }, + "kind": 12, + "label": "typeof", + "tags": [] + } +] Complete src/CompletionExpressions.res 69:25 posCursor:[69:25] posNoWhite:[69:24] Found expr:[69:11->69:26] @@ -386,16 +491,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "option", - "documentation": null, - "sortText": "A", "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 72:26 posCursor:[72:26] posNoWhite:[72:25] Found expr:[72:11->72:28] @@ -406,33 +512,19 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray -[{ - "label": "None", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null, "insertText": "Some($0)", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionExpressions.res 75:26 posCursor:[75:26] posNoWhite:[75:25] Found expr:[75:11->75:27] @@ -443,37 +535,49 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray -[{ - "label": "s", +[ + { "detail": "bool", "kind": 12, "label": "s", "tags": [] }, + { + "detail": "(unit => unit, float) => timeoutId", + "documentation": { + "kind": "markdown", + "value": "\n`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { "label": "setTimeoutFloat", + "tags": [] + }, + { + "detail": "(unit => unit, float) => intervalId", + "documentation": { + "kind": "markdown", + "value": "\n`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "(unit => unit, float) => timeoutId", - "documentation": {"kind": "markdown", "value": "\n`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```\n"} - }, { "label": "setIntervalFloat", + "tags": [] + }, + { + "detail": "(unit => unit, int) => intervalId", + "documentation": { + "kind": "markdown", + "value": "\n`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "(unit => unit, float) => intervalId", - "documentation": {"kind": "markdown", "value": "\n`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```\n"} - }, { "label": "setInterval", + "tags": [] + }, + { + "detail": "(unit => unit, int) => timeoutId", + "documentation": { + "kind": "markdown", + "value": "\n`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "(unit => unit, int) => intervalId", - "documentation": {"kind": "markdown", "value": "\n`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```\n"} - }, { "label": "setTimeout", - "kind": 12, - "tags": [], - "detail": "(unit => unit, int) => timeoutId", - "documentation": {"kind": "markdown", "value": "\n`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```\n"} - }] + "tags": [] + } +] Complete src/CompletionExpressions.res 78:31 posCursor:[78:31] posNoWhite:[78:30] Found expr:[78:11->78:34] @@ -484,19 +588,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionExpressions.res 81:31 posCursor:[81:31] posNoWhite:[81:30] Found expr:[81:11->81:34] @@ -507,33 +602,19 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null, "insertText": "Some($0)", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionExpressions.res 84:31 posCursor:[84:31] posNoWhite:[84:30] Found expr:[84:11->84:40] @@ -544,33 +625,19 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingArray]($0) ContextPath Value[fnTakingArray] Path fnTakingArray -[{ - "label": "None", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null, "insertText": "Some($0)", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionExpressions.res 89:38 posCursor:[89:38] posNoWhite:[89:37] Found expr:[89:11->89:41] @@ -581,13 +648,7 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "someBoolVar", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 12, "label": "someBoolVar", "tags": [] } ] Complete src/CompletionExpressions.res 96:43 posCursor:[96:43] posNoWhite:[96:42] Found expr:[96:11->96:46] @@ -598,16 +659,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingOtherRecord]($0) ContextPath Value[fnTakingOtherRecord] Path fnTakingOtherRecord -[{ - "label": "\"\"", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": null, - "sortText": "A", "insertText": "\"$0\"", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "\"\"", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 108:57 posCursor:[108:57] posNoWhite:[108:56] Found expr:[108:11->108:60] @@ -618,19 +680,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecordWithOptionalField]($0) ContextPath Value[fnTakingRecordWithOptionalField] Path fnTakingRecordWithOptionalField -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionExpressions.res 116:53 posCursor:[116:53] posNoWhite:[116:52] Found expr:[116:11->116:56] @@ -641,53 +694,78 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecordWithOptVariant]($0) ContextPath Value[fnTakingRecordWithOptVariant] Path fnTakingRecordWithOptVariant -[{ - "label": "Some(someVariant)", - "kind": 12, - "tags": [], +[ + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Some(someVariant)$0", - "insertTextFormat": 2 - }, { - "label": "Some(_)", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Some(someVariant)", + "tags": [] + }, + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Some($0)", - "insertTextFormat": 2 - }, { - "label": "None", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Some(_)", + "tags": [] + }, + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```"} - }, { - "label": "Some(One)", - "kind": 4, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, + "kind": 12, + "label": "None", + "tags": [] + }, + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Some(One)", - "insertTextFormat": 2 - }, { - "label": "Some(Two)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Some(One)", + "tags": [] + }, + { "detail": "Two", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Some(Two)", - "insertTextFormat": 2 - }, { - "label": "Some(Three(_, _))", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Some(Two)", + "tags": [] + }, + { "detail": "Three(int, string)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(int, string)\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(int, string)\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Some(Three(${1:_}, ${2:_}))", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Some(Three(_, _))", + "tags": [] + } +] Complete src/CompletionExpressions.res 126:49 posCursor:[126:49] posNoWhite:[126:48] Found expr:[126:11->126:51] @@ -698,16 +776,21 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingInlineRecord]($0) ContextPath Value[fnTakingInlineRecord] Path fnTakingInlineRecord -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "{someBoolField: bool, otherField: option, nestedRecord: otherRecord}", - "documentation": {"kind": "markdown", "value": "```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 129:50 posCursor:[129:50] posNoWhite:[129:49] Found expr:[129:11->129:53] @@ -718,25 +801,38 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingInlineRecord]($0) ContextPath Value[fnTakingInlineRecord] Path fnTakingInlineRecord -[{ - "label": "someBoolField", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeBoolField: bool\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```"} - }, { - "label": "otherField", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeBoolField: bool\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "someBoolField", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\notherField: option\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```"} - }, { - "label": "nestedRecord", + "documentation": { + "kind": "markdown", + "value": "```rescript\notherField: option\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "otherField", + "tags": [] + }, + { "detail": "otherRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nnestedRecord: otherRecord\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnestedRecord: otherRecord\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```" + }, + "kind": 5, + "label": "nestedRecord", + "tags": [] + } +] Complete src/CompletionExpressions.res 132:51 posCursor:[132:51] posNoWhite:[132:50] Found expr:[132:11->132:54] @@ -747,13 +843,18 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingInlineRecord]($0) ContextPath Value[fnTakingInlineRecord] Path fnTakingInlineRecord -[{ - "label": "someBoolField", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeBoolField: bool\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeBoolField: bool\n```\n\n```rescript\n{someBoolField: bool, otherField: option, nestedRecord: otherRecord}\n```" + }, + "kind": 5, + "label": "someBoolField", + "tags": [] + } +] Complete src/CompletionExpressions.res 135:63 posCursor:[135:63] posNoWhite:[135:62] Found expr:[135:11->135:67] @@ -764,16 +865,21 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingInlineRecord]($0) ContextPath Value[fnTakingInlineRecord] Path fnTakingInlineRecord -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "otherRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 138:65 posCursor:[138:65] posNoWhite:[138:64] Found expr:[138:11->138:70] @@ -784,19 +890,28 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingInlineRecord]($0) ContextPath Value[fnTakingInlineRecord] Path fnTakingInlineRecord -[{ - "label": "someField", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeField: int\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"} - }, { - "label": "otherField", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeField: int\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, "kind": 5, - "tags": [], + "label": "someField", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\notherField: string\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\notherField: string\n```\n\n```rescript\ntype otherRecord = {someField: int, otherField: string}\n```" + }, + "kind": 5, + "label": "otherField", + "tags": [] + } +] Complete src/CompletionExpressions.res 159:20 posCursor:[159:20] posNoWhite:[159:19] Found expr:[159:3->159:21] @@ -807,16 +922,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($0) ContextPath Value[fnTakingCallback] Path fnTakingCallback -[{ - "label": "() => {}", - "kind": 12, - "tags": [], +[ + { "detail": "unit => unit", - "documentation": null, - "sortText": "A", "insertText": "() => ${0:()}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "() => {}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 162:21 posCursor:[162:21] posNoWhite:[162:20] Found expr:[162:3->162:22] @@ -827,13 +943,18 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($0) ContextPath Value[fnTakingCallback] Path fnTakingCallback -[{ - "label": "assertEqual", - "kind": 12, - "tags": [], +[ + { "detail": "('a, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`assertEqual(a, b)` check if `a` is equal `b`. If not throw a panic exception\n\n## Examples\n\n```rescript\nlist{1, 2}->List.tailExn == list{2}\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`assertEqual(a, b)` check if `a` is equal `b`. If not throw a panic exception\n\n## Examples\n\n```rescript\nlist{1, 2}->List.tailExn == list{2}\n```\n" + }, + "kind": 12, + "label": "assertEqual", + "tags": [] + } +] Complete src/CompletionExpressions.res 165:22 posCursor:[165:22] posNoWhite:[165:21] Found expr:[165:3->165:24] @@ -844,16 +965,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($1) ContextPath Value[fnTakingCallback] Path fnTakingCallback -[{ - "label": "v => v", - "kind": 12, - "tags": [], +[ + { "detail": "bool => unit", - "documentation": null, - "sortText": "A", "insertText": "${1:v} => ${0:v}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "v => v", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 168:25 posCursor:[168:25] posNoWhite:[168:24] Found expr:[168:3->168:27] @@ -864,16 +986,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($2) ContextPath Value[fnTakingCallback] Path fnTakingCallback -[{ - "label": "event => event", - "kind": 12, - "tags": [], +[ + { "detail": "ReactEvent.Mouse.t => unit", - "documentation": null, - "sortText": "A", "insertText": "${1:event} => ${0:event}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "event => event", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 171:29 posCursor:[171:29] posNoWhite:[171:27] Found expr:[171:3->171:30] @@ -884,16 +1007,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($3) ContextPath Value[fnTakingCallback] Path fnTakingCallback -[{ - "label": "(~on, ~off=?, variant) => {}", - "kind": 12, - "tags": [], +[ + { "detail": "(~on: bool, ~off: bool=?, variant) => int", - "documentation": null, - "sortText": "A", "insertText": "(~on, ~off=?, ${1:variant}) => {${0:()}}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(~on, ~off=?, variant) => {}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 174:32 posCursor:[174:32] posNoWhite:[174:30] Found expr:[174:3->174:33] @@ -904,16 +1028,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($4) ContextPath Value[fnTakingCallback] Path fnTakingCallback -[{ - "label": "(v1, v2, v3) => {}", - "kind": 12, - "tags": [], +[ + { "detail": "(bool, option, bool) => unit", - "documentation": null, - "sortText": "A", "insertText": "(${1:v1}, ${2:v2}, ${3:v3}) => {${0:()}}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(v1, v2, v3) => {}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 177:34 posCursor:[177:34] posNoWhite:[177:33] Found expr:[177:3->177:36] @@ -924,16 +1049,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingCallback]($5) ContextPath Value[fnTakingCallback] Path fnTakingCallback -[{ - "label": "(~on=?, ~off=?, ()) => {}", - "kind": 12, - "tags": [], +[ + { "detail": "(~on: bool=?, ~off: bool=?, unit) => int", - "documentation": null, - "sortText": "A", "insertText": "(~on=?, ~off=?, ()) => {${0:()}}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(~on=?, ~off=?, ()) => {}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 185:15 posCursor:[185:15] posNoWhite:[185:14] Found expr:[181:2->185:16] @@ -948,55 +1074,52 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[Console, log]($0) ContextPath Value[Console, log] Path Console.log -[{ - "label": "second2", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }, { - "label": "second", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "someBoolVar", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "s", +[ + { "detail": "int", "kind": 12, "label": "second2", "tags": [] }, + { "detail": "bool", "kind": 12, "label": "second", "tags": [] }, + { "detail": "bool", "kind": 12, "label": "someBoolVar", "tags": [] }, + { "detail": "bool", "kind": 12, "label": "s", "tags": [] }, + { + "detail": "(unit => unit, float) => timeoutId", + "documentation": { + "kind": "markdown", + "value": "\n`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { "label": "setTimeoutFloat", + "tags": [] + }, + { + "detail": "(unit => unit, float) => intervalId", + "documentation": { + "kind": "markdown", + "value": "\n`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "(unit => unit, float) => timeoutId", - "documentation": {"kind": "markdown", "value": "\n`setTimeoutFloat(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nThe same as `setTimeout`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeoutFloat(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200.)\n```\n"} - }, { "label": "setIntervalFloat", + "tags": [] + }, + { + "detail": "(unit => unit, int) => intervalId", + "documentation": { + "kind": "markdown", + "value": "\n`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "(unit => unit, float) => intervalId", - "documentation": {"kind": "markdown", "value": "\n`setIntervalFloat(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nThe same as `setInterval`, but allows you to pass a `float` instead of an `int` for the duration.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 2 seconds (200 milliseconds).\nlet intervalId = setIntervalFloat(() => {\n Console.log(\"This prints every 200 ms\")\n}, 200.)\n\n// Stop the interval after 500 ms\nlet timeoutId = setTimeoutFloat(() => {\n clearInterval(intervalId)\n}, 500.0)\n```\n"} - }, { "label": "setInterval", + "tags": [] + }, + { + "detail": "(unit => unit, int) => timeoutId", + "documentation": { + "kind": "markdown", + "value": "\n`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```\n" + }, "kind": 12, - "tags": [], - "detail": "(unit => unit, int) => intervalId", - "documentation": {"kind": "markdown", "value": "\n`setInterval(callback, intervalInMilliseconds)` starts an interval that will execute `callback` every `durationInMilliseconds` milliseconds.\n\nSee [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console ever 200 ms (200 milliseconds).\nlet intervalId = setInterval(() => {\n Console.log(\"This prints every 200 ms.\")\n}, 200)\n\nlet timeoutId = setTimeout(() => {\n clearInterval(intervalId)\n}, 500)\n```\n"} - }, { "label": "setTimeout", - "kind": 12, - "tags": [], - "detail": "(unit => unit, int) => timeoutId", - "documentation": {"kind": "markdown", "value": "\n`setTimeout(callback, durationInMilliseconds)` starts a timer that will execute `callback` after `durationInMilliseconds`.\n\nSee [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) on MDN.\n\n## Examples\n\n```rescript\n// Log to the console after 200 milliseconds.\nlet timeoutId = setTimeout(() => {\n Console.log(\"This prints in 200 ms.\")\n}, 200)\n```\n"} - }] + "tags": [] + } +] Complete src/CompletionExpressions.res 196:14 posCursor:[196:14] posNoWhite:[196:13] Found expr:[196:3->196:14] @@ -1013,13 +1136,18 @@ Path fff CPPipe pathFromEnv: found:true Path CompletionExpressions.someOpt Path someOpt -[{ - "label": "someOptField", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeOptField?: bool\n```\n\n```rescript\ntype recordWithOptionalField = {\n someField: int,\n someOptField?: bool,\n}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeOptField?: bool\n```\n\n```rescript\ntype recordWithOptionalField = {\n someField: int,\n someOptField?: bool,\n}\n```" + }, + "kind": 5, + "label": "someOptField", + "tags": [] + } +] Complete src/CompletionExpressions.res 205:11 posCursor:[205:11] posNoWhite:[205:10] Found expr:[205:3->205:12] @@ -1030,16 +1158,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[takesCb]($0) ContextPath Value[takesCb] Path takesCb -[{ - "label": "someTyp => someTyp", - "kind": 12, - "tags": [], +[ + { "detail": "someTyp => 'a", - "documentation": null, - "sortText": "A", "insertText": "${1:someTyp} => ${0:someTyp}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "someTyp => someTyp", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 216:12 posCursor:[216:12] posNoWhite:[216:11] Found expr:[216:3->216:13] @@ -1050,16 +1179,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[takesCb2]($0) ContextPath Value[takesCb2] Path takesCb2 -[{ - "label": "environment => environment", - "kind": 12, - "tags": [], +[ + { "detail": "Environment.t => 'a", - "documentation": null, - "sortText": "A", "insertText": "${1:environment} => ${0:environment}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "environment => environment", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 225:12 posCursor:[225:12] posNoWhite:[225:11] Found expr:[225:3->225:13] @@ -1070,16 +1200,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[takesCb3]($0) ContextPath Value[takesCb3] Path takesCb3 -[{ - "label": "apiCallResult => apiCallResult", - "kind": 12, - "tags": [], +[ + { "detail": "apiCallResult => 'a", - "documentation": null, - "sortText": "A", "insertText": "${1:apiCallResult} => ${0:apiCallResult}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "apiCallResult => apiCallResult", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 232:12 posCursor:[232:12] posNoWhite:[232:11] Found expr:[232:3->232:13] @@ -1090,16 +1221,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[takesCb4]($0) ContextPath Value[takesCb4] Path takesCb4 -[{ - "label": "apiCallResult => apiCallResult", - "kind": 12, - "tags": [], +[ + { "detail": "option => 'a", - "documentation": null, - "sortText": "A", "insertText": "${1:apiCallResult} => ${0:apiCallResult}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "apiCallResult => apiCallResult", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 239:12 posCursor:[239:12] posNoWhite:[239:11] Found expr:[239:3->239:13] @@ -1110,16 +1242,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[takesCb5]($0) ContextPath Value[takesCb5] Path takesCb5 -[{ - "label": "apiCallResults => apiCallResults", - "kind": 12, - "tags": [], +[ + { "detail": "array> => 'a", - "documentation": null, - "sortText": "A", "insertText": "${1:apiCallResults} => ${0:apiCallResults}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "apiCallResults => apiCallResults", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 250:30 posCursor:[250:30] posNoWhite:[250:29] Found expr:[250:3->250:31] @@ -1130,16 +1263,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[commitLocalUpdate](~updater) ContextPath Value[commitLocalUpdate] Path commitLocalUpdate -[{ - "label": "recordSourceSelectorProxy => recordSourceSelectorProxy", - "kind": 12, - "tags": [], +[ + { "detail": "RecordSourceSelectorProxy.t => unit", - "documentation": null, - "sortText": "A", "insertText": "${1:recordSourceSelectorProxy} => ${0:recordSourceSelectorProxy}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "recordSourceSelectorProxy => recordSourceSelectorProxy", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 257:25 posCursor:[257:25] posNoWhite:[257:24] Found expr:[257:3->257:26] @@ -1150,16 +1284,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingAsyncCallback]($0) ContextPath Value[fnTakingAsyncCallback] Path fnTakingAsyncCallback -[{ - "label": "async () => {}", - "kind": 12, - "tags": [], +[ + { "detail": "unit => promise", - "documentation": null, - "sortText": "A", "insertText": "async () => ${0:()}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "async () => {}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 262:23 posCursor:[262:23] posNoWhite:[262:22] Found expr:[262:3->262:24] @@ -1169,16 +1304,17 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[Belt, Array, map]($1) ContextPath Value[Belt, Array, map] Path Belt.Array.map -[{ - "label": "v => v", - "kind": 12, - "tags": [], +[ + { "detail": "'a => 'b", - "documentation": null, - "sortText": "A", "insertText": "${1:v} => ${0:v}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "v => v", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionExpressions.res 271:15 posCursor:[271:15] posNoWhite:[271:14] Found expr:[271:3->271:16] @@ -1189,15 +1325,20 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[takesExotic]($0) ContextPath Value[takesExotic] Path takesExotic -[{ - "label": "#\"some exotic\"", - "kind": 4, - "tags": [], +[ + { "detail": "#\"some exotic\"", - "documentation": {"kind": "markdown", "value": "```rescript\n#\"some exotic\"\n```\n\n```rescript\n[#\"some exotic\"]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#\"some exotic\"\n```\n\n```rescript\n[#\"some exotic\"]\n```" + }, "insertText": "#\"some exotic\"", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#\"some exotic\"", + "tags": [] + } +] Complete src/CompletionExpressions.res 278:23 posCursor:[278:23] posNoWhite:[278:22] Found expr:[278:3->278:24] @@ -1208,31 +1349,44 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingPolyVariant]($0) ContextPath Value[fnTakingPolyVariant] Path fnTakingPolyVariant -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#one", - "insertTextFormat": 2 - }, { - "label": "#three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#one", + "tags": [] + }, + { "detail": "#three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }, { - "label": "#two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#three(_, _)", + "tags": [] + }, + { "detail": "#two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#two($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two(_)", + "tags": [] + } +] Complete src/CompletionExpressions.res 281:24 posCursor:[281:24] posNoWhite:[281:23] Found expr:[281:3->302:1] @@ -1243,31 +1397,44 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingPolyVariant]($0) ContextPath Value[fnTakingPolyVariant] Path fnTakingPolyVariant -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "one", - "insertTextFormat": 2 - }, { - "label": "#three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#one", + "tags": [] + }, + { "detail": "#three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }, { - "label": "#two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#three(_, _)", + "tags": [] + }, + { "detail": "#two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "two($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two(_)", + "tags": [] + } +] Complete src/CompletionExpressions.res 284:25 posCursor:[284:25] posNoWhite:[284:24] Found expr:[284:3->284:26] @@ -1278,15 +1445,20 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingPolyVariant]($0) ContextPath Value[fnTakingPolyVariant] Path fnTakingPolyVariant -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "one", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#one", + "tags": [] + } +] Complete src/CompletionExpressions.res 287:24 posCursor:[287:24] posNoWhite:[287:23] Found expr:[287:3->287:25] @@ -1297,15 +1469,20 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingPolyVariant]($0) ContextPath Value[fnTakingPolyVariant] Path fnTakingPolyVariant -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#one", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#one", + "tags": [] + } +] Complete src/CompletionExpressions.res 306:41 XXX Not found! @@ -1314,15 +1491,16 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[withIntLocal] Path withIntLocal -[{ - "label": "SuperInt.make()", - "kind": 12, - "tags": [], +[ + { "detail": "int => t", - "documentation": null, "insertText": "SuperInt.make($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "SuperInt.make()", + "tags": [] + } +] Complete src/CompletionExpressions.res 309:36 posCursor:[309:36] posNoWhite:[309:35] Found expr:[309:3->309:37] @@ -1333,15 +1511,16 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[CompletionSupport, makeTestHidden]($0) ContextPath Value[CompletionSupport, makeTestHidden] Path CompletionSupport.makeTestHidden -[{ - "label": "CompletionSupport.TestHidden.make()", - "kind": 12, - "tags": [], +[ + { "detail": "int => t", - "documentation": null, "insertText": "CompletionSupport.TestHidden.make($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "CompletionSupport.TestHidden.make()", + "tags": [] + } +] Complete src/CompletionExpressions.res 313:36 posCursor:[313:36] posNoWhite:[313:35] Found expr:[313:3->313:37] @@ -1353,15 +1532,16 @@ Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[CompletionSupport, makeTestHidden]($0) ContextPath Value[CompletionSupport, makeTestHidden] Path CompletionSupport.makeTestHidden -[{ - "label": "TestHidden.make()", - "kind": 12, - "tags": [], +[ + { "detail": "int => t", - "documentation": null, "insertText": "TestHidden.make($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "TestHidden.make()", + "tags": [] + } +] Complete src/CompletionExpressions.res 321:11 posCursor:[321:11] posNoWhite:[321:10] Found expr:[321:3->321:12] @@ -1373,31 +1553,32 @@ Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[mkStuff]($0) ContextPath Value[mkStuff] Path mkStuff -[{ - "label": "//g", - "kind": 4, - "tags": [], +[ + { "detail": "Regular expression", - "documentation": null, "insertText": "/$0/g", - "insertTextFormat": 2 - }, { - "label": "RegExp.fromString()", - "kind": 12, - "tags": [], + "insertTextFormat": 2, + "kind": 4, + "label": "//g", + "tags": [] + }, + { "detail": "(string, ~flags: string=?) => t", - "documentation": null, "insertText": "RegExp.fromString($0)", - "insertTextFormat": 2 - }, { - "label": "RegExp.fromStringWithFlags()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "RegExp.fromString()", + "tags": [] + }, + { "detail": "(string, ~flags: string) => t", - "documentation": null, "insertText": "RegExp.fromStringWithFlags($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "RegExp.fromStringWithFlags()", + "tags": [] + } +] Complete src/CompletionExpressions.res 352:24 posCursor:[352:24] posNoWhite:[352:23] Found expr:[352:3->352:25] @@ -1409,31 +1590,32 @@ Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[tArgCompletionTestFn]($0) ContextPath Value[tArgCompletionTestFn] Path tArgCompletionTestFn -[{ - "label": "Money.fromInt()", - "kind": 12, - "tags": [], +[ + { "detail": "int => t", - "documentation": null, "insertText": "Money.fromInt($0)", - "insertTextFormat": 2 - }, { - "label": "Money.make()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Money.fromInt()", + "tags": [] + }, + { "detail": "unit => t", - "documentation": null, "insertText": "Money.make($0)", - "insertTextFormat": 2 - }, { - "label": "Money.zero", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Money.make()", + "tags": [] + }, + { "detail": "t", - "documentation": null, "insertText": "Money.zero", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Money.zero", + "tags": [] + } +] Complete src/CompletionExpressions.res 357:37 posCursor:[357:37] posNoWhite:[357:36] Found expr:[357:3->357:38] @@ -1445,31 +1627,32 @@ Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[labeledTArgCompletionTestFn](~tVal) ContextPath Value[labeledTArgCompletionTestFn] Path labeledTArgCompletionTestFn -[{ - "label": "Money.fromInt()", - "kind": 12, - "tags": [], +[ + { "detail": "int => t", - "documentation": null, "insertText": "Money.fromInt($0)", - "insertTextFormat": 2 - }, { - "label": "Money.make()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Money.fromInt()", + "tags": [] + }, + { "detail": "unit => t", - "documentation": null, "insertText": "Money.make($0)", - "insertTextFormat": 2 - }, { - "label": "Money.zero", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Money.make()", + "tags": [] + }, + { "detail": "t", - "documentation": null, "insertText": "Money.zero", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Money.zero", + "tags": [] + } +] Complete src/CompletionExpressions.res 362:18 posCursor:[362:18] posNoWhite:[362:17] Found expr:[362:3->362:32] @@ -1488,13 +1671,18 @@ Path someTyp CPPipe pathFromEnv: found:true Path CompletionExpressions. Path -[{ - "label": "test", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\ntest: bool\n```\n\n```rescript\ntype someTyp = {test: bool}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntest: bool\n```\n\n```rescript\ntype someTyp = {test: bool}\n```" + }, + "kind": 5, + "label": "test", + "tags": [] + } +] Complete src/CompletionExpressions.res 380:22 posCursor:[380:22] posNoWhite:[380:18] Found expr:[380:13->386:2] @@ -1506,13 +1694,18 @@ Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[hook]($0) ContextPath Value[hook] Path hook -[{ - "label": "operator", - "kind": 5, - "tags": [], +[ + { "detail": "[#\"and\" | #or]", - "documentation": {"kind": "markdown", "value": "```rescript\noperator?: [#\"and\" | #or]\n```\n\n```rescript\ntype config = {includeName: bool, operator: option<[#\"and\" | #or]>, showMore: bool}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\noperator?: [#\"and\" | #or]\n```\n\n```rescript\ntype config = {includeName: bool, operator: option<[#\"and\" | #or]>, showMore: bool}\n```" + }, + "kind": 5, + "label": "operator", + "tags": [] + } +] Complete src/CompletionExpressions.res 382:8 posCursor:[382:8] posNoWhite:[382:7] Found expr:[380:13->386:2] @@ -1524,13 +1717,18 @@ Resolved opens 2 Stdlib CompletionSupport ContextPath CArgument Value[hook]($0) ContextPath Value[hook] Path hook -[{ - "label": "operator", - "kind": 5, - "tags": [], +[ + { "detail": "[#\"and\" | #or]", - "documentation": {"kind": "markdown", "value": "```rescript\noperator?: [#\"and\" | #or]\n```\n\n```rescript\ntype config = {includeName: bool, operator: option<[#\"and\" | #or]>, showMore: bool}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\noperator?: [#\"and\" | #or]\n```\n\n```rescript\ntype config = {includeName: bool, operator: option<[#\"and\" | #or]>, showMore: bool}\n```" + }, + "kind": 5, + "label": "operator", + "tags": [] + } +] Complete src/CompletionExpressions.res 388:18 posCursor:[388:18] posNoWhite:[388:17] Found expr:[388:3->388:24] @@ -1549,11 +1747,16 @@ Path someTyp CPPipe pathFromEnv: found:true Path CompletionExpressions. Path -[{ - "label": "test", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\ntest: bool\n```\n\n```rescript\ntype someTyp = {test: bool}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntest: bool\n```\n\n```rescript\ntype someTyp = {test: bool}\n```" + }, + "kind": 5, + "label": "test", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt b/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt index 8cfb06f7ea8..738afd8d01f 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFromModule.res.txt @@ -13,25 +13,35 @@ Path n CPPipe pathFromEnv:SomeModule found:true Path SomeModule. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }, { - "label": "->SomeModule.getName", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 10 }, + "start": { "character": 4, "line": 10 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getName", "insertText": "->SomeModule.getName", - "additionalTextEdits": [{ - "range": {"start": {"line": 10, "character": 4}, "end": {"line": 10, "character": 5}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->SomeModule.getName", + "sortText": "getName", + "tags": [] + } +] Complete src/CompletionFromModule.res 30:6 posCursor:[30:6] posNoWhite:[30:5] Found expr:[30:3->30:6] @@ -49,61 +59,86 @@ CPPipe pathFromEnv:SomeOtherModule found:true Path SomeOtherModule. Path CompletionFromModule.SomeOtherModule. Path -[{ - "label": "nname", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```"} - }, { - "label": "->SomeOtherModule.getNName", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```" + }, + "kind": 5, + "label": "nname", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 30 }, + "start": { "character": 5, "line": 30 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 30 }, + "start": { "character": 5, "line": 30 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 30 }, + "start": { "character": 5, "line": 30 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 30 }, + "start": { "character": 5, "line": 30 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + } +] Complete src/CompletionFromModule.res 33:32 XXX Not found! @@ -112,13 +147,14 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[SomeOthe] Path SomeOthe -[{ - "label": "SomeOtherModule", - "kind": 9, - "tags": [], +[ + { "detail": "module SomeOtherModule", - "documentation": null - }] + "kind": 9, + "label": "SomeOtherModule", + "tags": [] + } +] Complete src/CompletionFromModule.res 38:8 posCursor:[38:8] posNoWhite:[38:7] Found expr:[38:3->0:-1] @@ -132,19 +168,20 @@ CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. Path -[{ - "label": "SomeOtherModule.getNName", - "kind": 12, - "tags": [], +[ + { "detail": "t => string", - "documentation": null - }, { - "label": "SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "SomeOtherModule.getNName", + "tags": [] + }, + { "detail": "typeOutsideModule => string", - "documentation": null - }] + "kind": 12, + "label": "SomeOtherModule.getNName2", + "tags": [] + } +] Complete src/CompletionFromModule.res 42:8 posCursor:[42:8] posNoWhite:[42:7] Found expr:[42:3->0:-1] @@ -159,17 +196,13 @@ CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. Path -[{ - "label": "getNName", +[ + { "detail": "t => string", "kind": 12, "label": "getNName", "tags": [] }, + { + "detail": "typeOutsideModule => string", "kind": 12, - "tags": [], - "detail": "t => string", - "documentation": null - }, { "label": "getNName2", - "kind": 12, - "tags": [], - "detail": "typeOutsideModule => string", - "documentation": null - }] + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt b/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt index eb647d43c57..790684f6236 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFromModule2.res.txt @@ -13,25 +13,35 @@ Path CompletionFromModule.n CPPipe pathFromEnv:SomeModule found:true Path CompletionFromModule.SomeModule. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }, { - "label": "->CompletionFromModule.SomeModule.getName", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 26, "line": 2 }, + "start": { "character": 25, "line": 2 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getName", "insertText": "->CompletionFromModule.SomeModule.getName", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 25}, "end": {"line": 2, "character": 26}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->CompletionFromModule.SomeModule.getName", + "sortText": "getName", + "tags": [] + } +] Complete src/CompletionFromModule2.res 5:27 posCursor:[5:27] posNoWhite:[5:26] Found expr:[5:3->5:27] @@ -49,61 +59,86 @@ CPPipe pathFromEnv:SomeOtherModule found:true Path CompletionFromModule.SomeOtherModule. Path CompletionFromModule.SomeOtherModule. Path -[{ - "label": "nname", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```"} - }, { - "label": "->CompletionFromModule.SomeOtherModule.getNName", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```" + }, + "kind": 5, + "label": "nname", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 27, "line": 5 }, + "start": { "character": 26, "line": 5 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->CompletionFromModule.SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 26}, "end": {"line": 5, "character": 27}}, - "newText": "" - }] - }, { - "label": "->CompletionFromModule.SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->CompletionFromModule.SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 27, "line": 5 }, + "start": { "character": 26, "line": 5 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->CompletionFromModule.SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 26}, "end": {"line": 5, "character": 27}}, - "newText": "" - }] - }, { - "label": "->CompletionFromModule.SomeOtherModule.getNName", "kind": 12, - "tags": [], + "label": "->CompletionFromModule.SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 27, "line": 5 }, + "start": { "character": 26, "line": 5 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->CompletionFromModule.SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 26}, "end": {"line": 5, "character": 27}}, - "newText": "" - }] - }, { - "label": "->CompletionFromModule.SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->CompletionFromModule.SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 27, "line": 5 }, + "start": { "character": 26, "line": 5 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->CompletionFromModule.SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 26}, "end": {"line": 5, "character": 27}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->CompletionFromModule.SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + } +] Complete src/CompletionFromModule2.res 8:29 posCursor:[8:29] posNoWhite:[8:28] Found expr:[8:3->0:-1] @@ -117,19 +152,20 @@ CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. Path -[{ - "label": "CompletionFromModule.SomeOtherModule.getNName", - "kind": 12, - "tags": [], +[ + { "detail": "t => string", - "documentation": null - }, { - "label": "CompletionFromModule.SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "CompletionFromModule.SomeOtherModule.getNName", + "tags": [] + }, + { "detail": "typeOutsideModule => string", - "documentation": null - }] + "kind": 12, + "label": "CompletionFromModule.SomeOtherModule.getNName2", + "tags": [] + } +] Complete src/CompletionFromModule2.res 12:29 posCursor:[12:29] posNoWhite:[12:28] Found expr:[12:3->0:-1] @@ -144,17 +180,13 @@ CPPipe pathFromEnv: found:true Path CompletionFromModule. Path CompletionFromModule.SomeOtherModule. Path -[{ - "label": "getNName", +[ + { "detail": "t => string", "kind": 12, "label": "getNName", "tags": [] }, + { + "detail": "typeOutsideModule => string", "kind": 12, - "tags": [], - "detail": "t => string", - "documentation": null - }, { "label": "getNName2", - "kind": 12, - "tags": [], - "detail": "typeOutsideModule => string", - "documentation": null - }] + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt b/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt index 48c89535fbe..e5a13c3b6dc 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionFunctionArguments.res.txt @@ -7,19 +7,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFn](~isOn) ContextPath Value[someFn] Path someFn -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionFunctionArguments.res 13:25 posCursor:[13:25] posNoWhite:[13:24] Found expr:[13:11->13:26] @@ -30,26 +21,26 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFn](~isOn) ContextPath Value[someFn] Path someFn -[{ - "label": "true", - "kind": 4, - "tags": [], +[ + { "detail": "bool", - "documentation": null, - "sortText": "A true" - }, { - "label": "tLocalVar", + "kind": 4, + "label": "true", + "sortText": "A true", + "tags": [] + }, + { "detail": "bool", "kind": 12, "label": "tLocalVar", "tags": [] }, + { + "detail": "'a => Type.t", + "documentation": { + "kind": "markdown", + "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n" + }, "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { "label": "typeof", - "kind": 12, - "tags": [], - "detail": "'a => Type.t", - "documentation": {"kind": "markdown", "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n"} - }] + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 16:25 posCursor:[16:25] posNoWhite:[16:24] Found expr:[16:11->16:26] @@ -60,19 +51,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFn](~isOff) ContextPath Value[someFn] Path someFn -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionFunctionArguments.res 21:27 posCursor:[21:27] posNoWhite:[21:26] Found expr:[19:8->25:1] @@ -87,19 +69,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFn](~isOn) ContextPath Value[someFn] Path someFn -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionFunctionArguments.res 34:24 posCursor:[34:24] posNoWhite:[34:23] Found expr:[34:11->34:25] @@ -110,13 +83,7 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someOtherFn]($0) ContextPath Value[someOtherFn] Path someOtherFn -[{ - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "false", "tags": [] } ] Complete src/CompletionFunctionArguments.res 51:39 posCursor:[51:39] posNoWhite:[51:38] Found expr:[51:11->51:40] @@ -127,31 +94,44 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFnTakingVariant](~config) ContextPath Value[someFnTakingVariant] Path someFnTakingVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Two", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two", + "tags": [] + }, + { "detail": "Three(int, string)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(int, string)\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(int, string)\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 54:40 posCursor:[54:40] posNoWhite:[54:39] Found expr:[54:11->54:41] @@ -162,60 +142,50 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFnTakingVariant](~config) ContextPath Value[someFnTakingVariant] Path someFnTakingVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, - "sortText": "A One", + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "OIncludeMeInCompletions", - "kind": 9, - "tags": [], + "insertTextFormat": 2, + "kind": 4, + "label": "One", + "sortText": "A One", + "tags": [] + }, + { "detail": "module OIncludeMeInCompletions", - "documentation": null - }, { - "label": "Option", - "kind": 9, - "tags": [], - "detail": "module Option", - "documentation": null - }, { - "label": "Ordering", - "kind": 9, - "tags": [], - "detail": "module Ordering", - "documentation": null - }, { - "label": "Object", "kind": 9, - "tags": [], - "detail": "module Object", - "documentation": null - }, { - "label": "Obj", - "kind": 9, - "tags": [], - "detail": "module Obj", - "documentation": null, + "label": "OIncludeMeInCompletions", + "tags": [] + }, + { "detail": "module Option", "kind": 9, "label": "Option", "tags": [] }, + { "detail": "module Ordering", "kind": 9, "label": "Ordering", "tags": [] }, + { "detail": "module Object", "kind": 9, "label": "Object", "tags": [] }, + { "data": { "modulePath": "Obj", "filePath": "src/CompletionFunctionArguments.res" - } - }, { - "label": "Objects", + }, + "detail": "module Obj", "kind": 9, - "tags": [], - "detail": "module Objects", - "documentation": null, + "label": "Obj", + "tags": [] + }, + { "data": { "modulePath": "Objects", "filePath": "src/CompletionFunctionArguments.res" - } - }] + }, + "detail": "module Objects", + "kind": 9, + "label": "Objects", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 57:33 posCursor:[57:33] posNoWhite:[57:32] Found expr:[57:11->57:34] @@ -226,15 +196,20 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFnTakingVariant]($0) ContextPath Value[someFnTakingVariant] Path someFnTakingVariant -[{ - "label": "Some(_)", - "kind": 12, - "tags": [], +[ + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "Some($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 60:44 posCursor:[60:44] posNoWhite:[60:43] Found expr:[60:11->60:45] @@ -245,60 +220,50 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someFnTakingVariant](~configOpt2) ContextPath Value[someFnTakingVariant] Path someFnTakingVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```"}, - "sortText": "A One", + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two | Three(int, string)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "OIncludeMeInCompletions", - "kind": 9, - "tags": [], + "insertTextFormat": 2, + "kind": 4, + "label": "One", + "sortText": "A One", + "tags": [] + }, + { "detail": "module OIncludeMeInCompletions", - "documentation": null - }, { - "label": "Option", - "kind": 9, - "tags": [], - "detail": "module Option", - "documentation": null - }, { - "label": "Ordering", "kind": 9, - "tags": [], - "detail": "module Ordering", - "documentation": null - }, { - "label": "Object", - "kind": 9, - "tags": [], - "detail": "module Object", - "documentation": null - }, { - "label": "Obj", - "kind": 9, - "tags": [], - "detail": "module Obj", - "documentation": null, + "label": "OIncludeMeInCompletions", + "tags": [] + }, + { "detail": "module Option", "kind": 9, "label": "Option", "tags": [] }, + { "detail": "module Ordering", "kind": 9, "label": "Ordering", "tags": [] }, + { "detail": "module Object", "kind": 9, "label": "Object", "tags": [] }, + { "data": { "modulePath": "Obj", "filePath": "src/CompletionFunctionArguments.res" - } - }, { - "label": "Objects", + }, + "detail": "module Obj", "kind": 9, - "tags": [], - "detail": "module Objects", - "documentation": null, + "label": "Obj", + "tags": [] + }, + { "data": { "modulePath": "Objects", "filePath": "src/CompletionFunctionArguments.res" - } - }] + }, + "detail": "module Objects", + "kind": 9, + "label": "Objects", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 63:23 posCursor:[63:23] posNoWhite:[63:22] Found expr:[63:11->63:24] @@ -309,19 +274,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someOtherFn]($0) ContextPath Value[someOtherFn] Path someOtherFn -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionFunctionArguments.res 66:28 posCursor:[66:28] posNoWhite:[66:27] Found expr:[66:11->66:30] @@ -332,19 +288,10 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someOtherFn]($2) ContextPath Value[someOtherFn] Path someOtherFn -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionFunctionArguments.res 69:30 posCursor:[69:30] posNoWhite:[69:29] Found expr:[69:11->69:31] @@ -354,26 +301,26 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[someOtherFn]($2) ContextPath Value[someOtherFn] Path someOtherFn -[{ - "label": "true", - "kind": 4, - "tags": [], +[ + { "detail": "bool", - "documentation": null, - "sortText": "A true" - }, { - "label": "tLocalVar", + "kind": 4, + "label": "true", + "sortText": "A true", + "tags": [] + }, + { "detail": "bool", "kind": 12, "label": "tLocalVar", "tags": [] }, + { + "detail": "'a => Type.t", + "documentation": { + "kind": "markdown", + "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n" + }, "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { "label": "typeof", - "kind": 12, - "tags": [], - "detail": "'a => Type.t", - "documentation": {"kind": "markdown", "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n"} - }] + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 76:25 posCursor:[76:25] posNoWhite:[76:24] Found expr:[76:11->76:26] @@ -384,15 +331,16 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingTuple]($0) ContextPath Value[fnTakingTuple] Path fnTakingTuple -[{ - "label": "(_, _, _)", - "kind": 12, - "tags": [], +[ + { "detail": "(int, int, float)", - "documentation": null, "insertText": "(${1:_}, ${2:_}, ${3:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(_, _, _)", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 89:27 posCursor:[89:27] posNoWhite:[89:26] Found expr:[89:11->89:29] @@ -403,25 +351,38 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[fnTakingRecord]($0) ContextPath Value[fnTakingRecord] Path fnTakingRecord -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option}\n```"} - }, { - "label": "offline", + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option}\n```" + }, "kind": 5, - "tags": [], + "label": "age", + "tags": [] + }, + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\noffline: bool\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option}\n```"} - }, { - "label": "online", + "documentation": { + "kind": "markdown", + "value": "```rescript\noffline: bool\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option}\n```" + }, "kind": 5, - "tags": [], + "label": "offline", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nonline: option\n```\n\n```rescript\ntype someRecord = {age: int, offline: bool, online: option}\n```" + }, + "kind": 5, + "label": "online", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 109:29 posCursor:[109:29] posNoWhite:[109:28] Found expr:[105:2->114:4] @@ -439,13 +400,14 @@ Path thisGetsBrokenLoc CPPipe pathFromEnv:JsxEvent.Mouse found:false Path JsxEvent.Mouse.a Path a -[{ - "label": "JsxEvent.Mouse.altKey", - "kind": 12, - "tags": [], +[ + { "detail": "t => bool", - "documentation": null - }] + "kind": 12, + "label": "JsxEvent.Mouse.altKey", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 111:27 posCursor:[111:27] posNoWhite:[111:26] Found expr:[105:2->114:4] @@ -463,13 +425,14 @@ Path reassignedWorks CPPipe pathFromEnv:JsxEvent.Mouse found:false Path JsxEvent.Mouse.a Path a -[{ - "label": "JsxEvent.Mouse.altKey", - "kind": 12, - "tags": [], +[ + { "detail": "t => bool", - "documentation": null - }] + "kind": 12, + "label": "JsxEvent.Mouse.altKey", + "tags": [] + } +] Complete src/CompletionFunctionArguments.res 121:57 posCursor:[121:57] posNoWhite:[121:56] Found expr:[121:3->121:73] @@ -485,11 +448,12 @@ Path fineModuleVal CPPipe pathFromEnv:FineModule found:true Path FineModule. Path -[{ - "label": "FineModule.setToFalse", - "kind": 12, - "tags": [], +[ + { "detail": "t => t", - "documentation": null - }] + "kind": 12, + "label": "FineModule.setToFalse", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt b/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt index 5d72fc9174d..881ae2ea386 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt @@ -11,67 +11,112 @@ Path x ContextPath int Path Stdlib.Int.t Path t -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toExponentialWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixedWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toExponentialWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }, { - "label": "Int.toPrecisionWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toFixedWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecisionWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecision", + "tags": [] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toFloat", + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toString", + "tags": [] + }, + { "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n"} - }, { - "label": "Int.toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toFloat", + "tags": [] + }, + { "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n"} - }, { - "label": "Int.toExponential", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toLocaleString", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixed", + "documentation": { + "kind": "markdown", + "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponential", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, + "kind": 12, + "label": "Int.toFixed", + "tags": [] + } +] Complete src/CompletionInferValues.res 18:30 posCursor:[18:30] posNoWhite:[18:29] Found expr:[18:28->18:30] @@ -94,19 +139,28 @@ Path getSomeRecord CPPipe pathFromEnv: found:true Path CompletionInferValues. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/CompletionInferValues.res 21:53 posCursor:[21:53] posNoWhite:[21:52] Found expr:[21:45->21:53] @@ -133,19 +187,28 @@ Path getSomeRecord CPPipe pathFromEnv: found:true Path CompletionInferValues. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/CompletionInferValues.res 24:63 posCursor:[24:63] posNoWhite:[24:62] Found expr:[24:3->24:64] @@ -175,19 +238,28 @@ Path someFnWithCallback CPPipe pathFromEnv: found:true Path CompletionInferValues. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/CompletionInferValues.res 27:90 posCursor:[27:90] posNoWhite:[27:89] Found expr:[27:39->27:91] @@ -221,19 +293,28 @@ Path someFnWithCallback CPPipe pathFromEnv: found:true Path CompletionInferValues. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/CompletionInferValues.res 30:36 posCursor:[30:36] posNoWhite:[30:35] Found expr:[30:3->30:39] @@ -253,13 +334,14 @@ Path reactEventFn CPPipe pathFromEnv:ReactEvent.Mouse found:false Path ReactEvent.Mouse.pr Path pr -[{ - "label": "ReactEvent.Mouse.preventDefault", - "kind": 12, - "tags": [], +[ + { "detail": "t => unit", - "documentation": null - }] + "kind": 12, + "label": "ReactEvent.Mouse.preventDefault", + "tags": [] + } +] Complete src/CompletionInferValues.res 41:50 posCursor:[41:50] posNoWhite:[41:49] Found expr:[41:11->41:56] @@ -279,13 +361,14 @@ Path JsxDOM.domProps CPPipe pathFromEnv:JsxEvent.Mouse found:false Path JsxEvent.Mouse.pr Path pr -[{ - "label": "JsxEvent.Mouse.preventDefault", - "kind": 12, - "tags": [], +[ + { "detail": "t => unit", - "documentation": null - }] + "kind": 12, + "label": "JsxEvent.Mouse.preventDefault", + "tags": [] + } +] Complete src/CompletionInferValues.res 44:50 posCursor:[44:50] posNoWhite:[44:49] Found expr:[44:11->44:56] @@ -304,13 +387,14 @@ Path Div.make CPPipe pathFromEnv:JsxEvent.Mouse found:false Path JsxEvent.Mouse.pr Path pr -[{ - "label": "JsxEvent.Mouse.preventDefault", - "kind": 12, - "tags": [], +[ + { "detail": "t => unit", - "documentation": null - }] + "kind": 12, + "label": "JsxEvent.Mouse.preventDefault", + "tags": [] + } +] Complete src/CompletionInferValues.res 47:87 posCursor:[47:87] posNoWhite:[47:86] Found expr:[47:11->47:93] @@ -329,67 +413,112 @@ ContextPath Value[JsxEvent, Mouse, button] Path JsxEvent.Mouse.button Path Stdlib.Int.t Path t -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toExponentialWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixedWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toExponentialWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }, { - "label": "Int.toPrecisionWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toFixedWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecisionWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecision", + "tags": [] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toFloat", + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toString", + "tags": [] + }, + { "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n"} - }, { - "label": "Int.toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toFloat", + "tags": [] + }, + { "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n"} - }, { - "label": "Int.toExponential", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toLocaleString", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixed", + "documentation": { + "kind": "markdown", + "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponential", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, + "kind": 12, + "label": "Int.toFixed", + "tags": [] + } +] Complete src/CompletionInferValues.res 50:103 posCursor:[50:103] posNoWhite:[50:102] Found expr:[50:11->50:109] @@ -426,19 +555,28 @@ Path String.split Path Stdlib.Array.ma Path ArrayUtils.ma Path ma -[{ - "label": "Array.map", - "kind": 12, - "tags": [], +[ + { "detail": "(array<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }, { - "label": "Array.mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "Array.map", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n" + }, + "kind": 12, + "label": "Array.mapWithIndex", + "tags": [] + } +] Complete src/CompletionInferValues.res 75:78 posCursor:[75:78] posNoWhite:[75:77] Found expr:[75:70->75:78] @@ -465,19 +603,28 @@ Path someRecordWithNestedStuff CPPipe pathFromEnv: found:true Path CompletionInferValues. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/CompletionInferValues.res 79:86 posCursor:[79:86] posNoWhite:[79:85] Found expr:[79:78->79:86] @@ -504,13 +651,18 @@ Path someRecordWithNestedStuff CPPipe pathFromEnv: found:true Path CompletionInferValues. Path -[{ - "label": "someRecord", - "kind": 5, - "tags": [], +[ + { "detail": "someRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeRecord: someRecord\n```\n\n```rescript\ntype someNestedRecord = {someRecord: someRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeRecord: someRecord\n```\n\n```rescript\ntype someNestedRecord = {someRecord: someRecord}\n```" + }, + "kind": 5, + "label": "someRecord", + "tags": [] + } +] Complete src/CompletionInferValues.res 83:103 posCursor:[83:103] posNoWhite:[83:102] Found expr:[83:92->83:103] @@ -537,19 +689,28 @@ Path someRecordWithNestedStuff CPPipe pathFromEnv: found:true Path CompletionInferValues. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/CompletionInferValues.res 87:81 posCursor:[87:81] posNoWhite:[87:80] Found expr:[87:69->87:81] @@ -566,19 +727,29 @@ ContextPath Type[someRecordWithNestedStuff] Path someRecordWithNestedStuff Path Stdlib.String.slic Path slic -[{ - "label": "String.slice", - "kind": 12, - "tags": [], +[ + { "detail": "(string, ~start: int, ~end: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n"} - }, { - "label": "String.sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n" + }, "kind": 12, - "tags": [1], + "label": "String.slice", + "tags": [] + }, + { + "deprecated": true, "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n" + }, + "kind": 12, + "label": "String.sliceToEnd", + "tags": [ 1 ] + } +] Complete src/CompletionInferValues.res 91:82 posCursor:[91:82] posNoWhite:[91:81] Found expr:[91:70->91:82] @@ -595,19 +766,29 @@ ContextPath Type[someRecordWithNestedStuff] Path someRecordWithNestedStuff Path Stdlib.Int.toS Path toS -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, + "kind": 12, + "label": "Int.toString", + "tags": [] + } +] Complete src/CompletionInferValues.res 95:109 posCursor:[95:109] posNoWhite:[95:108] Found expr:[95:97->95:109] @@ -627,19 +808,29 @@ ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.Int.toS Path toS -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, + "kind": 12, + "label": "Int.toString", + "tags": [] + } +] Complete src/CompletionInferValues.res 99:102 posCursor:[99:102] posNoWhite:[99:101] Found expr:[99:57->99:102] @@ -660,19 +851,29 @@ ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.Int.toS Path toS -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, + "kind": 12, + "label": "Int.toString", + "tags": [] + } +] Complete src/CompletionInferValues.res 103:88 posCursor:[103:88] posNoWhite:[103:87] Found expr:[103:79->103:88] @@ -689,19 +890,29 @@ ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.String.slic Path slic -[{ - "label": "String.slice", - "kind": 12, - "tags": [], +[ + { "detail": "(string, ~start: int, ~end: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n"} - }, { - "label": "String.sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n" + }, "kind": 12, - "tags": [1], + "label": "String.slice", + "tags": [] + }, + { + "deprecated": true, "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n" + }, + "kind": 12, + "label": "String.sliceToEnd", + "tags": [ 1 ] + } +] Complete src/CompletionInferValues.res 107:89 posCursor:[107:89] posNoWhite:[107:88] Found expr:[107:80->107:89] @@ -718,19 +929,29 @@ ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.String.slic Path slic -[{ - "label": "String.slice", - "kind": 12, - "tags": [], +[ + { "detail": "(string, ~start: int, ~end: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n"} - }, { - "label": "String.sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n" + }, "kind": 12, - "tags": [1], + "label": "String.slice", + "tags": [] + }, + { + "deprecated": true, "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n" + }, + "kind": 12, + "label": "String.sliceToEnd", + "tags": [ 1 ] + } +] Complete src/CompletionInferValues.res 111:80 posCursor:[111:80] posNoWhite:[111:79] Found expr:[111:70->111:80] @@ -747,19 +968,29 @@ ContextPath Type[otherNestedRecord] Path otherNestedRecord Path Stdlib.String.slic Path slic -[{ - "label": "String.slice", - "kind": 12, - "tags": [], +[ + { "detail": "(string, ~start: int, ~end: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n"} - }, { - "label": "String.sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n" + }, "kind": 12, - "tags": [1], + "label": "String.slice", + "tags": [] + }, + { + "deprecated": true, "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n" + }, + "kind": 12, + "label": "String.sliceToEnd", + "tags": [ 1 ] + } +] Complete src/CompletionInferValues.res 115:53 posCursor:[115:53] posNoWhite:[115:52] Found expr:[115:46->115:53] @@ -774,19 +1005,29 @@ Path x ContextPath int Path Stdlib.Int.toSt Path toSt -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, + "kind": 12, + "label": "Int.toString", + "tags": [] + } +] Complete src/CompletionInferValues.res 123:26 posCursor:[123:26] posNoWhite:[123:25] Found expr:[123:3->123:37] @@ -801,19 +1042,28 @@ ContextPath CArgument CArgument Value[fnWithRecordCallback]($0)($0) ContextPath CArgument Value[fnWithRecordCallback]($0) ContextPath Value[fnWithRecordCallback] Path fnWithRecordCallback -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/CompletionInferValues.res 130:30 posCursor:[130:30] posNoWhite:[130:29] Found expr:[130:3->130:33] @@ -835,19 +1085,20 @@ Path fn2 CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root. Path -[{ - "label": "ReactDOM.Client.Root.unmount", - "kind": 12, - "tags": [], +[ + { "detail": "(t, unit) => unit", - "documentation": null - }, { - "label": "ReactDOM.Client.Root.render", "kind": 12, - "tags": [], + "label": "ReactDOM.Client.Root.unmount", + "tags": [] + }, + { "detail": "(t, React.element) => unit", - "documentation": null - }] + "kind": 12, + "label": "ReactDOM.Client.Root.render", + "tags": [] + } +] Complete src/CompletionInferValues.res 139:30 posCursor:[139:30] posNoWhite:[139:29] Found expr:[139:3->139:33] @@ -869,19 +1120,20 @@ Path fn3 CPPipe pathFromEnv:CompletionSupport.Test found:false Path CompletionSupport.Test. Path -[{ - "label": "CompletionSupport.Test.add", - "kind": 12, - "tags": [], +[ + { "detail": "t => int", - "documentation": null - }, { - "label": "CompletionSupport.Test.addSelf", "kind": 12, - "tags": [], + "label": "CompletionSupport.Test.add", + "tags": [] + }, + { "detail": "t => t", - "documentation": null - }] + "kind": 12, + "label": "CompletionSupport.Test.addSelf", + "tags": [] + } +] Complete src/CompletionInferValues.res 143:47 XXX Not found! @@ -891,16 +1143,17 @@ Resolved opens 1 Stdlib ContextPath Value[Belt, Int, toString](Nolabel) ContextPath Value[Belt, Int, toString] Path Belt.Int.toString -[{ - "label": "\"\"", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": null, - "sortText": "A", "insertText": "\"$0\"", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "\"\"", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionInferValues.res 147:66 XXX Not found! @@ -910,16 +1163,17 @@ Resolved opens 1 Stdlib ContextPath Value[String, split](Nolabel, Nolabel) ContextPath Value[String, split] Path String.split -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": null, - "sortText": "A", "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionInferValues.res 151:105 posCursor:[151:105] posNoWhite:[151:104] Found expr:[151:18->151:110] @@ -949,13 +1203,18 @@ Path CompletionSupport2.makeRenderer CPPipe pathFromEnv:CompletionSupport.Nested found:false Path CompletionSupport.Nested. Path -[{ - "label": "root", - "kind": 5, - "tags": [], +[ + { "detail": "ReactDOM.Client.Root.t", - "documentation": {"kind": "markdown", "value": "```rescript\nroot: ReactDOM.Client.Root.t\n```\n\n```rescript\ntype config = {root: ReactDOM.Client.Root.t}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nroot: ReactDOM.Client.Root.t\n```\n\n```rescript\ntype config = {root: ReactDOM.Client.Root.t}\n```" + }, + "kind": 5, + "label": "root", + "tags": [] + } +] Complete src/CompletionInferValues.res 155:110 posCursor:[155:110] posNoWhite:[155:109] Found expr:[155:18->155:115] @@ -977,19 +1236,20 @@ Path CompletionSupport2.makeRenderer CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root. Path -[{ - "label": "ReactDOM.Client.Root.unmount", - "kind": 12, - "tags": [], +[ + { "detail": "(t, unit) => unit", - "documentation": null - }, { - "label": "ReactDOM.Client.Root.render", "kind": 12, - "tags": [], + "label": "ReactDOM.Client.Root.unmount", + "tags": [] + }, + { "detail": "(t, React.element) => unit", - "documentation": null - }] + "kind": 12, + "label": "ReactDOM.Client.Root.render", + "tags": [] + } +] Hover src/CompletionInferValues.res 160:27 Nothing at that position. Now trying to use completion. @@ -1004,5 +1264,5 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } diff --git a/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt b/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt index a866ce1ee3e..4a660c15557 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt @@ -8,19 +8,28 @@ ContextPath Value[someString] Path someString Path Stdlib.String.st Path st -[{ - "label": "String.startsWith", - "kind": 12, - "tags": [], +[ + { "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} - }, { - "label": "String.startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "String.startsWith", + "tags": [] + }, + { "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, + "kind": 12, + "label": "String.startsWithFrom", + "tags": [] + } +] Complete src/CompletionJsx.res 13:21 posCursor:[13:21] posNoWhite:[13:20] Found expr:[8:13->33:3] @@ -38,27 +47,40 @@ ContextPath Value[someString] Path someString Path Stdlib.String.st Path st -[{ - "label": "React.string", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "Turns `string` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "String.startsWith", + "documentation": { + "kind": "markdown", + "value": "Turns `string` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "React.string", + "sortText": "A", + "tags": [] + }, + { "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} - }, { - "label": "String.startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "String.startsWith", + "tags": [] + }, + { "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, + "kind": 12, + "label": "String.startsWithFrom", + "tags": [] + } +] Complete src/CompletionJsx.res 18:24 posCursor:[18:24] posNoWhite:[18:23] Found expr:[8:13->33:3] @@ -77,27 +99,40 @@ ContextPath Value[someString] Path someString Path Stdlib.String.st Path st -[{ - "label": "React.string", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "Turns `string` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "String.startsWith", + "documentation": { + "kind": "markdown", + "value": "Turns `string` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "React.string", + "sortText": "A", + "tags": [] + }, + { "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} - }, { - "label": "String.startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "String.startsWith", + "tags": [] + }, + { "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, + "kind": 12, + "label": "String.startsWithFrom", + "tags": [] + } +] Complete src/CompletionJsx.res 20:27 posCursor:[20:27] posNoWhite:[20:26] Found expr:[8:13->33:3] @@ -115,27 +150,40 @@ ContextPath string->st <> ContextPath string Path Stdlib.String.st Path st -[{ - "label": "React.string", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "Turns `string` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "String.startsWith", + "documentation": { + "kind": "markdown", + "value": "Turns `string` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "React.string", + "sortText": "A", + "tags": [] + }, + { "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} - }, { - "label": "String.startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "String.startsWith", + "tags": [] + }, + { "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, + "kind": 12, + "label": "String.startsWithFrom", + "tags": [] + } +] Complete src/CompletionJsx.res 22:40 posCursor:[22:40] posNoWhite:[22:39] Found expr:[8:13->33:3] @@ -155,27 +203,40 @@ ContextPath Value[String, trim] Path String.trim Path Stdlib.String.st Path st -[{ - "label": "React.string", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "Turns `string` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "String.startsWith", + "documentation": { + "kind": "markdown", + "value": "Turns `string` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "React.string", + "sortText": "A", + "tags": [] + }, + { "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"} - }, { - "label": "String.startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "kind": 12, - "tags": [], + "label": "String.startsWith", + "tags": [] + }, + { "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, + "kind": 12, + "label": "String.startsWithFrom", + "tags": [] + } +] Complete src/CompletionJsx.res 24:19 posCursor:[24:19] posNoWhite:[24:18] Found expr:[8:13->33:3] @@ -194,159 +255,257 @@ ContextPath Value[someInt] Path someInt Path Stdlib.Int. Path -[{ - "label": "React.int", - "kind": 12, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "Turns `int` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "Int.equal", + "documentation": { + "kind": "markdown", + "value": "Turns `int` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "React.int", + "sortText": "A", + "tags": [] + }, + { "detail": "(int, int) => bool", - "documentation": null - }, { - "label": "Int.toStringWithRadix", "kind": 12, - "tags": [1], + "label": "Int.equal", + "tags": [] + }, + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toExponentialWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.bitwiseXor", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponentialWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`bigwiseXor(n1, n2)` calculates the bitwise XOR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseXor(7, 4) == 3\n```\n"} - }, { - "label": "Int.clamp", + "documentation": { + "kind": "markdown", + "value": "\n`bigwiseXor(n1, n2)` calculates the bitwise XOR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseXor(7, 4) == 3\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseXor", + "tags": [] + }, + { "detail": "(~min: int=?, ~max: int=?, int) => int", - "documentation": {"kind": "markdown", "value": "\n`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nInt.clamp(42) == 42\nInt.clamp(42, ~min=50) == 50\nInt.clamp(42, ~max=40) == 40\nInt.clamp(42, ~min=50, ~max=40) == 50\n```\n"} - }, { - "label": "Int.toFixedWithPrecision", + "documentation": { + "kind": "markdown", + "value": "\n`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nInt.clamp(42) == 42\nInt.clamp(42, ~min=50) == 50\nInt.clamp(42, ~max=40) == 40\nInt.clamp(42, ~min=50, ~max=40) == 50\n```\n" + }, "kind": 12, - "tags": [1], + "label": "Int.clamp", + "tags": [] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }, { - "label": "Int.toPrecisionWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toFixedWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.bitwiseAnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecisionWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`bitwiseAnd(n1, n2)` calculates the bitwise AND of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseAnd(7, 4) == 4\n```\n"} - }, { - "label": "Int.shiftRight", + "documentation": { + "kind": "markdown", + "value": "\n`bitwiseAnd(n1, n2)` calculates the bitwise AND of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseAnd(7, 4) == 4\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseAnd", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\n\nAlso known as \"arithmetic right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRight(8, 1) == 4\n```\n"} - }, { - "label": "Int.compare", + "documentation": { + "kind": "markdown", + "value": "\n`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\n\nAlso known as \"arithmetic right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRight(8, 1) == 4\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.shiftRight", + "tags": [] + }, + { "detail": "(int, int) => Ordering.t", - "documentation": null - }, { - "label": "Int.ignore", "kind": 12, - "tags": [], + "label": "Int.compare", + "tags": [] + }, + { "detail": "int => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(int)` ignores the provided int and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"} - }, { - "label": "Int.bitwiseOr", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(int)` ignores the provided int and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "kind": 12, - "tags": [], + "label": "Int.ignore", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`bitwiseOr(n1, n2)` calculates the bitwise OR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseOr(7, 4) == 7\n```\n"} - }, { - "label": "Int.toPrecision", + "documentation": { + "kind": "markdown", + "value": "\n`bitwiseOr(n1, n2)` calculates the bitwise OR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseOr(7, 4) == 7\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseOr", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.range", + "documentation": { + "kind": "markdown", + "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecision", + "tags": [] + }, + { "detail": "(int, int, ~options: rangeOptions=?) => array", - "documentation": {"kind": "markdown", "value": "\n`range(start, end, ~options=?)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `step` is not set and `start < end`, the sequence will be increasing in steps of 1.\n\nIf `step` is not set and `start > end`, the sequence will be decreasing in steps of -1.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nthrown as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\nInt.range(3, 7, ~options={step: 2}) == [3, 5]\nInt.range(3, 7, ~options={step: 2, inclusive: true}) == [3, 5, 7]\nInt.range(3, 6, ~options={step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "\n`range(start, end, ~options=?)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `step` is not set and `start < end`, the sequence will be increasing in steps of 1.\n\nIf `step` is not set and `start > end`, the sequence will be decreasing in steps of -1.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nthrown as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\nInt.range(3, 7, ~options={step: 2}) == [3, 5]\nInt.range(3, 7, ~options={step: 2, inclusive: true}) == [3, 5, 7]\nInt.range(3, 6, ~options={step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n" + }, "kind": 12, - "tags": [], + "label": "Int.range", + "tags": [] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.shiftLeft", + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toString", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.\n\n## Examples\n\n```rescript\nInt.shiftLeft(4, 1) == 8\n```\n"} - }, { - "label": "Int.toFloat", + "documentation": { + "kind": "markdown", + "value": "\n`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.\n\n## Examples\n\n```rescript\nInt.shiftLeft(4, 1) == 8\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.shiftLeft", + "tags": [] + }, + { "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n"} - }, { - "label": "Int.mod", + "documentation": { + "kind": "markdown", + "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toFloat", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`mod(n1, n2)` calculates the modulo (remainder after division) of two integers.\n\n## Examples\n\n```rescript\nInt.mod(7, 4) == 3\n```\n"} - }, { - "label": "Int.rangeWithOptions", + "documentation": { + "kind": "markdown", + "value": "\n`mod(n1, n2)` calculates the modulo (remainder after division) of two integers.\n\n## Examples\n\n```rescript\nInt.mod(7, 4) == 3\n```\n" + }, "kind": 12, - "tags": [1], + "label": "Int.mod", + "tags": [] + }, + { + "deprecated": true, "detail": "(int, int, rangeOptions) => array", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `range` instead\n\n\n`rangeWithOptions(start, end, options)` is like `range`, but with `step` and\n`inclusive` options configurable.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.rangeWithOptions(3, 7, {step: 2}) == [3, 5]\nInt.rangeWithOptions(3, 7, {step: 2, inclusive: true}) == [3, 5, 7]\nInt.rangeWithOptions(3, 6, {step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n"} - }, { - "label": "Int.shiftRightUnsigned", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `range` instead\n\n\n`rangeWithOptions(start, end, options)` is like `range`, but with `step` and\n`inclusive` options configurable.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.rangeWithOptions(3, 7, {step: 2}) == [3, 5]\nInt.rangeWithOptions(3, 7, {step: 2, inclusive: true}) == [3, 5, 7]\nInt.rangeWithOptions(3, 6, {step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n" + }, "kind": 12, - "tags": [], + "label": "Int.rangeWithOptions", + "tags": [ 1 ] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\nExcess bits shifted off to the right are discarded, and zero bits are shifted in from the left.\n\nAlso known as \"zero-filling right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRightUnsigned(4, 1) == 2\n```\n"} - }, { - "label": "Int.toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\nExcess bits shifted off to the right are discarded, and zero bits are shifted in from the left.\n\nAlso known as \"zero-filling right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRightUnsigned(4, 1) == 2\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.shiftRightUnsigned", + "tags": [] + }, + { "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n"} - }, { - "label": "Int.bitwiseNot", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toLocaleString", + "tags": [] + }, + { "detail": "int => int", - "documentation": {"kind": "markdown", "value": "\n`bitwiseNot(n)` calculates the bitwise NOT of an integer.\n\n## Examples\n\n```rescript\nInt.bitwiseNot(2) == -3\n```\n"} - }, { - "label": "Int.toExponential", + "documentation": { + "kind": "markdown", + "value": "\n`bitwiseNot(n)` calculates the bitwise NOT of an integer.\n\n## Examples\n\n```rescript\nInt.bitwiseNot(2) == -3\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseNot", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixed", + "documentation": { + "kind": "markdown", + "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponential", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, + "kind": 12, + "label": "Int.toFixed", + "tags": [] + } +] Complete src/CompletionJsx.res 26:14 posCursor:[26:14] posNoWhite:[26:13] Found expr:[8:13->33:3] @@ -364,159 +523,257 @@ ContextPath int-> <> ContextPath int Path Stdlib.Int. Path -[{ - "label": "React.int", - "kind": 12, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "Turns `int` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "Int.equal", + "documentation": { + "kind": "markdown", + "value": "Turns `int` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "React.int", + "sortText": "A", + "tags": [] + }, + { "detail": "(int, int) => bool", - "documentation": null - }, { - "label": "Int.toStringWithRadix", "kind": 12, - "tags": [1], + "label": "Int.equal", + "tags": [] + }, + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toExponentialWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.bitwiseXor", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponentialWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`bigwiseXor(n1, n2)` calculates the bitwise XOR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseXor(7, 4) == 3\n```\n"} - }, { - "label": "Int.clamp", + "documentation": { + "kind": "markdown", + "value": "\n`bigwiseXor(n1, n2)` calculates the bitwise XOR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseXor(7, 4) == 3\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseXor", + "tags": [] + }, + { "detail": "(~min: int=?, ~max: int=?, int) => int", - "documentation": {"kind": "markdown", "value": "\n`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nInt.clamp(42) == 42\nInt.clamp(42, ~min=50) == 50\nInt.clamp(42, ~max=40) == 40\nInt.clamp(42, ~min=50, ~max=40) == 50\n```\n"} - }, { - "label": "Int.toFixedWithPrecision", + "documentation": { + "kind": "markdown", + "value": "\n`clamp(~min=?, ~max=?, value)` returns `value`, optionally bounded by `min` and `max`.\n\nif `max` \\< `min` returns `min`.\n\n## Examples\n\n```rescript\nInt.clamp(42) == 42\nInt.clamp(42, ~min=50) == 50\nInt.clamp(42, ~max=40) == 40\nInt.clamp(42, ~min=50, ~max=40) == 50\n```\n" + }, "kind": 12, - "tags": [1], + "label": "Int.clamp", + "tags": [] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }, { - "label": "Int.toPrecisionWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toFixedWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.bitwiseAnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecisionWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`bitwiseAnd(n1, n2)` calculates the bitwise AND of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseAnd(7, 4) == 4\n```\n"} - }, { - "label": "Int.shiftRight", + "documentation": { + "kind": "markdown", + "value": "\n`bitwiseAnd(n1, n2)` calculates the bitwise AND of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseAnd(7, 4) == 4\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseAnd", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\n\nAlso known as \"arithmetic right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRight(8, 1) == 4\n```\n"} - }, { - "label": "Int.compare", + "documentation": { + "kind": "markdown", + "value": "\n`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\n\nAlso known as \"arithmetic right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRight(8, 1) == 4\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.shiftRight", + "tags": [] + }, + { "detail": "(int, int) => Ordering.t", - "documentation": null - }, { - "label": "Int.ignore", "kind": 12, - "tags": [], + "label": "Int.compare", + "tags": [] + }, + { "detail": "int => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(int)` ignores the provided int and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"} - }, { - "label": "Int.bitwiseOr", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(int)` ignores the provided int and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "kind": 12, - "tags": [], + "label": "Int.ignore", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`bitwiseOr(n1, n2)` calculates the bitwise OR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseOr(7, 4) == 7\n```\n"} - }, { - "label": "Int.toPrecision", + "documentation": { + "kind": "markdown", + "value": "\n`bitwiseOr(n1, n2)` calculates the bitwise OR of two integers.\n\n## Examples\n\n```rescript\nInt.bitwiseOr(7, 4) == 7\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseOr", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.range", + "documentation": { + "kind": "markdown", + "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecision", + "tags": [] + }, + { "detail": "(int, int, ~options: rangeOptions=?) => array", - "documentation": {"kind": "markdown", "value": "\n`range(start, end, ~options=?)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `step` is not set and `start < end`, the sequence will be increasing in steps of 1.\n\nIf `step` is not set and `start > end`, the sequence will be decreasing in steps of -1.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nthrown as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\nInt.range(3, 7, ~options={step: 2}) == [3, 5]\nInt.range(3, 7, ~options={step: 2, inclusive: true}) == [3, 5, 7]\nInt.range(3, 6, ~options={step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "\n`range(start, end, ~options=?)` returns an int array of the sequence of integers in the\nrange `[start, end)`. That is, including `start` but excluding `end`.\n\nIf `step` is not set and `start < end`, the sequence will be increasing in steps of 1.\n\nIf `step` is not set and `start > end`, the sequence will be decreasing in steps of -1.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nthrown as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.range(3, 6) == [3, 4, 5]\nInt.range(-3, -1) == [-3, -2]\nInt.range(3, 1) == [3, 2]\nInt.range(3, 7, ~options={step: 2}) == [3, 5]\nInt.range(3, 7, ~options={step: 2, inclusive: true}) == [3, 5, 7]\nInt.range(3, 6, ~options={step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n" + }, "kind": 12, - "tags": [], + "label": "Int.range", + "tags": [] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.shiftLeft", + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toString", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.\n\n## Examples\n\n```rescript\nInt.shiftLeft(4, 1) == 8\n```\n"} - }, { - "label": "Int.toFloat", + "documentation": { + "kind": "markdown", + "value": "\n`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.\n\n## Examples\n\n```rescript\nInt.shiftLeft(4, 1) == 8\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.shiftLeft", + "tags": [] + }, + { "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n"} - }, { - "label": "Int.mod", + "documentation": { + "kind": "markdown", + "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toFloat", + "tags": [] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`mod(n1, n2)` calculates the modulo (remainder after division) of two integers.\n\n## Examples\n\n```rescript\nInt.mod(7, 4) == 3\n```\n"} - }, { - "label": "Int.rangeWithOptions", + "documentation": { + "kind": "markdown", + "value": "\n`mod(n1, n2)` calculates the modulo (remainder after division) of two integers.\n\n## Examples\n\n```rescript\nInt.mod(7, 4) == 3\n```\n" + }, "kind": 12, - "tags": [1], + "label": "Int.mod", + "tags": [] + }, + { + "deprecated": true, "detail": "(int, int, rangeOptions) => array", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `range` instead\n\n\n`rangeWithOptions(start, end, options)` is like `range`, but with `step` and\n`inclusive` options configurable.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.rangeWithOptions(3, 7, {step: 2}) == [3, 5]\nInt.rangeWithOptions(3, 7, {step: 2, inclusive: true}) == [3, 5, 7]\nInt.rangeWithOptions(3, 6, {step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n"} - }, { - "label": "Int.shiftRightUnsigned", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `range` instead\n\n\n`rangeWithOptions(start, end, options)` is like `range`, but with `step` and\n`inclusive` options configurable.\n\nIf `step` is set, the sequence will increase or decrease by that amount for each\nstep. If `start < end` and `step` is negative, or vice versa, an empty array is\nreturned since the sequence would otherwise never reach or exceed the end value\nand hence be infinite. If `step` is `0` and `start !=` end, a `RangeError` is\nraised as the sequence would never reach or exceed the end value and hence be\ninfinite.\n\nIf `inclusive` is set to `true`, the sequence will include `end` if `step` is\nset such that the sequence includes it.\n\n## Examples\n\n```rescript\nInt.rangeWithOptions(3, 7, {step: 2}) == [3, 5]\nInt.rangeWithOptions(3, 7, {step: 2, inclusive: true}) == [3, 5, 7]\nInt.rangeWithOptions(3, 6, {step: -2}) // RangeError\n```\n\n## Exceptions\n\n- Raises `RangeError` if `step == 0 && start != end`.\n" + }, "kind": 12, - "tags": [], + "label": "Int.rangeWithOptions", + "tags": [ 1 ] + }, + { "detail": "(int, int) => int", - "documentation": {"kind": "markdown", "value": "\n`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\nExcess bits shifted off to the right are discarded, and zero bits are shifted in from the left.\n\nAlso known as \"zero-filling right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRightUnsigned(4, 1) == 2\n```\n"} - }, { - "label": "Int.toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.\nExcess bits shifted off to the right are discarded, and zero bits are shifted in from the left.\n\nAlso known as \"zero-filling right shift\" operation.\n\n## Examples\n\n```rescript\nInt.shiftRightUnsigned(4, 1) == 2\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.shiftRightUnsigned", + "tags": [] + }, + { "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n"} - }, { - "label": "Int.bitwiseNot", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toLocaleString", + "tags": [] + }, + { "detail": "int => int", - "documentation": {"kind": "markdown", "value": "\n`bitwiseNot(n)` calculates the bitwise NOT of an integer.\n\n## Examples\n\n```rescript\nInt.bitwiseNot(2) == -3\n```\n"} - }, { - "label": "Int.toExponential", + "documentation": { + "kind": "markdown", + "value": "\n`bitwiseNot(n)` calculates the bitwise NOT of an integer.\n\n## Examples\n\n```rescript\nInt.bitwiseNot(2) == -3\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.bitwiseNot", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixed", + "documentation": { + "kind": "markdown", + "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponential", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, + "kind": 12, + "label": "Int.toFixed", + "tags": [] + } +] Complete src/CompletionJsx.res 28:20 posCursor:[28:20] posNoWhite:[28:19] Found expr:[8:13->33:3] @@ -536,27 +793,40 @@ Path someArr Path Stdlib.Array.a Path ArrayUtils.a Path a -[{ - "label": "React.array", - "kind": 12, - "tags": [], +[ + { "detail": "array", - "documentation": {"kind": "markdown", "value": "Turns `array` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", - "insertTextFormat": 2 - }, { - "label": "Array.at", + "documentation": { + "kind": "markdown", + "value": "Turns `array` into a JSX element so it can be used inside of JSX." + }, + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "React.array", + "sortText": "A", + "tags": [] + }, + { "detail": "(array<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(2) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(3) == None\n[\"a\", \"b\", \"c\"]->Array.at(-1) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(-3) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(-4) == None\n```\n"} - }, { - "label": "Array.asIterable", + "documentation": { + "kind": "markdown", + "value": "\n`at(array, index)`\n\nGet an element by its index. Negative indices count backwards from the last item.\n\n## Examples\n\n```rescript\n[\"a\", \"b\", \"c\"]->Array.at(0) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(2) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(3) == None\n[\"a\", \"b\", \"c\"]->Array.at(-1) == Some(\"c\")\n[\"a\", \"b\", \"c\"]->Array.at(-3) == Some(\"a\")\n[\"a\", \"b\", \"c\"]->Array.at(-4) == None\n```\n" + }, "kind": 12, - "tags": [], + "label": "Array.at", + "tags": [] + }, + { "detail": "array<'a> => Iterable.t<'a>", - "documentation": {"kind": "markdown", "value": "\n`asIterable(array)` views `array` as an `Iterable.t`.\n\nThis is useful when passing an array to APIs that consume iterables, such as\n`Array.from` or `for...of` in JavaScript.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`asIterable(array)` views `array` as an `Iterable.t`.\n\nThis is useful when passing an array to APIs that consume iterables, such as\n`Array.from` or `for...of` in JavaScript.\n" + }, + "kind": 12, + "label": "Array.asIterable", + "tags": [] + } +] Complete src/CompletionJsx.res 30:12 posCursor:[30:12] posNoWhite:[30:11] Found expr:[8:13->33:3] @@ -571,28 +841,42 @@ JSX 30:12] > _children:None Completable: ChtmlElement ", - "kind": 4, - "tags": [], +[ + { "detail": "Defines a dialog box or subwindow.", - "documentation": {"kind": "markdown", "value": "Defines a dialog box or subwindow."}, - "insertText": "dialog" - }, { - "label": "", + "documentation": { + "kind": "markdown", + "value": "Defines a dialog box or subwindow." + }, + "insertText": "dialog", "kind": 4, - "tags": [1], + "label": "", + "tags": [] + }, + { + "deprecated": true, "detail": "Defines a directory list. Use
    instead.", - "documentation": {"kind": "markdown", "value": "Deprecated: true\n\nDefines a directory list. Use
      instead."}, - "insertText": "dir" - }, { - "label": "
      ", + "documentation": { + "kind": "markdown", + "value": "Deprecated: true\n\nDefines a directory list. Use
        instead." + }, + "insertText": "dir", "kind": 4, - "tags": [], + "label": "", + "tags": [ 1 ] + }, + { "detail": "Specifies a division or a section in a document.", - "documentation": {"kind": "markdown", "value": "Specifies a division or a section in a document."}, - "insertText": "div" - }] + "documentation": { + "kind": "markdown", + "value": "Specifies a division or a section in a document." + }, + "insertText": "div", + "kind": 4, + "label": "
        ", + "tags": [] + } +] Complete src/CompletionJsx.res 45:23 posCursor:[45:23] posNoWhite:[45:22] Found expr:[45:3->45:23] @@ -601,13 +885,7 @@ Completable: Cjsx([CompWithoutJsxPpx], n, [n]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path CompWithoutJsxPpx.make -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "name", "tags": [] } ] Complete src/CompletionJsx.res 48:27 posCursor:[48:27] posNoWhite:[48:26] Found expr:[48:3->48:28] @@ -617,16 +895,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [SomeComponent] someProp Path SomeComponent.make -[{ - "label": "\"\"", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": null, - "sortText": "A", "insertText": "{\"$0\"}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "\"\"", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionJsx.res 51:11 posCursor:[51:11] posNoWhite:[51:10] Found expr:[51:3->51:11] @@ -636,13 +915,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path ReactDOM.domProps Path JsxDOM.domProps -[{ - "label": "hidden", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "hidden", "tags": [] } ] Complete src/CompletionJsx.res 61:30 posCursor:[61:30] posNoWhite:[61:28] Found expr:[61:3->61:29] @@ -651,25 +924,11 @@ Completable: Cjsx([IntrinsicElementLowercase], "", []) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path IntrinsicElementLowercase.make -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }, { - "label": "age", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }, { - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ + { "detail": "option", "kind": 4, "label": "name", "tags": [] }, + { "detail": "option", "kind": 4, "label": "age", "tags": [] }, + { "detail": "string", "kind": 4, "label": "key", "tags": [] } +] Complete src/CompletionJsx.res 73:36 posCursor:[73:36] posNoWhite:[73:35] Found expr:[73:3->73:41] @@ -679,23 +938,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [MultiPropComp] time Path MultiPropComp.make -[{ - "label": "Now", - "kind": 4, - "tags": [], +[ + { "detail": "Now", - "documentation": {"kind": "markdown", "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```" + }, "insertText": "{Now}", - "insertTextFormat": 2 - }, { - "label": "Later", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Now", + "tags": [] + }, + { "detail": "Later", - "documentation": {"kind": "markdown", "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```" + }, "insertText": "{Later}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Later", + "tags": [] + } +] Complete src/CompletionJsx.res 76:36 posCursor:[76:36] posNoWhite:[76:35] Found expr:[76:3->76:40] @@ -705,23 +973,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [MultiPropComp] time Path MultiPropComp.make -[{ - "label": "Now", - "kind": 4, - "tags": [], +[ + { "detail": "Now", - "documentation": {"kind": "markdown", "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```" + }, "insertText": "{Now}", - "insertTextFormat": 2 - }, { - "label": "Later", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Now", + "tags": [] + }, + { "detail": "Later", - "documentation": {"kind": "markdown", "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```" + }, "insertText": "{Later}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Later", + "tags": [] + } +] Complete src/CompletionJsx.res 79:28 posCursor:[79:28] posNoWhite:[79:27] Found expr:[79:3->79:32] @@ -731,23 +1008,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [MultiPropComp] time Path MultiPropComp.make -[{ - "label": "Now", - "kind": 4, - "tags": [], +[ + { "detail": "Now", - "documentation": {"kind": "markdown", "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nNow\n```\n\n```rescript\ntype time = Now | Later\n```" + }, "insertText": "{Now}", - "insertTextFormat": 2 - }, { - "label": "Later", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Now", + "tags": [] + }, + { "detail": "Later", - "documentation": {"kind": "markdown", "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nLater\n```\n\n```rescript\ntype time = Now | Later\n```" + }, "insertText": "{Later}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Later", + "tags": [] + } +] Complete src/CompletionJsx.res 89:26 posCursor:[89:26] posNoWhite:[89:24] Found expr:[89:3->89:27] @@ -756,13 +1042,7 @@ Completable: Cjsx([Info], "", [_type]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path Info.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/CompletionJsx.res 93:19 posCursor:[93:19] posNoWhite:[93:18] Found expr:[93:11->93:24] @@ -778,162 +1058,282 @@ ContextPath string->s <> ContextPath string Path Stdlib.String.s Path s -[{ - "label": "->React.string", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "string", - "documentation": {"kind": "markdown", "value": "Turns `string` into a JSX element so it can be used inside of JSX."}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "Turns `string` into a JSX element so it can be used inside of JSX." + }, "insertText": "->React.string", "insertTextFormat": 2, - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.searchOpt", "kind": 12, - "tags": [], + "label": "->React.string", + "sortText": "A", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, RegExp.t) => option", - "documentation": {"kind": "markdown", "value": "\n`searchOpt(str, regexp)`. Like `search`, but return an `option`.\n\n## Examples\n\n```rescript\nString.searchOpt(\"testing 1 2 3\", /\\d+/) == Some(8)\nString.searchOpt(\"no numbers\", /\\d+/) == None\n```\n"}, - "sortText": "searchOpt", + "documentation": { + "kind": "markdown", + "value": "\n`searchOpt(str, regexp)`. Like `search`, but return an `option`.\n\n## Examples\n\n```rescript\nString.searchOpt(\"testing 1 2 3\", /\\d+/) == Some(8)\nString.searchOpt(\"no numbers\", /\\d+/) == None\n```\n" + }, "insertText": "->String.searchOpt", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.splitByRegExpAtMost", "kind": 12, - "tags": [], + "label": "->String.searchOpt", + "sortText": "searchOpt", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, RegExp.t, ~limit: int) => array>", - "documentation": {"kind": "markdown", "value": "\n`splitByRegExpAtMost(str, regexp, ~limit)` splits the given `str` at every\noccurrence of `regexp` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings, the\narray will contain all the substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExpAtMost(\"Hello World. How are you doing?\", / /, ~limit=3) == [\n Some(\"Hello\"),\n Some(\"World.\"),\n Some(\"How\"),\n ]\n```\n"}, - "sortText": "splitByRegExpAtMost", + "documentation": { + "kind": "markdown", + "value": "\n`splitByRegExpAtMost(str, regexp, ~limit)` splits the given `str` at every\noccurrence of `regexp` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings, the\narray will contain all the substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExpAtMost(\"Hello World. How are you doing?\", / /, ~limit=3) == [\n Some(\"Hello\"),\n Some(\"World.\"),\n Some(\"How\"),\n ]\n```\n" + }, "insertText": "->String.splitByRegExpAtMost", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.slice", "kind": 12, - "tags": [], + "label": "->String.splitByRegExpAtMost", + "sortText": "splitByRegExpAtMost", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, ~start: int, ~end: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(str, ~start, ~end)` returns the substring of `str` starting at\ncharacter `start` up to but not including `end`.\n- If either `start` or `end` is negative, then it is evaluated as\n `length(str - start)` or `length(str - end)`.\n- If `end` is greater than the length of `str`, then it is treated as\n `length(str)`.\n- If `start` is greater than `end`, slice returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.slice(\"abcdefg\", ~start=2, ~end=5) == \"cde\"\nString.slice(\"abcdefg\", ~start=2, ~end=9) == \"cdefg\"\nString.slice(\"abcdefg\", ~start=-4, ~end=-2) == \"de\"\nString.slice(\"abcdefg\", ~start=5, ~end=1) == \"\"\nString.slice(\"abcdefg\", ~start=2) == \"cdefg\"\nString.slice(\"Hello World\", ~start=6) == \"World\"\n```\n" + }, "insertText": "->String.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.substringToEnd", "kind": 12, - "tags": [1], + "label": "->String.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], + "deprecated": true, "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `substring` instead\n\n\n`substringToEnd(str, ~start)` returns the substring of `str` from position\n`start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string\n is returned.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substringToEnd(\"playground\", ~start=4) == \"ground\"\nString.substringToEnd(\"playground\", ~start=-3) == \"playground\"\nString.substringToEnd(\"playground\", ~start=12) == \"\"\n```\n"}, - "sortText": "substringToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `substring` instead\n\n\n`substringToEnd(str, ~start)` returns the substring of `str` from position\n`start` to the end.\n- If `start` is less than or equal to zero, the entire string is returned.\n- If `start` is greater than or equal to the length of `str`, the empty string\n is returned.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substringToEnd(\"playground\", ~start=4) == \"ground\"\nString.substringToEnd(\"playground\", ~start=-3) == \"playground\"\nString.substringToEnd(\"playground\", ~start=12) == \"\"\n```\n" + }, "insertText": "->String.substringToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.startsWith", "kind": 12, - "tags": [], + "label": "->String.substringToEnd", + "sortText": "substringToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n"}, - "sortText": "startsWith", + "documentation": { + "kind": "markdown", + "value": "\n`startsWith(str, substr)` returns `true` if the `str` starts with `substr`,\n`false` otherwise.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWith(\"BuckleScript\", \"Buckle\") == true\nString.startsWith(\"BuckleScript\", \"\") == true\nString.startsWith(\"JavaScript\", \"Buckle\") == false\n```\n" + }, "insertText": "->String.startsWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.splitAtMost", "kind": 12, - "tags": [], + "label": "->String.startsWith", + "sortText": "startsWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, string, ~limit: int) => array", - "documentation": {"kind": "markdown", "value": "\n`splitAtMost(str, delimiter, ~limit)` splits the given `str` at every\noccurrence of `delimiter` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings,\nthe array will contain all the substrings.\n\n## Examples\n\n```rescript\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=3) == [\"ant\", \"bee\", \"cat\"]\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=0) == []\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=9) == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```\n"}, - "sortText": "splitAtMost", + "documentation": { + "kind": "markdown", + "value": "\n`splitAtMost(str, delimiter, ~limit)` splits the given `str` at every\noccurrence of `delimiter` and returns an array of the first `limit` resulting\nsubstrings. If `limit` is negative or greater than the number of substrings,\nthe array will contain all the substrings.\n\n## Examples\n\n```rescript\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=3) == [\"ant\", \"bee\", \"cat\"]\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=0) == []\nString.splitAtMost(\"ant/bee/cat/dog/elk\", \"/\", ~limit=9) == [\"ant\", \"bee\", \"cat\", \"dog\", \"elk\"]\n```\n" + }, "insertText": "->String.splitAtMost", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->String.splitAtMost", + "sortText": "splitAtMost", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], + "deprecated": true, "detail": "(string, ~start: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(str, ~start)` returns the substring of `str` starting at character\n`start` to the end of the string.\n- If `start` is negative, then it is evaluated as `length(str - start)`.\n- If `start` is greater than the length of `str`, then sliceToEnd returns the empty string.\n See [`String.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) on MDN.\n\n## Examples\n\n```rescript\nString.sliceToEnd(\"abcdefg\", ~start=4) == \"efg\"\nString.sliceToEnd(\"abcdefg\", ~start=-2) == \"fg\"\nString.sliceToEnd(\"abcdefg\", ~start=7) == \"\"\n```\n" + }, "insertText": "->String.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.splitByRegExp", "kind": 12, - "tags": [], + "label": "->String.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, RegExp.t) => array>", - "documentation": {"kind": "markdown", "value": "\n`splitByRegExp(str, regexp)` splits the given `str` at every occurrence of\n`regexp` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExp(\"Jan,Feb,Mar\", /,/) == [Some(\"Jan\"), Some(\"Feb\"), Some(\"Mar\")]\n```\n"}, - "sortText": "splitByRegExp", + "documentation": { + "kind": "markdown", + "value": "\n`splitByRegExp(str, regexp)` splits the given `str` at every occurrence of\n`regexp` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.splitByRegExp(\"Jan,Feb,Mar\", /,/) == [Some(\"Jan\"), Some(\"Feb\"), Some(\"Mar\")]\n```\n" + }, "insertText": "->String.splitByRegExp", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.startsWithFrom", "kind": 12, - "tags": [], + "label": "->String.splitByRegExp", + "sortText": "splitByRegExp", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n"}, - "sortText": "startsWithFrom", + "documentation": { + "kind": "markdown", + "value": "\n`startsWithFrom(str, substr, n)` returns `true` if the `str` starts\nwith `substr` starting at position `n`, `false` otherwise. If `n` is negative,\nthe search starts at the beginning of `str`.\nSee [`String.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) on MDN.\n\n## Examples\n\n```rescript\nString.startsWithFrom(\"BuckleScript\", \"kle\", 3) == true\nString.startsWithFrom(\"BuckleScript\", \"\", 3) == true\nString.startsWithFrom(\"JavaScript\", \"Buckle\", 2) == false\n```\n" + }, "insertText": "->String.startsWithFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.split", "kind": 12, - "tags": [], + "label": "->String.startsWithFrom", + "sortText": "startsWithFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, string) => array", - "documentation": {"kind": "markdown", "value": "\n`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nString.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nString.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nString.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```\n"}, - "sortText": "split", + "documentation": { + "kind": "markdown", + "value": "\n`split(str, delimiter)` splits the given `str` at every occurrence of\n`delimiter` and returns an array of the resulting substrings.\nSee [`String.split`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) on MDN.\n\n## Examples\n\n```rescript\nString.split(\"2018-01-02\", \"-\") == [\"2018\", \"01\", \"02\"]\nString.split(\"a,b,,c\", \",\") == [\"a\", \"b\", \"\", \"c\"]\nString.split(\"good::bad as great::awful\", \"::\") == [\"good\", \"bad as great\", \"awful\"]\nString.split(\"has-no-delimiter\", \";\") == [\"has-no-delimiter\"]\n```\n" + }, "insertText": "->String.split", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.substring", "kind": 12, - "tags": [], + "label": "->String.split", + "sortText": "split", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, ~start: int, ~end: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`substring(str, ~start, ~end)` returns characters `start` up to but not\nincluding end from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `end` is zero or negative, the empty string is returned.\n- If `start` is greater than `end`, the `start` and `end` points are swapped.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substring(\"playground\", ~start=3, ~end=6) == \"ygr\"\nString.substring(\"playground\", ~start=6, ~end=3) == \"ygr\"\nString.substring(\"playground\", ~start=4, ~end=12) == \"ground\"\nString.substring(\"playground\", ~start=4) == \"ground\"\nString.substring(\"Hello World\", ~start=6) == \"World\"\n```\n"}, - "sortText": "substring", + "documentation": { + "kind": "markdown", + "value": "\n`substring(str, ~start, ~end)` returns characters `start` up to but not\nincluding end from `str`.\n- If `start` is less than zero, it is treated as zero.\n- If `end` is zero or negative, the empty string is returned.\n- If `start` is greater than `end`, the `start` and `end` points are swapped.\n See [`String.substring`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) on MDN.\n\n## Examples\n\n```rescript\nString.substring(\"playground\", ~start=3, ~end=6) == \"ygr\"\nString.substring(\"playground\", ~start=6, ~end=3) == \"ygr\"\nString.substring(\"playground\", ~start=4, ~end=12) == \"ground\"\nString.substring(\"playground\", ~start=4) == \"ground\"\nString.substring(\"Hello World\", ~start=6) == \"World\"\n```\n" + }, "insertText": "->String.substring", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }, { - "label": "->String.search", "kind": 12, - "tags": [], + "label": "->String.substring", + "sortText": "substring", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 93 }, + "start": { "character": 17, "line": 93 } + } + } + ], "detail": "(string, RegExp.t) => int", - "documentation": {"kind": "markdown", "value": "\n`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search) on MDN.\n\n## Examples\n\n```rescript\nString.search(\"testing 1 2 3\", /\\d+/) == 8\nString.search(\"no numbers\", /\\d+/) == -1\n```\n"}, - "sortText": "search", + "documentation": { + "kind": "markdown", + "value": "\n`search(str, regexp)` returns the starting position of the first match of\n`regexp` in the given `str`, or -1 if there is no match.\nSee [`String.search`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search) on MDN.\n\n## Examples\n\n```rescript\nString.search(\"testing 1 2 3\", /\\d+/) == 8\nString.search(\"no numbers\", /\\d+/) == -1\n```\n" + }, "insertText": "->String.search", - "additionalTextEdits": [{ - "range": {"start": {"line": 93, "character": 17}, "end": {"line": 93, "character": 18}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->String.search", + "sortText": "search", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt b/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt index af410bf97a7..7d6405d1408 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionJsxProps.res.txt @@ -6,19 +6,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] on Path CompletionSupport.TestComponent.make -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionJsxProps.res 3:48 posCursor:[3:48] posNoWhite:[3:47] Found expr:[3:11->3:48] @@ -28,20 +19,25 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] on Path CompletionSupport.TestComponent.make -[{ - "label": "true", - "kind": 4, - "tags": [], +[ + { "detail": "bool", - "documentation": null, - "sortText": "A true" - }, { - "label": "typeof", - "kind": 12, - "tags": [], + "kind": 4, + "label": "true", + "sortText": "A true", + "tags": [] + }, + { "detail": "'a => Type.t", - "documentation": {"kind": "markdown", "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n" + }, + "kind": 12, + "label": "typeof", + "tags": [] + } +] Complete src/CompletionJsxProps.res 6:50 posCursor:[6:50] posNoWhite:[6:49] Found expr:[6:11->6:50] @@ -51,93 +47,97 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] test Path CompletionSupport.TestComponent.make -[{ - "label": "Two", - "kind": 4, - "tags": [], +[ + { "detail": "Two", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```"}, - "sortText": "A Two", + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```" + }, "insertText": "{Two}", - "insertTextFormat": 2 - }, { - "label": "Three(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two", + "sortText": "A Two", + "tags": [] + }, + { "detail": "Three(int)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(int)\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```"}, - "sortText": "A Three(_)", + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(int)\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```" + }, "insertText": "{Three($0)}", - "insertTextFormat": 2 - }, { - "label": "TypedArray", - "kind": 9, - "tags": [], + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_)", + "sortText": "A Three(_)", + "tags": [] + }, + { "detail": "module TypedArray", - "documentation": null - }, { - "label": "TimeoutId", "kind": 9, - "tags": [], + "label": "TypedArray", + "tags": [] + }, + { "detail": "module TimeoutId", - "documentation": null - }, { - "label": "Type", - "kind": 9, - "tags": [], - "detail": "module Type", - "documentation": null - }, { - "label": "TableclothMap", "kind": 9, - "tags": [], - "detail": "module TableclothMap", - "documentation": null, + "label": "TimeoutId", + "tags": [] + }, + { "detail": "module Type", "kind": 9, "label": "Type", "tags": [] }, + { "data": { "modulePath": "TableclothMap", "filePath": "src/CompletionJsxProps.res" - } - }, { - "label": "TypeArgCtx", + }, + "detail": "module TableclothMap", "kind": 9, - "tags": [], - "detail": "module TypeArgCtx", - "documentation": null, + "label": "TableclothMap", + "tags": [] + }, + { "data": { "modulePath": "TypeArgCtx", "filePath": "src/CompletionJsxProps.res" - } - }, { - "label": "TypeAtPosCompletion", + }, + "detail": "module TypeArgCtx", "kind": 9, - "tags": [], - "detail": "module TypeAtPosCompletion", - "documentation": null, + "label": "TypeArgCtx", + "tags": [] + }, + { "data": { "modulePath": "TypeAtPosCompletion", "filePath": "src/CompletionJsxProps.res" - } - }, { - "label": "TypeConstraint", + }, + "detail": "module TypeAtPosCompletion", "kind": 9, - "tags": [], - "detail": "module TypeConstraint", - "documentation": null, + "label": "TypeAtPosCompletion", + "tags": [] + }, + { "data": { "modulePath": "TypeConstraint", "filePath": "src/CompletionJsxProps.res" - } - }, { - "label": "TypeDefinition", + }, + "detail": "module TypeConstraint", "kind": 9, - "tags": [], - "detail": "module TypeDefinition", - "documentation": null, + "label": "TypeConstraint", + "tags": [] + }, + { "data": { "modulePath": "TypeDefinition", "filePath": "src/CompletionJsxProps.res" - } - }] + }, + "detail": "module TypeDefinition", + "kind": 9, + "label": "TypeDefinition", + "tags": [] + } +] Complete src/CompletionJsxProps.res 9:52 posCursor:[9:52] posNoWhite:[9:51] Found expr:[9:11->9:52] @@ -147,39 +147,56 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] polyArg Path CompletionSupport.TestComponent.make -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "{#one}", - "insertTextFormat": 2 - }, { - "label": "#three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#one", + "tags": [] + }, + { "detail": "#three(int, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#three(int, bool)\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#three(int, bool)\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "{#three(${1:_}, ${2:_})}", - "insertTextFormat": 2 - }, { - "label": "#two", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#three(_, _)", + "tags": [] + }, + { "detail": "#two", - "documentation": {"kind": "markdown", "value": "```rescript\n#two\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "{#two}", - "insertTextFormat": 2 - }, { - "label": "#two2", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#two", + "tags": [] + }, + { "detail": "#two2", - "documentation": {"kind": "markdown", "value": "```rescript\n#two2\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two2\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "{#two2}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two2", + "tags": [] + } +] Complete src/CompletionJsxProps.res 12:54 posCursor:[12:54] posNoWhite:[12:53] Found expr:[12:11->12:54] @@ -189,31 +206,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] polyArg Path CompletionSupport.TestComponent.make -[{ - "label": "#three(_, _)", - "kind": 4, - "tags": [], +[ + { "detail": "#three(int, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#three(int, bool)\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#three(int, bool)\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "{three(${1:_}, ${2:_})}", - "insertTextFormat": 2 - }, { - "label": "#two", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#three(_, _)", + "tags": [] + }, + { "detail": "#two", - "documentation": {"kind": "markdown", "value": "```rescript\n#two\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "{two}", - "insertTextFormat": 2 - }, { - "label": "#two2", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#two", + "tags": [] + }, + { "detail": "#two2", - "documentation": {"kind": "markdown", "value": "```rescript\n#two2\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two2\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "{two2}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two2", + "tags": [] + } +] Complete src/CompletionJsxProps.res 15:22 posCursor:[15:22] posNoWhite:[15:21] Found expr:[15:11->15:25] @@ -224,19 +254,10 @@ Resolved opens 1 Stdlib ContextPath CJsxPropValue [div] muted Path ReactDOM.domProps Path JsxDOM.domProps -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionJsxProps.res 18:29 posCursor:[18:29] posNoWhite:[18:28] Found expr:[18:11->18:32] @@ -247,16 +268,17 @@ Resolved opens 1 Stdlib ContextPath CJsxPropValue [div] onMouseEnter Path ReactDOM.domProps Path JsxDOM.domProps -[{ - "label": "event => event", - "kind": 12, - "tags": [], +[ + { "detail": "JsxEvent.Mouse.t => unit", - "documentation": null, - "sortText": "A", "insertText": "{${1:event} => ${0:event}}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "event => event", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionJsxProps.res 22:52 posCursor:[22:52] posNoWhite:[22:51] Found expr:[22:11->22:52] @@ -266,16 +288,21 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] testArr Path CompletionSupport.TestComponent.make -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "testVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype testVariant = One | Two | Three(int)\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype testVariant = One | Two | Three(int)\n```" + }, "insertText": "{[$0]}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionJsxProps.res 26:54 posCursor:[26:54] posNoWhite:[26:53] Found expr:[26:11->26:56] @@ -285,31 +312,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] testArr Path CompletionSupport.TestComponent.make -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```" + }, "insertText": "Two", - "insertTextFormat": 2 - }, { - "label": "Three(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two", + "tags": [] + }, + { "detail": "Three(int)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(int)\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(int)\n```\n\n```rescript\ntype testVariant = One | Two | Three(int)\n```" + }, "insertText": "Three($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_)", + "tags": [] + } +] Complete src/CompletionJsxProps.res 31:53 posCursor:[31:53] posNoWhite:[31:52] Found expr:[31:11->31:54] @@ -319,39 +359,56 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] polyArg Path CompletionSupport.TestComponent.make -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "#one", - "insertTextFormat": 2 - }, { - "label": "#three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#one", + "tags": [] + }, + { "detail": "#three(int, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#three(int, bool)\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#three(int, bool)\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "#three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }, { - "label": "#two", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#three(_, _)", + "tags": [] + }, + { "detail": "#two", - "documentation": {"kind": "markdown", "value": "```rescript\n#two\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "#two", - "insertTextFormat": 2 - }, { - "label": "#two2", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#two", + "tags": [] + }, + { "detail": "#two2", - "documentation": {"kind": "markdown", "value": "```rescript\n#two2\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two2\n```\n\n```rescript\n[#one | #three(int, bool) | #two | #two2]\n```" + }, "insertText": "#two2", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two2", + "tags": [] + } +] Complete src/CompletionJsxProps.res 34:49 posCursor:[34:49] posNoWhite:[34:48] Found expr:[34:11->34:50] @@ -361,25 +418,20 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletionSupport, TestComponent] on Path CompletionSupport.TestComponent.make -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "tsomeVar", +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "[> #two]", "kind": 12, "label": "tsomeVar", "tags": [] }, + { + "detail": "'a => Type.t", + "documentation": { + "kind": "markdown", + "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n" + }, "kind": 12, - "tags": [], - "detail": "[> #two]", - "documentation": null - }, { "label": "typeof", - "kind": 12, - "tags": [], - "detail": "'a => Type.t", - "documentation": {"kind": "markdown", "value": "\n`typeof(value)` exposes JavaScript's `typeof` operator and returns a `Type.t` enum.\nIt helps you inspect values that come from JavaScript APIs.\n\n## Examples\n\n```rescript\ntypeof(1) == #number\ntypeof(\"a\") == #string\n```\n"} - }] + "tags": [] + } +] Complete src/CompletionJsxProps.res 44:44 posCursor:[44:44] posNoWhite:[44:43] Found expr:[44:11->44:44] @@ -389,21 +441,30 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CJsxPropValue [CompletableComponentLazy] status Path CompletableComponentLazy.make -[{ - "label": "On", - "kind": 4, - "tags": [], +[ + { "detail": "On", - "documentation": {"kind": "markdown", "value": "```rescript\nOn\n```\n\n```rescript\ntype status = On | Off\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOn\n```\n\n```rescript\ntype status = On | Off\n```" + }, "insertText": "{On}", - "insertTextFormat": 2 - }, { - "label": "Off", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "On", + "tags": [] + }, + { "detail": "Off", - "documentation": {"kind": "markdown", "value": "```rescript\nOff\n```\n\n```rescript\ntype status = On | Off\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOff\n```\n\n```rescript\ntype status = On | Off\n```" + }, "insertText": "{Off}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Off", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt b/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt index cc9888647e1..f5383e166fb 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionMultipleEditorCompleteFrom.res.txt @@ -15,29 +15,40 @@ Path A. Path B. Path C. Path -[{ - "label": "->B.b", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 19 }, + "start": { "character": 4, "line": 19 } + } + } + ], "detail": "A.a => int", - "documentation": null, - "sortText": "b", "insertText": "->B.b", - "additionalTextEdits": [{ - "range": {"start": {"line": 19, "character": 4}, "end": {"line": 19, "character": 5}}, - "newText": "" - }] - }, { - "label": "->C.c", "kind": 12, - "tags": [], + "label": "->B.b", + "sortText": "b", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 19 }, + "start": { "character": 4, "line": 19 } + } + } + ], "detail": "A.a => char", - "documentation": null, - "sortText": "c", "insertText": "->C.c", - "additionalTextEdits": [{ - "range": {"start": {"line": 19, "character": 4}, "end": {"line": 19, "character": 5}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->C.c", + "sortText": "c", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionNullNullable.res.txt b/tests/analysis_tests/tests/src/expected/CompletionNullNullable.res.txt index 8903a5ef5a3..3fdbfa4534f 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionNullNullable.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionNullNullable.res.txt @@ -12,187 +12,326 @@ ContextPath Value[x] Path x Path Stdlib.Null. Path -[{ - "label": "->Null.equal", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "(t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`equal(a, b, eq)` checks if `a` and `b` are equal.\nIf both are `Null.Value`, it will use function `eq` to check if the values are equal.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\nNull.equal(a, b, Int.equal) == false\nNull.equal(a, c, Int.equal) == false\nNull.equal(Null.null, Null.null, Int.equal) == true\n```\n "}, - "sortText": "equal", + "documentation": { + "kind": "markdown", + "value": "\n`equal(a, b, eq)` checks if `a` and `b` are equal.\nIf both are `Null.Value`, it will use function `eq` to check if the values are equal.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\nNull.equal(a, b, Int.equal) == false\nNull.equal(a, c, Int.equal) == false\nNull.equal(Null.null, Null.null, Int.equal) == true\n```\n " + }, "insertText": "->Null.equal", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.getUnsafe", "kind": 12, - "tags": [], + "label": "->Null.equal", + "sortText": "equal", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "t<'a> => 'a", - "documentation": {"kind": "markdown", "value": "\n`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNull.getUnsafe(Null.make(3)) == 3\nNull.getUnsafe(Null.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null`.\n"}, - "sortText": "getUnsafe", + "documentation": { + "kind": "markdown", + "value": "\n`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNull.getUnsafe(Null.make(3)) == 3\nNull.getUnsafe(Null.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null`.\n" + }, "insertText": "->Null.getUnsafe", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.map", "kind": 12, - "tags": [], + "label": "->Null.getUnsafe", + "sortText": "getUnsafe", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(value, f)` returns `f(value)` if `value` is not `null`, otherwise returns\n`value` unchanged.\n\n## Examples\n\n```rescript\nNull.map(Null.make(3), x => x * x) // Null.make(9)\nNull.map(Null.null, x => x * x) // null\n```\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(value, f)` returns `f(value)` if `value` is not `null`, otherwise returns\n`value` unchanged.\n\n## Examples\n\n```rescript\nNull.map(Null.make(3), x => x * x) // Null.make(9)\nNull.map(Null.null, x => x * x) // null\n```\n" + }, "insertText": "->Null.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.getExn", "kind": 12, - "tags": [1], + "label": "->Null.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], + "deprecated": true, "detail": "t<'a> => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `getOrThrow` instead\n\n\n`getExn(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getExn(Null.make(3)) == 3\n\nswitch Null.getExn(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`\n"}, - "sortText": "getExn", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `getOrThrow` instead\n\n\n`getExn(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getExn(Null.make(3)) == 3\n\nswitch Null.getExn(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`\n" + }, "insertText": "->Null.getExn", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.compare", "kind": 12, - "tags": [], + "label": "->Null.getExn", + "sortText": "getExn", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "(t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t", - "documentation": {"kind": "markdown", "value": "\n`compare(a, b, cmp)` compares `a` and `b`.\nIf both are `Null.Value`, it will use function `cmp` to compare the values.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\n// A value is greater than null\nNull.compare(a, b, Int.compare) == Stdlib_Ordering.greater\n// A value is less than null\nNull.compare(b, a, Int.compare) == Stdlib_Ordering.less\n// A null is equal to null\nNull.compare(Null.null, Null.null, Int.compare) == Stdlib_Ordering.equal\n// The compare function is used if both are `Null.Value`\nNull.compare(a, c, Int.compare) == Stdlib_Ordering.less\n```\n"}, - "sortText": "compare", + "documentation": { + "kind": "markdown", + "value": "\n`compare(a, b, cmp)` compares `a` and `b`.\nIf both are `Null.Value`, it will use function `cmp` to compare the values.\n\n## Examples\n```rescript\nlet a = Null.Value(1)\nlet b = Null.null\nlet c = Null.Value(2)\n\n// A value is greater than null\nNull.compare(a, b, Int.compare) == Stdlib_Ordering.greater\n// A value is less than null\nNull.compare(b, a, Int.compare) == Stdlib_Ordering.less\n// A null is equal to null\nNull.compare(Null.null, Null.null, Int.compare) == Stdlib_Ordering.equal\n// The compare function is used if both are `Null.Value`\nNull.compare(a, c, Int.compare) == Stdlib_Ordering.less\n```\n" + }, "insertText": "->Null.compare", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.ignore", "kind": 12, - "tags": [], + "label": "->Null.compare", + "sortText": "compare", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(null)` ignores the provided null and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(null)` ignores the provided null and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Null.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.getOrThrow", "kind": 12, - "tags": [], + "label": "->Null.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "t<'a> => 'a", - "documentation": {"kind": "markdown", "value": "\n`getOrThrow(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getOrThrow(Null.make(3)) == 3\n\nswitch Null.getOrThrow(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`\n"}, - "sortText": "getOrThrow", + "documentation": { + "kind": "markdown", + "value": "\n`getOrThrow(value)` throws an exception if `null`, otherwise returns the value.\n\n```rescript\nNull.getOrThrow(Null.make(3)) == 3\n\nswitch Null.getOrThrow(%raw(\"'ReScript'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"ReScript\"\n}\n\nswitch Null.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null`\n" + }, "insertText": "->Null.getOrThrow", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.toOption", "kind": 12, - "tags": [], + "label": "->Null.getOrThrow", + "sortText": "getOrThrow", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "t<'a> => option<'a>", - "documentation": {"kind": "markdown", "value": "\nConverts a nullable value into an option, so it can be pattern matched on.\nWill convert `null` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullStr = Null.make(\"Hello\")\n\nswitch nullStr->Null.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```\n"}, - "sortText": "toOption", + "documentation": { + "kind": "markdown", + "value": "\nConverts a nullable value into an option, so it can be pattern matched on.\nWill convert `null` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullStr = Null.make(\"Hello\")\n\nswitch nullStr->Null.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```\n" + }, "insertText": "->Null.toOption", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.getOr", "kind": 12, - "tags": [], + "label": "->Null.toOption", + "sortText": "toOption", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "(t<'a>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "\n`getOr(value, default)` returns `value` if not `null`, otherwise return\n`default`.\n\n## Examples\n\n```rescript\nNull.getOr(Null.null, \"Banana\") // Banana\nNull.getOr(Null.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNull.make(\"Jane\")->Null.toOption->greet // \"Greetings Jane\"\nNull.null->Null.toOption->greet // \"Greetings Anonymous\"\n```\n"}, - "sortText": "getOr", + "documentation": { + "kind": "markdown", + "value": "\n`getOr(value, default)` returns `value` if not `null`, otherwise return\n`default`.\n\n## Examples\n\n```rescript\nNull.getOr(Null.null, \"Banana\") // Banana\nNull.getOr(Null.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNull.make(\"Jane\")->Null.toOption->greet // \"Greetings Jane\"\nNull.null->Null.toOption->greet // \"Greetings Anonymous\"\n```\n" + }, "insertText": "->Null.getOr", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.mapOr", "kind": 12, - "tags": [], + "label": "->Null.getOr", + "sortText": "getOr", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "(t<'a>, 'b, 'a => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`,\notherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Null.make(3)\nsomeValue->Null.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Null.null\nnoneValue->Null.mapOr(0, x => x + 5) // 0\n```\n"}, - "sortText": "mapOr", + "documentation": { + "kind": "markdown", + "value": "\n`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`,\notherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Null.make(3)\nsomeValue->Null.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Null.null\nnoneValue->Null.mapOr(0, x => x + 5) // 0\n```\n" + }, "insertText": "->Null.mapOr", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.mapWithDefault", "kind": 12, - "tags": [1], + "label": "->Null.mapOr", + "sortText": "mapOr", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'b, 'a => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "Deprecated: Use mapOr instead\n\n"}, - "sortText": "mapWithDefault", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use mapOr instead\n\n" + }, "insertText": "->Null.mapWithDefault", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.getWithDefault", "kind": 12, - "tags": [1], + "label": "->Null.mapWithDefault", + "sortText": "mapWithDefault", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use getOr instead\n\n"}, - "sortText": "getWithDefault", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use getOr instead\n\n" + }, "insertText": "->Null.getWithDefault", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.asNullable", "kind": 12, - "tags": [], + "label": "->Null.getWithDefault", + "sortText": "getWithDefault", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "t<'a> => Nullable.t<'a>", - "documentation": {"kind": "markdown", "value": "\nConverts a `Null.t` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet nullValue = Null.make(\"Hello\")\nlet asNullable = nullValue->Null.asNullable // Nullable.t\n```\n"}, - "sortText": "asNullable", + "documentation": { + "kind": "markdown", + "value": "\nConverts a `Null.t` into a `Nullable.t`.\n\n## Examples\n```rescript\nlet nullValue = Null.make(\"Hello\")\nlet asNullable = nullValue->Null.asNullable // Nullable.t\n```\n" + }, "insertText": "->Null.asNullable", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.forEach", "kind": 12, - "tags": [], + "label": "->Null.asNullable", + "sortText": "asNullable", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(value, f)` call `f` on `value`. if `value` is not `null`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNull.forEach(Null.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNull.forEach(Null.null, x => Console.log(x)) // logs nothing\n```\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(value, f)` call `f` on `value`. if `value` is not `null`, then if calls\n`f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNull.forEach(Null.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNull.forEach(Null.null, x => Console.log(x)) // logs nothing\n```\n" + }, "insertText": "->Null.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Null.flatMap", "kind": 12, - "tags": [], + "label": "->Null.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 2 }, + "start": { "character": 4, "line": 2 } + } + } + ], "detail": "(t<'a>, 'a => t<'b>) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`flatMap(value, f)` returns `f(value)` if `value` is not `null`, otherwise\nreturns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Null.make(value + 1)\n } else {\n Null.null\n }\n\nNull.flatMap(Null.make(2), addIfAboveOne) // Null.make(3)\nNull.flatMap(Null.make(-4), addIfAboveOne) // null\nNull.flatMap(Null.null, addIfAboveOne) // null\n```\n"}, - "sortText": "flatMap", + "documentation": { + "kind": "markdown", + "value": "\n`flatMap(value, f)` returns `f(value)` if `value` is not `null`, otherwise\nreturns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Null.make(value + 1)\n } else {\n Null.null\n }\n\nNull.flatMap(Null.make(2), addIfAboveOne) // Null.make(3)\nNull.flatMap(Null.make(-4), addIfAboveOne) // null\nNull.flatMap(Null.null, addIfAboveOne) // null\n```\n" + }, "insertText": "->Null.flatMap", - "additionalTextEdits": [{ - "range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 5}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->Null.flatMap", + "sortText": "flatMap", + "tags": [] + } +] Complete src/CompletionNullNullable.res 7:5 posCursor:[7:5] posNoWhite:[7:4] Found expr:[7:3->7:5] @@ -208,185 +347,316 @@ ContextPath Value[y] Path y Path Stdlib.Nullable. Path -[{ - "label": "->Nullable.equal", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "(t<'a>, t<'b>, ('a, 'b) => bool) => bool", - "documentation": null, - "sortText": "equal", "insertText": "->Nullable.equal", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.getUnsafe", "kind": 12, - "tags": [], + "label": "->Nullable.equal", + "sortText": "equal", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "t<'a> => 'a", - "documentation": {"kind": "markdown", "value": "\n`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNullable.getUnsafe(Nullable.make(3)) == 3\nNullable.getUnsafe(Nullable.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null` or `undefined`.\n"}, - "sortText": "getUnsafe", + "documentation": { + "kind": "markdown", + "value": "\n`getUnsafe(value)` returns `value`.\n\n## Examples\n\n```rescript\nNullable.getUnsafe(Nullable.make(3)) == 3\nNullable.getUnsafe(Nullable.null) // Throws an error\n```\n\n## Important\n\n- This is an unsafe operation, it assumes `value` is not `null` or `undefined`.\n" + }, "insertText": "->Nullable.getUnsafe", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.map", "kind": 12, - "tags": [], + "label": "->Nullable.getUnsafe", + "sortText": "getUnsafe", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nNullable.map(Nullable.make(3), x => x * x) // Nullable.make(9)\nNullable.map(undefined, x => x * x) // undefined\n```\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nNullable.map(Nullable.make(3), x => x * x) // Nullable.make(9)\nNullable.map(undefined, x => x * x) // undefined\n```\n" + }, "insertText": "->Nullable.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.getExn", "kind": 12, - "tags": [1], + "label": "->Nullable.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], + "deprecated": true, "detail": "t<'a> => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `getOrThrow` instead\n\n\n`getExn(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getExn(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getExn(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`\n"}, - "sortText": "getExn", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `getOrThrow` instead\n\n\n`getExn(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getExn(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getExn(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getExn(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`\n" + }, "insertText": "->Nullable.getExn", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.compare", "kind": 12, - "tags": [], + "label": "->Nullable.getExn", + "sortText": "getExn", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "(t<'a>, t<'b>, ('a, 'b) => Ordering.t) => Ordering.t", - "documentation": null, - "sortText": "compare", "insertText": "->Nullable.compare", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.ignore", "kind": 12, - "tags": [], + "label": "->Nullable.compare", + "sortText": "compare", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(nullable)` ignores the provided nullable and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(nullable)` ignores the provided nullable and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Nullable.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.getOrThrow", "kind": 12, - "tags": [], + "label": "->Nullable.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "t<'a> => 'a", - "documentation": {"kind": "markdown", "value": "\n`getOrThrow(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getOrThrow(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getOrThrow(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`\n"}, - "sortText": "getOrThrow", + "documentation": { + "kind": "markdown", + "value": "\n`getOrThrow(value)` throws an exception if `null` or `undefined`, otherwise returns the value.\n\n```rescript\nswitch Nullable.getOrThrow(%raw(\"'Hello'\")) {\n| exception Invalid_argument(_) => assert(false)\n| value => value == \"Hello\"\n}\n\nswitch Nullable.getOrThrow(%raw(\"null\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n\nswitch Nullable.getOrThrow(%raw(\"undefined\")) {\n| exception Invalid_argument(_) => assert(true)\n| _ => assert(false)\n}\n```\n\n## Exceptions\n\n- Throws `Invalid_argument` if `value` is `null` or `undefined`\n" + }, "insertText": "->Nullable.getOrThrow", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.toOption", "kind": 12, - "tags": [], + "label": "->Nullable.getOrThrow", + "sortText": "getOrThrow", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "t<'a> => option<'a>", - "documentation": {"kind": "markdown", "value": "\nConverts a nullable value into an option, so it can be pattern matched on.\nWill convert both `null` and `undefined` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullableString = Nullable.make(\"Hello\")\n\nswitch nullableString->Nullable.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```\n"}, - "sortText": "toOption", + "documentation": { + "kind": "markdown", + "value": "\nConverts a nullable value into an option, so it can be pattern matched on.\nWill convert both `null` and `undefined` to `None`, and a present value to `Some(value)`.\n\n## Examples\n```rescript\nlet nullableString = Nullable.make(\"Hello\")\n\nswitch nullableString->Nullable.toOption {\n| Some(str) => Console.log2(\"Got string:\", str)\n| None => Console.log(\"Didn't have a value.\")\n}\n```\n" + }, "insertText": "->Nullable.toOption", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.getOr", "kind": 12, - "tags": [], + "label": "->Nullable.toOption", + "sortText": "toOption", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "(t<'a>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "\n`getOr(value, default)` returns `value` if not `null` or `undefined`,\notherwise return `default`.\n\n## Examples\n\n```rescript\nNullable.getOr(Nullable.null, \"Banana\") // Banana\nNullable.getOr(Nullable.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNullable.make(\"Jane\")->Nullable.toOption->greet // \"Greetings Jane\"\nNullable.null->Nullable.toOption->greet // \"Greetings Anonymous\"\n```\n"}, - "sortText": "getOr", + "documentation": { + "kind": "markdown", + "value": "\n`getOr(value, default)` returns `value` if not `null` or `undefined`,\notherwise return `default`.\n\n## Examples\n\n```rescript\nNullable.getOr(Nullable.null, \"Banana\") // Banana\nNullable.getOr(Nullable.make(\"Apple\"), \"Banana\") // Apple\n\nlet greet = (firstName: option) => \"Greetings \" ++ firstName->Option.getOr(\"Anonymous\")\n\nNullable.make(\"Jane\")->Nullable.toOption->greet // \"Greetings Jane\"\nNullable.null->Nullable.toOption->greet // \"Greetings Anonymous\"\n```\n" + }, "insertText": "->Nullable.getOr", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.mapOr", "kind": 12, - "tags": [], + "label": "->Nullable.getOr", + "sortText": "getOr", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "(t<'a>, 'b, 'a => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`\nor `undefined`, otherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Nullable.make(3)\nsomeValue->Nullable.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Nullable.null\nnoneValue->Nullable.mapOr(0, x => x + 5) // 0\n```\n"}, - "sortText": "mapOr", + "documentation": { + "kind": "markdown", + "value": "\n`mapOr(value, default, f)` returns `f(value)` if `value` is not `null`\nor `undefined`, otherwise returns `default`.\n\n## Examples\n\n```rescript\nlet someValue = Nullable.make(3)\nsomeValue->Nullable.mapOr(0, x => x + 5) // 8\n\nlet noneValue = Nullable.null\nnoneValue->Nullable.mapOr(0, x => x + 5) // 0\n```\n" + }, "insertText": "->Nullable.mapOr", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.mapWithDefault", "kind": 12, - "tags": [1], + "label": "->Nullable.mapOr", + "sortText": "mapOr", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'b, 'a => 'b) => 'b", - "documentation": {"kind": "markdown", "value": "Deprecated: Use mapOr instead\n\n"}, - "sortText": "mapWithDefault", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use mapOr instead\n\n" + }, "insertText": "->Nullable.mapWithDefault", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.getWithDefault", "kind": 12, - "tags": [1], + "label": "->Nullable.mapWithDefault", + "sortText": "mapWithDefault", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use getOr instead\n\n"}, - "sortText": "getWithDefault", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use getOr instead\n\n" + }, "insertText": "->Nullable.getWithDefault", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.isNullable", "kind": 12, - "tags": [], + "label": "->Nullable.getWithDefault", + "sortText": "getWithDefault", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "t<'a> => bool", - "documentation": {"kind": "markdown", "value": "\n`isNullable(a)` returns `true` if `a` is null or undefined, `false` otherwise.\n\n## Examples\n\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Check if asNullable is not null or undefined\nswitch asNullable->Nullable.isNullable {\n| true => assert(false)\n| false => assert(true)\n}\n```\n"}, - "sortText": "isNullable", + "documentation": { + "kind": "markdown", + "value": "\n`isNullable(a)` returns `true` if `a` is null or undefined, `false` otherwise.\n\n## Examples\n\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Check if asNullable is not null or undefined\nswitch asNullable->Nullable.isNullable {\n| true => assert(false)\n| false => assert(true)\n}\n```\n" + }, "insertText": "->Nullable.isNullable", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.forEach", "kind": 12, - "tags": [], + "label": "->Nullable.isNullable", + "sortText": "isNullable", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(value, f)` call `f` on `value`. if `value` is not `null` or `undefined`,\nthen if calls `f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNullable.forEach(Nullable.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNullable.forEach(Nullable.null, x => Console.log(x)) // returns ()\nNullable.forEach(undefined, x => Console.log(x)) // returns ()\n```\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(value, f)` call `f` on `value`. if `value` is not `null` or `undefined`,\nthen if calls `f`, otherwise returns `unit`.\n\n## Examples\n\n```rescript\nNullable.forEach(Nullable.make(\"thing\"), x => Console.log(x)) // logs \"thing\"\nNullable.forEach(Nullable.null, x => Console.log(x)) // returns ()\nNullable.forEach(undefined, x => Console.log(x)) // returns ()\n```\n" + }, "insertText": "->Nullable.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }, { - "label": "->Nullable.flatMap", "kind": 12, - "tags": [], + "label": "->Nullable.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 7 }, + "start": { "character": 4, "line": 7 } + } + } + ], "detail": "(t<'a>, 'a => t<'b>) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`flatMap(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Nullable.make(value + 1)\n } else {\n Nullable.null\n }\n\nNullable.flatMap(Nullable.make(2), addIfAboveOne) // Nullable.make(3)\nNullable.flatMap(Nullable.make(-4), addIfAboveOne) // undefined\nNullable.flatMap(Nullable.null, addIfAboveOne) // undefined\n```\n"}, - "sortText": "flatMap", + "documentation": { + "kind": "markdown", + "value": "\n`flatMap(value, f)` returns `f(value)` if `value` is not `null` or `undefined`,\notherwise returns `value` unchanged.\n\n## Examples\n\n```rescript\nlet addIfAboveOne = value =>\n if value > 1 {\n Nullable.make(value + 1)\n } else {\n Nullable.null\n }\n\nNullable.flatMap(Nullable.make(2), addIfAboveOne) // Nullable.make(3)\nNullable.flatMap(Nullable.make(-4), addIfAboveOne) // undefined\nNullable.flatMap(Nullable.null, addIfAboveOne) // undefined\n```\n" + }, "insertText": "->Nullable.flatMap", - "additionalTextEdits": [{ - "range": {"start": {"line": 7, "character": 4}, "end": {"line": 7, "character": 5}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->Nullable.flatMap", + "sortText": "flatMap", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionObjects.res.txt b/tests/analysis_tests/tests/src/expected/CompletionObjects.res.txt index aeee22461dc..8bc83dda759 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionObjects.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionObjects.res.txt @@ -8,31 +8,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "None", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionPattern.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPattern.res.txt index 3ee897359ec..bd60dbe226c 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPattern.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPattern.res.txt @@ -9,15 +9,16 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[v] Path v -[{ - "label": "(_, _, _)", - "kind": 12, - "tags": [], +[ + { "detail": "(bool, option, (bool, bool))", - "documentation": null, "insertText": "(${1:_}, ${2:_}, ${3:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(_, _, _)", + "tags": [] + } +] Complete src/CompletionPattern.res 13:18 posCursor:[13:18] posNoWhite:[13:17] Found pattern:[13:16->13:22] @@ -27,13 +28,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[v] Path v -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "true", "tags": [] } ] Complete src/CompletionPattern.res 16:25 posCursor:[16:25] posNoWhite:[16:24] Found pattern:[16:16->16:30] @@ -44,13 +39,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[v] Path v -[{ - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "false", "tags": [] } ] Complete src/CompletionPattern.res 21:15 XXX Not found! @@ -59,19 +48,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 24:17 posCursor:[24:17] posNoWhite:[24:16] Found pattern:[24:16->24:17] @@ -80,13 +60,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "true", "tags": [] } ] Complete src/CompletionPattern.res 46:15 XXX Not found! @@ -95,16 +69,21 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "someRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionPattern.res 49:17 posCursor:[49:17] posNoWhite:[49:16] Found pattern:[49:16->49:18] @@ -113,31 +92,48 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "first", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "second", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "first", + "tags": [] + }, + { "detail": "(bool, option)", - "documentation": {"kind": "markdown", "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "optThird", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "second", + "tags": [] + }, + { "detail": "option<[#first | #second(someRecord)]>", - "documentation": {"kind": "markdown", "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "nest", + "documentation": { + "kind": "markdown", + "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "optThird", + "tags": [] + }, + { "detail": "nestedRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "nest", + "tags": [] + } +] Complete src/CompletionPattern.res 52:24 posCursor:[52:24] posNoWhite:[52:22] Found pattern:[52:16->52:35] @@ -146,19 +142,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "optThird", - "kind": 5, - "tags": [], +[ + { "detail": "option<[#first | #second(someRecord)]>", - "documentation": {"kind": "markdown", "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "nest", + "documentation": { + "kind": "markdown", + "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "optThird", + "tags": [] + }, + { "detail": "nestedRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "nest", + "tags": [] + } +] Complete src/CompletionPattern.res 55:19 posCursor:[55:19] posNoWhite:[55:18] Found pattern:[55:16->55:20] @@ -168,13 +173,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "first", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "first", + "tags": [] + } +] Complete src/CompletionPattern.res 58:19 posCursor:[58:19] posNoWhite:[58:18] Found pattern:[58:16->58:24] @@ -185,13 +195,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "optThird", - "kind": 5, - "tags": [], +[ + { "detail": "option<[#first | #second(someRecord)]>", - "documentation": {"kind": "markdown", "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "optThird", + "tags": [] + } +] Complete src/CompletionPattern.res 61:22 posCursor:[61:22] posNoWhite:[61:21] Found pattern:[61:16->61:25] @@ -200,16 +215,21 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "nestedRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype nestedRecord = {nested: bool}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype nestedRecord = {nested: bool}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionPattern.res 64:24 posCursor:[64:24] posNoWhite:[64:23] Found pattern:[64:16->64:26] @@ -219,13 +239,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "nested", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nnested: bool\n```\n\n```rescript\ntype nestedRecord = {nested: bool}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnested: bool\n```\n\n```rescript\ntype nestedRecord = {nested: bool}\n```" + }, + "kind": 5, + "label": "nested", + "tags": [] + } +] Complete src/CompletionPattern.res 70:22 posCursor:[70:22] posNoWhite:[70:21] Found expr:[69:2->72:13] @@ -236,13 +261,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[nest] Path nest -[{ - "label": "nested", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nnested: bool\n```\n\n```rescript\ntype nestedRecord = {nested: bool}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnested: bool\n```\n\n```rescript\ntype nestedRecord = {nested: bool}\n```" + }, + "kind": 5, + "label": "nested", + "tags": [] + } +] Complete src/CompletionPattern.res 76:8 posCursor:[76:8] posNoWhite:[76:7] Found pattern:[76:7->76:9] @@ -251,31 +281,48 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "first", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "second", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "first", + "tags": [] + }, + { "detail": "(bool, option)", - "documentation": {"kind": "markdown", "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "optThird", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "second", + "tags": [] + }, + { "detail": "option<[#first | #second(someRecord)]>", - "documentation": {"kind": "markdown", "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "nest", + "documentation": { + "kind": "markdown", + "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "optThird", + "tags": [] + }, + { "detail": "nestedRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "nest", + "tags": [] + } +] Complete src/CompletionPattern.res 79:16 posCursor:[79:16] posNoWhite:[79:15] Found pattern:[79:7->79:18] @@ -286,13 +333,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[f] Path f -[{ - "label": "nested", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nnested: bool\n```\n\n```rescript\ntype nestedRecord = {nested: bool}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnested: bool\n```\n\n```rescript\ntype nestedRecord = {nested: bool}\n```" + }, + "kind": 5, + "label": "nested", + "tags": [] + } +] Complete src/CompletionPattern.res 87:20 posCursor:[87:20] posNoWhite:[87:19] Found pattern:[87:16->87:21] @@ -304,19 +356,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 90:21 posCursor:[90:21] posNoWhite:[90:20] Found pattern:[90:16->90:22] @@ -327,13 +370,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "true", "tags": [] } ] Complete src/CompletionPattern.res 93:23 posCursor:[93:23] posNoWhite:[93:22] Found pattern:[93:16->93:25] @@ -344,31 +381,48 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "first", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "second", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "first", + "tags": [] + }, + { "detail": "(bool, option)", - "documentation": {"kind": "markdown", "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "optThird", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "second", + "tags": [] + }, + { "detail": "option<[#first | #second(someRecord)]>", - "documentation": {"kind": "markdown", "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "nest", + "documentation": { + "kind": "markdown", + "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "optThird", + "tags": [] + }, + { "detail": "nestedRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "nest", + "tags": [] + } +] Complete src/CompletionPattern.res 96:27 posCursor:[96:27] posNoWhite:[96:26] Found pattern:[96:16->96:28] @@ -380,13 +434,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "true", "tags": [] } ] Complete src/CompletionPattern.res 103:21 posCursor:[103:21] posNoWhite:[103:20] Found pattern:[103:16->103:22] @@ -397,19 +445,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[b] Path b -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 106:22 posCursor:[106:22] posNoWhite:[106:21] Found pattern:[106:16->106:23] @@ -419,13 +458,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[b] Path b -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "true", "tags": [] } ] Complete src/CompletionPattern.res 109:24 posCursor:[109:24] posNoWhite:[109:23] Found pattern:[109:16->109:26] @@ -435,31 +468,48 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[b] Path b -[{ - "label": "first", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "second", + "documentation": { + "kind": "markdown", + "value": "```rescript\nfirst: int\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "first", + "tags": [] + }, + { "detail": "(bool, option)", - "documentation": {"kind": "markdown", "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "optThird", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "second", + "tags": [] + }, + { "detail": "option<[#first | #second(someRecord)]>", - "documentation": {"kind": "markdown", "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "nest", + "documentation": { + "kind": "markdown", + "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "optThird", + "tags": [] + }, + { "detail": "nestedRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "nest", + "tags": [] + } +] Complete src/CompletionPattern.res 112:28 posCursor:[112:28] posNoWhite:[112:27] Found pattern:[112:16->112:29] @@ -470,13 +520,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[b] Path b -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ { "detail": "bool", "kind": 4, "label": "true", "tags": [] } ] Complete src/CompletionPattern.res 118:15 XXX Not found! @@ -485,16 +529,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[c] Path c -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "bool", - "documentation": null, - "sortText": "A", "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionPattern.res 121:17 posCursor:[121:17] posNoWhite:[121:16] Found pattern:[121:16->121:18] @@ -503,19 +548,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[c] Path c -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 127:21 posCursor:[127:21] posNoWhite:[127:20] Found pattern:[127:16->127:22] @@ -527,19 +563,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[o] Path o -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 134:23 posCursor:[134:23] posNoWhite:[134:22] Found pattern:[134:16->134:25] @@ -549,19 +576,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[p] Path p -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 137:29 posCursor:[137:29] posNoWhite:[137:28] Found pattern:[137:16->137:31] @@ -572,33 +590,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[p] Path p -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionPattern.res 140:23 posCursor:[140:23] posNoWhite:[140:22] Found pattern:[140:16->140:31] @@ -609,19 +613,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[p] Path p -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 143:35 posCursor:[143:35] posNoWhite:[143:34] Found pattern:[143:16->143:37] @@ -632,16 +627,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[p] Path p -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "bool", - "documentation": null, - "sortText": "A", "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionPattern.res 150:24 posCursor:[150:24] posNoWhite:[150:23] Found pattern:[150:16->150:26] @@ -650,19 +646,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[v] Path v -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 153:30 posCursor:[153:30] posNoWhite:[153:29] Found pattern:[153:16->153:32] @@ -672,33 +659,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[v] Path v -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionPattern.res 156:24 posCursor:[156:24] posNoWhite:[156:23] Found pattern:[156:16->156:32] @@ -708,19 +681,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[v] Path v -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 159:36 posCursor:[159:36] posNoWhite:[159:35] Found pattern:[159:16->159:38] @@ -730,16 +694,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[v] Path v -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "bool", - "documentation": null, - "sortText": "A", "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionPattern.res 164:17 posCursor:[164:17] posNoWhite:[164:16] Found pattern:[164:16->164:18] @@ -749,19 +714,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[s] Path s -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 167:23 posCursor:[167:23] posNoWhite:[167:21] Found pattern:[167:16->167:24] @@ -770,33 +726,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[s] Path s -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionPattern.res 170:22 posCursor:[170:22] posNoWhite:[170:21] Found pattern:[170:16->170:28] @@ -805,33 +747,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[s] Path s -[{ - "label": "None", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionPattern.res 173:35 XXX Not found! @@ -840,15 +768,16 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[s] Path s -[{ - "label": "(_, _, _)", - "kind": 12, - "tags": [], +[ + { "detail": "(bool, option, array)", - "documentation": null, "insertText": "(${1:_}, ${2:_}, ${3:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(_, _, _)", + "tags": [] + } +] Complete src/CompletionPattern.res 176:41 posCursor:[176:41] posNoWhite:[176:40] Found pattern:[176:35->176:47] @@ -857,33 +786,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[s] Path s -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionPattern.res 179:21 XXX Not found! @@ -892,31 +807,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Two(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two(_)", + "tags": [] + }, + { "detail": "Three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] Complete src/CompletionPattern.res 182:32 posCursor:[182:32] posNoWhite:[182:31] Found pattern:[182:16->182:34] @@ -927,19 +855,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 185:48 posCursor:[185:48] posNoWhite:[185:47] Found pattern:[185:16->185:50] @@ -951,19 +870,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[z] Path z -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 188:34 posCursor:[188:34] posNoWhite:[188:33] Found pattern:[188:16->188:36] @@ -973,19 +883,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[b] Path b -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 191:50 posCursor:[191:50] posNoWhite:[191:49] Found pattern:[191:16->191:52] @@ -996,19 +897,10 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[b] Path b -[{ - "label": "true", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "false", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] +[ + { "detail": "bool", "kind": 4, "label": "true", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "false", "tags": [] } +] Complete src/CompletionPattern.res 194:24 posCursor:[194:24] posNoWhite:[194:23] Found pattern:[194:16->194:29] @@ -1018,33 +910,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[s] Path s -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionPattern.res 201:25 posCursor:[201:25] posNoWhite:[201:24] Found pattern:[201:17->201:28] @@ -1062,13 +940,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[xn] Path xn -[{ - "label": "Exn.Error(error)", - "kind": 4, - "tags": [], +[ + { "detail": "Catches errors from JavaScript errors.", - "documentation": {"kind": "markdown", "value": "Matches on a JavaScript error. Read more in the [documentation on catching JS exceptions](https://rescript-lang.org/docs/manual/latest/exception#catching-js-exceptions)."} - }] + "documentation": { + "kind": "markdown", + "value": "Matches on a JavaScript error. Read more in the [documentation on catching JS exceptions](https://rescript-lang.org/docs/manual/latest/exception#catching-js-exceptions)." + }, + "kind": 4, + "label": "Exn.Error(error)", + "tags": [] + } +] Complete src/CompletionPattern.res 211:30 XXX Not found! @@ -1079,31 +962,44 @@ ContextPath await Value[getThing](Nolabel) ContextPath Value[getThing](Nolabel) ContextPath Value[getThing] Path getThing -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Two(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two(_)", + "tags": [] + }, + { "detail": "Three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] Complete src/CompletionPattern.res 216:21 posCursor:[216:21] posNoWhite:[216:20] Found pattern:[216:18->216:22] @@ -1115,31 +1011,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Two(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two(_)", + "tags": [] + }, + { "detail": "Three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] Complete src/CompletionPattern.res 219:24 posCursor:[219:24] posNoWhite:[219:23] Found pattern:[219:18->219:25] @@ -1151,31 +1060,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#one", - "insertTextFormat": 2 - }, { - "label": "#three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#one", + "tags": [] + }, + { "detail": "#three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }, { - "label": "#two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#three(_, _)", + "tags": [] + }, + { "detail": "#two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#two(${1:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two(_)", + "tags": [] + } +] Complete src/CompletionPattern.res 227:25 posCursor:[227:25] posNoWhite:[227:24] Found expr:[223:11->232:1] @@ -1187,25 +1109,38 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[r] Path r -[{ - "label": "second", - "kind": 5, - "tags": [], +[ + { "detail": "(bool, option)", - "documentation": {"kind": "markdown", "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "optThird", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsecond: (bool, option)\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "second", + "tags": [] + }, + { "detail": "option<[#first | #second(someRecord)]>", - "documentation": {"kind": "markdown", "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }, { - "label": "nest", + "documentation": { + "kind": "markdown", + "value": "```rescript\noptThird: option<[#first | #second(someRecord)]>\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, "kind": 5, - "tags": [], + "label": "optThird", + "tags": [] + }, + { "detail": "nestedRecord", - "documentation": {"kind": "markdown", "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nnest: nestedRecord\n```\n\n```rescript\ntype someRecord = {first: int, second: (bool, option), optThird: option<[#first | #second(someRecord)]>, nest: nestedRecord}\n```" + }, + "kind": 5, + "label": "nest", + "tags": [] + } +] Complete src/CompletionPattern.res 243:33 posCursor:[243:33] posNoWhite:[243:32] Found pattern:[243:7->243:35] @@ -1215,11 +1150,16 @@ Resolved opens 1 Stdlib ContextPath Value[hitsUse](Nolabel) ContextPath Value[hitsUse] Path hitsUse -[{ - "label": "hits", - "kind": 5, - "tags": [], +[ + { "detail": "array", - "documentation": {"kind": "markdown", "value": "```rescript\nhits: array\n```\n\n```rescript\ntype hitsUse = {results: results, hits: array}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nhits: array\n```\n\n```rescript\ntype hitsUse = {results: results, hits: array}\n```" + }, + "kind": 5, + "label": "hits", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt index 1519636e45b..fd4f532bd61 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeChain.res.txt @@ -9,31 +9,27 @@ Path int CPPipe pathFromEnv:Integer found:true Path Integer. Path -[{ - "label": "Integer.toInt", +[ + { "detail": "t => int", "kind": 12, "label": "Integer.toInt", "tags": [] }, + { + "detail": "(t, int) => t", "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { "label": "Integer.increment", + "tags": [] + }, + { + "detail": "(t, int => int) => t", "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { "label": "Integer.decrement", + "tags": [] + }, + { + "detail": "Integer.t => SuperFloat.t", "kind": 12, - "tags": [], - "detail": "(t, int => int) => t", - "documentation": null - }, { "label": "toFlt", - "kind": 12, - "tags": [], - "detail": "Integer.t => SuperFloat.t", - "documentation": null - }] + "tags": [] + } +] Complete src/CompletionPipeChain.res 30:23 posCursor:[30:23] posNoWhite:[30:22] Found expr:[30:11->0:-1] @@ -47,13 +43,14 @@ Path toFlt CPPipe pathFromEnv:SuperFloat found:true Path SuperFloat. Path -[{ - "label": "SuperFloat.toInteger", - "kind": 12, - "tags": [], +[ + { "detail": "t => Integer.t", - "documentation": null - }] + "kind": 12, + "label": "SuperFloat.toInteger", + "tags": [] + } +] Complete src/CompletionPipeChain.res 33:38 posCursor:[33:38] posNoWhite:[33:37] Found expr:[33:11->0:-1] @@ -67,31 +64,27 @@ Path Integer.increment CPPipe pathFromEnv:Integer found:true Path Integer. Path -[{ - "label": "Integer.toInt", +[ + { "detail": "t => int", "kind": 12, "label": "Integer.toInt", "tags": [] }, + { + "detail": "(t, int) => t", "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { "label": "Integer.increment", + "tags": [] + }, + { + "detail": "(t, int => int) => t", "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { "label": "Integer.decrement", + "tags": [] + }, + { + "detail": "Integer.t => SuperFloat.t", "kind": 12, - "tags": [], - "detail": "(t, int => int) => t", - "documentation": null - }, { "label": "toFlt", - "kind": 12, - "tags": [], - "detail": "Integer.t => SuperFloat.t", - "documentation": null - }] + "tags": [] + } +] Complete src/CompletionPipeChain.res 36:38 posCursor:[36:38] posNoWhite:[36:37] Found expr:[36:11->0:-1] @@ -105,31 +98,27 @@ Path Integer.increment CPPipe pathFromEnv:Integer found:true Path Integer. Path -[{ - "label": "Integer.toInt", +[ + { "detail": "t => int", "kind": 12, "label": "Integer.toInt", "tags": [] }, + { + "detail": "(t, int) => t", "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { "label": "Integer.increment", + "tags": [] + }, + { + "detail": "(t, int => int) => t", "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { "label": "Integer.decrement", + "tags": [] + }, + { + "detail": "Integer.t => SuperFloat.t", "kind": 12, - "tags": [], - "detail": "(t, int => int) => t", - "documentation": null - }, { "label": "toFlt", - "kind": 12, - "tags": [], - "detail": "Integer.t => SuperFloat.t", - "documentation": null - }] + "tags": [] + } +] Complete src/CompletionPipeChain.res 39:47 posCursor:[39:47] posNoWhite:[39:46] Found expr:[39:11->0:-1] @@ -143,31 +132,27 @@ Path Integer.decrement CPPipe pathFromEnv:Integer found:true Path Integer. Path -[{ - "label": "Integer.toInt", +[ + { "detail": "t => int", "kind": 12, "label": "Integer.toInt", "tags": [] }, + { + "detail": "(t, int) => t", "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { "label": "Integer.increment", + "tags": [] + }, + { + "detail": "(t, int => int) => t", "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { "label": "Integer.decrement", + "tags": [] + }, + { + "detail": "Integer.t => SuperFloat.t", "kind": 12, - "tags": [], - "detail": "(t, int => int) => t", - "documentation": null - }, { "label": "toFlt", - "kind": 12, - "tags": [], - "detail": "Integer.t => SuperFloat.t", - "documentation": null - }] + "tags": [] + } +] Complete src/CompletionPipeChain.res 42:69 posCursor:[42:69] posNoWhite:[42:68] Found expr:[42:11->0:-1] @@ -181,31 +166,27 @@ Path Integer.decrement CPPipe pathFromEnv:Integer found:true Path Integer. Path -[{ - "label": "Integer.toInt", +[ + { "detail": "t => int", "kind": 12, "label": "Integer.toInt", "tags": [] }, + { + "detail": "(t, int) => t", "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { "label": "Integer.increment", + "tags": [] + }, + { + "detail": "(t, int => int) => t", "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { "label": "Integer.decrement", + "tags": [] + }, + { + "detail": "Integer.t => SuperFloat.t", "kind": 12, - "tags": [], - "detail": "(t, int => int) => t", - "documentation": null - }, { "label": "toFlt", - "kind": 12, - "tags": [], - "detail": "Integer.t => SuperFloat.t", - "documentation": null - }] + "tags": [] + } +] Complete src/CompletionPipeChain.res 45:62 posCursor:[45:62] posNoWhite:[45:61] Found expr:[45:11->0:-1] @@ -219,13 +200,14 @@ Path SuperFloat.fromInteger CPPipe pathFromEnv:SuperFloat found:true Path SuperFloat. Path -[{ - "label": "SuperFloat.toInteger", - "kind": 12, - "tags": [], +[ + { "detail": "t => Integer.t", - "documentation": null - }] + "kind": 12, + "label": "SuperFloat.toInteger", + "tags": [] + } +] Complete src/CompletionPipeChain.res 48:63 posCursor:[48:63] posNoWhite:[48:62] Found expr:[48:11->48:63] @@ -239,13 +221,14 @@ Path SuperFloat.fromInteger CPPipe pathFromEnv:SuperFloat found:true Path SuperFloat.t Path t -[{ - "label": "SuperFloat.toInteger", - "kind": 12, - "tags": [], +[ + { "detail": "t => Integer.t", - "documentation": null - }] + "kind": 12, + "label": "SuperFloat.toInteger", + "tags": [] + } +] Complete src/CompletionPipeChain.res 51:82 posCursor:[51:82] posNoWhite:[51:81] Found expr:[51:11->0:-1] @@ -259,19 +242,20 @@ Path CompletionSupport.Test.make CPPipe pathFromEnv:Test found:true Path CompletionSupport.Test. Path -[{ - "label": "CompletionSupport.Test.add", - "kind": 12, - "tags": [], +[ + { "detail": "t => int", - "documentation": null - }, { - "label": "CompletionSupport.Test.addSelf", "kind": 12, - "tags": [], + "label": "CompletionSupport.Test.add", + "tags": [] + }, + { "detail": "t => t", - "documentation": null - }] + "kind": 12, + "label": "CompletionSupport.Test.addSelf", + "tags": [] + } +] Complete src/CompletionPipeChain.res 54:78 posCursor:[54:78] posNoWhite:[54:77] Found expr:[54:11->0:-1] @@ -285,19 +269,20 @@ Path CompletionSupport.Test.addSelf CPPipe pathFromEnv:Test found:true Path CompletionSupport.Test. Path -[{ - "label": "CompletionSupport.Test.add", - "kind": 12, - "tags": [], +[ + { "detail": "t => int", - "documentation": null - }, { - "label": "CompletionSupport.Test.addSelf", "kind": 12, - "tags": [], + "label": "CompletionSupport.Test.add", + "tags": [] + }, + { "detail": "t => t", - "documentation": null - }] + "kind": 12, + "label": "CompletionSupport.Test.addSelf", + "tags": [] + } +] Complete src/CompletionPipeChain.res 58:5 posCursor:[58:5] posNoWhite:[58:4] Found expr:[57:8->0:-1] @@ -324,67 +309,112 @@ ContextPath Value[Belt, Array, reduce] Path Belt.Array.reduce Path Stdlib.Int.t Path t -[{ - "label": "Int.toStringWithRadix", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "(int, ~radix: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toExponentialWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toString` instead\n\n\n`toStringWithRadix(n, ~radix)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toStringWithRadix(6, ~radix=2) // \"110\"\nInt.toStringWithRadix(373592855, ~radix=16) // \"16449317\"\nInt.toStringWithRadix(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toStringWithRadix", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixedWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toExponential` instead\n\n\n`toExponential(n, ~digits)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\non MDN.\n\n## Examples\n\n```rescript\nInt.toExponentialWithPrecision(77, ~digits=2) // \"7.70e+1\"\nInt.toExponentialWithPrecision(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toExponentialWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }, { - "label": "Int.toPrecisionWithPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toFixed` instead\n\n\n`toFixedWithPrecision(n, ~digits)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixedWithPrecision(300, ~digits=4) // \"300.0000\"\nInt.toFixedWithPrecision(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, "kind": 12, - "tags": [1], + "label": "Int.toFixedWithPrecision", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "(int, ~digits: int) => string", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toPrecision", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `toPrecision` instead\n\n\n`toPrecisionWithPrecision(n, ~digits)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecisionWithPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecisionWithPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecisionWithPrecision", + "tags": [ 1 ] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n"} - }, { - "label": "Int.toString", + "documentation": { + "kind": "markdown", + "value": "\n`toPrecision(n, ~digits=?)` return a `string` representing the giver value with\nprecision. `digits` specifies the number of significant digits. See [`Number.toPrecision`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision) on MDN.\n\n## Examples\n\n```rescript\nInt.toPrecision(100) // \"100\"\nInt.toPrecision(1) // \"1\"\nInt.toPrecision(100, ~digits=2) // \"1.0e+2\"\nInt.toPrecision(1, ~digits=2) // \"1.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is not between 1 and 100 (inclusive).\n Implementations are allowed to support larger and smaller values as well.\n ECMA-262 only requires a precision of up to 21 significant digits.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toPrecision", + "tags": [] + }, + { "detail": "(int, ~radix: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n"} - }, { - "label": "Int.toFloat", + "documentation": { + "kind": "markdown", + "value": "\n`toString(n, ~radix=?)` return a `string` representing the given value.\n`~radix` specifies the radix base to use for the formatted number.\nSee [`Number.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString)\non MDN.\n\n## Examples\n\n```rescript\nInt.toString(1000) // \"1000\"\nInt.toString(-1000) // \"-1000\"\nInt.toString(6, ~radix=2) // \"110\"\nInt.toString(373592855, ~radix=16) // \"16449317\"\nInt.toString(123456, ~radix=36) // \"2n9c\"\n```\n\n## Exceptions\n\n`RangeError`: if `radix` is less than 2 or greater than 36.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toString", + "tags": [] + }, + { "detail": "int => float", - "documentation": {"kind": "markdown", "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n"} - }, { - "label": "Int.toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toFloat(n)` return a `float` representing the given value.\n\n## Examples\n\n```rescript\nInt.toFloat(100) == 100.0\nInt.toFloat(2) == 2.0\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toFloat", + "tags": [] + }, + { "detail": "int => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n"} - }, { - "label": "Int.toExponential", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(n)` return a `string` with language-sensitive representing the\ngiven value. See [`Number.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) on MDN.\n\n## Examples\n\n```rescript\n// If the application uses English as the default language\nInt.toLocaleString(1000) // \"1,000\"\n\n// If the application uses Portuguese Brazil as the default language\nInt.toLocaleString(1000) // \"1.000\"\n```\n" + }, "kind": 12, - "tags": [], + "label": "Int.toLocaleString", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n"} - }, { - "label": "Int.toFixed", + "documentation": { + "kind": "markdown", + "value": "\n`toExponential(n, ~digits=?)` return a `string` representing the given value in\nexponential notation. `digits` specifies how many digits should appear after\nthe decimal point. See [`Number.toExponential`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential)\n\n## Examples\n\n```rescript\nInt.toExponential(1000) // \"1e+3\"\nInt.toExponential(-1000) // \"-1e+3\"\nInt.toExponential(77, ~digits=2) // \"7.70e+1\"\nInt.toExponential(5678, ~digits=2) // \"5.68e+3\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` less than 0 or greater than 10.\n" + }, "kind": 12, - "tags": [], + "label": "Int.toExponential", + "tags": [] + }, + { "detail": "(int, ~digits: int=?) => string", - "documentation": {"kind": "markdown", "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`toFixed(n, ~digits=?)` return a `string` representing the given\nvalue using fixed-point notation. `digits` specifies how many digits should\nappear after the decimal point. See [`Number.toFixed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)\non MDN.\n\n## Examples\n\n```rescript\nInt.toFixed(123456) // \"123456.00\"\nInt.toFixed(10) // \"10.00\"\nInt.toFixed(300, ~digits=4) // \"300.0000\"\nInt.toFixed(300, ~digits=1) // \"300.0\"\n```\n\n## Exceptions\n\n- `RangeError`: If `digits` is less than 0 or larger than 100.\n" + }, + "kind": 12, + "label": "Int.toFixed", + "tags": [] + } +] Complete src/CompletionPipeChain.res 70:12 posCursor:[70:12] posNoWhite:[70:11] Found expr:[70:3->0:-1] @@ -397,19 +427,20 @@ Path aliased CPPipe pathFromEnv:CompletionSupport.Test found:false Path CompletionSupport.Test. Path -[{ - "label": "CompletionSupport.Test.add", - "kind": 12, - "tags": [], +[ + { "detail": "t => int", - "documentation": null - }, { - "label": "CompletionSupport.Test.addSelf", "kind": 12, - "tags": [], + "label": "CompletionSupport.Test.add", + "tags": [] + }, + { "detail": "t => t", - "documentation": null - }] + "kind": 12, + "label": "CompletionSupport.Test.addSelf", + "tags": [] + } +] Complete src/CompletionPipeChain.res 73:15 posCursor:[73:15] posNoWhite:[73:14] Found expr:[73:3->0:-1] @@ -422,19 +453,20 @@ Path notAliased CPPipe pathFromEnv:CompletionSupport.Test found:false Path CompletionSupport.Test. Path -[{ - "label": "CompletionSupport.Test.add", - "kind": 12, - "tags": [], +[ + { "detail": "t => int", - "documentation": null - }, { - "label": "CompletionSupport.Test.addSelf", "kind": 12, - "tags": [], + "label": "CompletionSupport.Test.add", + "tags": [] + }, + { "detail": "t => t", - "documentation": null - }] + "kind": 12, + "label": "CompletionSupport.Test.addSelf", + "tags": [] + } +] Complete src/CompletionPipeChain.res 82:30 posCursor:[82:30] posNoWhite:[82:29] Found expr:[76:15->93:1] @@ -473,13 +505,14 @@ Path root CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root.ren Path ren -[{ - "label": "ReactDOM.Client.Root.render", - "kind": 12, - "tags": [], +[ + { "detail": "(t, React.element) => unit", - "documentation": null - }] + "kind": 12, + "label": "ReactDOM.Client.Root.render", + "tags": [] + } +] Complete src/CompletionPipeChain.res 88:16 posCursor:[88:16] posNoWhite:[88:15] Found expr:[76:15->93:1] @@ -499,13 +532,14 @@ Path root CPPipe pathFromEnv:ReactDOM.Client.Root found:false Path ReactDOM.Client.Root.ren Path ren -[{ - "label": "ReactDOM.Client.Root.render", - "kind": 12, - "tags": [], +[ + { "detail": "(t, React.element) => unit", - "documentation": null - }] + "kind": 12, + "label": "ReactDOM.Client.Root.render", + "tags": [] + } +] Complete src/CompletionPipeChain.res 95:20 posCursor:[95:20] posNoWhite:[95:19] Found expr:[95:3->95:21] @@ -521,31 +555,27 @@ Path int CPPipe pathFromEnv:Integer found:true Path Integer. Path -[{ - "label": "Integer.toInt", +[ + { "detail": "t => int", "kind": 12, "label": "Integer.toInt", "tags": [] }, + { + "detail": "(t, int) => t", "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { "label": "Integer.increment", + "tags": [] + }, + { + "detail": "(t, int => int) => t", "kind": 12, - "tags": [], - "detail": "(t, int) => t", - "documentation": null - }, { "label": "Integer.decrement", + "tags": [] + }, + { + "detail": "Integer.t => SuperFloat.t", "kind": 12, - "tags": [], - "detail": "(t, int => int) => t", - "documentation": null - }, { "label": "toFlt", - "kind": 12, - "tags": [], - "detail": "Integer.t => SuperFloat.t", - "documentation": null - }] + "tags": [] + } +] Complete src/CompletionPipeChain.res 98:21 posCursor:[98:21] posNoWhite:[98:20] Found expr:[98:3->98:22] @@ -560,19 +590,15 @@ Path int CPPipe pathFromEnv:Integer found:true Path Integer.t Path t -[{ - "label": "Integer.toInt", +[ + { "detail": "t => int", "kind": 12, "label": "Integer.toInt", "tags": [] }, + { + "detail": "Integer.t => SuperFloat.t", "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { "label": "toFlt", - "kind": 12, - "tags": [], - "detail": "Integer.t => SuperFloat.t", - "documentation": null - }] + "tags": [] + } +] Complete src/CompletionPipeChain.res 103:8 posCursor:[103:8] posNoWhite:[103:7] Found expr:[103:3->103:8] @@ -584,13 +610,18 @@ ContextPath Value[r] Path r Path Stdlib.RegExp.la Path la -[{ - "label": "RegExp.lastIndex", - "kind": 12, - "tags": [], +[ + { "detail": "t => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```\n" + }, + "kind": 12, + "label": "RegExp.lastIndex", + "tags": [] + } +] Complete src/CompletionPipeChain.res 112:7 posCursor:[112:7] posNoWhite:[112:6] Found expr:[112:3->0:-1] @@ -603,11 +634,5 @@ Path xx CPPipe pathFromEnv:Xyz found:true Path Xyz. Path -[{ - "label": "Xyz.do", - "kind": 12, - "tags": [], - "detail": "xx => string", - "documentation": null - }] +[ { "detail": "xx => string", "kind": 12, "label": "Xyz.do", "tags": [] } ] diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt index 29d9652878d..35d9831e114 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeProperty.res.txt @@ -27,41 +27,60 @@ Path anchor CPPipe pathFromEnv:ObservablePoint found:true Path ObservablePoint. Path -[{ - "label": "x", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nx: int\n```\n\n```rescript\ntype op = {mutable x: int, mutable y: int}\n```"} - }, { - "label": "y", + "documentation": { + "kind": "markdown", + "value": "```rescript\nx: int\n```\n\n```rescript\ntype op = {mutable x: int, mutable y: int}\n```" + }, "kind": 5, - "tags": [], + "label": "x", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\ny: int\n```\n\n```rescript\ntype op = {mutable x: int, mutable y: int}\n```"} - }, { - "label": "->ObservablePoint.setBoth", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ny: int\n```\n\n```rescript\ntype op = {mutable x: int, mutable y: int}\n```" + }, + "kind": 5, + "label": "y", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 21 }, + "start": { "character": 16, "line": 21 } + } + } + ], "detail": "(op, float) => unit", - "documentation": null, - "sortText": "setBoth", "insertText": "->ObservablePoint.setBoth", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 16}, "end": {"line": 21, "character": 17}}, - "newText": "" - }] - }, { - "label": "->ObservablePoint.set", "kind": 12, - "tags": [], + "label": "->ObservablePoint.setBoth", + "sortText": "setBoth", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 21 }, + "start": { "character": 16, "line": 21 } + } + } + ], "detail": "(op, float, float) => unit", - "documentation": null, - "sortText": "set", "insertText": "->ObservablePoint.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 16}, "end": {"line": 21, "character": 17}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->ObservablePoint.set", + "sortText": "set", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt b/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt index 8c6ad205056..948806c930b 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionPipeSubmodules.res.txt @@ -11,13 +11,7 @@ Path A.B1.xx CPPipe pathFromEnv:A.B1 found:true Path A.B1. Path -[{ - "label": "A.B1.d", - "kind": 12, - "tags": [], - "detail": "b1 => string", - "documentation": null - }] +[ { "detail": "b1 => string", "kind": 12, "label": "A.B1.d", "tags": [] } ] Complete src/CompletionPipeSubmodules.res 17:18 posCursor:[17:18] posNoWhite:[17:17] Found expr:[17:11->23:23] @@ -39,13 +33,7 @@ Path v CPPipe pathFromEnv:A.B1 found:true Path A.B1. Path -[{ - "label": "A.B1.d", - "kind": 12, - "tags": [], - "detail": "b1 => string", - "documentation": null - }] +[ { "detail": "b1 => string", "kind": 12, "label": "A.B1.d", "tags": [] } ] Complete src/CompletionPipeSubmodules.res 41:20 posCursor:[41:20] posNoWhite:[41:19] Found expr:[41:11->0:-1] @@ -79,13 +67,7 @@ Path v CPPipe pathFromEnv:C found:false Path C. Path -[{ - "label": "C.do", - "kind": 12, - "tags": [], - "detail": "t => string", - "documentation": null - }] +[ { "detail": "t => string", "kind": 12, "label": "C.do", "tags": [] } ] Complete src/CompletionPipeSubmodules.res 45:21 posCursor:[45:21] posNoWhite:[45:20] Found expr:[45:11->0:-1] @@ -119,11 +101,5 @@ Path v2 CPPipe pathFromEnv:D.C2 found:true Path D.C2. Path -[{ - "label": "D.C2.do", - "kind": 12, - "tags": [], - "detail": "t2 => string", - "documentation": null - }] +[ { "detail": "t2 => string", "kind": 12, "label": "D.C2.do", "tags": [] } ] diff --git a/tests/analysis_tests/tests/src/expected/CompletionRegexp.res.txt b/tests/analysis_tests/tests/src/expected/CompletionRegexp.res.txt index 053f84b1d04..52a73734951 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionRegexp.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionRegexp.res.txt @@ -8,77 +8,126 @@ ContextPath Value[emailPattern] Path emailPattern Path Stdlib.RegExp. Path -[{ - "label": "RegExp.lastIndex", - "kind": 12, - "tags": [], +[ + { "detail": "t => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```\n"} - }, { - "label": "RegExp.setLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndex(regexp)` returns the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `0` to the console\n\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `4` to the console\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.lastIndex", + "tags": [] + }, + { "detail": "(t, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```\n"} - }, { - "label": "RegExp.sticky", + "documentation": { + "kind": "markdown", + "value": "\n`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.setLastIndex", + "tags": [] + }, + { "detail": "t => bool", - "documentation": {"kind": "markdown", "value": "\n`sticky(regexp)` returns whether the sticky (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.sticky`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `y` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"my\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `y` is set\n```\n"} - }, { - "label": "RegExp.ignore", + "documentation": { + "kind": "markdown", + "value": "\n`sticky(regexp)` returns whether the sticky (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.sticky`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `y` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"my\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `y` is set\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.sticky", + "tags": [] + }, + { "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(regExp)` ignores the provided regExp and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"} - }, { - "label": "RegExp.exec", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(regExp)` ignores the provided regExp and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.ignore", + "tags": [] + }, + { "detail": "(t, string) => option", - "documentation": {"kind": "markdown", "value": "\n`exec(regexp, string)` executes the provided regexp on the provided string, optionally returning a `RegExp.Result.t` if the regexp matches on the string.\n\nSee [`RegExp.exec`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```\n"} - }, { - "label": "RegExp.ignoreCase", + "documentation": { + "kind": "markdown", + "value": "\n`exec(regexp, string)` executes the provided regexp on the provided string, optionally returning a `RegExp.Result.t` if the regexp matches on the string.\n\nSee [`RegExp.exec`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nswitch regexp->RegExp.exec(\"ReScript is pretty cool, right?\") {\n| None => Console.log(\"Nope, no match...\")\n| Some(result) => Console.log(result->RegExp.Result.fullMatch) // Prints \"ReScript\"\n}\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.exec", + "tags": [] + }, + { "detail": "t => bool", - "documentation": {"kind": "markdown", "value": "\n`ignoreCase(regexp)` returns whether the ignore case (`i`) flag is set on this `RegExp`.\n\nSee [`RegExp.ignoreCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/ignoreCase) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.ignoreCase) // Logs `false`, since `i` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.ignoreCase) // Logs `true`, since `i` is set\n```\n"} - }, { - "label": "RegExp.global", + "documentation": { + "kind": "markdown", + "value": "\n`ignoreCase(regexp)` returns whether the ignore case (`i`) flag is set on this `RegExp`.\n\nSee [`RegExp.ignoreCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/ignoreCase) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.ignoreCase) // Logs `false`, since `i` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.ignoreCase) // Logs `true`, since `i` is set\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.ignoreCase", + "tags": [] + }, + { "detail": "t => bool", - "documentation": {"kind": "markdown", "value": "\n`global(regexp)` returns whether the global (`g`) flag is set on this `RegExp`.\n\nSee [`RegExp.global`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.global) // Logs `true`, since `g` is set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.global) // Logs `false`, since `g` is not set\n```\n"} - }, { - "label": "RegExp.multiline", + "documentation": { + "kind": "markdown", + "value": "\n`global(regexp)` returns whether the global (`g`) flag is set on this `RegExp`.\n\nSee [`RegExp.global`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.global) // Logs `true`, since `g` is set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"i\")\nConsole.log(regexp2->RegExp.global) // Logs `false`, since `g` is not set\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.global", + "tags": [] + }, + { "detail": "t => bool", - "documentation": {"kind": "markdown", "value": "\n`multiline(regexp)` returns whether the multiline (`m`) flag is set on this `RegExp`.\n\nSee [`RegExp.multiline`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/multiline) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.multiline) // Logs `false`, since `m` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mi\")\nConsole.log(regexp2->RegExp.multiline) // Logs `true`, since `m` is set\n```\n"} - }, { - "label": "RegExp.test", + "documentation": { + "kind": "markdown", + "value": "\n`multiline(regexp)` returns whether the multiline (`m`) flag is set on this `RegExp`.\n\nSee [`RegExp.multiline`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/multiline) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.multiline) // Logs `false`, since `m` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mi\")\nConsole.log(regexp2->RegExp.multiline) // Logs `true`, since `m` is set\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.multiline", + "tags": [] + }, + { "detail": "(t, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`test(regexp, string)` tests whether the provided `regexp` matches on the provided string.\n\nSee [`RegExp.test`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nif regexp->RegExp.test(\"ReScript is cool!\") {\n Console.log(\"Yay, there's a word in there.\")\n}\n```\n"} - }, { - "label": "RegExp.unicode", + "documentation": { + "kind": "markdown", + "value": "\n`test(regexp, string)` tests whether the provided `regexp` matches on the provided string.\n\nSee [`RegExp.test`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\n\nif regexp->RegExp.test(\"ReScript is cool!\") {\n Console.log(\"Yay, there's a word in there.\")\n}\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.test", + "tags": [] + }, + { "detail": "t => bool", - "documentation": {"kind": "markdown", "value": "\n`unicode(regexp)` returns whether the unicode (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.unicode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `u` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mu\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `u` is set\n```\n"} - }, { - "label": "RegExp.source", + "documentation": { + "kind": "markdown", + "value": "\n`unicode(regexp)` returns whether the unicode (`y`) flag is set on this `RegExp`.\n\nSee [`RegExp.unicode`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) on MDN.\n\n## Examples\n```rescript\nlet regexp1 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp1->RegExp.unicode) // Logs `false`, since `u` is not set\n\nlet regexp2 = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"mu\")\nConsole.log(regexp2->RegExp.unicode) // Logs `true`, since `u` is set\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.unicode", + "tags": [] + }, + { "detail": "t => string", - "documentation": {"kind": "markdown", "value": "\n`source(regexp)` returns the source text for this `RegExp`, without the two forward slashes (if present), and without any set flags.\n\nSee [`RegExp.source`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/source) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp->RegExp.source) // Logs `\\w+`, the source text of the `RegExp`\n```\n"} - }, { - "label": "RegExp.flags", + "documentation": { + "kind": "markdown", + "value": "\n`source(regexp)` returns the source text for this `RegExp`, without the two forward slashes (if present), and without any set flags.\n\nSee [`RegExp.source`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/source) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromStringWithFlags(\"\\\\w+\", ~flags=\"g\")\nConsole.log(regexp->RegExp.source) // Logs `\\w+`, the source text of the `RegExp`\n```\n" + }, "kind": 12, - "tags": [], + "label": "RegExp.source", + "tags": [] + }, + { "detail": "t => string", - "documentation": {"kind": "markdown", "value": "\n`flags(regexp)` returns a string consisting of all the flags set on this `RegExp`.\n\nSee [`RegExp.flags`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromString(\"\\\\w+\", ~flags=\"gi\")\nConsole.log(regexp->RegExp.flags) // Logs \"gi\", all the flags set on the RegExp\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`flags(regexp)` returns a string consisting of all the flags set on this `RegExp`.\n\nSee [`RegExp.flags`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) on MDN.\n\n## Examples\n```rescript\nlet regexp = RegExp.fromString(\"\\\\w+\", ~flags=\"gi\")\nConsole.log(regexp->RegExp.flags) // Logs \"gi\", all the flags set on the RegExp\n```\n" + }, + "kind": 12, + "label": "RegExp.flags", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt b/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt index 2cfc84238d7..7fe6d09ca6a 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt @@ -13,43 +13,59 @@ Path w CPPipe pathFromEnv:M found:true Path M. Path -[{ - "label": "->M.xyz", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 13 }, + "start": { "character": 12, "line": 13 } + } + } + ], "detail": "(t, int) => int", - "documentation": null, - "sortText": "xyz", "insertText": "->M.xyz", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 12}, "end": {"line": 13, "character": 13}}, - "newText": "" - }] - }, { - "label": "->M.b", "kind": 12, - "tags": [], + "label": "->M.xyz", + "sortText": "xyz", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 13 }, + "start": { "character": 12, "line": 13 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "b", "insertText": "->M.b", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 12}, "end": {"line": 13, "character": 13}}, - "newText": "" - }] - }, { - "label": "->M.a", "kind": 12, - "tags": [], + "label": "->M.b", + "sortText": "b", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 13 }, + "start": { "character": 12, "line": 13 } + } + } + ], "detail": "t => int", - "documentation": null, - "sortText": "a", "insertText": "->M.a", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 12}, "end": {"line": 13, "character": 13}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->M.a", + "sortText": "a", + "tags": [] + } +] Complete src/CompletionTaggedTemplate.res 16:20 posCursor:[16:20] posNoWhite:[16:19] Found expr:[16:11->0:-1] @@ -67,41 +83,57 @@ Path meh CPPipe pathFromEnv:M found:true Path M. Path -[{ - "label": "->M.xyz", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 20, "line": 16 }, + "start": { "character": 19, "line": 16 } + } + } + ], "detail": "(t, int) => int", - "documentation": null, - "sortText": "xyz", "insertText": "->M.xyz", - "additionalTextEdits": [{ - "range": {"start": {"line": 16, "character": 19}, "end": {"line": 16, "character": 20}}, - "newText": "" - }] - }, { - "label": "->M.b", "kind": 12, - "tags": [], + "label": "->M.xyz", + "sortText": "xyz", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 20, "line": 16 }, + "start": { "character": 19, "line": 16 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "b", "insertText": "->M.b", - "additionalTextEdits": [{ - "range": {"start": {"line": 16, "character": 19}, "end": {"line": 16, "character": 20}}, - "newText": "" - }] - }, { - "label": "->M.a", "kind": 12, - "tags": [], + "label": "->M.b", + "sortText": "b", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 20, "line": 16 }, + "start": { "character": 19, "line": 16 } + } + } + ], "detail": "t => int", - "documentation": null, - "sortText": "a", "insertText": "->M.a", - "additionalTextEdits": [{ - "range": {"start": {"line": 16, "character": 19}, "end": {"line": 16, "character": 20}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->M.a", + "sortText": "a", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionTypeAnnotation.res.txt b/tests/analysis_tests/tests/src/expected/CompletionTypeAnnotation.res.txt index 8a30600d10b..79dbbe34d43 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionTypeAnnotation.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionTypeAnnotation.res.txt @@ -5,16 +5,21 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[someRecord] Path someRecord -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "someRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someRecord = {age: int, name: string}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someRecord = {age: int, name: string}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 12:24 XXX Not found! @@ -23,19 +28,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[someRecord] Path someRecord -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {age: int, name: string}\n```"} - }, { - "label": "name", + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype someRecord = {age: int, name: string}\n```" + }, "kind": 5, - "tags": [], + "label": "age", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {age: int, name: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype someRecord = {age: int, name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 15:23 XXX Not found! @@ -44,23 +58,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[someVariant] Path someVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "Two($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Two(_)", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 18:25 XXX Not found! @@ -69,54 +92,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[someVariant] Path someVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, - "sortText": "A One", + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Option", - "kind": 9, - "tags": [], - "detail": "module Option", - "documentation": null - }, { - "label": "Ordering", - "kind": 9, - "tags": [], - "detail": "module Ordering", - "documentation": null - }, { - "label": "Object", - "kind": 9, - "tags": [], - "detail": "module Object", - "documentation": null - }, { - "label": "Obj", - "kind": 9, - "tags": [], - "detail": "module Obj", - "documentation": null, + "insertTextFormat": 2, + "kind": 4, + "label": "One", + "sortText": "A One", + "tags": [] + }, + { "detail": "module Option", "kind": 9, "label": "Option", "tags": [] }, + { "detail": "module Ordering", "kind": 9, "label": "Ordering", "tags": [] }, + { "detail": "module Object", "kind": 9, "label": "Object", "tags": [] }, + { "data": { "modulePath": "Obj", "filePath": "src/CompletionTypeAnnotation.res" - } - }, { - "label": "Objects", + }, + "detail": "module Obj", "kind": 9, - "tags": [], - "detail": "module Objects", - "documentation": null, + "label": "Obj", + "tags": [] + }, + { "data": { "modulePath": "Objects", "filePath": "src/CompletionTypeAnnotation.res" - } - }] + }, + "detail": "module Objects", + "kind": 9, + "label": "Objects", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 21:27 XXX Not found! @@ -125,23 +138,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[somePolyVariant] Path somePolyVariant -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #two(bool)]\n```" + }, "insertText": "#one", - "insertTextFormat": 2 - }, { - "label": "#two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#one", + "tags": [] + }, + { "detail": "#two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #two(bool)]\n```" + }, "insertText": "#two($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two(_)", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 24:30 XXX Not found! @@ -150,15 +172,20 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[somePolyVariant] Path somePolyVariant -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #two(bool)]\n```" + }, "insertText": "one", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#one", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 29:20 XXX Not found! @@ -167,16 +194,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[someFunc] Path someFunc -[{ - "label": "(v1, v2) => {}", - "kind": 12, - "tags": [], +[ + { "detail": "(int, string) => bool", - "documentation": null, - "sortText": "A", "insertText": "(${1:v1}, ${2:v2}) => {${0:()}}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(v1, v2) => {}", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 34:21 XXX Not found! @@ -185,15 +213,16 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[someTuple] Path someTuple -[{ - "label": "(_, _)", - "kind": 12, - "tags": [], +[ + { "detail": "(bool, option)", - "documentation": null, "insertText": "(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "(_, _)", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 37:28 XXX Not found! @@ -202,33 +231,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[someTuple] Path someTuple -[{ - "label": "None", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(_)", - "kind": 12, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "None", "tags": [] }, + { "detail": "bool", - "documentation": null, "insertText": "Some($0)", - "insertTextFormat": 2 - }, { - "label": "Some(true)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "Some(false)", - "kind": 4, - "tags": [], - "detail": "bool", - "documentation": null - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "bool", "kind": 4, "label": "Some(true)", "tags": [] }, + { "detail": "bool", "kind": 4, "label": "Some(false)", "tags": [] } +] Complete src/CompletionTypeAnnotation.res 40:31 XXX Not found! @@ -238,37 +253,54 @@ Resolved opens 1 Stdlib ContextPath option ContextPath Type[someVariant] Path someVariant -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two(bool)\n```"} - }, { - "label": "Some(_)", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two(bool)\n```" + }, "kind": 12, - "tags": [], + "label": "None", + "tags": [] + }, + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "Some($0)", - "insertTextFormat": 2 - }, { - "label": "Some(One)", - "kind": 4, - "tags": [], + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "Some(One)", - "insertTextFormat": 2 - }, { - "label": "Some(Two(_))", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Some(One)", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "Some(Two($0))", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Some(Two(_))", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 43:37 XXX Not found! @@ -278,23 +310,32 @@ Resolved opens 1 Stdlib ContextPath option ContextPath Type[someVariant] Path someVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "Two($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Two(_)", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 46:30 XXX Not found! @@ -304,16 +345,21 @@ Resolved opens 1 Stdlib ContextPath array ContextPath Type[someVariant] Path someVariant -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two(bool)\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 49:32 XXX Not found! @@ -323,23 +369,32 @@ Resolved opens 1 Stdlib ContextPath array ContextPath Type[someVariant] Path someVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "Two($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Two(_)", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 52:38 XXX Not found! @@ -350,16 +405,21 @@ ContextPath array> ContextPath option ContextPath Type[someVariant] Path someVariant -[{ - "label": "[]", - "kind": 12, - "tags": [], +[ + { "detail": "option", - "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\noption\n```" + }, "insertText": "[$0]", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "[]", + "sortText": "A", + "tags": [] + } +] Complete src/CompletionTypeAnnotation.res 55:45 XXX Not found! @@ -370,21 +430,30 @@ ContextPath option> ContextPath array ContextPath Type[someVariant] Path someVariant -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool)\n```" + }, "insertText": "Two($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Two(_)", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionTypeT.res.txt b/tests/analysis_tests/tests/src/expected/CompletionTypeT.res.txt index 9adbcead38a..e09021182eb 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionTypeT.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionTypeT.res.txt @@ -5,29 +5,38 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[date] Path date -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "Date.t", - "documentation": {"kind": "markdown", "value": "\nA type representing a JavaScript date.\n"} - }, { - "label": "Some(_)", + "documentation": { + "kind": "markdown", + "value": "\nA type representing a JavaScript date.\n" + }, "kind": 12, - "tags": [], + "label": "None", + "tags": [] + }, + { "detail": "Date.t", - "documentation": {"kind": "markdown", "value": "\nA type representing a JavaScript date.\n"}, + "documentation": { + "kind": "markdown", + "value": "\nA type representing a JavaScript date.\n" + }, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(date)", - "kind": 4, - "tags": [], + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "date", - "documentation": null, "insertText": "Some(${0:date})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Some(date)", + "tags": [] + } +] Complete src/CompletionTypeT.res 7:27 XXX Not found! @@ -36,77 +45,78 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[withDate] Path withDate -[{ - "label": "Date.makeWithYMD()", - "kind": 12, - "tags": [], +[ + { "detail": "(~year: int, ~month: int, ~day: int) => t", - "documentation": null, "insertText": "Date.makeWithYMD($0)", - "insertTextFormat": 2 - }, { - "label": "Date.makeWithYMDHM()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.makeWithYMD()", + "tags": [] + }, + { "detail": "(\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n) => t", - "documentation": null, "insertText": "Date.makeWithYMDHM($0)", - "insertTextFormat": 2 - }, { - "label": "Date.make()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.makeWithYMDHM()", + "tags": [] + }, + { "detail": "unit => t", - "documentation": null, "insertText": "Date.make($0)", - "insertTextFormat": 2 - }, { - "label": "Date.fromTime()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.make()", + "tags": [] + }, + { "detail": "msSinceEpoch => t", - "documentation": null, "insertText": "Date.fromTime($0)", - "insertTextFormat": 2 - }, { - "label": "Date.fromString()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.fromTime()", + "tags": [] + }, + { "detail": "string => t", - "documentation": null, "insertText": "Date.fromString($0)", - "insertTextFormat": 2 - }, { - "label": "Date.makeWithYMDHMSM()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.fromString()", + "tags": [] + }, + { "detail": "(\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n ~milliseconds: int,\n) => t", - "documentation": null, "insertText": "Date.makeWithYMDHMSM($0)", - "insertTextFormat": 2 - }, { - "label": "Date.makeWithYM()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.makeWithYMDHMSM()", + "tags": [] + }, + { "detail": "(~year: int, ~month: int) => t", - "documentation": null, "insertText": "Date.makeWithYM($0)", - "insertTextFormat": 2 - }, { - "label": "Date.makeWithYMDHMS()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.makeWithYM()", + "tags": [] + }, + { "detail": "(\n ~year: int,\n ~month: int,\n ~day: int,\n ~hours: int,\n ~minutes: int,\n ~seconds: int,\n) => t", - "documentation": null, "insertText": "Date.makeWithYMDHMS($0)", - "insertTextFormat": 2 - }, { - "label": "Date.makeWithYMDH()", + "insertTextFormat": 2, "kind": 12, - "tags": [], + "label": "Date.makeWithYMDHMS()", + "tags": [] + }, + { "detail": "(~year: int, ~month: int, ~day: int, ~hours: int) => t", - "documentation": null, "insertText": "Date.makeWithYMDH($0)", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "Date.makeWithYMDH()", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/CompletionTypedArrays.res.txt b/tests/analysis_tests/tests/src/expected/CompletionTypedArrays.res.txt index ee9e5f9972d..c9dff580bac 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionTypedArrays.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionTypedArrays.res.txt @@ -14,679 +14,1188 @@ CPPipe pathFromEnv:Stdlib.BigInt64Array found:false Path Stdlib.BigInt64Array. Path Stdlib.TypedArray. Path -[{ - "label": "->BigInt64Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(bigIntArray)` ignores the provided bigIntArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(bigIntArray)` ignores the provided bigIntArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->BigInt64Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->BigInt64Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 16, "line": 1 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 1, "character": 16}, "end": {"line": 1, "character": 17}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 5:18 posCursor:[5:18] posNoWhite:[5:17] Found expr:[5:3->5:18] @@ -704,679 +1213,1188 @@ CPPipe pathFromEnv:Stdlib.BigUint64Array found:false Path Stdlib.BigUint64Array. Path Stdlib.TypedArray. Path -[{ - "label": "->BigUint64Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(bigUintArray)` ignores the provided bigUintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(bigUintArray)` ignores the provided bigUintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->BigUint64Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->BigUint64Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 18, "line": 5 }, + "start": { "character": 17, "line": 5 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 5, "character": 17}, "end": {"line": 5, "character": 18}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 9:16 posCursor:[9:16] posNoWhite:[9:15] Found expr:[9:3->9:16] @@ -1394,679 +2412,1188 @@ CPPipe pathFromEnv:Stdlib.Float32Array found:false Path Stdlib.Float32Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Float32Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Float32Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Float32Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 9 }, + "start": { "character": 15, "line": 9 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 9, "character": 15}, "end": {"line": 9, "character": 16}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 13:16 posCursor:[13:16] posNoWhite:[13:15] Found expr:[13:3->13:16] @@ -2084,679 +3611,1188 @@ CPPipe pathFromEnv:Stdlib.Float64Array found:false Path Stdlib.Float64Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Float64Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(floatArray)` ignores the provided floatArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Float64Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Float64Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 16, "line": 13 }, + "start": { "character": 15, "line": 13 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 13, "character": 15}, "end": {"line": 13, "character": 16}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 17:14 posCursor:[17:14] posNoWhite:[17:13] Found expr:[17:3->17:14] @@ -2774,679 +4810,1188 @@ CPPipe pathFromEnv:Stdlib.Int16Array found:false Path Stdlib.Int16Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Int16Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Int16Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Int16Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 13, "line": 17 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 17, "character": 13}, "end": {"line": 17, "character": 14}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 21:14 posCursor:[21:14] posNoWhite:[21:13] Found expr:[21:3->21:14] @@ -3464,679 +6009,1188 @@ CPPipe pathFromEnv:Stdlib.Int32Array found:false Path Stdlib.Int32Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Int32Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Int32Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Int32Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 21 }, + "start": { "character": 13, "line": 21 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 21, "character": 13}, "end": {"line": 21, "character": 14}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 25:13 posCursor:[25:13] posNoWhite:[25:12] Found expr:[25:3->25:13] @@ -4154,679 +7208,1188 @@ CPPipe pathFromEnv:Stdlib.Int8Array found:false Path Stdlib.Int8Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Int8Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(intArray)` ignores the provided intArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Int8Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Int8Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 25 }, + "start": { "character": 12, "line": 25 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 25, "character": 12}, "end": {"line": 25, "character": 13}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 29:15 posCursor:[29:15] posNoWhite:[29:14] Found expr:[29:3->29:15] @@ -4844,679 +8407,1188 @@ CPPipe pathFromEnv:Stdlib.Uint16Array found:false Path Stdlib.Uint16Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Uint16Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Uint16Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Uint16Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 29 }, + "start": { "character": 14, "line": 29 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 29, "character": 14}, "end": {"line": 29, "character": 15}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 33:15 posCursor:[33:15] posNoWhite:[33:14] Found expr:[33:3->33:15] @@ -5534,679 +9606,1188 @@ CPPipe pathFromEnv:Stdlib.Uint32Array found:false Path Stdlib.Uint32Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Uint32Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Uint32Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Uint32Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 33 }, + "start": { "character": 14, "line": 33 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 33, "character": 14}, "end": {"line": 33, "character": 15}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 37:14 posCursor:[37:14] posNoWhite:[37:13] Found expr:[37:3->37:14] @@ -6224,679 +10805,1188 @@ CPPipe pathFromEnv:Stdlib.Uint8Array found:false Path Stdlib.Uint8Array. Path Stdlib.TypedArray. Path -[{ - "label": "->Uint8Array.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Uint8Array.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Uint8Array.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 14, "line": 37 }, + "start": { "character": 13, "line": 37 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 37, "character": 13}, "end": {"line": 37, "character": 14}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] Complete src/CompletionTypedArrays.res 41:21 posCursor:[41:21] posNoWhite:[41:20] Found expr:[41:3->41:21] @@ -6914,677 +12004,1186 @@ CPPipe pathFromEnv:Stdlib.Uint8ClampedArray found:false Path Stdlib.Uint8ClampedArray. Path Stdlib.TypedArray. Path -[{ - "label": "->Uint8ClampedArray.ignore", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(uintArray)` ignores the provided uintArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->Uint8ClampedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndexWithIndex", "kind": 12, - "tags": [], + "label": "->Uint8ClampedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n"}, - "sortText": "findLastIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndexWithIndex(typedArray, predicate)` is the indexed variant of `findLastIndex`.\n" + }, "insertText": "->TypedArray.findLastIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndexWithIndex", + "sortText": "findLastIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n"}, - "sortText": "lastIndexOf", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOf(typedArray, value)` returns the last index of `value`, or `-1` if not found.\n\nSee [`TypedArray.prototype.lastIndexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lastIndexOf) on MDN.\n" + }, "insertText": "->TypedArray.lastIndexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOf", + "sortText": "lastIndexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n"}, - "sortText": "findLastWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastWithIndex(typedArray, predicate)` is the indexed variant of `findLast`.\n" + }, "insertText": "->TypedArray.findLastWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLast", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastWithIndex", + "sortText": "findLastWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n"}, - "sortText": "findLast", + "documentation": { + "kind": "markdown", + "value": "\n`findLast(typedArray, predicate)` returns the last element that satisfies `predicate`.\n\nSee [`TypedArray.prototype.findLast`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLast) on MDN.\n" + }, "insertText": "->TypedArray.findLast", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filter", "kind": 12, - "tags": [], + "label": "->TypedArray.findLast", + "sortText": "findLast", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(typedArray, predicate)` returns a new typed array containing only elements that satisfy `predicate`.\n\nSee [`TypedArray.prototype.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter) on MDN.\n" + }, "insertText": "->TypedArray.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteLength", "kind": 12, - "tags": [], + "label": "->TypedArray.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n"}, - "sortText": "byteLength", + "documentation": { + "kind": "markdown", + "value": "\n`byteLength(typedArray)` returns the length in bytes of the view.\n\nSee [`TypedArray.prototype.byteLength`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteLength) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.byteLength(view) == 8\n```\n" + }, "insertText": "->TypedArray.byteLength", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.ignore", "kind": 12, - "tags": [], + "label": "->TypedArray.byteLength", + "sortText": "byteLength", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n"}, - "sortText": "ignore", + "documentation": { + "kind": "markdown", + "value": "\n `ignore(typedArray)` ignores the provided typedArray and returns unit.\n\n This helper is useful when you want to discard a value (for example, the result of an operation with side effects)\n without having to store or process it further.\n" + }, "insertText": "->TypedArray.ignore", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRightWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.ignore", + "sortText": "ignore", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n"}, - "sortText": "reduceRightWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRightWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduceRight`.\n" + }, "insertText": "->TypedArray.reduceRightWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceRight", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRightWithIndex", + "sortText": "reduceRightWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n"}, - "sortText": "reduceRight", + "documentation": { + "kind": "markdown", + "value": "\n`reduceRight(typedArray, reducer, initial)` is like `reduce` but processes the elements from right to left.\n\nSee [`TypedArray.prototype.reduceRight`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduceRight) on MDN.\n" + }, "insertText": "->TypedArray.reduceRight", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.joinWith", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceRight", + "sortText": "reduceRight", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, string) => string", - "documentation": {"kind": "markdown", "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n"}, - "sortText": "joinWith", + "documentation": { + "kind": "markdown", + "value": "\n`joinWith(typedArray, separator)` returns a string formed by the elements joined with `separator`.\n\nSee [`TypedArray.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/join) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.joinWith(view, \"-\") == \"1-2-3\"\n```\n" + }, "insertText": "->TypedArray.joinWith", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.buffer", "kind": 12, - "tags": [], + "label": "->TypedArray.joinWith", + "sortText": "joinWith", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => ArrayBuffer.t", - "documentation": {"kind": "markdown", "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n"}, - "sortText": "buffer", + "documentation": { + "kind": "markdown", + "value": "\n`buffer(typedArray)` returns the underlying `ArrayBuffer` backing this view.\n\nSee [`TypedArray.prototype.buffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/buffer) on MDN.\n" + }, "insertText": "->TypedArray.buffer", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduce", "kind": 12, - "tags": [], + "label": "->TypedArray.buffer", + "sortText": "buffer", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('b, 'a) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n"}, - "sortText": "reduce", + "documentation": { + "kind": "markdown", + "value": "\n`reduce(typedArray, reducer, initial)` combines the elements from left to right using `reducer`.\n\nSee [`TypedArray.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reduce) on MDN.\n" + }, "insertText": "->TypedArray.reduce", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEachWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.reduce", + "sortText": "reduce", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n"}, - "sortText": "forEachWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`forEachWithIndex(typedArray, f)` runs `f` for every element, also providing the index.\n" + }, "insertText": "->TypedArray.forEachWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copy", "kind": 12, - "tags": [], + "label": "->TypedArray.forEachWithIndex", + "sortText": "forEachWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n"}, - "sortText": "copy", + "documentation": { + "kind": "markdown", + "value": "\n`copy(typedArray)` produces a shallow copy of the typed array.\n" + }, "insertText": "->TypedArray.copy", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.someWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copy", + "sortText": "copy", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n"}, - "sortText": "someWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`someWithIndex(typedArray, predicate)` behaves like `some`, but `predicate` also receives the element index.\n" + }, "insertText": "->TypedArray.someWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndexWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.someWithIndex", + "sortText": "someWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n"}, - "sortText": "findIndexWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndexWithIndex(typedArray, predicate)` is the indexed variant of `findIndex`.\n" + }, "insertText": "->TypedArray.findIndexWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sliceToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.findIndexWithIndex", + "sortText": "findIndexWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n"}, - "sortText": "sliceToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `slice` instead\n\n\n`sliceToEnd(typedArray, ~start)` returns the elements from `start` through the end in a new typed array.\n" + }, "insertText": "->TypedArray.sliceToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.slice", "kind": 12, - "tags": [], + "label": "->TypedArray.sliceToEnd", + "sortText": "sliceToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n"}, - "sortText": "slice", + "documentation": { + "kind": "markdown", + "value": "\n`slice(typedArray, ~start, ~end)` returns a new typed array containing the elements in `[start, end)`.\n\nSee [`TypedArray.prototype.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice) on MDN.\n" + }, "insertText": "->TypedArray.slice", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findLastIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.slice", + "sortText": "slice", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n"}, - "sortText": "findLastIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findLastIndex(typedArray, predicate)` returns the index of the last matching element, or `-1` if none do.\n\nSee [`TypedArray.prototype.findLastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findLastIndex) on MDN.\n" + }, "insertText": "->TypedArray.findLastIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.includes", "kind": 12, - "tags": [], + "label": "->TypedArray.findLastIndex", + "sortText": "findLastIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(typedArray, value)` returns `true` if `value` occurs in the typed array.\n\nSee [`TypedArray.prototype.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/includes) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.includes(view, 2) == true\nTypedArray.includes(view, 10) == false\n```\n" + }, "insertText": "->TypedArray.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, 'a, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n"}, - "sortText": "fillToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `fill` instead\n\n\n`fillToEnd(typedArray, value, ~start)` fills from `start` through the end with `value`.\n\nBeware this will *mutate* the typed array.\n" + }, "insertText": "->TypedArray.fillToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fillAll", "kind": 12, - "tags": [], + "label": "->TypedArray.fillToEnd", + "sortText": "fillToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n"}, - "sortText": "fillAll", + "documentation": { + "kind": "markdown", + "value": "\n`fillAll(typedArray, value)` fills every element with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet _ = TypedArray.fillAll(view, 9)\nTypedArray.toString(view) == \"9,9,9\"\n```\n" + }, "insertText": "->TypedArray.fillAll", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.find", "kind": 12, - "tags": [], + "label": "->TypedArray.fillAll", + "sortText": "fillAll", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n"}, - "sortText": "find", + "documentation": { + "kind": "markdown", + "value": "\n`find(typedArray, predicate)` returns the first element that satisfies `predicate`, or `None` if nothing matches.\n\nSee [`TypedArray.prototype.find`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/find) on MDN.\n" + }, "insertText": "->TypedArray.find", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarrayToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.find", + "sortText": "find", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~start: int) => t<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n"}, - "sortText": "subarrayToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `subarray` instead\n\n\n`subarrayToEnd(typedArray, ~start)` returns a new view from `start` to the end of the buffer.\n" + }, "insertText": "->TypedArray.subarrayToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.set", "kind": 12, - "tags": [], + "label": "->TypedArray.subarrayToEnd", + "sortText": "subarrayToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, int, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n"}, - "sortText": "set", + "documentation": { + "kind": "markdown", + "value": "\n`set(typedArray, index, item)` sets the provided `item` at `index` of `typedArray`.\n\nBeware this will *mutate* the array.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2])\nTypedArray.set(view, 1, 5)\nTypedArray.get(view, 1) == Some(5)\n```\n" + }, "insertText": "->TypedArray.set", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toLocaleString", "kind": 12, - "tags": [], + "label": "->TypedArray.set", + "sortText": "set", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n"}, - "sortText": "toLocaleString", + "documentation": { + "kind": "markdown", + "value": "\n`toLocaleString(typedArray)` concatenates the elements using locale-aware formatting.\n\nSee [`TypedArray.prototype.toLocaleString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toLocaleString) on MDN.\n" + }, "insertText": "->TypedArray.toLocaleString", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.lastIndexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toLocaleString", + "sortText": "toLocaleString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n"}, - "sortText": "lastIndexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`lastIndexOfFrom(typedArray, value, fromIndex)` searches backwards starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.lastIndexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.lastIndexOfFrom", + "sortText": "lastIndexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => bool) => int", - "documentation": {"kind": "markdown", "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n"}, - "sortText": "findIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findIndex(typedArray, predicate)` returns the index of the first element that satisfies `predicate`, or `-1` if none do.\n\nSee [`TypedArray.prototype.findIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/findIndex) on MDN.\n" + }, "insertText": "->TypedArray.findIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.filterWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.findIndex", + "sortText": "findIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(typedArray, predicate)` behaves like `filter` but also passes the index to `predicate`.\n" + }, "insertText": "->TypedArray.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.sort", "kind": 12, - "tags": [], + "label": "->TypedArray.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => unit", - "documentation": {"kind": "markdown", "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n"}, - "sortText": "sort", + "documentation": { + "kind": "markdown", + "value": "\n`sort(typedArray, comparator)` sorts the values in place using `comparator`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/sort) on MDN.\n" + }, "insertText": "->TypedArray.sort", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.mapWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.sort", + "sortText": "sort", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n"}, - "sortText": "mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(typedArray, f)` behaves like `map`, but `f` also receives the index.\n" + }, "insertText": "->TypedArray.mapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.every", "kind": 12, - "tags": [], + "label": "->TypedArray.mapWithIndex", + "sortText": "mapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n"}, - "sortText": "every", + "documentation": { + "kind": "markdown", + "value": "\n`every(typedArray, predicate)` returns `true` if `predicate` returns `true` for every element.\n\nSee [`TypedArray.prototype.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/every) on MDN.\n" + }, "insertText": "->TypedArray.every", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.length", "kind": 12, - "tags": [], + "label": "->TypedArray.every", + "sortText": "every", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n"}, - "sortText": "length", + "documentation": { + "kind": "markdown", + "value": "\n`length(typedArray)` returns the number of elements.\n\nSee [`TypedArray.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.length(view) == 3\n```\n" + }, "insertText": "->TypedArray.length", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOf", "kind": 12, - "tags": [], + "label": "->TypedArray.length", + "sortText": "length", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n"}, - "sortText": "indexOf", + "documentation": { + "kind": "markdown", + "value": "\n`indexOf(typedArray, value)` returns the first index of `value`, or `-1` when not found.\n\nSee [`TypedArray.prototype.indexOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/indexOf) on MDN.\n" + }, "insertText": "->TypedArray.indexOf", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithinToEnd", "kind": 12, - "tags": [1], + "label": "->TypedArray.indexOf", + "sortText": "indexOf", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], + "deprecated": true, "detail": "(t<'a>, ~target: int, ~start: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n"}, - "sortText": "copyWithinToEnd", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `copyWithin` instead\n\n\n`copyWithinToEnd(typedArray, ~target, ~start)` copies values from `start` through the end of the view into the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithinToEnd(view, ~target=0, ~start=2)\nTypedArray.toString(view) == \"3,4,3,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithinToEnd", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.some", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithinToEnd", + "sortText": "copyWithinToEnd", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n"}, - "sortText": "some", + "documentation": { + "kind": "markdown", + "value": "\n`some(typedArray, predicate)` returns `true` if `predicate` returns `true` for at least one element.\n\nSee [`TypedArray.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/some) on MDN.\n" + }, "insertText": "->TypedArray.some", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reduceWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.some", + "sortText": "some", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('b, 'a, int) => 'b, 'b) => 'b", - "documentation": {"kind": "markdown", "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n"}, - "sortText": "reduceWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`reduceWithIndex(typedArray, reducer, initial)` is the indexed variant of `reduce`.\n" + }, "insertText": "->TypedArray.reduceWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.map", "kind": 12, - "tags": [], + "label": "->TypedArray.reduceWithIndex", + "sortText": "reduceWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => 'b) => t<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n"}, - "sortText": "map", + "documentation": { + "kind": "markdown", + "value": "\n`map(typedArray, f)` returns a new typed array whose elements are produced by applying `f` to each element.\n\nSee [`TypedArray.prototype.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map) on MDN.\n" + }, "insertText": "->TypedArray.map", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toSorted", "kind": 12, - "tags": [], + "label": "->TypedArray.map", + "sortText": "map", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, 'a) => Ordering.t) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n"}, - "sortText": "toSorted", + "documentation": { + "kind": "markdown", + "value": "\n`toSorted(typedArray, comparator)` returns a new typed array containing the sorted values, leaving the original untouched.\n\nSee [`TypedArray.prototype.toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toSorted) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([3, 1, 2])\nlet sorted = TypedArray.toSorted(view, Int.compare)\nTypedArray.toString(sorted) == \"1,2,3\"\nTypedArray.toString(view) == \"3,1,2\"\n```\n" + }, "insertText": "->TypedArray.toSorted", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyAllWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toSorted", + "sortText": "toSorted", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ~target: int) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n"}, - "sortText": "copyAllWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyAllWithin(typedArray, ~target)` copies values starting at index `0` over the positions beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([10, 20, 30])\nlet _ = TypedArray.copyAllWithin(view, ~target=1)\nTypedArray.toString(view) == \"10,10,20\"\n```\n" + }, "insertText": "->TypedArray.copyAllWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.subarray", "kind": 12, - "tags": [], + "label": "->TypedArray.copyAllWithin", + "sortText": "copyAllWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n"}, - "sortText": "subarray", + "documentation": { + "kind": "markdown", + "value": "\n`subarray(typedArray, ~start, ~end)` returns a new view referencing the same buffer over `[start, end)`.\n\nSee [`TypedArray.prototype.subarray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray) on MDN.\n" + }, "insertText": "->TypedArray.subarray", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArray", "kind": 12, - "tags": [], + "label": "->TypedArray.subarray", + "sortText": "subarray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n"}, - "sortText": "setArray", + "documentation": { + "kind": "markdown", + "value": "\n`setArray(target, source)` copies the values from `source` into `target`, mutating it.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0])\nTypedArray.setArray(view, [1, 2])\nTypedArray.toString(view) == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.setArray", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.get", "kind": 12, - "tags": [], + "label": "->TypedArray.setArray", + "sortText": "setArray", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, int) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n"}, - "sortText": "get", + "documentation": { + "kind": "markdown", + "value": "\n`get(typedArray, index)` returns the element at `index` of `typedArray`.\nReturns `None` if the index does not exist in the typed array. Equivalent to doing `typedArray[index]` in JavaScript.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nTypedArray.get(view, 0) == Some(1)\nTypedArray.get(view, 10) == None\n```\n" + }, "insertText": "->TypedArray.get", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.with", "kind": 12, - "tags": [], + "label": "->TypedArray.get", + "sortText": "get", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, int, 'a) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "with", + "documentation": { + "kind": "markdown", + "value": "\n`with(typedArray, index, value)` returns a new typed array where the element at `index` is replaced with `value`.\n\nSee [`TypedArray.prototype.with`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/with) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet updated = TypedArray.with(view, 1, 10)\nTypedArray.toString(updated) == \"1,10,3\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.with", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toReversed", "kind": 12, - "tags": [], + "label": "->TypedArray.with", + "sortText": "with", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n"}, - "sortText": "toReversed", + "documentation": { + "kind": "markdown", + "value": "\n`toReversed(typedArray)` returns a new typed array with the elements in reverse order, leaving the original untouched.\n\nSee [`TypedArray.prototype.toReversed`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toReversed) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3])\nlet reversed = TypedArray.toReversed(view)\nTypedArray.toString(reversed) == \"3,2,1\"\nTypedArray.toString(view) == \"1,2,3\"\n```\n" + }, "insertText": "->TypedArray.toReversed", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.copyWithin", "kind": 12, - "tags": [], + "label": "->TypedArray.toReversed", + "sortText": "toReversed", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ~target: int, ~start: int, ~end: int=?) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n"}, - "sortText": "copyWithin", + "documentation": { + "kind": "markdown", + "value": "\n`copyWithin(typedArray, ~target, ~start, ~end)` copies the section `[start, end)` onto the range beginning at `target`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.copyWithin`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.copyWithin(view, ~target=1, ~start=2, ~end=4)\nTypedArray.toString(view) == \"1,3,4,4\"\n```\n" + }, "insertText": "->TypedArray.copyWithin", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.everyWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.copyWithin", + "sortText": "copyWithin", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => bool", - "documentation": {"kind": "markdown", "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n"}, - "sortText": "everyWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`everyWithIndex(typedArray, checker)` is like `every` but provides the element index to `checker`.\n" + }, "insertText": "->TypedArray.everyWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.toString", "kind": 12, - "tags": [], + "label": "->TypedArray.everyWithIndex", + "sortText": "everyWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => string", - "documentation": {"kind": "markdown", "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n"}, - "sortText": "toString", + "documentation": { + "kind": "markdown", + "value": "\n`toString(typedArray)` returns a comma-separated string of the elements.\n\nSee [`TypedArray.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/toString) on MDN.\n\n## Examples\n\n```rescript\nInt32Array.fromArray([1, 2])->TypedArray.toString == \"1,2\"\n```\n" + }, "insertText": "->TypedArray.toString", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.setArrayFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.toString", + "sortText": "toString", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, array<'a>, int) => unit", - "documentation": {"kind": "markdown", "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n"}, - "sortText": "setArrayFrom", + "documentation": { + "kind": "markdown", + "value": "\n`setArrayFrom(target, source, index)` copies `source` into `target` starting at `index`.\n\nSee [`TypedArray.prototype.set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([0, 0, 0])\nTypedArray.setArrayFrom(view, [5, 6], 1)\nTypedArray.toString(view) == \"0,5,6\"\n```\n" + }, "insertText": "->TypedArray.setArrayFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.forEach", "kind": 12, - "tags": [], + "label": "->TypedArray.setArrayFrom", + "sortText": "setArrayFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a => unit) => unit", - "documentation": {"kind": "markdown", "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n"}, - "sortText": "forEach", + "documentation": { + "kind": "markdown", + "value": "\n`forEach(typedArray, f)` runs `f` for every element in order.\n\nSee [`TypedArray.prototype.forEach`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/forEach) on MDN.\n" + }, "insertText": "->TypedArray.forEach", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.findWithIndex", "kind": 12, - "tags": [], + "label": "->TypedArray.forEach", + "sortText": "forEach", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, ('a, int) => bool) => option<'a>", - "documentation": {"kind": "markdown", "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n"}, - "sortText": "findWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`findWithIndex(typedArray, predicate)` behaves like `find`, but `predicate` also receives the index.\n" + }, "insertText": "->TypedArray.findWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.fill", "kind": 12, - "tags": [], + "label": "->TypedArray.findWithIndex", + "sortText": "findWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a, ~start: int, ~end: int=?) => t<'a>", - "documentation": {"kind": "markdown", "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n"}, - "sortText": "fill", + "documentation": { + "kind": "markdown", + "value": "\n`fill(typedArray, value, ~start, ~end)` fills the half-open interval `[start, end)` with `value`.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill) on MDN.\n\n## Examples\n\n```rescript\nlet view = Int32Array.fromArray([1, 2, 3, 4])\nlet _ = TypedArray.fill(view, 0, ~start=1, ~end=3)\nTypedArray.toString(view) == \"1,0,0,4\"\n```\n" + }, "insertText": "->TypedArray.fill", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.indexOfFrom", "kind": 12, - "tags": [], + "label": "->TypedArray.fill", + "sortText": "fill", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "(t<'a>, 'a, int) => int", - "documentation": {"kind": "markdown", "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n"}, - "sortText": "indexOfFrom", + "documentation": { + "kind": "markdown", + "value": "\n`indexOfFrom(typedArray, value, fromIndex)` searches for `value` starting at `fromIndex`.\n" + }, "insertText": "->TypedArray.indexOfFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.reverse", "kind": 12, - "tags": [], + "label": "->TypedArray.indexOfFrom", + "sortText": "indexOfFrom", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => unit", - "documentation": {"kind": "markdown", "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n"}, - "sortText": "reverse", + "documentation": { + "kind": "markdown", + "value": "\n`reverse(typedArray)` reverses the elements of the view in place.\n\nBeware this will *mutate* the typed array.\n\nSee [`TypedArray.prototype.reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/reverse) on MDN.\n" + }, "insertText": "->TypedArray.reverse", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }, { - "label": "->TypedArray.byteOffset", "kind": 12, - "tags": [], + "label": "->TypedArray.reverse", + "sortText": "reverse", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 21, "line": 41 }, + "start": { "character": 20, "line": 41 } + } + } + ], "detail": "t<'a> => int", - "documentation": {"kind": "markdown", "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n"}, - "sortText": "byteOffset", + "documentation": { + "kind": "markdown", + "value": "\n`byteOffset(typedArray)` returns the offset in bytes from the start of the buffer.\n\nSee [`TypedArray.prototype.byteOffset`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/byteOffset) on MDN.\n" + }, "insertText": "->TypedArray.byteOffset", - "additionalTextEdits": [{ - "range": {"start": {"line": 41, "character": 20}, "end": {"line": 41, "character": 21}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->TypedArray.byteOffset", + "sortText": "byteOffset", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/Cross.res.txt b/tests/analysis_tests/tests/src/expected/Cross.res.txt index 9cbbdc6d998..24a89762cfd 100644 --- a/tests/analysis_tests/tests/src/expected/Cross.res.txt +++ b/tests/analysis_tests/tests/src/expected/Cross.res.txt @@ -1,97 +1,201 @@ References src/Cross.res 0:17 [ -{"uri": "Cross.res", "range": {"start": {"line": 0, "character": 15}, "end": {"line": 0, "character": 25}}}, -{"uri": "Cross.res", "range": {"start": {"line": 3, "character": 16}, "end": {"line": 3, "character": 26}}}, -{"uri": "Cross.res", "range": {"start": {"line": 5, "character": 13}, "end": {"line": 5, "character": 23}}}, -{"uri": "Cross.res", "range": {"start": {"line": 7, "character": 16}, "end": {"line": 7, "character": 26}}}, -{"uri": "References.res", "range": {"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 0}}} + { + "range": { + "end": { "character": 25, "line": 0 }, + "start": { "character": 15, "line": 0 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 26, "line": 3 }, + "start": { "character": 16, "line": 3 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 23, "line": 5 }, + "start": { "character": 13, "line": 5 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 26, "line": 7 }, + "start": { "character": 16, "line": 7 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 0, "line": 0 }, + "start": { "character": 0, "line": 0 } + }, + "uri": "file:///References.res" + } ] References src/Cross.res 9:31 [ -{"uri": "Cross.res", "range": {"start": {"line": 9, "character": 28}, "end": {"line": 9, "character": 51}}}, -{"uri": "Cross.res", "range": {"start": {"line": 12, "character": 29}, "end": {"line": 12, "character": 52}}}, -{"uri": "Cross.res", "range": {"start": {"line": 14, "character": 26}, "end": {"line": 14, "character": 49}}}, -{"uri": "Cross.res", "range": {"start": {"line": 16, "character": 29}, "end": {"line": 16, "character": 52}}}, -{"uri": "ReferencesWithInterface.res", "range": {"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 0}}}, -{"uri": "ReferencesWithInterface.resi", "range": {"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 0}}} + { + "range": { + "end": { "character": 51, "line": 9 }, + "start": { "character": 28, "line": 9 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 52, "line": 12 }, + "start": { "character": 29, "line": 12 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 49, "line": 14 }, + "start": { "character": 26, "line": 14 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 52, "line": 16 }, + "start": { "character": 29, "line": 16 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 0, "line": 0 }, + "start": { "character": 0, "line": 0 } + }, + "uri": "file:///ReferencesWithInterface.res" + }, + { + "range": { + "end": { "character": 0, "line": 0 }, + "start": { "character": 0, "line": 0 } + }, + "uri": "file:///ReferencesWithInterface.resi" + } ] Rename src/Cross.res 18:13 RenameWithInterfacePrime [ -{ - "kind": "rename", - "oldUri": "RenameWithInterface.resi", - "newUri": "RenameWithInterfacePrime.resi" -}, -{ - "kind": "rename", - "oldUri": "RenameWithInterface.res", - "newUri": "RenameWithInterfacePrime.res" -}, -{ - "textDocument": { - "version": null, - "uri": "Cross.res" - }, - "edits": [{ - "range": {"start": {"line": 18, "character": 8}, "end": {"line": 18, "character": 27}}, - "newText": "RenameWithInterfacePrime" - }, { - "range": {"start": {"line": 21, "character": 8}, "end": {"line": 21, "character": 27}}, - "newText": "RenameWithInterfacePrime" - }] + { + "kind": "rename", + "newUri": "file:///RenameWithInterfacePrime.resi", + "oldUri": "file:///RenameWithInterface.resi" + }, + { + "kind": "rename", + "newUri": "file:///RenameWithInterfacePrime.res", + "oldUri": "file:///RenameWithInterface.res" + }, + { + "edits": [ + { + "newText": "RenameWithInterfacePrime", + "range": { + "end": { "character": 27, "line": 18 }, + "start": { "character": 8, "line": 18 } + } + }, + { + "newText": "RenameWithInterfacePrime", + "range": { + "end": { "character": 27, "line": 21 }, + "start": { "character": 8, "line": 21 } + } + } + ], + "textDocument": { "uri": "file:///Cross.res", "version": 0 } } ] Rename src/Cross.res 21:28 xPrime [ -{ - "textDocument": { - "version": null, - "uri": "RenameWithInterface.resi" - }, - "edits": [{ - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "newText": "xPrime" - }] - }, -{ - "textDocument": { - "version": null, - "uri": "RenameWithInterface.res" + { + "edits": [ + { + "newText": "xPrime", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + }, + { + "newText": "xPrime", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + } + ], + "textDocument": { + "uri": "file:///RenameWithInterface.resi", + "version": 0 + } }, - "edits": [{ - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "newText": "xPrime" - }] - }, -{ - "textDocument": { - "version": null, - "uri": "Cross.res" - }, - "edits": [{ - "range": {"start": {"line": 18, "character": 28}, "end": {"line": 18, "character": 29}}, - "newText": "xPrime" - }, { - "range": {"start": {"line": 21, "character": 28}, "end": {"line": 21, "character": 29}}, - "newText": "xPrime" - }] + { + "edits": [ + { + "newText": "xPrime", + "range": { + "end": { "character": 29, "line": 18 }, + "start": { "character": 28, "line": 18 } + } + }, + { + "newText": "xPrime", + "range": { + "end": { "character": 29, "line": 21 }, + "start": { "character": 28, "line": 21 } + } + } + ], + "textDocument": { "uri": "file:///Cross.res", "version": 0 } } ] TypeDefinition src/Cross.res 24:5 -{"uri": "TypeDefinition.res", "range": {"start": {"line": 2, "character": 0}, "end": {"line": 2, "character": 28}}} +{ + "range": { + "end": { "character": 28, "line": 2 }, + "start": { "character": 0, "line": 2 } + }, + "uri": "file:///TypeDefinition.res" +} Definition src/Cross.res 27:32 -{"uri": "DefinitionWithInterface.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}} +{ + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} Definition src/Cross.res 30:36 -{"uri": "DefinitionWithInterface.res", "range": {"start": {"line": 3, "character": 5}, "end": {"line": 3, "character": 6}}} +{ + "range": { + "end": { "character": 6, "line": 3 }, + "start": { "character": 5, "line": 3 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} TypeDefinition src/Cross.res 33:37 -{"uri": "DefinitionWithInterface.resi", "range": {"start": {"line": 3, "character": 0}, "end": {"line": 3, "character": 6}}} +{ + "range": { + "end": { "character": 6, "line": 3 }, + "start": { "character": 0, "line": 3 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} Complete src/Cross.res 36:28 posCursor:[36:28] posNoWhite:[36:27] Found expr:[36:3->36:28] @@ -104,5 +208,11 @@ Path DefinitionWithInterface.a [] Definition src/Cross.res 39:39 -{"uri": "DefinitionWithInterface.res", "range": {"start": {"line": 9, "character": 6}, "end": {"line": 9, "character": 7}}} +{ + "range": { + "end": { "character": 12, "line": 6 }, + "start": { "character": 2, "line": 6 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} diff --git a/tests/analysis_tests/tests/src/expected/Debug.res.txt b/tests/analysis_tests/tests/src/expected/Debug.res.txt index 3c94d138aaa..53064946e9a 100644 --- a/tests/analysis_tests/tests/src/expected/Debug.res.txt +++ b/tests/analysis_tests/tests/src/expected/Debug.res.txt @@ -1,5 +1,11 @@ Definition src/Debug.res 2:27 -{"uri": "ShadowedBelt.res", "range": {"start": {"line": 1, "character": 6}, "end": {"line": 1, "character": 9}}} +{ + "range": { + "end": { "character": 9, "line": 1 }, + "start": { "character": 6, "line": 1 } + }, + "uri": "file:///ShadowedBelt.res" +} Complete src/Debug.res 11:8 posCursor:[11:8] posNoWhite:[11:7] Found expr:[11:5->11:8] @@ -10,18 +16,29 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 2 Stdlib Js ContextPath Value[eqN] Path eqN -[{ - "label": "eqNullable", - "kind": 12, - "tags": [1], +[ + { + "deprecated": true, "detail": "('a, nullable<'a>) => bool", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `eqNullable` directly instead.\n\n"} - }, { - "label": "eqNull", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `eqNullable` directly instead.\n\n" + }, "kind": 12, - "tags": [1], + "label": "eqNullable", + "tags": [ 1 ] + }, + { + "deprecated": true, "detail": "('a, null<'a>) => bool", - "documentation": {"kind": "markdown", "value": "Deprecated: Use `eqNull` directly instead.\n\n"} - }] + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use `eqNull` directly instead.\n\n" + }, + "kind": 12, + "label": "eqNull", + "tags": [ 1 ] + } +] diff --git a/tests/analysis_tests/tests/src/expected/Definition.res.txt b/tests/analysis_tests/tests/src/expected/Definition.res.txt index 824f03e3c5d..ae0362539ca 100644 --- a/tests/analysis_tests/tests/src/expected/Definition.res.txt +++ b/tests/analysis_tests/tests/src/expected/Definition.res.txt @@ -1,18 +1,51 @@ Definition src/Definition.res 2:8 -{"uri": "Definition.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 6}}} +{ + "range": { + "end": { "character": 6, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///Definition.res" +} Definition src/Definition.res 10:23 -{"uri": "Definition.res", "range": {"start": {"line": 6, "character": 7}, "end": {"line": 6, "character": 13}}} +{ + "range": { + "end": { "character": 13, "line": 6 }, + "start": { "character": 7, "line": 6 } + }, + "uri": "file:///Definition.res" +} Hover src/Definition.res 14:14 -{"contents": {"kind": "markdown", "value": "```rescript\n(list<'a>, 'a => 'b) => list<'b>\n```\n---\n\n`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) == list{2, 3}\n```\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n(list<'a>, 'a => 'b) => list<'b>\n```\n---\n\n`map(list, f)` returns a new list with `f` applied to each element of `list`.\n\n## Examples\n\n```rescript\nlist{1, 2}->List.map(x => x + 1) == list{2, 3}\n```\n" + } +} Hover src/Definition.res 18:14 -{"contents": {"kind": "markdown", "value": "```rescript\n('a => 'b, list<'a>) => list<'b>\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n('a => 'b, list<'a>) => list<'b>\n```" + } +} Hover src/Definition.res 23:3 -{"contents": {"kind": "markdown", "value": "```rescript\n(int, int) => int\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n(int, int) => int\n```" + } +} Definition src/Definition.res 26:3 -{"uri": "Definition.res", "range": {"start": {"line": 21, "character": 4}, "end": {"line": 21, "character": 13}}} +{ + "range": { + "end": { "character": 13, "line": 21 }, + "start": { "character": 4, "line": 21 } + }, + "uri": "file:///Definition.res" +} diff --git a/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.res.txt b/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.res.txt index f8d85032d22..fa6c727e3db 100644 --- a/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.res.txt +++ b/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.res.txt @@ -1,6 +1,18 @@ Definition src/DefinitionWithInterface.res 0:4 -{"uri": "DefinitionWithInterface.resi", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}} +{ + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} Definition src/DefinitionWithInterface.res 9:6 -{"uri": "DefinitionWithInterface.resi", "range": {"start": {"line": 6, "character": 2}, "end": {"line": 6, "character": 12}}} +{ + "range": { + "end": { "character": 12, "line": 6 }, + "start": { "character": 2, "line": 6 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} diff --git a/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.resi.txt b/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.resi.txt index 10bc343390a..e6f9264f2ce 100644 --- a/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.resi.txt +++ b/tests/analysis_tests/tests/src/expected/DefinitionWithInterface.resi.txt @@ -1,6 +1,18 @@ Definition src/DefinitionWithInterface.resi 0:4 -{"uri": "DefinitionWithInterface.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}} +{ + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} Definition src/DefinitionWithInterface.resi 6:6 -{"uri": "DefinitionWithInterface.res", "range": {"start": {"line": 9, "character": 6}, "end": {"line": 9, "character": 7}}} +{ + "range": { + "end": { "character": 12, "line": 6 }, + "start": { "character": 2, "line": 6 } + }, + "uri": "file:///DefinitionWithInterface.resi" +} diff --git a/tests/analysis_tests/tests/src/expected/Destructuring.res.txt b/tests/analysis_tests/tests/src/expected/Destructuring.res.txt index cd442729444..ef93ff42af2 100644 --- a/tests/analysis_tests/tests/src/expected/Destructuring.res.txt +++ b/tests/analysis_tests/tests/src/expected/Destructuring.res.txt @@ -5,13 +5,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/Destructuring.res 7:8 posCursor:[7:8] posNoWhite:[7:7] Found pattern:[7:7->7:9] @@ -20,19 +25,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype x = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype x = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/Destructuring.res 11:13 posCursor:[11:13] posNoWhite:[11:11] Found expr:[10:8->14:1] @@ -43,13 +57,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/Destructuring.res 17:10 posCursor:[17:10] posNoWhite:[17:9] Found expr:[16:9->20:1] @@ -60,19 +79,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype x = {name: string, age: int}\n```"} - }, { - "label": "age", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype x = {name: string, age: int}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype x = {name: string, age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/Destructuring.res 31:8 posCursor:[31:8] posNoWhite:[31:7] Found pattern:[31:7->31:9] @@ -81,17 +109,26 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[x] Path x -[{ - "label": "someField", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nsomeField: int\n```\n\n```rescript\ntype recordWithOptField = {someField: int, someOptField: option}\n```"} - }, { - "label": "?someOptField", + "documentation": { + "kind": "markdown", + "value": "```rescript\nsomeField: int\n```\n\n```rescript\ntype recordWithOptField = {someField: int, someOptField: option}\n```" + }, "kind": 5, - "tags": [], + "label": "someField", + "tags": [] + }, + { "detail": "option", - "documentation": {"kind": "markdown", "value": "someOptField is an optional field, and needs to be destructured using '?'.\n\n```rescript\n?someOptField: option\n```\n\n```rescript\ntype recordWithOptField = {someField: int, someOptField: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "someOptField is an optional field, and needs to be destructured using '?'.\n\n```rescript\n?someOptField: option\n```\n\n```rescript\ntype recordWithOptField = {someField: int, someOptField: option}\n```" + }, + "kind": 5, + "label": "?someOptField", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/Div.res.txt b/tests/analysis_tests/tests/src/expected/Div.res.txt index deb951ada87..bad98fff5d0 100644 --- a/tests/analysis_tests/tests/src/expected/Div.res.txt +++ b/tests/analysis_tests/tests/src/expected/Div.res.txt @@ -1,5 +1,5 @@ Hover src/Div.res 0:10 -{"contents": {"kind": "markdown", "value": "```rescript\nstring\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nstring\n```" } } Complete src/Div.res 3:17 posCursor:[3:17] posNoWhite:[3:16] Found expr:[3:3->3:17] @@ -9,11 +9,12 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path ReactDOM.domProps Path JsxDOM.domProps -[{ - "label": "dangerouslySetInnerHTML", - "kind": 4, - "tags": [], +[ + { "detail": "{\"__html\": string}", - "documentation": null - }] + "kind": 4, + "label": "dangerouslySetInnerHTML", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/DocComments.res.txt b/tests/analysis_tests/tests/src/expected/DocComments.res.txt index 1f8ab304def..f9adbf2b358 100644 --- a/tests/analysis_tests/tests/src/expected/DocComments.res.txt +++ b/tests/analysis_tests/tests/src/expected/DocComments.res.txt @@ -1,15 +1,40 @@ Hover src/DocComments.res 9:9 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\n Doc comment with a triple-backquote example\\n \\n ```res example\\n let a = 10\\n /*\\n * stuff\\n */\\n ```\\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\n Doc comment with a triple-backquote example\\n \\n ```res example\\n let a = 10\\n /*\\n * stuff\\n */\\n ```\\n" + } +} Hover src/DocComments.res 22:6 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\n\n Doc comment with a triple-backquote example\n \n ```res example\n let a = 10\n /*\n * stuff\n */\n ```\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\n\n Doc comment with a triple-backquote example\n \n ```res example\n let a = 10\n /*\n * stuff\n */\n ```\n" + } +} Hover src/DocComments.res 33:9 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\n Doc comment with a triple-backquote example\\n \\n ```res example\\n let a = 10\\n let b = 20\\n ```\\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\n Doc comment with a triple-backquote example\\n \\n ```res example\\n let a = 10\\n let b = 20\\n ```\\n" + } +} Hover src/DocComments.res 44:6 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\n\n Doc comment with a triple-backquote example\n \n ```res example\n let a = 10\n let b = 20\n ```\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\n\n Doc comment with a triple-backquote example\n \n ```res example\n let a = 10\n let b = 20\n ```\n" + } +} Hover src/DocComments.res 48:5 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\nNew doc comment format"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\nNew doc comment format" + } +} diff --git a/tests/analysis_tests/tests/src/expected/DocumentSymbol.res.txt b/tests/analysis_tests/tests/src/expected/DocumentSymbol.res.txt index d103cf3956c..48eb87b68fb 100644 --- a/tests/analysis_tests/tests/src/expected/DocumentSymbol.res.txt +++ b/tests/analysis_tests/tests/src/expected/DocumentSymbol.res.txt @@ -1,105 +1,217 @@ DocumentSymbol src/DocumentSymbol.res [ -{ - "name": "MyList", - "kind": 2, - "range": {"start": {"line": 0, "character": 7}, "end": {"line": 0, "character": 25}}, - "selectionRange": {"start": {"line": 0, "character": 7}, "end": {"line": 0, "character": 25}} -}, -{ - "name": "Dep", - "kind": 2, - "range": {"start": {"line": 2, "character": 7}, "end": {"line": 7, "character": 1}}, - "selectionRange": {"start": {"line": 2, "character": 7}, "end": {"line": 7, "character": 1}}, - "children": [ { - "name": "customDouble", - "kind": 12, - "range": {"start": {"line": 6, "character": 2}, "end": {"line": 6, "character": 35}}, - "selectionRange": {"start": {"line": 6, "character": 2}, "end": {"line": 6, "character": 35}} - }] -}, -{ - "name": "Lib", - "kind": 2, - "range": {"start": {"line": 9, "character": 7}, "end": {"line": 12, "character": 1}}, - "selectionRange": {"start": {"line": 9, "character": 7}, "end": {"line": 12, "character": 1}}, - "children": [ - { - "name": "foo", - "kind": 12, - "range": {"start": {"line": 10, "character": 2}, "end": {"line": 10, "character": 54}}, - "selectionRange": {"start": {"line": 10, "character": 2}, "end": {"line": 10, "character": 54}} + "children": [], + "kind": 16, + "name": "zzz", + "range": { + "end": { "character": 12, "line": 31 }, + "start": { "character": 0, "line": 31 } + }, + "selectionRange": { + "end": { "character": 12, "line": 31 }, + "start": { "character": 0, "line": 31 } + } }, { - "name": "next", - "kind": 12, - "range": {"start": {"line": 11, "character": 2}, "end": {"line": 11, "character": 48}}, - "selectionRange": {"start": {"line": 11, "character": 2}, "end": {"line": 11, "character": 48}} - }] -}, -{ - "name": "op", - "kind": 13, - "range": {"start": {"line": 14, "character": 0}, "end": {"line": 14, "character": 16}}, - "selectionRange": {"start": {"line": 14, "character": 0}, "end": {"line": 14, "character": 16}} -}, -{ - "name": "ForAuto", - "kind": 2, - "range": {"start": {"line": 16, "character": 7}, "end": {"line": 20, "character": 1}}, - "selectionRange": {"start": {"line": 16, "character": 7}, "end": {"line": 20, "character": 1}}, - "children": [ + "children": [ + { + "children": [ + { + "children": [], + "kind": 12, + "name": "make", + "range": { + "end": { "character": 97, "line": 27 }, + "start": { "character": 4, "line": 26 } + }, + "selectionRange": { + "end": { "character": 97, "line": 27 }, + "start": { "character": 4, "line": 26 } + } + } + ], + "kind": 2, + "name": "Comp", + "range": { + "end": { "character": 3, "line": 28 }, + "start": { "character": 9, "line": 25 } + }, + "selectionRange": { + "end": { "character": 3, "line": 28 }, + "start": { "character": 9, "line": 25 } + } + } + ], + "kind": 2, + "name": "O", + "range": { + "end": { "character": 1, "line": 29 }, + "start": { "character": 7, "line": 24 } + }, + "selectionRange": { + "end": { "character": 1, "line": 29 }, + "start": { "character": 7, "line": 24 } + } + }, { - "name": "t", - "kind": 26, - "range": {"start": {"line": 17, "character": 2}, "end": {"line": 17, "character": 14}}, - "selectionRange": {"start": {"line": 17, "character": 2}, "end": {"line": 17, "character": 14}} + "children": [], + "kind": 16, + "name": "fa", + "range": { + "end": { "character": 22, "line": 22 }, + "start": { "character": 0, "line": 22 } + }, + "selectionRange": { + "end": { "character": 22, "line": 22 }, + "start": { "character": 0, "line": 22 } + } }, { - "name": "abc", - "kind": 12, - "range": {"start": {"line": 18, "character": 2}, "end": {"line": 18, "character": 32}}, - "selectionRange": {"start": {"line": 18, "character": 2}, "end": {"line": 18, "character": 32}} + "children": [ + { + "children": [], + "kind": 12, + "name": "abd", + "range": { + "end": { "character": 32, "line": 19 }, + "start": { "character": 2, "line": 19 } + }, + "selectionRange": { + "end": { "character": 32, "line": 19 }, + "start": { "character": 2, "line": 19 } + } + }, + { + "children": [], + "kind": 12, + "name": "abc", + "range": { + "end": { "character": 32, "line": 18 }, + "start": { "character": 2, "line": 18 } + }, + "selectionRange": { + "end": { "character": 32, "line": 18 }, + "start": { "character": 2, "line": 18 } + } + }, + { + "children": [], + "kind": 26, + "name": "t", + "range": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 2, "line": 17 } + }, + "selectionRange": { + "end": { "character": 14, "line": 17 }, + "start": { "character": 2, "line": 17 } + } + } + ], + "kind": 2, + "name": "ForAuto", + "range": { + "end": { "character": 1, "line": 20 }, + "start": { "character": 7, "line": 16 } + }, + "selectionRange": { + "end": { "character": 1, "line": 20 }, + "start": { "character": 7, "line": 16 } + } }, { - "name": "abd", - "kind": 12, - "range": {"start": {"line": 19, "character": 2}, "end": {"line": 19, "character": 32}}, - "selectionRange": {"start": {"line": 19, "character": 2}, "end": {"line": 19, "character": 32}} - }] -}, -{ - "name": "fa", - "kind": 16, - "range": {"start": {"line": 22, "character": 0}, "end": {"line": 22, "character": 22}}, - "selectionRange": {"start": {"line": 22, "character": 0}, "end": {"line": 22, "character": 22}} -}, -{ - "name": "O", - "kind": 2, - "range": {"start": {"line": 24, "character": 7}, "end": {"line": 29, "character": 1}}, - "selectionRange": {"start": {"line": 24, "character": 7}, "end": {"line": 29, "character": 1}}, - "children": [ + "children": [], + "kind": 13, + "name": "op", + "range": { + "end": { "character": 16, "line": 14 }, + "start": { "character": 0, "line": 14 } + }, + "selectionRange": { + "end": { "character": 16, "line": 14 }, + "start": { "character": 0, "line": 14 } + } + }, { - "name": "Comp", + "children": [ + { + "children": [], + "kind": 12, + "name": "next", + "range": { + "end": { "character": 48, "line": 11 }, + "start": { "character": 2, "line": 11 } + }, + "selectionRange": { + "end": { "character": 48, "line": 11 }, + "start": { "character": 2, "line": 11 } + } + }, + { + "children": [], + "kind": 12, + "name": "foo", + "range": { + "end": { "character": 54, "line": 10 }, + "start": { "character": 2, "line": 10 } + }, + "selectionRange": { + "end": { "character": 54, "line": 10 }, + "start": { "character": 2, "line": 10 } + } + } + ], "kind": 2, - "range": {"start": {"line": 25, "character": 9}, "end": {"line": 28, "character": 3}}, - "selectionRange": {"start": {"line": 25, "character": 9}, "end": {"line": 28, "character": 3}}, + "name": "Lib", + "range": { + "end": { "character": 1, "line": 12 }, + "start": { "character": 7, "line": 9 } + }, + "selectionRange": { + "end": { "character": 1, "line": 12 }, + "start": { "character": 7, "line": 9 } + } + }, + { "children": [ - { - "name": "make", - "kind": 12, - "range": {"start": {"line": 26, "character": 4}, "end": {"line": 27, "character": 97}}, - "selectionRange": {"start": {"line": 26, "character": 4}, "end": {"line": 27, "character": 97}} - }] - }] -}, -{ - "name": "zzz", - "kind": 16, - "range": {"start": {"line": 31, "character": 0}, "end": {"line": 31, "character": 12}}, - "selectionRange": {"start": {"line": 31, "character": 0}, "end": {"line": 31, "character": 12}} -} + { + "children": [], + "kind": 12, + "name": "customDouble", + "range": { + "end": { "character": 35, "line": 6 }, + "start": { "character": 2, "line": 6 } + }, + "selectionRange": { + "end": { "character": 35, "line": 6 }, + "start": { "character": 2, "line": 6 } + } + } + ], + "kind": 2, + "name": "Dep", + "range": { + "end": { "character": 1, "line": 7 }, + "start": { "character": 7, "line": 2 } + }, + "selectionRange": { + "end": { "character": 1, "line": 7 }, + "start": { "character": 7, "line": 2 } + } + }, + { + "children": [], + "kind": 2, + "name": "MyList", + "range": { + "end": { "character": 25, "line": 0 }, + "start": { "character": 7, "line": 0 } + }, + "selectionRange": { + "end": { "character": 25, "line": 0 }, + "start": { "character": 7, "line": 0 } + } + } ] diff --git a/tests/analysis_tests/tests/src/expected/DotPipeCompleteFromCurrentModule.res.txt b/tests/analysis_tests/tests/src/expected/DotPipeCompleteFromCurrentModule.res.txt index 70f6773fec5..edf1be3fb1a 100644 --- a/tests/analysis_tests/tests/src/expected/DotPipeCompleteFromCurrentModule.res.txt +++ b/tests/analysis_tests/tests/src/expected/DotPipeCompleteFromCurrentModule.res.txt @@ -16,17 +16,23 @@ Path x CPPipe pathFromEnv:X found:true Path X. Path -[{ - "label": "->z", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 10 }, + "start": { "character": 12, "line": 10 } + } + } + ], "detail": "X.t => string", - "documentation": null, - "sortText": "z", "insertText": "->z", - "additionalTextEdits": [{ - "range": {"start": {"line": 10, "character": 12}, "end": {"line": 10, "character": 13}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->z", + "sortText": "z", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt b/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt index c4f755efbc3..6e5b64bb4bf 100644 --- a/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt +++ b/tests/analysis_tests/tests/src/expected/DotPipeCompletionSpec.res.txt @@ -13,37 +13,52 @@ Path n CPPipe pathFromEnv:SomeModule found:true Path SomeModule. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }, { - "label": "->SomeModule.withUnlabelledArgumentNotFirst", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 15 }, + "start": { "character": 4, "line": 15 } + } + } + ], "detail": "(~name: string=?, t) => unit", - "documentation": null, - "sortText": "withUnlabelledArgumentNotFirst", "insertText": "->SomeModule.withUnlabelledArgumentNotFirst", - "additionalTextEdits": [{ - "range": {"start": {"line": 15, "character": 4}, "end": {"line": 15, "character": 5}}, - "newText": "" - }] - }, { - "label": "->SomeModule.getName", "kind": 12, - "tags": [], + "label": "->SomeModule.withUnlabelledArgumentNotFirst", + "sortText": "withUnlabelledArgumentNotFirst", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 15 }, + "start": { "character": 4, "line": 15 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getName", "insertText": "->SomeModule.getName", - "additionalTextEdits": [{ - "range": {"start": {"line": 15, "character": 4}, "end": {"line": 15, "character": 5}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->SomeModule.getName", + "sortText": "getName", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 44:6 posCursor:[44:6] posNoWhite:[44:5] Found expr:[44:3->44:6] @@ -62,85 +77,120 @@ Path SomeOtherModule. Path DotPipeCompletionSpec.CompleteFromThisToo. Path DotPipeCompletionSpec.SomeOtherModule. Path -[{ - "label": "nname", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```"} - }, { - "label": "->SomeOtherModule.getNName", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```" + }, + "kind": 5, + "label": "nname", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 44 }, + "start": { "character": 5, "line": 44 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 44 }, + "start": { "character": 5, "line": 44 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, - "newText": "" - }] - }, { - "label": "->CompleteFromThisToo.a", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 44 }, + "start": { "character": 5, "line": 44 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "a", "insertText": "->CompleteFromThisToo.a", - "additionalTextEdits": [{ - "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName", "kind": 12, - "tags": [], + "label": "->CompleteFromThisToo.a", + "sortText": "a", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 44 }, + "start": { "character": 5, "line": 44 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 44 }, + "start": { "character": 5, "line": 44 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, - "newText": "" - }] - }, { - "label": "->doWithTypeOutsideModule", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 44 }, + "start": { "character": 5, "line": 44 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "doWithTypeOutsideModule", "insertText": "->doWithTypeOutsideModule", - "additionalTextEdits": [{ - "range": {"start": {"line": 44, "character": 5}, "end": {"line": 44, "character": 6}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->doWithTypeOutsideModule", + "sortText": "doWithTypeOutsideModule", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 62:5 posCursor:[62:5] posNoWhite:[62:4] Found expr:[62:3->62:5] @@ -158,31 +208,42 @@ CPPipe pathFromEnv:A found:true Path A. Path B. Path -[{ - "label": "->A.withA", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 62 }, + "start": { "character": 4, "line": 62 } + } + } + ], "detail": "a => unit", - "documentation": null, - "sortText": "withA", "insertText": "->A.withA", - "additionalTextEdits": [{ - "range": {"start": {"line": 62, "character": 4}, "end": {"line": 62, "character": 5}}, - "newText": "" - }] - }, { - "label": "->B.b", "kind": 12, - "tags": [], + "label": "->A.withA", + "sortText": "withA", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 5, "line": 62 }, + "start": { "character": 4, "line": 62 } + } + } + ], "detail": "A.a => int", - "documentation": null, - "sortText": "b", "insertText": "->B.b", - "additionalTextEdits": [{ - "range": {"start": {"line": 62, "character": 4}, "end": {"line": 62, "character": 5}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->B.b", + "sortText": "b", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 67:6 posCursor:[67:6] posNoWhite:[67:5] Found expr:[67:3->67:6] @@ -199,25 +260,35 @@ Path xx CPPipe pathFromEnv:CompletionFromModule.SomeModule found:false Path CompletionFromModule.SomeModule. Path -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }, { - "label": "->CompletionFromModule.SomeModule.getName", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 6, "line": 67 }, + "start": { "character": 5, "line": 67 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getName", "insertText": "->CompletionFromModule.SomeModule.getName", - "additionalTextEdits": [{ - "range": {"start": {"line": 67, "character": 5}, "end": {"line": 67, "character": 6}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->CompletionFromModule.SomeModule.getName", + "sortText": "getName", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 75:9 posCursor:[75:9] posNoWhite:[75:8] Found expr:[75:3->75:9] @@ -234,55 +305,93 @@ Path ffff Path Stdlib.Array.u Path ArrayUtils.u Path u -[{ - "label": "->Array.unshiftMany", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 8, "line": 75 }, + "start": { "character": 7, "line": 75 } + } + } + ], "detail": "(array<'a>, array<'a>) => unit", - "documentation": {"kind": "markdown", "value": "\n`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray == [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```\n"}, - "sortText": "unshiftMany", + "documentation": { + "kind": "markdown", + "value": "\n`unshiftMany(array, itemsArray)` inserts many new items to the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.push`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshiftMany([\"yay\", \"wehoo\"])\nsomeArray == [\"yay\", \"wehoo\", \"hi\", \"hello\"]\n```\n" + }, "insertText": "->Array.unshiftMany", - "additionalTextEdits": [{ - "range": {"start": {"line": 75, "character": 7}, "end": {"line": 75, "character": 8}}, - "newText": "" - }] - }, { - "label": "->Array.unshift", "kind": 12, - "tags": [], + "label": "->Array.unshiftMany", + "sortText": "unshiftMany", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 8, "line": 75 }, + "start": { "character": 7, "line": 75 } + } + } + ], "detail": "(array<'a>, 'a) => unit", - "documentation": {"kind": "markdown", "value": "\n`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray == [\"yay\", \"hi\", \"hello\"]\n```\n"}, - "sortText": "unshift", + "documentation": { + "kind": "markdown", + "value": "\n`unshift(array, item)` inserts a new item at the start of the array.\n\nBeware this will *mutate* the array.\n\nSee [`Array.unshift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift) on MDN.\n\n## Examples\n\n```rescript\nlet someArray = [\"hi\", \"hello\"]\nsomeArray->Array.unshift(\"yay\")\nsomeArray == [\"yay\", \"hi\", \"hello\"]\n```\n" + }, "insertText": "->Array.unshift", - "additionalTextEdits": [{ - "range": {"start": {"line": 75, "character": 7}, "end": {"line": 75, "character": 8}}, - "newText": "" - }] - }, { - "label": "->Array.unsafe_get", "kind": 12, - "tags": [1], + "label": "->Array.unshift", + "sortText": "unshift", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 8, "line": 75 }, + "start": { "character": 7, "line": 75 } + } + } + ], + "deprecated": true, "detail": "(array<'a>, int) => 'a", - "documentation": {"kind": "markdown", "value": "Deprecated: Use getUnsafe instead. This will be removed in v13\n\n\n`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```\n"}, - "sortText": "unsafe_get", + "documentation": { + "kind": "markdown", + "value": "Deprecated: Use getUnsafe instead. This will be removed in v13\n\n\n`unsafe_get(array, index)` returns the element at `index` of `array`.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `array`.\n\nUse `Array.unsafe_get` only when you are sure the `index` exists (i.e. when using for-loop).\n\n## Examples\n\n```rescript\nlet array = [1, 2, 3]\nfor index in 0 to array->Array.length - 1 {\n let value = array->Array.unsafe_get(index)\n Console.log(value)\n}\n```\n" + }, "insertText": "->Array.unsafe_get", - "additionalTextEdits": [{ - "range": {"start": {"line": 75, "character": 7}, "end": {"line": 75, "character": 8}}, - "newText": "" - }] - }, { - "label": "->Array.unzip", "kind": 12, - "tags": [], + "label": "->Array.unsafe_get", + "sortText": "unsafe_get", + "tags": [ 1 ] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 8, "line": 75 }, + "start": { "character": 7, "line": 75 } + } + } + ], "detail": "array<('a, 'b)> => (t<'a>, array<'b>)", - "documentation": {"kind": "markdown", "value": "\n`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nArray.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nArray.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```\n"}, - "sortText": "unzip", + "documentation": { + "kind": "markdown", + "value": "\n`unzip(a)` takes an array of pairs and creates a pair of arrays. The first array\ncontains all the first items of the pairs; the second array contains all the\nsecond items.\n\n## Examples\n\n```rescript\nArray.unzip([(1, 2), (3, 4)]) == ([1, 3], [2, 4])\n\nArray.unzip([(1, 2), (3, 4), (5, 6), (7, 8)]) == ([1, 3, 5, 7], [2, 4, 6, 8])\n```\n" + }, "insertText": "->Array.unzip", - "additionalTextEdits": [{ - "range": {"start": {"line": 75, "character": 7}, "end": {"line": 75, "character": 8}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->Array.unzip", + "sortText": "unzip", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 80:7 posCursor:[80:7] posNoWhite:[80:6] Found expr:[80:3->80:7] @@ -300,61 +409,86 @@ CPPipe pathFromEnv: found:true Path DotPipeCompletionSpec. Path DotPipeCompletionSpec.SomeOtherModule. Path -[{ - "label": "nname", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```"} - }, { - "label": "->doWithTypeOutsideModule", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```" + }, + "kind": 5, + "label": "nname", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 80 }, + "start": { "character": 6, "line": 80 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "doWithTypeOutsideModule", "insertText": "->doWithTypeOutsideModule", - "additionalTextEdits": [{ - "range": {"start": {"line": 80, "character": 6}, "end": {"line": 80, "character": 7}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName", "kind": 12, - "tags": [], + "label": "->doWithTypeOutsideModule", + "sortText": "doWithTypeOutsideModule", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 80 }, + "start": { "character": 6, "line": 80 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 80, "character": 6}, "end": {"line": 80, "character": 7}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 80 }, + "start": { "character": 6, "line": 80 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 80, "character": 6}, "end": {"line": 80, "character": 7}}, - "newText": "" - }] - }, { - "label": "->doWithTypeOutsideModule", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 80 }, + "start": { "character": 6, "line": 80 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "doWithTypeOutsideModule", "insertText": "->doWithTypeOutsideModule", - "additionalTextEdits": [{ - "range": {"start": {"line": 80, "character": 6}, "end": {"line": 80, "character": 7}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->doWithTypeOutsideModule", + "sortText": "doWithTypeOutsideModule", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 86:39 posCursor:[86:39] posNoWhite:[86:38] Found expr:[86:3->86:39] @@ -374,55 +508,92 @@ Path Array.filter Path Stdlib.Array.filt Path ArrayUtils.filt Path filt -[{ - "label": "->Array.filterMap", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 35, "line": 86 }, + "start": { "character": 34, "line": 86 } + } + } + ], "detail": "(array<'a>, 'a => option<'b>) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n) == [5]\n\n[1, 2, 3, 4, 5, 6]->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None) == [4, 16, 36]\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None) == []\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == []\n```\n"}, - "sortText": "filterMap", + "documentation": { + "kind": "markdown", + "value": "\n`filterMap(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMap(item =>\n switch item {\n | \"Hello\" => Some(item->String.length)\n | _ => None\n }\n) == [5]\n\n[1, 2, 3, 4, 5, 6]->Array.filterMap(n => mod(n, 2) == 0 ? Some(n * n) : None) == [4, 16, 36]\n\nArray.filterMap([1, 2, 3, 4, 5, 6], _ => None) == []\n\nArray.filterMap([], n => mod(n, 2) == 0 ? Some(n * n) : None) == []\n```\n" + }, "insertText": "->Array.filterMap", - "additionalTextEdits": [{ - "range": {"start": {"line": 86, "character": 34}, "end": {"line": 86, "character": 35}}, - "newText": "" - }] - }, { - "label": "->Array.filterMapWithIndex", "kind": 12, - "tags": [], + "label": "->Array.filterMap", + "sortText": "filterMap", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 35, "line": 86 }, + "start": { "character": 34, "line": 86 } + } + } + ], "detail": "(array<'a>, ('a, int) => option<'b>) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```\n"}, - "sortText": "filterMapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```\n" + }, "insertText": "->Array.filterMapWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 86, "character": 34}, "end": {"line": 86, "character": 35}}, - "newText": "" - }] - }, { - "label": "->Array.filter", "kind": 12, - "tags": [], + "label": "->Array.filterMapWithIndex", + "sortText": "filterMapWithIndex", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 35, "line": 86 }, + "start": { "character": 34, "line": 86 } + } + } + ], "detail": "(array<'a>, 'a => bool) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filter(num => num > 2) == [3, 4]\n```\n"}, - "sortText": "filter", + "documentation": { + "kind": "markdown", + "value": "\n`filter(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filter(num => num > 2) == [3, 4]\n```\n" + }, "insertText": "->Array.filter", - "additionalTextEdits": [{ - "range": {"start": {"line": 86, "character": 34}, "end": {"line": 86, "character": 35}}, - "newText": "" - }] - }, { - "label": "->Array.filterWithIndex", "kind": 12, - "tags": [], + "label": "->Array.filter", + "sortText": "filter", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 35, "line": 86 }, + "start": { "character": 34, "line": 86 } + } + } + ], "detail": "(array<'a>, ('a, int) => bool) => array<'a>", - "documentation": {"kind": "markdown", "value": "\n`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filterWithIndex((num, index) => index === 0 || num === 2) == [1, 2]\n```\n"}, - "sortText": "filterWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`filterWithIndex(array, checker)` returns a new array containing all elements from `array` for which the provided `checker` function returns true.\n\nSee [`Array.filter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) on MDN.\n\n## Examples\n\n```rescript\n[1, 2, 3, 4]->Array.filterWithIndex((num, index) => index === 0 || num === 2) == [1, 2]\n```\n" + }, "insertText": "->Array.filterWithIndex", - "additionalTextEdits": [{ - "range": {"start": {"line": 86, "character": 34}, "end": {"line": 86, "character": 35}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->Array.filterWithIndex", + "sortText": "filterWithIndex", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 89:62 posCursor:[89:62] posNoWhite:[89:61] Found expr:[89:3->89:62] @@ -441,31 +612,50 @@ ContextPath Value[Array, joinWith] Path Array.joinWith Path Stdlib.String.includ Path includ -[{ - "label": "->String.includes", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 56, "line": 89 }, + "start": { "character": 55, "line": 89 } + } + } + ], "detail": "(string, string) => bool", - "documentation": {"kind": "markdown", "value": "\n`includes(str, searchValue)` returns `true` if `searchValue` is found anywhere\nwithin `str`, `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includes(\"programmer\", \"gram\") == true\nString.includes(\"programmer\", \"er\") == true\nString.includes(\"programmer\", \"pro\") == true\nString.includes(\"programmer.dat\", \"xyz\") == false\n```\n"}, - "sortText": "includes", + "documentation": { + "kind": "markdown", + "value": "\n`includes(str, searchValue)` returns `true` if `searchValue` is found anywhere\nwithin `str`, `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includes(\"programmer\", \"gram\") == true\nString.includes(\"programmer\", \"er\") == true\nString.includes(\"programmer\", \"pro\") == true\nString.includes(\"programmer.dat\", \"xyz\") == false\n```\n" + }, "insertText": "->String.includes", - "additionalTextEdits": [{ - "range": {"start": {"line": 89, "character": 55}, "end": {"line": 89, "character": 56}}, - "newText": "" - }] - }, { - "label": "->String.includesFrom", "kind": 12, - "tags": [], + "label": "->String.includes", + "sortText": "includes", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 56, "line": 89 }, + "start": { "character": 55, "line": 89 } + } + } + ], "detail": "(string, string, int) => bool", - "documentation": {"kind": "markdown", "value": "\n`includesFrom(str, searchValue, start)` returns `true` if `searchValue` is found\nanywhere within `str` starting at character number `start` (where 0 is the\nfirst character), `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includesFrom(\"programmer\", \"gram\", 1) == true\nString.includesFrom(\"programmer\", \"gram\", 4) == false\nString.includesFrom(`대한민국`, `한`, 1) == true\n```\n"}, - "sortText": "includesFrom", + "documentation": { + "kind": "markdown", + "value": "\n`includesFrom(str, searchValue, start)` returns `true` if `searchValue` is found\nanywhere within `str` starting at character number `start` (where 0 is the\nfirst character), `false` otherwise.\nSee [`String.includes`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes) on MDN.\n\n## Examples\n\n```rescript\nString.includesFrom(\"programmer\", \"gram\", 1) == true\nString.includesFrom(\"programmer\", \"gram\", 4) == false\nString.includesFrom(`대한민국`, `한`, 1) == true\n```\n" + }, "insertText": "->String.includesFrom", - "additionalTextEdits": [{ - "range": {"start": {"line": 89, "character": 55}, "end": {"line": 89, "character": 56}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->String.includesFrom", + "sortText": "includesFrom", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 94:36 posCursor:[94:36] posNoWhite:[94:35] Found expr:[94:3->94:36] @@ -483,19 +673,29 @@ ContextPath Value[String, toLowerCase] Path String.toLowerCase Path Stdlib.String.toUpperCa Path toUpperCa -[{ - "label": "->String.toUpperCase", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 27, "line": 94 }, + "start": { "character": 26, "line": 94 } + } + } + ], "detail": "string => string", - "documentation": {"kind": "markdown", "value": "\n`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```\n"}, - "sortText": "toUpperCase", + "documentation": { + "kind": "markdown", + "value": "\n`toUpperCase(str)` converts `str` to upper case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\nexpand the number of letters in the result, for example the German ß\ncapitalizes to two Ses in a row.\nSee [`String.toUpperCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) on MDN.\n\n## Examples\n\n```rescript\nString.toUpperCase(\"abc\") == \"ABC\"\nString.toUpperCase(`Straße`) == `STRASSE`\nString.toUpperCase(`πς`) == `ΠΣ`\n```\n" + }, "insertText": "->String.toUpperCase", - "additionalTextEdits": [{ - "range": {"start": {"line": 94, "character": 26}, "end": {"line": 94, "character": 27}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->String.toUpperCase", + "sortText": "toUpperCase", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 97:55 posCursor:[97:55] posNoWhite:[97:54] Found expr:[97:3->97:55] @@ -513,19 +713,29 @@ ContextPath Value[String, toUpperCase] Path String.toUpperCase Path Stdlib.String.toLowerC Path toLowerC -[{ - "label": "->String.toLowerCase", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 47, "line": 97 }, + "start": { "character": 46, "line": 97 } + } + } + ], "detail": "string => string", - "documentation": {"kind": "markdown", "value": "\n`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms, one when it is the last\ncharacter in a string and another when it is not.\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) on MDN.\n\n## Examples\n\n```rescript\nString.toLowerCase(\"ABC\") == \"abc\"\nString.toLowerCase(`ΣΠ`) == `σπ`\nString.toLowerCase(`ΠΣ`) == `πς`\n```\n"}, - "sortText": "toLowerCase", + "documentation": { + "kind": "markdown", + "value": "\n`toLowerCase(str)` converts `str` to lower case using the locale-insensitive\ncase mappings in the Unicode Character Database. Notice that the conversion can\ngive different results depending upon context, for example with the Greek\nletter sigma, which has two different lower case forms, one when it is the last\ncharacter in a string and another when it is not.\nSee [`String.toLowerCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) on MDN.\n\n## Examples\n\n```rescript\nString.toLowerCase(\"ABC\") == \"abc\"\nString.toLowerCase(`ΣΠ`) == `σπ`\nString.toLowerCase(`ΠΣ`) == `πς`\n```\n" + }, "insertText": "->String.toLowerCase", - "additionalTextEdits": [{ - "range": {"start": {"line": 97, "character": 46}, "end": {"line": 97, "character": 47}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->String.toLowerCase", + "sortText": "toLowerCase", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 101:7 posCursor:[101:7] posNoWhite:[101:6] Found expr:[100:9->104:1] @@ -544,61 +754,86 @@ CPPipe pathFromEnv: found:true Path DotPipeCompletionSpec. Path DotPipeCompletionSpec.SomeOtherModule. Path -[{ - "label": "nname", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```"} - }, { - "label": "->doWithTypeOutsideModule", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```" + }, + "kind": 5, + "label": "nname", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 101 }, + "start": { "character": 6, "line": 101 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "doWithTypeOutsideModule", "insertText": "->doWithTypeOutsideModule", - "additionalTextEdits": [{ - "range": {"start": {"line": 101, "character": 6}, "end": {"line": 101, "character": 7}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName", "kind": 12, - "tags": [], + "label": "->doWithTypeOutsideModule", + "sortText": "doWithTypeOutsideModule", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 101 }, + "start": { "character": 6, "line": 101 } + } + } + ], "detail": "t => string", - "documentation": null, - "sortText": "getNName", "insertText": "->SomeOtherModule.getNName", - "additionalTextEdits": [{ - "range": {"start": {"line": 101, "character": 6}, "end": {"line": 101, "character": 7}}, - "newText": "" - }] - }, { - "label": "->SomeOtherModule.getNName2", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName", + "sortText": "getNName", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 101 }, + "start": { "character": 6, "line": 101 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "getNName2", "insertText": "->SomeOtherModule.getNName2", - "additionalTextEdits": [{ - "range": {"start": {"line": 101, "character": 6}, "end": {"line": 101, "character": 7}}, - "newText": "" - }] - }, { - "label": "->doWithTypeOutsideModule", "kind": 12, - "tags": [], + "label": "->SomeOtherModule.getNName2", + "sortText": "getNName2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 7, "line": 101 }, + "start": { "character": 6, "line": 101 } + } + } + ], "detail": "typeOutsideModule => string", - "documentation": null, - "sortText": "doWithTypeOutsideModule", "insertText": "->doWithTypeOutsideModule", - "additionalTextEdits": [{ - "range": {"start": {"line": 101, "character": 6}, "end": {"line": 101, "character": 7}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->doWithTypeOutsideModule", + "sortText": "doWithTypeOutsideModule", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 108:27 XXX Not found! @@ -607,27 +842,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[Dot] Path Dot -[{ - "label": "DotPipeCompleteFromCurrentModule", - "kind": 9, - "tags": [], - "detail": "module DotPipeCompleteFromCurrentModule", - "documentation": null, +[ + { "data": { "modulePath": "DotPipeCompleteFromCurrentModule", "filePath": "src/DotPipeCompletionSpec.res" - } - }, { - "label": "DotPipeCompletionSpec", + }, + "detail": "module DotPipeCompleteFromCurrentModule", "kind": 9, - "tags": [], - "detail": "module DotPipeCompletionSpec", - "documentation": null, + "label": "DotPipeCompleteFromCurrentModule", + "tags": [] + }, + { "data": { "modulePath": "DotPipeCompletionSpec", "filePath": "src/DotPipeCompletionSpec.res" - } - }] + }, + "detail": "module DotPipeCompletionSpec", + "kind": 9, + "label": "DotPipeCompletionSpec", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 111:39 posCursor:[111:39] posNoWhite:[111:38] Found expr:[111:24->111:40] @@ -638,37 +874,38 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[CompletionPipe] Path CompletionPipe -[{ - "label": "CompletionPipeChain", - "kind": 9, - "tags": [], - "detail": "module CompletionPipeChain", - "documentation": null, +[ + { "data": { "modulePath": "CompletionPipeChain", "filePath": "src/DotPipeCompletionSpec.res" - } - }, { - "label": "CompletionPipeProperty", + }, + "detail": "module CompletionPipeChain", "kind": 9, - "tags": [], - "detail": "module CompletionPipeProperty", - "documentation": null, + "label": "CompletionPipeChain", + "tags": [] + }, + { "data": { "modulePath": "CompletionPipeProperty", "filePath": "src/DotPipeCompletionSpec.res" - } - }, { - "label": "CompletionPipeSubmodules", + }, + "detail": "module CompletionPipeProperty", "kind": 9, - "tags": [], - "detail": "module CompletionPipeSubmodules", - "documentation": null, + "label": "CompletionPipeProperty", + "tags": [] + }, + { "data": { "modulePath": "CompletionPipeSubmodules", "filePath": "src/DotPipeCompletionSpec.res" - } - }] + }, + "detail": "module CompletionPipeSubmodules", + "kind": 9, + "label": "CompletionPipeSubmodules", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 114:44 posCursor:[114:44] posNoWhite:[114:43] Found expr:[114:24->114:45] @@ -679,27 +916,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Dot] Path Dot -[{ - "label": "DotPipeCompleteFromCurrentModule", - "kind": 9, - "tags": [], - "detail": "module DotPipeCompleteFromCurrentModule", - "documentation": null, +[ + { "data": { "modulePath": "DotPipeCompleteFromCurrentModule", "filePath": "src/DotPipeCompletionSpec.res" - } - }, { - "label": "DotPipeCompletionSpec", + }, + "detail": "module DotPipeCompleteFromCurrentModule", "kind": 9, - "tags": [], - "detail": "module DotPipeCompletionSpec", - "documentation": null, + "label": "DotPipeCompleteFromCurrentModule", + "tags": [] + }, + { "data": { "modulePath": "DotPipeCompletionSpec", "filePath": "src/DotPipeCompletionSpec.res" - } - }] + }, + "detail": "module DotPipeCompletionSpec", + "kind": 9, + "label": "DotPipeCompletionSpec", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 122:11 posCursor:[122:11] posNoWhite:[122:10] Found expr:[122:3->122:11] @@ -713,29 +951,40 @@ Path someObj ContextPath Value[someObj]-> ContextPath Value[someObj] Path someObj -[{ - "label": "[\"age\"]", - "kind": 4, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 11, "line": 122 }, + "start": { "character": 10, "line": 122 } + } + } + ], "detail": "{\"age\": int, \"name\": string}", - "documentation": null, "insertText": "[\"age\"]", - "additionalTextEdits": [{ - "range": {"start": {"line": 122, "character": 10}, "end": {"line": 122, "character": 11}}, - "newText": "" - }] - }, { - "label": "[\"name\"]", "kind": 4, - "tags": [], + "label": "[\"age\"]", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 11, "line": 122 }, + "start": { "character": 10, "line": 122 } + } + } + ], "detail": "{\"age\": int, \"name\": string}", - "documentation": null, "insertText": "[\"name\"]", - "additionalTextEdits": [{ - "range": {"start": {"line": 122, "character": 10}, "end": {"line": 122, "character": 11}}, - "newText": "" - }] - }] + "kind": 4, + "label": "[\"name\"]", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 125:13 posCursor:[125:13] posNoWhite:[125:12] Found expr:[125:3->125:13] @@ -749,18 +998,24 @@ Path someObj ContextPath Value[someObj]->na ContextPath Value[someObj] Path someObj -[{ - "label": "[\"name\"]", - "kind": 4, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 11, "line": 125 }, + "start": { "character": 10, "line": 125 } + } + } + ], "detail": "{\"age\": int, \"name\": string}", - "documentation": null, "insertText": "[\"name\"]", - "additionalTextEdits": [{ - "range": {"start": {"line": 125, "character": 10}, "end": {"line": 125, "character": 11}}, - "newText": "" - }] - }] + "kind": 4, + "label": "[\"name\"]", + "tags": [] + } +] Complete src/DotPipeCompletionSpec.res 144:10 posCursor:[144:10] posNoWhite:[144:9] Found expr:[144:3->144:10] @@ -778,23 +1033,33 @@ CPPipe pathFromEnv:DOMAPI found:true Path DOMAPI. Path DotPipeCompletionSpec.HTMLButtonElement. Path -[{ - "label": "disabled", - "kind": 5, - "tags": [], +[ + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\ndisabled: bool\n```\n\n```rescript\ntype htmlButtonElement = {mutable disabled: bool}\n```"} - }, { - "label": "->HTMLButtonElement.checkValidity", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ndisabled: bool\n```\n\n```rescript\ntype htmlButtonElement = {mutable disabled: bool}\n```" + }, + "kind": 5, + "label": "disabled", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 10, "line": 144 }, + "start": { "character": 9, "line": 144 } + } + } + ], "detail": "DOMAPI.htmlButtonElement => bool", - "documentation": null, - "sortText": "checkValidity", "insertText": "->HTMLButtonElement.checkValidity", - "additionalTextEdits": [{ - "range": {"start": {"line": 144, "character": 9}, "end": {"line": 144, "character": 10}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->HTMLButtonElement.checkValidity", + "sortText": "checkValidity", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/EnvCompletion.res.txt b/tests/analysis_tests/tests/src/expected/EnvCompletion.res.txt index 04fcb8d2cff..984700667e5 100644 --- a/tests/analysis_tests/tests/src/expected/EnvCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/EnvCompletion.res.txt @@ -5,23 +5,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -[{ - "label": "Okay(_)", - "kind": 4, - "tags": [], +[ + { "detail": "Okay('a)", - "documentation": {"kind": "markdown", "value": "```rescript\nOkay('a)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOkay('a)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```" + }, "insertText": "Okay(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Failure(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Okay(_)", + "tags": [] + }, + { "detail": "Failure('b)", - "documentation": {"kind": "markdown", "value": "```rescript\nFailure('b)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nFailure('b)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```" + }, "insertText": "Failure(${1:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Failure(_)", + "tags": [] + } +] Complete src/EnvCompletion.res 13:23 posCursor:[13:23] posNoWhite:[13:22] Found pattern:[13:18->13:24] @@ -33,23 +42,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype things = One | Two\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype things = One | Two\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo\n```\n\n```rescript\ntype things = One | Two\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo\n```\n\n```rescript\ntype things = One | Two\n```" + }, "insertText": "Two", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Two", + "tags": [] + } +] Complete src/EnvCompletion.res 16:26 posCursor:[16:26] posNoWhite:[16:25] Found pattern:[16:18->16:27] @@ -61,16 +79,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -[{ - "label": "\"\"", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": null, - "sortText": "A", "insertText": "\"$0\"", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "\"\"", + "sortText": "A", + "tags": [] + } +] Complete src/EnvCompletion.res 19:19 XXX Not found! @@ -80,16 +99,21 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "EnvCompletionOtherFile.response", - "documentation": {"kind": "markdown", "value": "```rescript\ntype EnvCompletionOtherFile.response = {stuff: theVariant, res: someResult}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype EnvCompletionOtherFile.response = {stuff: theVariant, res: someResult}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/EnvCompletion.res 22:21 posCursor:[22:21] posNoWhite:[22:20] Found pattern:[22:20->22:22] @@ -99,19 +123,28 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "stuff", - "kind": 5, - "tags": [], +[ + { "detail": "theVariant", - "documentation": {"kind": "markdown", "value": "```rescript\nstuff: theVariant\n```\n\n```rescript\ntype EnvCompletionOtherFile.response = {stuff: theVariant, res: someResult}\n```"} - }, { - "label": "res", + "documentation": { + "kind": "markdown", + "value": "```rescript\nstuff: theVariant\n```\n\n```rescript\ntype EnvCompletionOtherFile.response = {stuff: theVariant, res: someResult}\n```" + }, "kind": 5, - "tags": [], + "label": "stuff", + "tags": [] + }, + { "detail": "someResult", - "documentation": {"kind": "markdown", "value": "```rescript\nres: someResult\n```\n\n```rescript\ntype EnvCompletionOtherFile.response = {stuff: theVariant, res: someResult}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nres: someResult\n```\n\n```rescript\ntype EnvCompletionOtherFile.response = {stuff: theVariant, res: someResult}\n```" + }, + "kind": 5, + "label": "res", + "tags": [] + } +] Complete src/EnvCompletion.res 25:27 posCursor:[25:27] posNoWhite:[25:26] Found pattern:[25:20->25:31] @@ -121,23 +154,32 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "First", - "kind": 4, - "tags": [], +[ + { "detail": "First", - "documentation": {"kind": "markdown", "value": "```rescript\nFirst\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nFirst\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```" + }, "insertText": "First", - "insertTextFormat": 2 - }, { - "label": "Second(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "First", + "tags": [] + }, + { "detail": "Second(r1)", - "documentation": {"kind": "markdown", "value": "```rescript\nSecond(r1)\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nSecond(r1)\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```" + }, "insertText": "Second(${1:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Second(_)", + "tags": [] + } +] Complete src/EnvCompletion.res 28:35 posCursor:[28:35] posNoWhite:[28:34] Found pattern:[28:20->28:38] @@ -151,16 +193,21 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "r1", - "documentation": {"kind": "markdown", "value": "```rescript\ntype r1 = {age: int}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype r1 = {age: int}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/EnvCompletion.res 31:36 posCursor:[31:36] posNoWhite:[31:35] Found pattern:[31:20->31:40] @@ -173,13 +220,18 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype r1 = {age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype r1 = {age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/EnvCompletion.res 34:25 posCursor:[34:25] posNoWhite:[34:24] Found pattern:[34:20->34:29] @@ -189,23 +241,32 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "Okay(_)", - "kind": 4, - "tags": [], +[ + { "detail": "Okay('a)", - "documentation": {"kind": "markdown", "value": "```rescript\nOkay('a)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOkay('a)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```" + }, "insertText": "Okay(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Failure(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Okay(_)", + "tags": [] + }, + { "detail": "Failure('b)", - "documentation": {"kind": "markdown", "value": "```rescript\nFailure('b)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nFailure('b)\n```\n\n```rescript\ntype someResult<'a, 'b> = Okay('a) | Failure('b)\n```" + }, "insertText": "Failure(${1:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Failure(_)", + "tags": [] + } +] Complete src/EnvCompletion.res 37:31 posCursor:[37:31] posNoWhite:[37:30] Found pattern:[37:20->37:34] @@ -219,23 +280,32 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "First", - "kind": 4, - "tags": [], +[ + { "detail": "First", - "documentation": {"kind": "markdown", "value": "```rescript\nFirst\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nFirst\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```" + }, "insertText": "First", - "insertTextFormat": 2 - }, { - "label": "Second(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "First", + "tags": [] + }, + { "detail": "Second(r1)", - "documentation": {"kind": "markdown", "value": "```rescript\nSecond(r1)\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nSecond(r1)\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```" + }, "insertText": "Second(${1:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Second(_)", + "tags": [] + } +] Complete src/EnvCompletion.res 40:38 posCursor:[40:38] posNoWhite:[40:37] Found pattern:[40:20->40:42] @@ -251,16 +321,21 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "r1", - "documentation": {"kind": "markdown", "value": "```rescript\ntype r1 = {age: int}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype r1 = {age: int}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/EnvCompletion.res 43:39 posCursor:[43:39] posNoWhite:[43:38] Found pattern:[43:20->43:44] @@ -275,13 +350,18 @@ Resolved opens 1 Stdlib ContextPath Value[use](Nolabel) ContextPath Value[use] Path use -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype r1 = {age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype r1 = {age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/EnvCompletion.res 52:18 XXX Not found! @@ -290,16 +370,21 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res2] Path res2 -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "EnvCompletionOtherFile.someRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/EnvCompletion.res 55:20 posCursor:[55:20] posNoWhite:[55:19] Found pattern:[55:19->55:21] @@ -308,25 +393,38 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res2] Path res2 -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```"} - }, { - "label": "theThing", + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```" + }, "kind": 5, - "tags": [], + "label": "name", + "tags": [] + }, + { "detail": "'thing", - "documentation": {"kind": "markdown", "value": "```rescript\ntheThing: 'thing\n```\n\n```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```"} - }, { - "label": "theVariant", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntheThing: 'thing\n```\n\n```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```" + }, "kind": 5, - "tags": [], + "label": "theThing", + "tags": [] + }, + { "detail": "theVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntheVariant: theVariant\n```\n\n```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntheVariant: theVariant\n```\n\n```rescript\ntype EnvCompletionOtherFile.someRecord = {name: string, theThing: 'thing, theVariant: theVariant}\n```" + }, + "kind": 5, + "label": "theVariant", + "tags": [] + } +] Complete src/EnvCompletion.res 58:29 posCursor:[58:29] posNoWhite:[58:28] Found pattern:[58:19->58:33] @@ -335,23 +433,32 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res2] Path res2 -[{ - "label": "Four", - "kind": 4, - "tags": [], +[ + { "detail": "Four", - "documentation": {"kind": "markdown", "value": "```rescript\nFour\n```\n\n```rescript\ntype things2 = Four | Five\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nFour\n```\n\n```rescript\ntype things2 = Four | Five\n```" + }, "insertText": "Four", - "insertTextFormat": 2 - }, { - "label": "Five", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Four", + "tags": [] + }, + { "detail": "Five", - "documentation": {"kind": "markdown", "value": "```rescript\nFive\n```\n\n```rescript\ntype things2 = Four | Five\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nFive\n```\n\n```rescript\ntype things2 = Four | Five\n```" + }, "insertText": "Five", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Five", + "tags": [] + } +] Complete src/EnvCompletion.res 61:31 posCursor:[61:31] posNoWhite:[61:30] Found pattern:[61:19->61:35] @@ -360,21 +467,30 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res2] Path res2 -[{ - "label": "First", - "kind": 4, - "tags": [], +[ + { "detail": "First", - "documentation": {"kind": "markdown", "value": "```rescript\nFirst\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nFirst\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```" + }, "insertText": "First", - "insertTextFormat": 2 - }, { - "label": "Second(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "First", + "tags": [] + }, + { "detail": "Second(r1)", - "documentation": {"kind": "markdown", "value": "```rescript\nSecond(r1)\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nSecond(r1)\n```\n\n```rescript\ntype theVariant = First | Second(r1)\n```" + }, "insertText": "Second(${1:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Second(_)", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt b/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt index 2d5586d1f28..ca5e05c5859 100644 --- a/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt +++ b/tests/analysis_tests/tests/src/expected/ExhaustiveSwitch.res.txt @@ -5,22 +5,27 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[withSomeVarian] Path withSomeVarian -[{ - "label": "withSomeVariant", - "kind": 12, - "tags": [], +[ + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three(option)\n```"} - }, { - "label": "withSomeVariant (exhaustive switch)", - "kind": 15, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three(option)\n```" + }, + "kind": 12, + "label": "withSomeVariant", + "tags": [] + }, + { "detail": "insert exhaustive switch for value", - "documentation": null, "filterText": "withSomeVariant", "insertText": "withSomeVariant {\n | One => ${1:%todo}\n | Two => ${2:%todo}\n | Three(_) => ${3:%todo}\n }", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 15, + "label": "withSomeVariant (exhaustive switch)", + "tags": [] + } +] Complete src/ExhaustiveSwitch.res 11:21 XXX Not found! @@ -29,22 +34,23 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[withSomePol] Path withSomePol -[{ - "label": "withSomePoly", - "kind": 12, - "tags": [], +[ + { "detail": "somePolyVariant", - "documentation": null - }, { - "label": "withSomePoly (exhaustive switch)", - "kind": 15, - "tags": [], + "kind": 12, + "label": "withSomePoly", + "tags": [] + }, + { "detail": "insert exhaustive switch for value", - "documentation": null, "filterText": "withSomePoly", "insertText": "withSomePoly {\n | #\"switch\" => ${1:%todo}\n | #one => ${2:%todo}\n | #three(_) => ${3:%todo}\n | #two => ${4:%todo}\n | #\"exotic ident\" => ${5:%todo}\n }", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 15, + "label": "withSomePoly (exhaustive switch)", + "tags": [] + } +] Complete src/ExhaustiveSwitch.res 14:17 XXX Not found! @@ -53,22 +59,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[someBoo] Path someBoo -[{ - "label": "someBool", - "kind": 12, - "tags": [], - "detail": "bool", - "documentation": null - }, { - "label": "someBool (exhaustive switch)", - "kind": 15, - "tags": [], +[ + { "detail": "bool", "kind": 12, "label": "someBool", "tags": [] }, + { "detail": "insert exhaustive switch for value", - "documentation": null, "filterText": "someBool", "insertText": "someBool {\n | true => ${1:%todo}\n | false => ${2:%todo}\n }", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 15, + "label": "someBool (exhaustive switch)", + "tags": [] + } +] Complete src/ExhaustiveSwitch.res 17:16 XXX Not found! @@ -77,22 +79,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[someOp] Path someOp -[{ - "label": "someOpt", - "kind": 12, - "tags": [], - "detail": "option", - "documentation": null - }, { - "label": "someOpt (exhaustive switch)", - "kind": 15, - "tags": [], +[ + { "detail": "option", "kind": 12, "label": "someOpt", "tags": [] }, + { "detail": "insert exhaustive switch for value", - "documentation": null, "filterText": "someOpt", "insertText": "someOpt {\n | Some($1) => ${2:%todo}\n | None => ${3:%todo}\n }", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 15, + "label": "someOpt (exhaustive switch)", + "tags": [] + } +] Xform src/ExhaustiveSwitch.res 30:13 posCursor:[30:13] posNoWhite:[30:12] Found expr:[30:3->30:17] @@ -123,7 +121,10 @@ Resolved opens 1 Stdlib Hit: Exhaustive switch TextDocumentEdit: ExhaustiveSwitch.res -{"start": {"line": 33, "character": 3}, "end": {"line": 33, "character": 10}} +{ + "end": { "character": 10, "line": 33 }, + "start": { "character": 3, "line": 33 } +} newText: <--here switch x->getV { @@ -144,7 +145,10 @@ Resolved opens 1 Stdlib Hit: Exhaustive switch TextDocumentEdit: ExhaustiveSwitch.res -{"start": {"line": 36, "character": 3}, "end": {"line": 36, "character": 6}} +{ + "end": { "character": 6, "line": 36 }, + "start": { "character": 3, "line": 36 } +} newText: <--here switch vvv { @@ -163,21 +167,26 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[withSomeVarian] Path withSomeVarian -[{ - "label": "withSomeVariant", - "kind": 12, - "tags": [], +[ + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three(option)\n```"} - }, { - "label": "withSomeVariant (exhaustive switch)", - "kind": 15, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three(option)\n```" + }, + "kind": 12, + "label": "withSomeVariant", + "tags": [] + }, + { "detail": "insert exhaustive switch for value", - "documentation": null, "filterText": "withSomeVariant", "insertText": "withSomeVariant {\n | One => ${1:%todo}\n | Two => ${2:%todo}\n | Three(_) => ${3:%todo}\n }", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 15, + "label": "withSomeVariant (exhaustive switch)", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/Firebase.res.txt b/tests/analysis_tests/tests/src/expected/Firebase.res.txt index 17105d12f49..65b15690df0 100644 --- a/tests/analysis_tests/tests/src/expected/Firebase.res.txt +++ b/tests/analysis_tests/tests/src/expected/Firebase.res.txt @@ -14,29 +14,43 @@ Path ref CPPipe pathFromEnv:Firebase.Firestore found:true Path Firebase.Firestore. Path -[{ - "label": "id", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nid: string\n```\n\n```rescript\ntype documentReference<'documentdata> = {\n id: string,\n path: string,\n}\n```"} - }, { - "label": "path", + "documentation": { + "kind": "markdown", + "value": "```rescript\nid: string\n```\n\n```rescript\ntype documentReference<'documentdata> = {\n id: string,\n path: string,\n}\n```" + }, "kind": 5, - "tags": [], + "label": "id", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\npath: string\n```\n\n```rescript\ntype documentReference<'documentdata> = {\n id: string,\n path: string,\n}\n```"} - }, { - "label": "->Firestore.getDoc", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\npath: string\n```\n\n```rescript\ntype documentReference<'documentdata> = {\n id: string,\n path: string,\n}\n```" + }, + "kind": 5, + "label": "path", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 9, "line": 30 }, + "start": { "character": 8, "line": 30 } + } + } + ], "detail": "documentReference<\n 'documentdata,\n> => Promise.t>", - "documentation": null, - "sortText": "getDoc", "insertText": "->Firestore.getDoc", - "additionalTextEdits": [{ - "range": {"start": {"line": 30, "character": 8}, "end": {"line": 30, "character": 9}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->Firestore.getDoc", + "sortText": "getDoc", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/FirstClassModules.res.txt b/tests/analysis_tests/tests/src/expected/FirstClassModules.res.txt index cc0bfcaf1db..34efeb08337 100644 --- a/tests/analysis_tests/tests/src/expected/FirstClassModules.res.txt +++ b/tests/analysis_tests/tests/src/expected/FirstClassModules.res.txt @@ -1,5 +1,10 @@ Hover src/FirstClassModules.res 11:16 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule type SomeModule = {\n module Inner\n type t = {x: int}\n let foo: t => int\n let doStuff: string => unit\n let doOtherStuff: string => unit\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule type SomeModule = {\n module Inner\n type t = {x: int}\n let foo: t => int\n let doStuff: string => unit\n let doOtherStuff: string => unit\n}\n```" + } +} Complete src/FirstClassModules.res 13:15 posCursor:[13:15] posNoWhite:[13:14] Found expr:[10:13->26:1] @@ -12,40 +17,35 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[SomeModule, ""] Path SomeModule. -[{ - "label": "Inner", - "kind": 9, - "tags": [], - "detail": "module Inner", - "documentation": null - }, { - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "module Inner", "kind": 9, "label": "Inner", "tags": [] }, + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = {x: int}\n```"} - }, { - "label": "foo", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "doStuff", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = {x: int}\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + }, + { "detail": "t => int", "kind": 12, "label": "foo", "tags": [] }, + { "detail": "string => unit", "kind": 12, "label": "doStuff", "tags": [] }, + { "detail": "string => unit", - "documentation": null - }, { - "label": "doOtherStuff", "kind": 12, - "tags": [], - "detail": "string => unit", - "documentation": null - }] + "label": "doOtherStuff", + "tags": [] + } +] Hover src/FirstClassModules.res 16:8 -{"contents": {"kind": "markdown", "value": "```rescript\nstring => unit\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nstring => unit\n```" + } +} Complete src/FirstClassModules.res 20:7 posCursor:[20:7] posNoWhite:[20:6] Found expr:[10:13->26:1] @@ -60,25 +60,25 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[M, ""] Path M. -[{ - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = {name: string}\n```"} - }, { - "label": "getName", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = {name: string}\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + }, + { "detail": "t => string", "kind": 12, "label": "getName", "tags": [] }, + { + "detail": "unit => string", "kind": 12, - "tags": [], - "detail": "t => string", - "documentation": null - }, { "label": "thisShouldNotBeCompletedFor", - "kind": 12, - "tags": [], - "detail": "unit => string", - "documentation": null - }] + "tags": [] + } +] Complete src/FirstClassModules.res 23:8 posCursor:[23:8] posNoWhite:[23:7] Found expr:[10:13->26:1] @@ -93,13 +93,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[M, g] Path M.g -[{ - "label": "getName", - "kind": 12, - "tags": [], - "detail": "t => string", - "documentation": null - }] +[ { "detail": "t => string", "kind": 12, "label": "getName", "tags": [] } ] Complete src/FirstClassModules.res 32:8 posCursor:[32:8] posNoWhite:[32:7] Found expr:[30:22->35:1] @@ -112,37 +106,27 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[S2, ""] Path S2. -[{ - "label": "Inner", - "kind": 9, - "tags": [], - "detail": "module Inner", - "documentation": null - }, { - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "module Inner", "kind": 9, "label": "Inner", "tags": [] }, + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = {x: int}\n```"} - }, { - "label": "foo", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "doStuff", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = {x: int}\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + }, + { "detail": "t => int", "kind": 12, "label": "foo", "tags": [] }, + { "detail": "string => unit", "kind": 12, "label": "doStuff", "tags": [] }, + { "detail": "string => unit", - "documentation": null - }, { - "label": "doOtherStuff", "kind": 12, - "tags": [], - "detail": "string => unit", - "documentation": null - }] + "label": "doOtherStuff", + "tags": [] + } +] Complete src/FirstClassModules.res 38:7 posCursor:[38:7] posNoWhite:[38:6] Found expr:[38:5->38:7] @@ -152,40 +136,35 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[X, ""] Path X. -[{ - "label": "Inner", - "kind": 9, - "tags": [], - "detail": "module Inner", - "documentation": null - }, { - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "module Inner", "kind": 9, "label": "Inner", "tags": [] }, + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = {x: int}\n```"} - }, { - "label": "foo", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "doStuff", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = {x: int}\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + }, + { "detail": "t => int", "kind": 12, "label": "foo", "tags": [] }, + { "detail": "string => unit", "kind": 12, "label": "doStuff", "tags": [] }, + { "detail": "string => unit", - "documentation": null - }, { - "label": "doOtherStuff", "kind": 12, - "tags": [], - "detail": "string => unit", - "documentation": null - }] + "label": "doOtherStuff", + "tags": [] + } +] Hover src/FirstClassModules.res 44:7 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule type SomeModule = {\n module Inner\n type t = {x: int}\n let foo: t => int\n let doStuff: string => unit\n let doOtherStuff: string => unit\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule type SomeModule = {\n module Inner\n type t = {x: int}\n let foo: t => int\n let doStuff: string => unit\n let doOtherStuff: string => unit\n}\n```" + } +} Complete src/FirstClassModules.res 52:17 posCursor:[52:17] posNoWhite:[52:16] Found expr:[50:15->55:3] @@ -198,37 +177,27 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[SomeModule, ""] Path SomeModule. -[{ - "label": "Inner", - "kind": 9, - "tags": [], - "detail": "module Inner", - "documentation": null - }, { - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "module Inner", "kind": 9, "label": "Inner", "tags": [] }, + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = {x: int}\n```"} - }, { - "label": "foo", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "doStuff", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = {x: int}\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + }, + { "detail": "t => int", "kind": 12, "label": "foo", "tags": [] }, + { "detail": "string => unit", "kind": 12, "label": "doStuff", "tags": [] }, + { "detail": "string => unit", - "documentation": null - }, { - "label": "doOtherStuff", "kind": 12, - "tags": [], - "detail": "string => unit", - "documentation": null - }] + "label": "doOtherStuff", + "tags": [] + } +] Complete src/FirstClassModules.res 65:17 posCursor:[65:17] posNoWhite:[65:16] Found expr:[58:16->69:1] @@ -243,35 +212,25 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[SomeModule, ""] Path SomeModule. -[{ - "label": "Inner", - "kind": 9, - "tags": [], - "detail": "module Inner", - "documentation": null - }, { - "label": "t", - "kind": 22, - "tags": [], +[ + { "detail": "module Inner", "kind": 9, "label": "Inner", "tags": [] }, + { "detail": "type t", - "documentation": {"kind": "markdown", "value": "```rescript\ntype t = {x: int}\n```"} - }, { - "label": "foo", - "kind": 12, - "tags": [], - "detail": "t => int", - "documentation": null - }, { - "label": "doStuff", - "kind": 12, - "tags": [], + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype t = {x: int}\n```" + }, + "kind": 22, + "label": "t", + "tags": [] + }, + { "detail": "t => int", "kind": 12, "label": "foo", "tags": [] }, + { "detail": "string => unit", "kind": 12, "label": "doStuff", "tags": [] }, + { "detail": "string => unit", - "documentation": null - }, { - "label": "doOtherStuff", "kind": 12, - "tags": [], - "detail": "string => unit", - "documentation": null - }] + "label": "doOtherStuff", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/Fragment.res.txt b/tests/analysis_tests/tests/src/expected/Fragment.res.txt index c2601ef1216..09ba7d34d15 100644 --- a/tests/analysis_tests/tests/src/expected/Fragment.res.txt +++ b/tests/analysis_tests/tests/src/expected/Fragment.res.txt @@ -1,6 +1,16 @@ Hover src/Fragment.res 6:19 -{"contents": {"kind": "markdown", "value": "```rescript\nReact.component>\n```\n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C13%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype SectionHeader.props<'children> = {children: 'children}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Fragment.res%22%2C1%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.element = Jsx.element\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C0%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nReact.component>\n```\n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C13%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype SectionHeader.props<'children> = {children: 'children}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Fragment.res%22%2C1%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.element = Jsx.element\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C0%2C0%5D)\n" + } +} Hover src/Fragment.res 9:56 -{"contents": {"kind": "markdown", "value": "```rescript\nReact.component\n```\n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C13%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.fragmentProps = {children?: element}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C42%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nReact.component\n```\n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C13%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.fragmentProps = {children?: element}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C42%2C0%5D)\n" + } +} diff --git a/tests/analysis_tests/tests/src/expected/Hover.res.txt b/tests/analysis_tests/tests/src/expected/Hover.res.txt index f9f1746e150..34120153e1c 100644 --- a/tests/analysis_tests/tests/src/expected/Hover.res.txt +++ b/tests/analysis_tests/tests/src/expected/Hover.res.txt @@ -1,52 +1,108 @@ Hover src/Hover.res 0:4 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } Hover src/Hover.res 3:5 -{"contents": {"kind": "markdown", "value": "```rescript\ntype t = (int, float)\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype t = (int, float)\n```" + } +} Hover src/Hover.res 6:7 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule Id: {\n type x = int\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule Id: {\n type x = int\n}\n```" + } +} Hover src/Hover.res 19:11 -{"contents": {"kind": "markdown", "value": "\nThis module is commented\n---\n\n```\n \n```\n```rescript\nmodule Dep: {\n let customDouble: int => int\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "\nThis module is commented\n---\n\n```\n \n```\n```rescript\nmodule Dep: {\n let customDouble: int => int\n}\n```" + } +} Hover src/Hover.res 22:11 -{"contents": {"kind": "markdown", "value": "```rescript\nint => int\n```\n---\nSome doc comment"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint => int\n```\n---\nSome doc comment" + } +} Hover src/Hover.res 26:6 getLocItem #8: heuristic for JSX with at most one child heuristic for: [makeProps, make, createElement], give the loc of `make` -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } Hover src/Hover.res 33:4 -{"contents": {"kind": "markdown", "value": "```rescript\nunit => int\n```\n---\nDoc comment for functionWithTypeAnnotation"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nunit => int\n```\n---\nDoc comment for functionWithTypeAnnotation" + } +} Hover src/Hover.res 37:13 -{"contents": {"kind": "markdown", "value": "```rescript\nstring\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nstring\n```" } } Hover src/Hover.res 42:15 -{"contents": {"kind": "markdown", "value": "```rescript\nstring\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nstring\n```" } } Hover src/Hover.res 46:10 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } Hover src/Hover.res 49:13 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule type Logger = {\n let log: string => unit\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule type Logger = {\n let log: string => unit\n}\n```" + } +} Hover src/Hover.res 54:7 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule type Logger = {\n let log: string => unit\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule type Logger = {\n let log: string => unit\n}\n```" + } +} Definition src/Hover.res 60:14 -{"uri": "Hover.res", "range": {"start": {"line": 49, "character": 12}, "end": {"line": 49, "character": 18}}} +{ + "range": { + "end": { "character": 18, "line": 49 }, + "start": { "character": 12, "line": 49 } + }, + "uri": "file:///Hover.res" +} Hover src/Hover.res 63:9 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule IdDefinedTwice: {\n let y: int\n let _x: int\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule IdDefinedTwice: {\n let y: int\n let _x: int\n}\n```" + } +} Hover src/Hover.res 74:7 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule A: {\n let x: int\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule A: {\n let x: int\n}\n```" + } +} Hover src/Hover.res 77:7 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule A: {\n let x: int\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule A: {\n let x: int\n}\n```" + } +} Hover src/Hover.res 91:10 Nothing at that position. Now trying to use completion. @@ -61,16 +117,26 @@ JSX 95:8] > _children:96:4 null Hover src/Hover.res 103:25 -{"contents": {"kind": "markdown", "value": "```rescript\nfloat\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nfloat\n```" } } Hover src/Hover.res 106:21 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } Hover src/Hover.res 116:16 -{"contents": {"kind": "markdown", "value": "```rescript\nAA.cond<([< #str(string)] as 'a)> => AA.cond<'a>\n```\n\n---\n\n```\n \n```\n```rescript\ntype AA.cond<'a> = 'a\n constraint 'a = [< #str(string)]\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C110%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nAA.cond<([< #str(string)] as 'a)> => AA.cond<'a>\n```\n\n---\n\n```\n \n```\n```rescript\ntype AA.cond<'a> = 'a\n constraint 'a = [< #str(string)]\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C110%2C2%5D)\n" + } +} Hover src/Hover.res 119:25 -{"contents": {"kind": "markdown", "value": "```rescript\nAA.cond<([< #str(string)] as 'a)> => AA.cond<'a>\n```\n\n---\n\n```\n \n```\n```rescript\ntype AA.cond<'a> = 'a\n constraint 'a = [< #str(string)]\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C110%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nAA.cond<([< #str(string)] as 'a)> => AA.cond<'a>\n```\n\n---\n\n```\n \n```\n```rescript\ntype AA.cond<'a> = 'a\n constraint 'a = [< #str(string)]\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C110%2C2%5D)\n" + } +} Hover src/Hover.res 122:3 Nothing at that position. Now trying to use completion. @@ -78,31 +144,76 @@ Attribute id:live:[122:0->122:5] label:live Completable: Cdecorator(live) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "The `@live` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.\n\n`@live` tells the dead code analysis that the value should be considered live, even though it might appear to be dead. This is typically used in case of FFI where there are indirect ways to access values. It can be added to everything that could otherwise be considered unused by the dead code analysis - values, functions, arguments, records, individual record fields, and so on.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#live-decorator).\n\nHint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!"}} +{ + "contents": { + "kind": "markdown", + "value": "The `@live` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.\n\n`@live` tells the dead code analysis that the value should be considered live, even though it might appear to be dead. This is typically used in case of FFI where there are indirect ways to access values. It can be added to everything that could otherwise be considered unused by the dead code analysis - values, functions, arguments, records, individual record fields, and so on.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#live-decorator).\n\nHint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!" + } +} Hover src/Hover.res 125:4 -{"contents": {"kind": "markdown", "value": "```rescript\nunit => unit => int\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nunit => unit => int\n```" + } +} Hover src/Hover.res 131:4 -{"contents": {"kind": "markdown", "value": "```rescript\n(unit, unit) => int\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n(unit, unit) => int\n```" + } +} Hover src/Hover.res 134:4 -{"contents": {"kind": "markdown", "value": "```rescript\n(unit, unit) => int\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n(unit, unit) => int\n```" + } +} Hover src/Hover.res 137:5 -{"contents": {"kind": "markdown", "value": "```rescript\nunit => unit => int\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nunit => unit => int\n```" + } +} Hover src/Hover.res 144:9 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\ndoc comment 1"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\ndoc comment 1" + } +} Hover src/Hover.res 148:6 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\n doc comment 2 "}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\n doc comment 2 " + } +} Hover src/Hover.res 165:23 -{"contents": {"kind": "markdown", "value": "```rescript\nfoo\n```\n\n---\n\n```\n \n```\n```rescript\ntype foo<'a> = {content: 'a, zzz: string}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C161%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype bar = {age: int}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C162%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nfoo\n```\n\n---\n\n```\n \n```\n```rescript\ntype foo<'a> = {content: 'a, zzz: string}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C161%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype bar = {age: int}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C162%2C2%5D)\n" + } +} Hover src/Hover.res 167:22 -{"contents": {"kind": "markdown", "value": "```rescript\nfoobar\n```\n\n---\n\n```\n \n```\n```rescript\ntype foobar = foo\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C163%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nfoobar\n```\n\n---\n\n```\n \n```\n```rescript\ntype foobar = foo\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C163%2C2%5D)\n" + } +} Complete src/Hover.res 170:16 posCursor:[170:16] posNoWhite:[170:15] Found expr:[170:5->170:16] @@ -133,13 +244,18 @@ Path content CPPipe pathFromEnv: found:true Path Hover. Path -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/Hover.res 173:16 posCursor:[173:16] posNoWhite:[173:15] Found expr:[173:5->173:16] @@ -170,13 +286,18 @@ Path content CPPipe pathFromEnv: found:true Path Hover. Path -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/Hover.res 182:16 posCursor:[182:16] posNoWhite:[182:15] Found expr:[182:5->182:16] @@ -207,13 +328,18 @@ Path content CPPipe pathFromEnv: found:true Path Hover. Path -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Complete src/Hover.res 185:16 posCursor:[185:16] posNoWhite:[185:15] Found expr:[185:5->185:16] @@ -244,19 +370,34 @@ Path content CPPipe pathFromEnv: found:true Path Hover. Path -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nage: int\n```\n\n```rescript\ntype bar = {age: int}\n```" + }, + "kind": 5, + "label": "age", + "tags": [] + } +] Hover src/Hover.res 197:4 -{"contents": {"kind": "markdown", "value": "```rescript\nCompV4.props => React.element\n```\n\n---\n\n```\n \n```\n```rescript\ntype CompV4.props<'n, 's> = {n?: 'n, s: 's}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C190%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.element = Jsx.element\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C0%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nCompV4.props => React.element\n```\n\n---\n\n```\n \n```\n```rescript\ntype CompV4.props<'n, 's> = {n?: 'n, s: 's}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C190%2C2%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype React.element = Jsx.element\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C0%2C0%5D)\n" + } +} Hover src/Hover.res 202:16 -{"contents": {"kind": "markdown", "value": "```rescript\nuseR\n```\n\n---\n\n```\n \n```\n```rescript\ntype useR = {x: int, y: list>>}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C200%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype r<'a> = {i: 'a, f: float}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C101%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nuseR\n```\n\n---\n\n```\n \n```\n```rescript\ntype useR = {x: int, y: list>>}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C200%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype r<'a> = {i: 'a, f: float}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C101%2C0%5D)\n" + } +} Hover src/Hover.res 210:13 Nothing at that position. Now trying to use completion. @@ -269,13 +410,28 @@ ContextPath Value[usr] Path usr Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "```rescript\nuseR\n```\n\n---\n\n```\n \n```\n```rescript\ntype useR = {x: int, y: list>>}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C200%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype r<'a> = {i: 'a, f: float}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C101%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nuseR\n```\n\n---\n\n```\n \n```\n```rescript\ntype useR = {x: int, y: list>>}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C200%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype r<'a> = {i: 'a, f: float}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C101%2C0%5D)\n" + } +} Hover src/Hover.res 230:20 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\n More Stuff "}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\n More Stuff " + } +} Hover src/Hover.res 233:17 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```\n---\n More Stuff "}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nint\n```\n---\n More Stuff " + } +} Hover src/Hover.res 245:6 Nothing at that position. Now trying to use completion. @@ -295,22 +451,52 @@ Path Hover.someField Path someField Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "```rescript\nbool\n```\n---\n Mighty fine field here. "}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nbool\n```\n---\n Mighty fine field here. " + } +} Hover src/Hover.res 248:19 -{"contents": {"kind": "markdown", "value": "```rescript\nbool\n```\n---\n Mighty fine field here. "}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nbool\n```\n---\n Mighty fine field here. " + } +} Hover src/Hover.res 253:20 -{"contents": {"kind": "markdown", "value": "```rescript\nvariant\nCoolVariant\n```\n---\n Cool variant! \n\n---\n\n```\n \n```\n```rescript\ntype variant = CoolVariant | OtherCoolVariant\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C251%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nvariant\nCoolVariant\n```\n---\n Cool variant! \n\n---\n\n```\n \n```\n```rescript\ntype variant = CoolVariant | OtherCoolVariant\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C251%2C0%5D)\n" + } +} Hover src/Hover.res 258:22 -{"contents": {"kind": "markdown", "value": "```rescript\npayloadVariants\nInlineRecord({field1: int, field2: bool})\n```\n\n---\n\n```\n \n```\n```rescript\ntype payloadVariants =\n | InlineRecord({field1: int, field2: bool})\n | Args(int, bool)\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C256%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\npayloadVariants\nInlineRecord({field1: int, field2: bool})\n```\n\n---\n\n```\n \n```\n```rescript\ntype payloadVariants =\n | InlineRecord({field1: int, field2: bool})\n | Args(int, bool)\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C256%2C0%5D)\n" + } +} Hover src/Hover.res 261:23 -{"contents": {"kind": "markdown", "value": "```rescript\npayloadVariants\nArgs(int, bool)\n```\n\n---\n\n```\n \n```\n```rescript\ntype payloadVariants =\n | InlineRecord({field1: int, field2: bool})\n | Args(int, bool)\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C256%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\npayloadVariants\nArgs(int, bool)\n```\n\n---\n\n```\n \n```\n```rescript\ntype payloadVariants =\n | InlineRecord({field1: int, field2: bool})\n | Args(int, bool)\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C256%2C0%5D)\n" + } +} Hover src/Hover.res 268:42 -{"contents": {"kind": "markdown", "value": "```rescript\nRecursiveVariants.t\nAction1(int)\n```\n\n---\n\n```\n \n```\n```rescript\ntype RecursiveVariants.t =\n | Action1(int)\n | Action2(float)\n | Batch(array)\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C265%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nRecursiveVariants.t\nAction1(int)\n```\n\n---\n\n```\n \n```\n```rescript\ntype RecursiveVariants.t =\n | Action1(int)\n | Action2(float)\n | Batch(array)\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C265%2C2%5D)\n" + } +} Hover src/Hover.res 272:23 Nothing at that position. Now trying to use completion. @@ -324,7 +510,7 @@ Path fff Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath string -{"contents": {"kind": "markdown", "value": "```rescript\nstring\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nstring\n```" } } Hover src/Hover.res 275:33 Nothing at that position. Now trying to use completion. @@ -340,11 +526,21 @@ Resolved opens 1 Stdlib ContextPath CPatternPath(Value[x])->recordField(someField) ContextPath Value[x] Path x -{"contents": {"kind": "markdown", "value": "```rescript\nbool\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nbool\n```" } } Hover src/Hover.res 278:8 -{"contents": {"kind": "markdown", "value": "\n [`Belt.Array`]()\n\n **mutable array**: Utilities functions\n\n---\n\n```\n \n```\n```rescript\nmodule Array: {\n module Id\n module Array\n module SortArray\n module MutableQueue\n module MutableStack\n module List\n module Range\n module Set\n module Map\n module MutableSet\n module MutableMap\n module HashSet\n module HashMap\n module Option\n module Result\n module Int\n module Float\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "\n [`Belt.Array`]()\n\n **mutable array**: Utilities functions\n\n---\n\n```\n \n```\n```rescript\nmodule Array: {\n module Id\n module Array\n module SortArray\n module MutableQueue\n module MutableStack\n module List\n module Range\n module Set\n module Map\n module MutableSet\n module MutableMap\n module HashSet\n module HashMap\n module Option\n module Result\n module Int\n module Float\n}\n```" + } +} Hover src/Hover.res 281:6 -{"contents": {"kind": "markdown", "value": "```rescript\ntype aliased = variant\n```\n\n---\n\n```\n \n```\n```rescript\ntype variant = CoolVariant | OtherCoolVariant\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C251%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype aliased = variant\n```\n\n---\n\n```\n \n```\n```rescript\ntype variant = CoolVariant | OtherCoolVariant\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C251%2C0%5D)\n" + } +} diff --git a/tests/analysis_tests/tests/src/expected/IncludeModuleCompletion.res.txt b/tests/analysis_tests/tests/src/expected/IncludeModuleCompletion.res.txt index 57535091fe8..231cb223563 100644 --- a/tests/analysis_tests/tests/src/expected/IncludeModuleCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/IncludeModuleCompletion.res.txt @@ -15,55 +15,76 @@ Path k CPPipe pathFromEnv:Types found:true Path Types. Path -[{ - "label": "->blah", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 11, "line": 47 }, + "start": { "character": 10, "line": 47 } + } + } + ], "detail": "Types.context => string", - "documentation": null, - "sortText": "blah", "insertText": "->blah", - "additionalTextEdits": [{ - "range": {"start": {"line": 47, "character": 10}, "end": {"line": 47, "character": 11}}, - "newText": "" - }] - }, { - "label": "->add", "kind": 12, - "tags": [], + "label": "->blah", + "sortText": "blah", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 11, "line": 47 }, + "start": { "character": 10, "line": 47 } + } + } + ], "detail": "(Types.context, array) => 't", - "documentation": null, - "sortText": "add", "insertText": "->add", - "additionalTextEdits": [{ - "range": {"start": {"line": 47, "character": 10}, "end": {"line": 47, "character": 11}}, - "newText": "" - }] - }, { - "label": "->addPosFromVec2", "kind": 12, - "tags": [], + "label": "->add", + "sortText": "add", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 11, "line": 47 }, + "start": { "character": 10, "line": 47 } + } + } + ], "detail": "(Types.context, Types.vec2) => Types.comp", - "documentation": null, - "sortText": "addPosFromVec2", "insertText": "->addPosFromVec2", - "additionalTextEdits": [{ - "range": {"start": {"line": 47, "character": 10}, "end": {"line": 47, "character": 11}}, - "newText": "" - }] - }, { - "label": "->addPos", "kind": 12, - "tags": [], + "label": "->addPosFromVec2", + "sortText": "addPosFromVec2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 11, "line": 47 }, + "start": { "character": 10, "line": 47 } + } + } + ], "detail": "(Types.context, float, float) => Types.comp", - "documentation": null, - "sortText": "addPos", "insertText": "->addPos", - "additionalTextEdits": [{ - "range": {"start": {"line": 47, "character": 10}, "end": {"line": 47, "character": 11}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->addPos", + "sortText": "addPos", + "tags": [] + } +] Complete src/IncludeModuleCompletion.res 49:12 posCursor:[49:12] posNoWhite:[49:11] Found expr:[45:13->52:3] @@ -75,25 +96,26 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[add] Path add -[{ - "label": "add", - "kind": 12, - "tags": [], +[ + { "detail": "(Types.context, array) => 't", - "documentation": null - }, { - "label": "addPosFromVec2", "kind": 12, - "tags": [], + "label": "add", + "tags": [] + }, + { "detail": "(Types.context, Types.vec2) => Types.comp", - "documentation": null - }, { - "label": "addPos", "kind": 12, - "tags": [], + "label": "addPosFromVec2", + "tags": [] + }, + { "detail": "(Types.context, float, float) => Types.comp", - "documentation": null - }] + "kind": 12, + "label": "addPos", + "tags": [] + } +] Complete src/IncludeModuleCompletion.res 58:13 posCursor:[58:13] posNoWhite:[58:12] Found expr:[54:17->61:3] @@ -104,19 +126,20 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[add]($1) ContextPath Value[add] Path add -[{ - "label": "addPosFromVec2", - "kind": 12, - "tags": [], +[ + { "detail": "(Types.context, Types.vec2) => Types.comp", - "documentation": null - }, { - "label": "addPos", "kind": 12, - "tags": [], + "label": "addPosFromVec2", + "tags": [] + }, + { "detail": "(Types.context, float, float) => Types.comp", - "documentation": null - }] + "kind": 12, + "label": "addPos", + "tags": [] + } +] Complete src/IncludeModuleCompletion.res 70:13 posCursor:[70:13] posNoWhite:[70:12] Found expr:[68:15->73:5] @@ -135,67 +158,93 @@ Path k CPPipe pathFromEnv:Types found:true Path Types. Path -[{ - "label": "->blah", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 70 }, + "start": { "character": 12, "line": 70 } + } + } + ], "detail": "Types.context => string", - "documentation": null, - "sortText": "blah", "insertText": "->blah", - "additionalTextEdits": [{ - "range": {"start": {"line": 70, "character": 12}, "end": {"line": 70, "character": 13}}, - "newText": "" - }] - }, { - "label": "->add", "kind": 12, - "tags": [], + "label": "->blah", + "sortText": "blah", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 70 }, + "start": { "character": 12, "line": 70 } + } + } + ], "detail": "(Types.context, array) => 't", - "documentation": null, - "sortText": "add", "insertText": "->add", - "additionalTextEdits": [{ - "range": {"start": {"line": 70, "character": 12}, "end": {"line": 70, "character": 13}}, - "newText": "" - }] - }, { - "label": "->addSprite", "kind": 12, - "tags": [], + "label": "->add", + "sortText": "add", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 70 }, + "start": { "character": 12, "line": 70 } + } + } + ], "detail": "(Types.context, string) => Types.comp", - "documentation": null, - "sortText": "addSprite", "insertText": "->addSprite", - "additionalTextEdits": [{ - "range": {"start": {"line": 70, "character": 12}, "end": {"line": 70, "character": 13}}, - "newText": "" - }] - }, { - "label": "->addPosFromVec2", "kind": 12, - "tags": [], + "label": "->addSprite", + "sortText": "addSprite", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 70 }, + "start": { "character": 12, "line": 70 } + } + } + ], "detail": "(Types.context, Types.vec2) => Types.comp", - "documentation": null, - "sortText": "addPosFromVec2", "insertText": "->addPosFromVec2", - "additionalTextEdits": [{ - "range": {"start": {"line": 70, "character": 12}, "end": {"line": 70, "character": 13}}, - "newText": "" - }] - }, { - "label": "->addPos", "kind": 12, - "tags": [], + "label": "->addPosFromVec2", + "sortText": "addPosFromVec2", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 13, "line": 70 }, + "start": { "character": 12, "line": 70 } + } + } + ], "detail": "(Types.context, float, float) => Types.comp", - "documentation": null, - "sortText": "addPos", "insertText": "->addPos", - "additionalTextEdits": [{ - "range": {"start": {"line": 70, "character": 12}, "end": {"line": 70, "character": 13}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->addPos", + "sortText": "addPos", + "tags": [] + } +] Complete src/IncludeModuleCompletion.res 85:16 posCursor:[85:16] posNoWhite:[85:15] Found expr:[85:13->85:16] @@ -211,19 +260,25 @@ ContextPath Value[a] Path a Path Stdlib.Int.l Path l -[{ - "label": "->lex", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 15, "line": 85 }, + "start": { "character": 14, "line": 85 } + } + } + ], "detail": "int => string", - "documentation": null, - "sortText": "lex", "insertText": "->lex", - "additionalTextEdits": [{ - "range": {"start": {"line": 85, "character": 14}, "end": {"line": 85, "character": 15}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->lex", + "sortText": "lex", + "tags": [] + } +] Complete src/IncludeModuleCompletion.res 88:14 posCursor:[88:14] posNoWhite:[88:13] Found expr:[88:13->88:14] @@ -233,11 +288,5 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[l] Path l -[{ - "label": "lex", - "kind": 12, - "tags": [], - "detail": "int => string", - "documentation": null - }] +[ { "detail": "int => string", "kind": 12, "label": "lex", "tags": [] } ] diff --git a/tests/analysis_tests/tests/src/expected/InlayHint.res.txt b/tests/analysis_tests/tests/src/expected/InlayHint.res.txt index aad649db3b9..62c21eb99a5 100644 --- a/tests/analysis_tests/tests/src/expected/InlayHint.res.txt +++ b/tests/analysis_tests/tests/src/expected/InlayHint.res.txt @@ -1,81 +1,95 @@ Inlay Hint src/InlayHint.res 1:34 -[{ - "position": {"line": 33, "character": 14}, - "label": ": int", +[ + { "kind": 1, + "label": ": int", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 33, "character": 9}, - "label": ": string", + "paddingRight": false, + "position": { "character": 14, "line": 33 } + }, + { "kind": 1, + "label": ": string", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 28, "character": 9}, - "label": ": foo", + "paddingRight": false, + "position": { "character": 9, "line": 33 } + }, + { "kind": 1, + "label": ": foo", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 26, "character": 23}, - "label": ": (string, string)", + "paddingRight": false, + "position": { "character": 9, "line": 28 } + }, + { "kind": 1, + "label": ": (string, string)", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 18, "character": 9}, - "label": ": string", + "paddingRight": false, + "position": { "character": 23, "line": 26 } + }, + { "kind": 1, + "label": ": string", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 16, "character": 9}, - "label": ": (string, string)", + "paddingRight": false, + "position": { "character": 9, "line": 18 } + }, + { "kind": 1, + "label": ": (string, string)", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 10, "character": 10}, - "label": ": (~xx: int) => int", + "paddingRight": false, + "position": { "character": 9, "line": 16 } + }, + { "kind": 1, + "label": ": (~xx: int) => int", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 8, "character": 10}, - "label": ": int", + "paddingRight": false, + "position": { "character": 10, "line": 10 } + }, + { "kind": 1, + "label": ": int", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 6, "character": 7}, - "label": ": (int, int) => int", + "paddingRight": false, + "position": { "character": 10, "line": 8 } + }, + { "kind": 1, + "label": ": (int, int) => int", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 4, "character": 8}, - "label": ": char", + "paddingRight": false, + "position": { "character": 7, "line": 6 } + }, + { "kind": 1, + "label": ": char", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 3, "character": 9}, - "label": ": float", + "paddingRight": false, + "position": { "character": 8, "line": 4 } + }, + { "kind": 1, + "label": ": float", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 2, "character": 10}, - "label": ": int", + "paddingRight": false, + "position": { "character": 9, "line": 3 } + }, + { "kind": 1, + "label": ": int", "paddingLeft": true, - "paddingRight": false -}, { - "position": {"line": 1, "character": 10}, - "label": ": string", + "paddingRight": false, + "position": { "character": 10, "line": 2 } + }, + { "kind": 1, + "label": ": string", "paddingLeft": true, - "paddingRight": false -}] + "paddingRight": false, + "position": { "character": 10, "line": 1 } + } +] diff --git a/tests/analysis_tests/tests/src/expected/Jsx2.res.txt b/tests/analysis_tests/tests/src/expected/Jsx2.res.txt index 66920cb6331..de0ac1c3bb8 100644 --- a/tests/analysis_tests/tests/src/expected/Jsx2.res.txt +++ b/tests/analysis_tests/tests/src/expected/Jsx2.res.txt @@ -1,5 +1,11 @@ Definition src/Jsx2.res 5:9 -{"uri": "Jsx2.res", "range": {"start": {"line": 2, "character": 6}, "end": {"line": 2, "character": 10}}} +{ + "range": { + "end": { "character": 10, "line": 2 }, + "start": { "character": 6, "line": 2 } + }, + "uri": "file:///Jsx2.res" +} Complete src/Jsx2.res 8:15 posCursor:[8:15] posNoWhite:[8:14] Found expr:[8:3->8:15] @@ -18,19 +24,10 @@ Completable: Cjsx([M], f, [second, f]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "first", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }, { - "label": "fun", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[ + { "detail": "string", "kind": 4, "label": "first", "tags": [] }, + { "detail": "option", "kind": 4, "label": "fun", "tags": [] } +] Complete src/Jsx2.res 14:13 posCursor:[14:13] posNoWhite:[14:12] Found expr:[14:11->14:13] @@ -40,35 +37,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[M] Path M -[{ - "label": "M", - "kind": 9, - "tags": [], - "detail": "module M", - "documentation": null - }, { - "label": "Math", - "kind": 9, - "tags": [], - "detail": "module Math", - "documentation": null - }, { - "label": "Map", +[ + { "detail": "module M", "kind": 9, "label": "M", "tags": [] }, + { "detail": "module Math", "kind": 9, "label": "Math", "tags": [] }, + { "detail": "module Map", "kind": 9, "label": "Map", "tags": [] }, + { + "data": { "modulePath": "ModuleStuff", "filePath": "src/Jsx2.res" }, + "detail": "module ModuleStuff", "kind": 9, - "tags": [], - "detail": "module Map", - "documentation": null - }, { "label": "ModuleStuff", - "kind": 9, - "tags": [], - "detail": "module ModuleStuff", - "documentation": null, - "data": { - "modulePath": "ModuleStuff", - "filePath": "src/Jsx2.res" - } - }] + "tags": [] + } +] Complete src/Jsx2.res 22:19 posCursor:[22:19] posNoWhite:[22:18] Found expr:[22:3->22:19] @@ -77,13 +57,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 25:17 posCursor:[25:17] posNoWhite:[25:16] Found expr:[25:3->25:17] @@ -92,13 +66,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 28:21 posCursor:[28:21] posNoWhite:[28:20] Found expr:[28:3->28:21] @@ -107,13 +75,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 31:24 posCursor:[31:24] posNoWhite:[31:23] Found expr:[31:3->31:24] @@ -122,13 +84,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 34:18 posCursor:[34:18] posNoWhite:[34:17] Found expr:[34:3->34:18] @@ -137,13 +93,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 37:16 posCursor:[37:16] posNoWhite:[37:15] Found expr:[37:3->37:16] @@ -152,13 +102,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 40:17 posCursor:[40:17] posNoWhite:[40:16] Found expr:[40:3->40:17] @@ -167,13 +111,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 43:18 posCursor:[43:18] posNoWhite:[43:17] Found expr:[43:3->43:18] @@ -182,13 +120,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 46:16 posCursor:[46:16] posNoWhite:[46:15] Found expr:[46:3->46:16] @@ -197,13 +129,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 49:27 posCursor:[49:27] posNoWhite:[49:26] Found expr:[49:3->49:27] @@ -212,13 +138,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 52:38 posCursor:[52:38] posNoWhite:[52:37] Found expr:[52:3->52:38] @@ -227,13 +147,7 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 55:25 posCursor:[55:25] posNoWhite:[55:24] Found expr:[55:3->55:25] @@ -242,16 +156,16 @@ Completable: Cjsx([M], k, [prop, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Definition src/Jsx2.res 58:11 -{"uri": "Component.res", "range": {"start": {"line": 1, "character": 4}, "end": {"line": 1, "character": 8}}} +{ + "range": { + "end": { "character": 8, "line": 1 }, + "start": { "character": 4, "line": 1 } + }, + "uri": "file:///Component.resi" +} Complete src/Jsx2.res 68:10 posCursor:[68:10] posNoWhite:[68:9] Found expr:[68:3->68:10] @@ -260,13 +174,7 @@ Completable: Cjsx([Ext], al, [al]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path Ext.make -[{ - "label": "align", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[ { "detail": "option", "kind": 4, "label": "align", "tags": [] } ] Complete src/Jsx2.res 71:11 posCursor:[71:11] posNoWhite:[71:10] Found expr:[71:3->71:11] @@ -284,13 +192,7 @@ Completable: Cjsx([M], k, [first, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 77:23 posCursor:[77:23] posNoWhite:[77:22] Found expr:[77:3->77:23] @@ -299,13 +201,7 @@ Completable: Cjsx([M], k, [first, k]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M.make -[{ - "label": "key", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "key", "tags": [] } ] Complete src/Jsx2.res 80:6 posCursor:[80:6] posNoWhite:[80:5] Found expr:[80:3->85:69] @@ -324,13 +220,14 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[WithChildren] Path WithChildren -[{ - "label": "WithChildren", - "kind": 9, - "tags": [], +[ + { "detail": "module WithChildren", - "documentation": null - }] + "kind": 9, + "label": "WithChildren", + "tags": [] + } +] Complete src/Jsx2.res 91:18 posCursor:[91:18] posNoWhite:[91:17] Found expr:[91:3->91:18] @@ -339,13 +236,7 @@ Completable: Cjsx([WithChildren], n, [n]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path WithChildren.make -[{ - "label": "name", - "kind": 4, - "tags": [], - "detail": "string", - "documentation": null - }] +[ { "detail": "string", "kind": 4, "label": "name", "tags": [] } ] Complete src/Jsx2.res 94:18 posCursor:[94:18] posNoWhite:[94:17] Found pattern:[94:7->94:18] @@ -356,13 +247,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[React, e] Path React.e -[{ - "label": "element", - "kind": 22, - "tags": [], +[ + { "detail": "type element", - "documentation": {"kind": "markdown", "value": "```rescript\ntype element = Jsx.element\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype element = Jsx.element\n```" + }, + "kind": 22, + "label": "element", + "tags": [] + } +] Complete src/Jsx2.res 96:20 posCursor:[96:20] posNoWhite:[96:19] Found pattern:[96:7->99:6] @@ -396,13 +292,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[DefineSomeFields, ""] Path DefineSomeFields. -[{ - "label": "thisValue", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 12, "label": "thisValue", "tags": [] } ] Complete src/Jsx2.res 108:36 posCursor:[108:36] posNoWhite:[108:35] Found expr:[108:11->108:36] @@ -414,19 +304,28 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[DefineSomeFields].th Path DefineSomeFields.th -[{ - "label": "thisField", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nthisField: int\n```\n\n```rescript\ntype r = {thisField: int, thatField: string}\n```"} - }, { - "label": "thatField", + "documentation": { + "kind": "markdown", + "value": "```rescript\nthisField: int\n```\n\n```rescript\ntype r = {thisField: int, thatField: string}\n```" + }, "kind": 5, - "tags": [], + "label": "thisField", + "tags": [] + }, + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nthatField: string\n```\n\n```rescript\ntype r = {thisField: int, thatField: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nthatField: string\n```\n\n```rescript\ntype r = {thisField: int, thatField: string}\n```" + }, + "kind": 5, + "label": "thatField", + "tags": [] + } +] Complete src/Jsx2.res 122:20 posCursor:[122:20] posNoWhite:[122:19] Found expr:[121:2->125:4] @@ -438,13 +337,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Outer, Inner, h] Path Outer.Inner.h -[{ - "label": "hello", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 12, "label": "hello", "tags": [] } ] Complete src/Jsx2.res 129:19 posCursor:[129:19] posNoWhite:[129:18] Found expr:[128:2->131:9] @@ -456,13 +349,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[Outer, Inner, ""] Path Outer.Inner. -[{ - "label": "hello", - "kind": 12, - "tags": [], - "detail": "int", - "documentation": null - }] +[ { "detail": "int", "kind": 12, "label": "hello", "tags": [] } ] Complete src/Jsx2.res 136:7 posCursor:[136:7] posNoWhite:[136:6] Found expr:[135:2->138:9] @@ -473,16 +360,17 @@ Resolved opens 1 Stdlib ContextPath CJsxPropValue [div] x Path ReactDOM.domProps Path JsxDOM.domProps -[{ - "label": "\"\"", - "kind": 12, - "tags": [], +[ + { "detail": "string", - "documentation": null, - "sortText": "A", "insertText": "{\"$0\"}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "\"\"", + "sortText": "A", + "tags": [] + } +] Complete src/Jsx2.res 150:21 posCursor:[150:21] posNoWhite:[150:20] Found expr:[150:11->150:32] @@ -492,13 +380,7 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[Nested, Co] Path Nested.Co -[{ - "label": "Comp", - "kind": 9, - "tags": [], - "detail": "module Comp", - "documentation": null - }] +[ { "detail": "module Comp", "kind": 9, "label": "Comp", "tags": [] } ] Complete src/Jsx2.res 153:19 posCursor:[153:19] posNoWhite:[153:18] Found expr:[153:11->153:25] @@ -508,17 +390,21 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[Nested, ""] Path Nested. -[{ - "label": "Comp", - "kind": 9, - "tags": [], - "detail": "module Comp", - "documentation": null - }] +[ { "detail": "module Comp", "kind": 9, "label": "Comp", "tags": [] } ] Hover src/Jsx2.res 162:12 -{"contents": {"kind": "markdown", "value": "```rescript\nComp.props\n```\n\n---\n\n```\n \n```\n```rescript\ntype Comp.props<'age> = {age: 'age}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx2.res%22%2C157%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nComp.props\n```\n\n---\n\n```\n \n```\n```rescript\ntype Comp.props<'age> = {age: 'age}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx2.res%22%2C157%2C2%5D)\n" + } +} Hover src/Jsx2.res 167:16 -{"contents": {"kind": "markdown", "value": "```rescript\nComp.props\n```\n\n---\n\n```\n \n```\n```rescript\ntype Comp.props<'age> = {age: 'age}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx2.res%22%2C157%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nComp.props\n```\n\n---\n\n```\n \n```\n```rescript\ntype Comp.props<'age> = {age: 'age}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx2.res%22%2C157%2C2%5D)\n" + } +} diff --git a/tests/analysis_tests/tests/src/expected/Jsx2.resi.txt b/tests/analysis_tests/tests/src/expected/Jsx2.resi.txt index c34ab6fca53..027b2ab45ad 100644 --- a/tests/analysis_tests/tests/src/expected/Jsx2.resi.txt +++ b/tests/analysis_tests/tests/src/expected/Jsx2.resi.txt @@ -1,8 +1,13 @@ Hover src/Jsx2.resi 1:4 -{"contents": {"kind": "markdown", "value": "```rescript\nprops\n```\n\n---\n\n```\n \n```\n```rescript\ntype props<'first> = {first: 'first}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx2.resi%22%2C0%2C0%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nprops\n```\n\n---\n\n```\n \n```\n```rescript\ntype props<'first> = {first: 'first}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Jsx2.resi%22%2C0%2C0%5D)\n" + } +} Hover src/Jsx2.resi 4:4 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } Complete src/Jsx2.resi 7:19 posCursor:[7:19] posNoWhite:[7:18] Found type:[7:12->7:19] @@ -12,13 +17,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[React, e] Path React.e -[{ - "label": "element", - "kind": 22, - "tags": [], +[ + { "detail": "type element", - "documentation": {"kind": "markdown", "value": "```rescript\ntype element = Jsx.element\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype element = Jsx.element\n```" + }, + "kind": 22, + "label": "element", + "tags": [] + } +] Complete src/Jsx2.resi 10:18 posCursor:[10:18] posNoWhite:[10:17] Found type:[10:11->10:18] @@ -28,11 +38,16 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[React, e] Path React.e -[{ - "label": "element", - "kind": 22, - "tags": [], +[ + { "detail": "type element", - "documentation": {"kind": "markdown", "value": "```rescript\ntype element = Jsx.element\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype element = Jsx.element\n```" + }, + "kind": 22, + "label": "element", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/JsxV4.res.txt b/tests/analysis_tests/tests/src/expected/JsxV4.res.txt index 5c8085c298a..fc75beafb13 100644 --- a/tests/analysis_tests/tests/src/expected/JsxV4.res.txt +++ b/tests/analysis_tests/tests/src/expected/JsxV4.res.txt @@ -1,5 +1,11 @@ Definition src/JsxV4.res 8:9 -{"uri": "JsxV4.res", "range": {"start": {"line": 5, "character": 6}, "end": {"line": 5, "character": 10}}} +{ + "range": { + "end": { "character": 10, "line": 5 }, + "start": { "character": 6, "line": 5 } + }, + "uri": "file:///JsxV4.res" +} Complete src/JsxV4.res 11:20 posCursor:[11:20] posNoWhite:[11:19] Found expr:[11:3->11:20] @@ -8,16 +14,15 @@ Completable: Cjsx([M4], f, [first, f]) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib Path M4.make -[{ - "label": "fun", - "kind": 4, - "tags": [], - "detail": "option", - "documentation": null - }] +[ { "detail": "option", "kind": 4, "label": "fun", "tags": [] } ] Hover src/JsxV4.res 14:9 -{"contents": {"kind": "markdown", "value": "```rescript\nReact.component>\n```\n---\n Doc Comment For M4 \n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C13%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype M4.props<'first, 'fun, 'second> = {\n first: 'first,\n fun?: 'fun,\n second?: 'second,\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxV4.res%22%2C3%2C2%5D)\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nReact.component>\n```\n---\n Doc Comment For M4 \n\n---\n\n```\n \n```\n```rescript\ntype React.component<'props> = Jsx.component<'props>\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22React.res%22%2C13%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype M4.props<'first, 'fun, 'second> = {\n first: 'first,\n fun?: 'fun,\n second?: 'second,\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22JsxV4.res%22%2C3%2C2%5D)\n" + } +} Create Interface src/JsxV4.res module M4: { diff --git a/tests/analysis_tests/tests/src/expected/LongIdentTest.res.txt b/tests/analysis_tests/tests/src/expected/LongIdentTest.res.txt index 1c12fccf8e1..71897e76d4b 100644 --- a/tests/analysis_tests/tests/src/expected/LongIdentTest.res.txt +++ b/tests/analysis_tests/tests/src/expected/LongIdentTest.res.txt @@ -1,3 +1,3 @@ Hover src/LongIdentTest.res 2:13 -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } diff --git a/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt b/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt index c417c159323..0b948732960 100644 --- a/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt +++ b/tests/analysis_tests/tests/src/expected/NestedRecords.res.txt @@ -9,7 +9,12 @@ ContextPath Value[options] Path options Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "```rescript\noptions\n```\n\n---\n\n```\n \n```\n```rescript\ntype options = {\n extra: {name: string, superExtra: {age: int}},\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22NestedRecords.res%22%2C1%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype options.extra = {name: string, superExtra: {age: int}}\n```\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\noptions\n```\n\n---\n\n```\n \n```\n```rescript\ntype options = {\n extra: {name: string, superExtra: {age: int}},\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22NestedRecords.res%22%2C1%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype options.extra = {name: string, superExtra: {age: int}}\n```\n" + } +} Hover src/NestedRecords.res 20:13 Nothing at that position. Now trying to use completion. @@ -29,7 +34,12 @@ Path NestedRecords.extra Path extra Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "```rescript\ntype options.extra = {name: string, superExtra: {age: int}}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype options.extra = {name: string, superExtra: {age: int}}\n```" + } +} Hover src/NestedRecords.res 23:26 Nothing at that position. Now trying to use completion. @@ -63,7 +73,12 @@ Path NestedRecords.superExtra Path superExtra Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "```rescript\ntype options.extra.superExtra = {age: int}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype options.extra.superExtra = {age: int}\n```" + } +} Hover src/NestedRecords.res 26:29 Nothing at that position. Now trying to use completion. @@ -125,5 +140,5 @@ Path NestedRecords.age Path age Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib -{"contents": {"kind": "markdown", "value": "```rescript\nint\n```"}} +{ "contents": { "kind": "markdown", "value": "```rescript\nint\n```" } } diff --git a/tests/analysis_tests/tests/src/expected/NestedRecordsHover.res.txt b/tests/analysis_tests/tests/src/expected/NestedRecordsHover.res.txt index d0a0dc63b89..04b0c039ae7 100644 --- a/tests/analysis_tests/tests/src/expected/NestedRecordsHover.res.txt +++ b/tests/analysis_tests/tests/src/expected/NestedRecordsHover.res.txt @@ -1,15 +1,40 @@ Hover src/NestedRecordsHover.res 8:7 -{"contents": {"kind": "markdown", "value": "```rescript\noptions\n```\n\n---\n\n```\n \n```\n```rescript\ntype options = {\n extra?: {\n name: string,\n superExtra?: {age: int},\n otherExtra: option<\n {\n test: bool,\n anotherInlined: {record: bool},\n },\n >,\n },\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22NestedRecordsHover.res%22%2C0%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype options.extra = {\n name: string,\n superExtra?: {age: int},\n otherExtra: option<\n {\n test: bool,\n anotherInlined: {record: bool},\n },\n >,\n}\n```\n"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\noptions\n```\n\n---\n\n```\n \n```\n```rescript\ntype options = {\n extra?: {\n name: string,\n superExtra?: {age: int},\n otherExtra: option<\n {\n test: bool,\n anotherInlined: {record: bool},\n },\n >,\n },\n}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22NestedRecordsHover.res%22%2C0%2C0%5D)\n\n\n---\n\n```\n \n```\n```rescript\ntype options.extra = {\n name: string,\n superExtra?: {age: int},\n otherExtra: option<\n {\n test: bool,\n anotherInlined: {record: bool},\n },\n >,\n}\n```\n" + } +} Hover src/NestedRecordsHover.res 11:6 -{"contents": {"kind": "markdown", "value": "```rescript\ntype options.extra = {\n name: string,\n superExtra?: {age: int},\n otherExtra: option<\n {\n test: bool,\n anotherInlined: {record: bool},\n },\n >,\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype options.extra = {\n name: string,\n superExtra?: {age: int},\n otherExtra: option<\n {\n test: bool,\n anotherInlined: {record: bool},\n },\n >,\n}\n```" + } +} Hover src/NestedRecordsHover.res 14:8 -{"contents": {"kind": "markdown", "value": "```rescript\ntype options.extra.superExtra = {age: int}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype options.extra.superExtra = {age: int}\n```" + } +} Hover src/NestedRecordsHover.res 18:9 -{"contents": {"kind": "markdown", "value": "```rescript\ntype options.extra.otherExtra = {\n test: bool,\n anotherInlined: {record: bool},\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype options.extra.otherExtra = {\n test: bool,\n anotherInlined: {record: bool},\n}\n```" + } +} Hover src/NestedRecordsHover.res 21:11 -{"contents": {"kind": "markdown", "value": "```rescript\ntype options.extra.otherExtra.anotherInlined = {\n record: bool,\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\ntype options.extra.otherExtra.anotherInlined = {\n record: bool,\n}\n```" + } +} diff --git a/tests/analysis_tests/tests/src/expected/Patterns.res.txt b/tests/analysis_tests/tests/src/expected/Patterns.res.txt index 43cb4b1fc26..6a3d6c3ef75 100644 --- a/tests/analysis_tests/tests/src/expected/Patterns.res.txt +++ b/tests/analysis_tests/tests/src/expected/Patterns.res.txt @@ -1,12 +1,36 @@ Definition src/Patterns.res 19:10 -{"uri": "Patterns.res", "range": {"start": {"line": 3, "character": 7}, "end": {"line": 3, "character": 10}}} +{ + "range": { + "end": { "character": 10, "line": 3 }, + "start": { "character": 7, "line": 3 } + }, + "uri": "file:///Patterns.res" +} Definition src/Patterns.res 24:11 -{"uri": "Patterns.res", "range": {"start": {"line": 9, "character": 7}, "end": {"line": 9, "character": 11}}} +{ + "range": { + "end": { "character": 11, "line": 9 }, + "start": { "character": 7, "line": 9 } + }, + "uri": "file:///Patterns.res" +} Definition src/Patterns.res 27:11 -{"uri": "Patterns.res", "range": {"start": {"line": 11, "character": 7}, "end": {"line": 11, "character": 8}}} +{ + "range": { + "end": { "character": 8, "line": 11 }, + "start": { "character": 7, "line": 11 } + }, + "uri": "file:///Patterns.res" +} Definition src/Patterns.res 30:11 -{"uri": "Patterns.res", "range": {"start": {"line": 15, "character": 9}, "end": {"line": 15, "character": 11}}} +{ + "range": { + "end": { "character": 11, "line": 15 }, + "start": { "character": 9, "line": 15 } + }, + "uri": "file:///Patterns.res" +} diff --git a/tests/analysis_tests/tests/src/expected/PolyRec.res.txt b/tests/analysis_tests/tests/src/expected/PolyRec.res.txt index 64c790174bd..db379b2ce48 100644 --- a/tests/analysis_tests/tests/src/expected/PolyRec.res.txt +++ b/tests/analysis_tests/tests/src/expected/PolyRec.res.txt @@ -1,3 +1,8 @@ Hover src/PolyRec.res 12:10 -{"contents": {"kind": "markdown", "value": "```rescript\n([#Leaf | #Node(int, 'a, 'a)] as 'a)\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\n([#Leaf | #Node(int, 'a, 'a)] as 'a)\n```" + } +} diff --git a/tests/analysis_tests/tests/src/expected/PrepareRename.res.txt b/tests/analysis_tests/tests/src/expected/PrepareRename.res.txt index bb418cc27a9..bba85be51cc 100644 --- a/tests/analysis_tests/tests/src/expected/PrepareRename.res.txt +++ b/tests/analysis_tests/tests/src/expected/PrepareRename.res.txt @@ -1,12 +1,18 @@ PrepareRename src/PrepareRename.res 0:4 { - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "placeholder": "x" - } + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "placeholder": "x" +} PrepareRename src/PrepareRename.res 3:19 { - "range": {"start": {"line": 3, "character": 19}, "end": {"line": 3, "character": 21}}, - "placeholder": "xx" - } + "range": { + "end": { "character": 21, "line": 3 }, + "start": { "character": 19, "line": 3 } + }, + "placeholder": "xx" +} diff --git a/tests/analysis_tests/tests/src/expected/RecModules.res.txt b/tests/analysis_tests/tests/src/expected/RecModules.res.txt index 62e3e825ce5..393cb490023 100644 --- a/tests/analysis_tests/tests/src/expected/RecModules.res.txt +++ b/tests/analysis_tests/tests/src/expected/RecModules.res.txt @@ -1,6 +1,16 @@ Hover src/RecModules.res 18:12 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule C: {\n type t\n let createA: t => A.t\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule C: {\n type t\n let createA: t => A.t\n}\n```" + } +} Hover src/RecModules.res 20:12 -{"contents": {"kind": "markdown", "value": "```rescript\nmodule A: {\n type t\n let child: t => B.t\n}\n```"}} +{ + "contents": { + "kind": "markdown", + "value": "```rescript\nmodule A: {\n type t\n let child: t => B.t\n}\n```" + } +} diff --git a/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt b/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt index b4587be81af..1e255e44057 100644 --- a/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/RecordCompletion.res.txt @@ -16,19 +16,28 @@ Path n Path Stdlib.Array.m Path ArrayUtils.m Path m -[{ - "label": "Array.map", - "kind": 12, - "tags": [], +[ + { "detail": "(array<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }, { - "label": "Array.mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "Array.map", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n" + }, + "kind": 12, + "label": "Array.mapWithIndex", + "tags": [] + } +] Complete src/RecordCompletion.res 11:13 posCursor:[11:13] posNoWhite:[11:12] Found expr:[11:3->11:13] @@ -62,19 +71,28 @@ Path n Path Stdlib.Array.m Path ArrayUtils.m Path m -[{ - "label": "Array.map", - "kind": 12, - "tags": [], +[ + { "detail": "(array<'a>, 'a => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }, { - "label": "Array.mapWithIndex", + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, "kind": 12, - "tags": [], + "label": "Array.map", + "tags": [] + }, + { "detail": "(array<'a>, ('a, int) => 'b) => array<'b>", - "documentation": {"kind": "markdown", "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n"} - }] + "documentation": { + "kind": "markdown", + "value": "\n`mapWithIndex(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray =\n array->Array.mapWithIndex((greeting, index) => greeting ++ \" at position \" ++ Int.toString(index))\n\nmappedArray == [\"Hello at position 0\", \"Hi at position 1\", \"Good bye at position 2\"]\n```\n" + }, + "kind": 12, + "label": "Array.mapWithIndex", + "tags": [] + } +] Complete src/RecordCompletion.res 19:7 posCursor:[19:7] posNoWhite:[19:6] Found expr:[19:3->19:7] @@ -84,13 +102,18 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[R]."" Path R. -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + } +] Complete src/RecordCompletion.res 22:7 posCursor:[22:7] posNoWhite:[22:6] Found expr:[22:3->22:10] @@ -100,11 +123,16 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Module[R]."" Path R. -[{ - "label": "name", - "kind": 5, - "tags": [], +[ + { "detail": "string", - "documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```" + }, + "kind": 5, + "label": "name", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/RecoveryOnProp.res.txt b/tests/analysis_tests/tests/src/expected/RecoveryOnProp.res.txt index 704c9ccc964..66c291a3e41 100644 --- a/tests/analysis_tests/tests/src/expected/RecoveryOnProp.res.txt +++ b/tests/analysis_tests/tests/src/expected/RecoveryOnProp.res.txt @@ -15,61 +15,57 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Type[Res] Path Res -[{ - "label": "Result", - "kind": 9, - "tags": [], - "detail": "module Result", - "documentation": null - }, { - "label": "RescriptReactErrorBoundary", - "kind": 9, - "tags": [], - "detail": "module RescriptReactErrorBoundary", - "documentation": null, +[ + { "detail": "module Result", "kind": 9, "label": "Result", "tags": [] }, + { "data": { "modulePath": "RescriptReactErrorBoundary", "filePath": "src/RecoveryOnProp.res" - } - }, { - "label": "RescriptReactRouter", + }, + "detail": "module RescriptReactErrorBoundary", "kind": 9, - "tags": [], - "detail": "module RescriptReactRouter", - "documentation": null, + "label": "RescriptReactErrorBoundary", + "tags": [] + }, + { "data": { "modulePath": "RescriptReactRouter", "filePath": "src/RecoveryOnProp.res" - } - }, { - "label": "RescriptTools", + }, + "detail": "module RescriptReactRouter", "kind": 9, - "tags": [], - "detail": "module RescriptTools", - "documentation": null, + "label": "RescriptReactRouter", + "tags": [] + }, + { "data": { "modulePath": "RescriptTools", "filePath": "src/RecoveryOnProp.res" - } - }, { - "label": "RescriptTools_Docgen", + }, + "detail": "module RescriptTools", "kind": 9, - "tags": [], - "detail": "module RescriptTools_Docgen", - "documentation": null, + "label": "RescriptTools", + "tags": [] + }, + { "data": { "modulePath": "RescriptTools_Docgen", "filePath": "src/RecoveryOnProp.res" - } - }, { - "label": "RescriptTools_ExtractCodeBlocks", + }, + "detail": "module RescriptTools_Docgen", "kind": 9, - "tags": [], - "detail": "module RescriptTools_ExtractCodeBlocks", - "documentation": null, + "label": "RescriptTools_Docgen", + "tags": [] + }, + { "data": { "modulePath": "RescriptTools_ExtractCodeBlocks", "filePath": "src/RecoveryOnProp.res" - } - }] + }, + "detail": "module RescriptTools_ExtractCodeBlocks", + "kind": 9, + "label": "RescriptTools_ExtractCodeBlocks", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/References.res.txt b/tests/analysis_tests/tests/src/expected/References.res.txt index 842250d4521..f106eb290c2 100644 --- a/tests/analysis_tests/tests/src/expected/References.res.txt +++ b/tests/analysis_tests/tests/src/expected/References.res.txt @@ -1,31 +1,121 @@ References src/References.res 0:4 [ -{"uri": "Cross.res", "range": {"start": {"line": 0, "character": 26}, "end": {"line": 0, "character": 27}}}, -{"uri": "Cross.res", "range": {"start": {"line": 3, "character": 27}, "end": {"line": 3, "character": 28}}}, -{"uri": "Cross.res", "range": {"start": {"line": 7, "character": 27}, "end": {"line": 7, "character": 28}}}, -{"uri": "References.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}}, -{"uri": "References.res", "range": {"start": {"line": 3, "character": 8}, "end": {"line": 3, "character": 9}}}, -{"uri": "References.res", "range": {"start": {"line": 7, "character": 8}, "end": {"line": 7, "character": 9}}} + { + "range": { + "end": { "character": 27, "line": 0 }, + "start": { "character": 26, "line": 0 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 28, "line": 3 }, + "start": { "character": 27, "line": 3 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 28, "line": 7 }, + "start": { "character": 27, "line": 7 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///References.res" + }, + { + "range": { + "end": { "character": 9, "line": 3 }, + "start": { "character": 8, "line": 3 } + }, + "uri": "file:///References.res" + }, + { + "range": { + "end": { "character": 9, "line": 7 }, + "start": { "character": 8, "line": 7 } + }, + "uri": "file:///References.res" + } ] References src/References.res 9:19 [ -{"uri": "References.res", "range": {"start": {"line": 9, "character": 11}, "end": {"line": 9, "character": 14}}}, -{"uri": "References.res", "range": {"start": {"line": 9, "character": 19}, "end": {"line": 9, "character": 21}}} + { + "range": { + "end": { "character": 14, "line": 9 }, + "start": { "character": 11, "line": 9 } + }, + "uri": "file:///References.res" + }, + { + "range": { + "end": { "character": 21, "line": 9 }, + "start": { "character": 19, "line": 9 } + }, + "uri": "file:///References.res" + } ] References src/References.res 20:12 [ -{"uri": "References.res", "range": {"start": {"line": 13, "character": 2}, "end": {"line": 13, "character": 13}}}, -{"uri": "References.res", "range": {"start": {"line": 18, "character": 11}, "end": {"line": 18, "character": 13}}}, -{"uri": "References.res", "range": {"start": {"line": 20, "character": 11}, "end": {"line": 20, "character": 13}}} + { + "range": { + "end": { "character": 13, "line": 13 }, + "start": { "character": 2, "line": 13 } + }, + "uri": "file:///References.res" + }, + { + "range": { + "end": { "character": 13, "line": 18 }, + "start": { "character": 11, "line": 18 } + }, + "uri": "file:///References.res" + }, + { + "range": { + "end": { "character": 13, "line": 20 }, + "start": { "character": 11, "line": 20 } + }, + "uri": "file:///References.res" + } ] References src/References.res 23:15 [ -{"uri": "ReferencesInner.res", "range": {"start": {"line": 1, "character": 28}, "end": {"line": 1, "character": 32}}}, -{"uri": "References.res", "range": {"start": {"line": 23, "character": 19}, "end": {"line": 23, "character": 23}}}, -{"uri": "ComponentInner.res", "range": {"start": {"line": 1, "character": 4}, "end": {"line": 1, "character": 8}}}, -{"uri": "ComponentInner.resi", "range": {"start": {"line": 1, "character": 4}, "end": {"line": 1, "character": 8}}} + { + "range": { + "end": { "character": 32, "line": 1 }, + "start": { "character": 28, "line": 1 } + }, + "uri": "file:///ReferencesInner.res" + }, + { + "range": { + "end": { "character": 23, "line": 23 }, + "start": { "character": 19, "line": 23 } + }, + "uri": "file:///References.res" + }, + { + "range": { + "end": { "character": 8, "line": 1 }, + "start": { "character": 4, "line": 1 } + }, + "uri": "file:///ComponentInner.resi" + }, + { + "range": { + "end": { "character": 8, "line": 1 }, + "start": { "character": 4, "line": 1 } + }, + "uri": "file:///ComponentInner.resi" + } ] diff --git a/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.res.txt b/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.res.txt index 33f2d105d6b..f782c36af0f 100644 --- a/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.res.txt +++ b/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.res.txt @@ -1,9 +1,39 @@ References src/ReferencesWithInterface.res 0:4 [ -{"uri": "Cross.res", "range": {"start": {"line": 9, "character": 52}, "end": {"line": 9, "character": 53}}}, -{"uri": "Cross.res", "range": {"start": {"line": 12, "character": 53}, "end": {"line": 12, "character": 54}}}, -{"uri": "Cross.res", "range": {"start": {"line": 16, "character": 53}, "end": {"line": 16, "character": 54}}}, -{"uri": "ReferencesWithInterface.resi", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}}, -{"uri": "ReferencesWithInterface.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}} + { + "range": { + "end": { "character": 53, "line": 9 }, + "start": { "character": 52, "line": 9 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 54, "line": 12 }, + "start": { "character": 53, "line": 12 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 54, "line": 16 }, + "start": { "character": 53, "line": 16 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///ReferencesWithInterface.resi" + }, + { + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///ReferencesWithInterface.res" + } ] diff --git a/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.resi.txt b/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.resi.txt index 3e96fbc75c2..29dbae2b2bd 100644 --- a/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.resi.txt +++ b/tests/analysis_tests/tests/src/expected/ReferencesWithInterface.resi.txt @@ -1,9 +1,39 @@ References src/ReferencesWithInterface.resi 0:4 [ -{"uri": "Cross.res", "range": {"start": {"line": 9, "character": 52}, "end": {"line": 9, "character": 53}}}, -{"uri": "Cross.res", "range": {"start": {"line": 12, "character": 53}, "end": {"line": 12, "character": 54}}}, -{"uri": "Cross.res", "range": {"start": {"line": 16, "character": 53}, "end": {"line": 16, "character": 54}}}, -{"uri": "ReferencesWithInterface.res", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}}, -{"uri": "ReferencesWithInterface.resi", "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}} + { + "range": { + "end": { "character": 53, "line": 9 }, + "start": { "character": 52, "line": 9 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 54, "line": 12 }, + "start": { "character": 53, "line": 12 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 54, "line": 16 }, + "start": { "character": 53, "line": 16 } + }, + "uri": "file:///Cross.res" + }, + { + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///ReferencesWithInterface.resi" + }, + { + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + }, + "uri": "file:///ReferencesWithInterface.resi" + } ] diff --git a/tests/analysis_tests/tests/src/expected/Rename.res.txt b/tests/analysis_tests/tests/src/expected/Rename.res.txt index 92c381452c9..b6b193f8d18 100644 --- a/tests/analysis_tests/tests/src/expected/Rename.res.txt +++ b/tests/analysis_tests/tests/src/expected/Rename.res.txt @@ -1,37 +1,53 @@ Rename src/Rename.res 0:4 y [ -{ - "textDocument": { - "version": null, - "uri": "Rename.res" - }, - "edits": [{ - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "newText": "y" - }, { - "range": {"start": {"line": 3, "character": 8}, "end": {"line": 3, "character": 9}}, - "newText": "y" - }, { - "range": {"start": {"line": 7, "character": 8}, "end": {"line": 7, "character": 9}}, - "newText": "y" - }] + { + "edits": [ + { + "newText": "y", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + }, + { + "newText": "y", + "range": { + "end": { "character": 9, "line": 3 }, + "start": { "character": 8, "line": 3 } + } + }, + { + "newText": "y", + "range": { + "end": { "character": 9, "line": 7 }, + "start": { "character": 8, "line": 7 } + } + } + ], + "textDocument": { "uri": "file:///Rename.res", "version": 0 } } ] Rename src/Rename.res 9:19 yy [ -{ - "textDocument": { - "version": null, - "uri": "Rename.res" - }, - "edits": [{ - "range": {"start": {"line": 9, "character": 11}, "end": {"line": 9, "character": 14}}, - "newText": "yy" - }, { - "range": {"start": {"line": 9, "character": 19}, "end": {"line": 9, "character": 21}}, - "newText": "yy" - }] + { + "edits": [ + { + "newText": "yy", + "range": { + "end": { "character": 14, "line": 9 }, + "start": { "character": 11, "line": 9 } + } + }, + { + "newText": "yy", + "range": { + "end": { "character": 21, "line": 9 }, + "start": { "character": 19, "line": 9 } + } + } + ], + "textDocument": { "uri": "file:///Rename.res", "version": 0 } } ] diff --git a/tests/analysis_tests/tests/src/expected/RenameWithInterface.res.txt b/tests/analysis_tests/tests/src/expected/RenameWithInterface.res.txt index 48ecdabc568..d824b0501dd 100644 --- a/tests/analysis_tests/tests/src/expected/RenameWithInterface.res.txt +++ b/tests/analysis_tests/tests/src/expected/RenameWithInterface.res.txt @@ -1,37 +1,53 @@ Rename src/RenameWithInterface.res 0:4 y [ -{ - "textDocument": { - "version": null, - "uri": "RenameWithInterface.resi" + { + "edits": [ + { + "newText": "y", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + } + ], + "textDocument": { + "uri": "file:///RenameWithInterface.resi", + "version": 0 + } }, - "edits": [{ - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "newText": "y" - }] + { + "edits": [ + { + "newText": "y", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + } + ], + "textDocument": { + "uri": "file:///RenameWithInterface.res", + "version": 0 + } }, -{ - "textDocument": { - "version": null, - "uri": "RenameWithInterface.res" - }, - "edits": [{ - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "newText": "y" - }] - }, -{ - "textDocument": { - "version": null, - "uri": "Cross.res" - }, - "edits": [{ - "range": {"start": {"line": 18, "character": 28}, "end": {"line": 18, "character": 29}}, - "newText": "y" - }, { - "range": {"start": {"line": 21, "character": 28}, "end": {"line": 21, "character": 29}}, - "newText": "y" - }] + { + "edits": [ + { + "newText": "y", + "range": { + "end": { "character": 29, "line": 18 }, + "start": { "character": 28, "line": 18 } + } + }, + { + "newText": "y", + "range": { + "end": { "character": 29, "line": 21 }, + "start": { "character": 28, "line": 21 } + } + } + ], + "textDocument": { "uri": "file:///Cross.res", "version": 0 } } ] diff --git a/tests/analysis_tests/tests/src/expected/RenameWithInterface.resi.txt b/tests/analysis_tests/tests/src/expected/RenameWithInterface.resi.txt index 3c5d529093e..dc259e411ae 100644 --- a/tests/analysis_tests/tests/src/expected/RenameWithInterface.resi.txt +++ b/tests/analysis_tests/tests/src/expected/RenameWithInterface.resi.txt @@ -1,37 +1,45 @@ Rename src/RenameWithInterface.resi 0:4 y [ -{ - "textDocument": { - "version": null, - "uri": "RenameWithInterface.resi" + { + "edits": [ + { + "newText": "y", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + }, + { + "newText": "y", + "range": { + "end": { "character": 5, "line": 0 }, + "start": { "character": 4, "line": 0 } + } + } + ], + "textDocument": { + "uri": "file:///RenameWithInterface.resi", + "version": 0 + } }, - "edits": [{ - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "newText": "y" - }] - }, -{ - "textDocument": { - "version": null, - "uri": "RenameWithInterface.res" - }, - "edits": [{ - "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}}, - "newText": "y" - }] - }, -{ - "textDocument": { - "version": null, - "uri": "Cross.res" - }, - "edits": [{ - "range": {"start": {"line": 18, "character": 28}, "end": {"line": 18, "character": 29}}, - "newText": "y" - }, { - "range": {"start": {"line": 21, "character": 28}, "end": {"line": 21, "character": 29}}, - "newText": "y" - }] + { + "edits": [ + { + "newText": "y", + "range": { + "end": { "character": 29, "line": 18 }, + "start": { "character": 28, "line": 18 } + } + }, + { + "newText": "y", + "range": { + "end": { "character": 29, "line": 21 }, + "start": { "character": 28, "line": 21 } + } + } + ], + "textDocument": { "uri": "file:///Cross.res", "version": 0 } } ] diff --git a/tests/analysis_tests/tests/src/expected/Reprod.res.txt b/tests/analysis_tests/tests/src/expected/Reprod.res.txt index 08783543a54..a3fc27f052d 100644 --- a/tests/analysis_tests/tests/src/expected/Reprod.res.txt +++ b/tests/analysis_tests/tests/src/expected/Reprod.res.txt @@ -7,16 +7,21 @@ Resolved opens 1 Stdlib ContextPath CArgument Value[Query, use](~variables) ContextPath Value[Query, use] Path Query.use -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "input_ByAddress", - "documentation": {"kind": "markdown", "value": "```rescript\ntype input_ByAddress = {city: string}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype input_ByAddress = {city: string}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/Reprod.res 33:28 posCursor:[33:28] posNoWhite:[33:27] Found pattern:[33:21->33:31] @@ -25,31 +30,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[record] Path record -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Two(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two(_)", + "tags": [] + }, + { "detail": "Three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] Complete src/Reprod.res 36:29 posCursor:[36:29] posNoWhite:[36:28] Found pattern:[36:21->36:32] @@ -58,16 +76,21 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[record] Path record -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "SchemaAssets.input_ByAddress", - "documentation": {"kind": "markdown", "value": "```rescript\ntype SchemaAssets.input_ByAddress = {city: string}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype SchemaAssets.input_ByAddress = {city: string}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] Complete src/Reprod.res 43:21 posCursor:[43:21] posNoWhite:[43:20] Found pattern:[43:18->43:22] @@ -79,31 +102,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Two(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two(_)", + "tags": [] + }, + { "detail": "Three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] Complete src/Reprod.res 46:24 posCursor:[46:24] posNoWhite:[46:23] Found pattern:[46:18->46:25] @@ -115,31 +151,44 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[res] Path res -[{ - "label": "#one", - "kind": 4, - "tags": [], +[ + { "detail": "#one", - "documentation": {"kind": "markdown", "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#one\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#one", - "insertTextFormat": 2 - }, { - "label": "#three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#one", + "tags": [] + }, + { "detail": "#three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#three(someRecord, bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }, { - "label": "#two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "#three(_, _)", + "tags": [] + }, + { "detail": "#two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\n#two(bool)\n```\n\n```rescript\n[#one | #three(someRecord, bool) | #two(bool)]\n```" + }, "insertText": "#two(${1:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "#two(_)", + "tags": [] + } +] Complete src/Reprod.res 51:24 posCursor:[51:24] posNoWhite:[51:23] Found pattern:[51:21->51:25] @@ -151,45 +200,66 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[resOpt] Path resOpt -[{ - "label": "None", - "kind": 12, - "tags": [], +[ + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"} - }, { - "label": "Some(_)", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "kind": 12, - "tags": [], + "label": "None", + "tags": [] + }, + { "detail": "someVariant", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Some(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Some(One)", - "kind": 4, - "tags": [], + "insertTextFormat": 2, + "kind": 12, + "label": "Some(_)", + "tags": [] + }, + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Some(One)", - "insertTextFormat": 2 - }, { - "label": "Some(Two(_))", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Some(One)", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Some(Two(${1:_}))", - "insertTextFormat": 2 - }, { - "label": "Some(Three(_, _))", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Some(Two(_))", + "tags": [] + }, + { "detail": "Three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Some(Three(${1:_}, ${2:_}))", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Some(Three(_, _))", + "tags": [] + } +] Complete src/Reprod.res 54:29 posCursor:[54:29] posNoWhite:[54:28] Found pattern:[54:21->54:31] @@ -203,29 +273,42 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[resOpt] Path resOpt -[{ - "label": "One", - "kind": 4, - "tags": [], +[ + { "detail": "One", - "documentation": {"kind": "markdown", "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nOne\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "One", - "insertTextFormat": 2 - }, { - "label": "Two(_)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "One", + "tags": [] + }, + { "detail": "Two(bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nTwo(bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Two(${1:_})", - "insertTextFormat": 2 - }, { - "label": "Three(_, _)", + "insertTextFormat": 2, "kind": 4, - "tags": [], + "label": "Two(_)", + "tags": [] + }, + { "detail": "Three(someRecord, bool)", - "documentation": {"kind": "markdown", "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```"}, + "documentation": { + "kind": "markdown", + "value": "```rescript\nThree(someRecord, bool)\n```\n\n```rescript\ntype someVariant = One | Two(bool) | Three(someRecord, bool)\n```" + }, "insertText": "Three(${1:_}, ${2:_})", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 4, + "label": "Three(_, _)", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt b/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt index 9ab09fb9993..2b0365f8465 100644 --- a/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/RxjsCompletion.res.txt @@ -22,67 +22,93 @@ CPPipe pathFromEnv:Observable found:true Path Rxjs.Observable. Path Rxjs. Path -[{ - "label": "->Observable.subscribe", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 29, "line": 26 }, + "start": { "character": 28, "line": 26 } + } + } + ], "detail": "(t<'t>, 't => unit) => subscription", - "documentation": null, - "sortText": "subscribe", "insertText": "->Observable.subscribe", - "additionalTextEdits": [{ - "range": {"start": {"line": 26, "character": 28}, "end": {"line": 26, "character": 29}}, - "newText": "" - }] - }, { - "label": "->pipe", "kind": 12, - "tags": [], + "label": "->Observable.subscribe", + "sortText": "subscribe", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 29, "line": 26 }, + "start": { "character": 28, "line": 26 } + } + } + ], "detail": "(Observable.t<'t>, operation<'t, 'u>) => Observable.t<'u>", - "documentation": null, - "sortText": "pipe", "insertText": "->pipe", - "additionalTextEdits": [{ - "range": {"start": {"line": 26, "character": 28}, "end": {"line": 26, "character": 29}}, - "newText": "" - }] - }, { - "label": "->combineLatest", "kind": 12, - "tags": [], + "label": "->pipe", + "sortText": "pipe", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 29, "line": 26 }, + "start": { "character": 28, "line": 26 } + } + } + ], "detail": "(\n Observable.t<'a>,\n Observable.t<'b>,\n) => Observable.t<('a, 'b)>", - "documentation": null, - "sortText": "combineLatest", "insertText": "->combineLatest", - "additionalTextEdits": [{ - "range": {"start": {"line": 26, "character": 28}, "end": {"line": 26, "character": 29}}, - "newText": "" - }] - }, { - "label": "->merge", "kind": 12, - "tags": [], + "label": "->combineLatest", + "sortText": "combineLatest", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 29, "line": 26 }, + "start": { "character": 28, "line": 26 } + } + } + ], "detail": "(Observable.t<'t>, Observable.t<'t>) => Observable.t<'t>", - "documentation": null, - "sortText": "merge", "insertText": "->merge", - "additionalTextEdits": [{ - "range": {"start": {"line": 26, "character": 28}, "end": {"line": 26, "character": 29}}, - "newText": "" - }] - }, { - "label": "->pipe2", "kind": 12, - "tags": [], + "label": "->merge", + "sortText": "merge", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 29, "line": 26 }, + "start": { "character": 28, "line": 26 } + } + } + ], "detail": "(\n Observable.t<'t>,\n operation<'t, 'u>,\n operation<'u, 'i>,\n) => Observable.t<'i>", - "documentation": null, - "sortText": "pipe2", "insertText": "->pipe2", - "additionalTextEdits": [{ - "range": {"start": {"line": 26, "character": 28}, "end": {"line": 26, "character": 29}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->pipe2", + "sortText": "pipe2", + "tags": [] + } +] Complete src/RxjsCompletion.res 34:30 posCursor:[34:30] posNoWhite:[34:29] Found expr:[10:17->38:1] @@ -105,65 +131,91 @@ CPPipe pathFromEnv:Observable found:true Path Rxjs.Observable. Path Rxjs. Path -[{ - "label": "->Rxjs.Observable.subscribe", - "kind": 12, - "tags": [], +[ + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 30, "line": 34 }, + "start": { "character": 29, "line": 34 } + } + } + ], "detail": "(t<'t>, 't => unit) => subscription", - "documentation": null, - "sortText": "subscribe", "insertText": "->Rxjs.Observable.subscribe", - "additionalTextEdits": [{ - "range": {"start": {"line": 34, "character": 29}, "end": {"line": 34, "character": 30}}, - "newText": "" - }] - }, { - "label": "->Rxjs.pipe", "kind": 12, - "tags": [], + "label": "->Rxjs.Observable.subscribe", + "sortText": "subscribe", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 30, "line": 34 }, + "start": { "character": 29, "line": 34 } + } + } + ], "detail": "(Observable.t<'t>, operation<'t, 'u>) => Observable.t<'u>", - "documentation": null, - "sortText": "pipe", "insertText": "->Rxjs.pipe", - "additionalTextEdits": [{ - "range": {"start": {"line": 34, "character": 29}, "end": {"line": 34, "character": 30}}, - "newText": "" - }] - }, { - "label": "->Rxjs.combineLatest", "kind": 12, - "tags": [], + "label": "->Rxjs.pipe", + "sortText": "pipe", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 30, "line": 34 }, + "start": { "character": 29, "line": 34 } + } + } + ], "detail": "(\n Observable.t<'a>,\n Observable.t<'b>,\n) => Observable.t<('a, 'b)>", - "documentation": null, - "sortText": "combineLatest", "insertText": "->Rxjs.combineLatest", - "additionalTextEdits": [{ - "range": {"start": {"line": 34, "character": 29}, "end": {"line": 34, "character": 30}}, - "newText": "" - }] - }, { - "label": "->Rxjs.merge", "kind": 12, - "tags": [], + "label": "->Rxjs.combineLatest", + "sortText": "combineLatest", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 30, "line": 34 }, + "start": { "character": 29, "line": 34 } + } + } + ], "detail": "(Observable.t<'t>, Observable.t<'t>) => Observable.t<'t>", - "documentation": null, - "sortText": "merge", "insertText": "->Rxjs.merge", - "additionalTextEdits": [{ - "range": {"start": {"line": 34, "character": 29}, "end": {"line": 34, "character": 30}}, - "newText": "" - }] - }, { - "label": "->Rxjs.pipe2", "kind": 12, - "tags": [], + "label": "->Rxjs.merge", + "sortText": "merge", + "tags": [] + }, + { + "additionalTextEdits": [ + { + "newText": "", + "range": { + "end": { "character": 30, "line": 34 }, + "start": { "character": 29, "line": 34 } + } + } + ], "detail": "(\n Observable.t<'t>,\n operation<'t, 'u>,\n operation<'u, 'i>,\n) => Observable.t<'i>", - "documentation": null, - "sortText": "pipe2", "insertText": "->Rxjs.pipe2", - "additionalTextEdits": [{ - "range": {"start": {"line": 34, "character": 29}, "end": {"line": 34, "character": 30}}, - "newText": "" - }] - }] + "kind": 12, + "label": "->Rxjs.pipe2", + "sortText": "pipe2", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/SignatureHelp.res.txt b/tests/analysis_tests/tests/src/expected/SignatureHelp.res.txt index cdb8f9a2047..b30ae0c7e3b 100644 --- a/tests/analysis_tests/tests/src/expected/SignatureHelp.res.txt +++ b/tests/analysis_tests/tests/src/expected/SignatureHelp.res.txt @@ -13,13 +13,40 @@ extracted params: [( int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { - "signatures": [{ - "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": ""}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Does stuff. "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Does stuff. " }, + "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 11, 25 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 29, 49 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)" + }, + "label": [ 53, 71 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 75, 79 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 19:21 @@ -37,13 +64,40 @@ extracted params: [( int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { - "signatures": [{ - "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": ""}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Does stuff. "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Does stuff. " }, + "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 11, 25 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 29, 49 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)" + }, + "label": [ 53, 71 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 75, 79 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 22:29 @@ -61,13 +115,40 @@ extracted params: [( int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { - "signatures": [{ - "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": ""}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Does stuff. "} - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "documentation": { "kind": "markdown", "value": " Does stuff. " }, + "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 11, 25 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 29, 49 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)" + }, + "label": [ 53, 71 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 75, 79 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 25:33 @@ -85,13 +166,40 @@ extracted params: [( int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { - "signatures": [{ - "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": ""}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Does stuff. "} - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "documentation": { "kind": "markdown", "value": " Does stuff. " }, + "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 11, 25 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 29, 49 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)" + }, + "label": [ 53, 71 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 75, 79 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 28:38 @@ -109,13 +217,40 @@ extracted params: [( int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { - "signatures": [{ - "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": ""}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Does stuff. "} - }], + "activeParameter": 3, "activeSignature": 0, - "activeParameter": 3 + "signatures": [ + { + "activeParameter": 3, + "documentation": { "kind": "markdown", "value": " Does stuff. " }, + "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 11, 25 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 29, 49 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)" + }, + "label": [ 53, 71 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 75, 79 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 31:42 @@ -133,13 +268,40 @@ extracted params: [( int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { - "signatures": [{ - "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": ""}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Does stuff. "} - }], + "activeParameter": 3, "activeSignature": 0, - "activeParameter": 3 + "signatures": [ + { + "activeParameter": 3, + "documentation": { "kind": "markdown", "value": " Does stuff. " }, + "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 11, 25 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 29, 49 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)" + }, + "label": [ 53, 71 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 75, 79 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 34:21 @@ -156,12 +318,28 @@ argAtCursor: unlabelled<0> extracted params: [(string, int, float] { - "signatures": [{ - "label": "(string, int, float) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": ""}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "label": "(string, int, float) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 9, 12 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 14, 19 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 37:24 @@ -178,12 +356,28 @@ argAtCursor: unlabelled<0> extracted params: [(string, int, float] { - "signatures": [{ - "label": "(string, int, float) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": ""}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "label": "(string, int, float) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 9, 12 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 14, 19 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 40:35 @@ -200,12 +394,28 @@ argAtCursor: unlabelled<2> extracted params: [(string, int, float] { - "signatures": [{ - "label": "(string, int, float) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": ""}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 2, "activeSignature": 0, - "activeParameter": 2 + "signatures": [ + { + "activeParameter": 2, + "label": "(string, int, float) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 9, 12 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 14, 19 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 43:33 @@ -222,12 +432,24 @@ argAtCursor: ~age extracted params: [(~age: int, ~name: string] { - "signatures": [{ - "label": "(~age: int, ~name: string) => string", - "parameters": [{"label": [0, 10], "documentation": {"kind": "markdown", "value": ""}}, {"label": [12, 25], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "label": "(~age: int, ~name: string) => string", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 10 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 12, 25 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 50:24 @@ -244,12 +466,20 @@ argAtCursor: unlabelled<0> extracted params: [string] { - "signatures": [{ - "label": "string => unit", - "parameters": [{"label": [0, 6], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "label": "string => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 6 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 53:31 @@ -267,12 +497,28 @@ argAtCursor: unlabelled<1> extracted params: [(string, int, float] { - "signatures": [{ - "label": "(string, int, float) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [9, 12], "documentation": {"kind": "markdown", "value": ""}}, {"label": [14, 19], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "label": "(string, int, float) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 9, 12 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 14, 19 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 62:17 @@ -289,12 +535,28 @@ argAtCursor: unlabelled<1> extracted params: [(int, string, int] { - "signatures": [{ - "label": "(int, string, int) => unit", - "parameters": [{"label": [0, 4], "documentation": {"kind": "markdown", "value": ""}}, {"label": [6, 12], "documentation": {"kind": "markdown", "value": ""}}, {"label": [14, 17], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "label": "(int, string, int) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 4 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 6, 12 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 14, 17 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 65:17 @@ -311,12 +573,28 @@ argAtCursor: unlabelled<1> extracted params: [(int, string, int] { - "signatures": [{ - "label": "(int, string, int) => unit", - "parameters": [{"label": [0, 4], "documentation": {"kind": "markdown", "value": ""}}, {"label": [6, 12], "documentation": {"kind": "markdown", "value": ""}}, {"label": [14, 17], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "label": "(int, string, int) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 4 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 6, 12 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 14, 17 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 68:26 @@ -333,12 +611,28 @@ argAtCursor: unlabelled<2> extracted params: [(int, string, int] { - "signatures": [{ - "label": "(int, string, int) => unit", - "parameters": [{"label": [0, 4], "documentation": {"kind": "markdown", "value": ""}}, {"label": [6, 12], "documentation": {"kind": "markdown", "value": ""}}, {"label": [14, 17], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 2, "activeSignature": 0, - "activeParameter": 2 + "signatures": [ + { + "activeParameter": 2, + "label": "(int, string, int) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 4 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 6, 12 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 14, 17 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 71:29 @@ -357,12 +651,20 @@ argAtCursor: unlabelled<0> extracted params: [string] { - "signatures": [{ - "label": "string => unit", - "parameters": [{"label": [0, 6], "documentation": {"kind": "markdown", "value": ""}}] - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "label": "string => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 6 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 74:40 @@ -384,90 +686,238 @@ extracted params: [( int, ~two: string=?, ~three: unit => unit, ~four: someVariant, unit] { - "signatures": [{ - "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", - "parameters": [{"label": [0, 7], "documentation": {"kind": "markdown", "value": ""}}, {"label": [11, 25], "documentation": {"kind": "markdown", "value": ""}}, {"label": [29, 49], "documentation": {"kind": "markdown", "value": ""}}, {"label": [53, 71], "documentation": {"kind": "markdown", "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)"}}, {"label": [75, 79], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Does stuff. "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Does stuff. " }, + "label": "(\n int,\n ~two: string=?,\n ~three: unit => unit,\n ~four: someVariant,\n unit,\n) => unit", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 7 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 11, 25 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 29, 49 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someVariant = One | Two | Three\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C0%2C0%5D)" + }, + "label": [ 53, 71 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 75, 79 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 85:16 { - "signatures": [{ - "label": "One({miss?: bool, hit?: bool, stuff?: string})", - "parameters": [{"label": [0, 0], "documentation": {"kind": "markdown", "value": ""}}, {"label": [5, 16], "documentation": {"kind": "markdown", "value": ""}}, {"label": [18, 28], "documentation": {"kind": "markdown", "value": ""}}, {"label": [30, 44], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " One is cool. "} - }], + "activeParameter": -1, "activeSignature": 0, - "activeParameter": -1 + "signatures": [ + { + "activeParameter": -1, + "documentation": { "kind": "markdown", "value": " One is cool. " }, + "label": "One({miss?: bool, hit?: bool, stuff?: string})", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 0 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 5, 16 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 18, 28 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 30, 44 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 88:18 { - "signatures": [{ - "label": "One({miss?: bool, hit?: bool, stuff?: string})", - "parameters": [{"label": [0, 0], "documentation": {"kind": "markdown", "value": ""}}, {"label": [5, 16], "documentation": {"kind": "markdown", "value": ""}}, {"label": [18, 28], "documentation": {"kind": "markdown", "value": ""}}, {"label": [30, 44], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " One is cool. "} - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "documentation": { "kind": "markdown", "value": " One is cool. " }, + "label": "One({miss?: bool, hit?: bool, stuff?: string})", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 0 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 5, 16 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 18, 28 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 30, 44 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 91:23 { - "signatures": [{ - "label": "One({miss?: bool, hit?: bool, stuff?: string})", - "parameters": [{"label": [0, 0], "documentation": {"kind": "markdown", "value": ""}}, {"label": [5, 16], "documentation": {"kind": "markdown", "value": ""}}, {"label": [18, 28], "documentation": {"kind": "markdown", "value": ""}}, {"label": [30, 44], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " One is cool. "} - }], + "activeParameter": 2, "activeSignature": 0, - "activeParameter": 2 + "signatures": [ + { + "activeParameter": 2, + "documentation": { "kind": "markdown", "value": " One is cool. " }, + "label": "One({miss?: bool, hit?: bool, stuff?: string})", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 0 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 5, 16 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 18, 28 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 30, 44 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 94:15 { - "signatures": [{ - "label": "Two(mySpecialThing)", - "parameters": [{"label": [4, 18], "documentation": {"kind": "markdown", "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)"}}], - "documentation": {"kind": "markdown", "value": " Two is fun! "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Two is fun! " }, + "label": "Two(mySpecialThing)", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)" + }, + "label": [ 4, 18 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 97:19 { - "signatures": [{ - "label": "Three(mySpecialThing, array>)", - "parameters": [{"label": [6, 20], "documentation": {"kind": "markdown", "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)"}}, {"label": [22, 43], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Three is... three "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Three is... three " }, + "label": "Three(mySpecialThing, array>)", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)" + }, + "label": [ 6, 20 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 22, 43 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 100:24 { - "signatures": [{ - "label": "Three(mySpecialThing, array>)", - "parameters": [{"label": [6, 20], "documentation": {"kind": "markdown", "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)"}}, {"label": [22, 43], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Three is... three "} - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "documentation": { "kind": "markdown", "value": " Three is... three " }, + "label": "Three(mySpecialThing, array>)", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)" + }, + "label": [ 6, 20 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 22, 43 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 105:9 { - "signatures": [{ - "label": "One({miss?: bool, hit?: bool, stuff?: string})", - "parameters": [{"label": [0, 0], "documentation": {"kind": "markdown", "value": ""}}, {"label": [5, 16], "documentation": {"kind": "markdown", "value": ""}}, {"label": [18, 28], "documentation": {"kind": "markdown", "value": ""}}, {"label": [30, 44], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " One is cool. "} - }], + "activeParameter": -1, "activeSignature": 0, - "activeParameter": -1 + "signatures": [ + { + "activeParameter": -1, + "documentation": { "kind": "markdown", "value": " One is cool. " }, + "label": "One({miss?: bool, hit?: bool, stuff?: string})", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 0 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 5, 16 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 18, 28 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 30, 44 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 113:42 @@ -475,13 +925,28 @@ argAtCursor: unlabelled<1> extracted params: [(array, int => int] { - "signatures": [{ - "label": "(array, int => int) => array", - "parameters": [{"label": [0, 11], "documentation": {"kind": "markdown", "value": ""}}, {"label": [13, 23], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n"} - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "documentation": { + "kind": "markdown", + "value": "\n`map(array, fn)` returns a new array with all elements from `array`, each element transformed using the provided `fn`.\n\nSee [`Array.map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) on MDN.\n\n## Examples\n\n```rescript\nlet array = [\"Hello\", \"Hi\", \"Good bye\"]\nlet mappedArray = array->Array.map(greeting => greeting ++ \" to you\")\n\nmappedArray == [\"Hello to you\", \"Hi to you\", \"Good bye to you\"]\n```\n" + }, + "label": "(array, int => int) => array", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 11 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 13, 23 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 132:18 @@ -489,13 +954,31 @@ argAtCursor: unlabelled<0> extracted params: [(x, tt] { - "signatures": [{ - "label": "(x, tt) => string", - "parameters": [{"label": [0, 2], "documentation": {"kind": "markdown", "value": "```rescript\ntype x = {age?: int, name?: string}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C117%2C0%5D)"}}, {"label": [4, 6], "documentation": {"kind": "markdown", "value": "```rescript\ntype tt = One\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C123%2C0%5D)"}}], - "documentation": {"kind": "markdown", "value": " Some stuff "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Some stuff " }, + "label": "(x, tt) => string", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype x = {age?: int, name?: string}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C117%2C0%5D)" + }, + "label": [ 0, 2 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype tt = One\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C123%2C0%5D)" + }, + "label": [ 4, 6 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 135:22 @@ -503,100 +986,232 @@ argAtCursor: unlabelled<1> extracted params: [(x, tt] { - "signatures": [{ - "label": "(x, tt) => string", - "parameters": [{"label": [0, 2], "documentation": {"kind": "markdown", "value": "```rescript\ntype x = {age?: int, name?: string}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C117%2C0%5D)"}}, {"label": [4, 6], "documentation": {"kind": "markdown", "value": "```rescript\ntype tt = One\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C123%2C0%5D)"}}], - "documentation": {"kind": "markdown", "value": " Some stuff "} - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "documentation": { "kind": "markdown", "value": " Some stuff " }, + "label": "(x, tt) => string", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype x = {age?: int, name?: string}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C117%2C0%5D)" + }, + "label": [ 0, 2 ] + }, + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype tt = One\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C123%2C0%5D)" + }, + "label": [ 4, 6 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 139:8 { - "signatures": [{ - "label": "One({miss?: bool, hit?: bool, stuff?: string})", - "parameters": [{"label": [0, 0], "documentation": {"kind": "markdown", "value": ""}}, {"label": [5, 16], "documentation": {"kind": "markdown", "value": ""}}, {"label": [18, 28], "documentation": {"kind": "markdown", "value": ""}}, {"label": [30, 44], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " One is cool. "} - }], + "activeParameter": 2, "activeSignature": 0, - "activeParameter": 2 + "signatures": [ + { + "activeParameter": 2, + "documentation": { "kind": "markdown", "value": " One is cool. " }, + "label": "One({miss?: bool, hit?: bool, stuff?: string})", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 0 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 5, 16 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 18, 28 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 30, 44 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 141:7 { - "signatures": [{ - "label": "One({miss?: bool, hit?: bool, stuff?: string})", - "parameters": [{"label": [0, 0], "documentation": {"kind": "markdown", "value": ""}}, {"label": [5, 16], "documentation": {"kind": "markdown", "value": ""}}, {"label": [18, 28], "documentation": {"kind": "markdown", "value": ""}}, {"label": [30, 44], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " One is cool. "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " One is cool. " }, + "label": "One({miss?: bool, hit?: bool, stuff?: string})", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 0, 0 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 5, 16 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 18, 28 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 30, 44 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 143:7 { - "signatures": [{ - "label": "Two(mySpecialThing)", - "parameters": [{"label": [4, 18], "documentation": {"kind": "markdown", "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)"}}], - "documentation": {"kind": "markdown", "value": " Two is fun! "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Two is fun! " }, + "label": "Two(mySpecialThing)", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)" + }, + "label": [ 4, 18 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 145:9 { - "signatures": [{ - "label": "Three(mySpecialThing, array>)", - "parameters": [{"label": [6, 20], "documentation": {"kind": "markdown", "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)"}}, {"label": [22, 43], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Three is... three "} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { "kind": "markdown", "value": " Three is... three " }, + "label": "Three(mySpecialThing, array>)", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)" + }, + "label": [ 6, 20 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 22, 43 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 147:12 { - "signatures": [{ - "label": "Three(mySpecialThing, array>)", - "parameters": [{"label": [6, 20], "documentation": {"kind": "markdown", "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)"}}, {"label": [22, 43], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": " Three is... three "} - }], + "activeParameter": 1, "activeSignature": 0, - "activeParameter": 1 + "signatures": [ + { + "activeParameter": 1, + "documentation": { "kind": "markdown", "value": " Three is... three " }, + "label": "Three(mySpecialThing, array>)", + "parameters": [ + { + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype mySpecialThing = string\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22SignatureHelp.res%22%2C78%2C0%5D)" + }, + "label": [ 6, 20 ] + }, + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 22, 43 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 151:14 { - "signatures": [{ - "label": "Ok(bool)", - "parameters": [{"label": [3, 7], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": "```rescript\nresult\n```"} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { + "kind": "markdown", + "value": "```rescript\nresult\n```" + }, + "label": "Ok(bool)", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 3, 7 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 154:19 { - "signatures": [{ - "label": "Error(string)", - "parameters": [{"label": [6, 12], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": "```rescript\nresult<'a, string>\n```"} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { + "kind": "markdown", + "value": "```rescript\nresult<'a, string>\n```" + }, + "label": "Error(string)", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 6, 12 ] + } + ] + } + ] } Signature help src/SignatureHelp.res 157:16 { - "signatures": [{ - "label": "Some(bool)", - "parameters": [{"label": [5, 9], "documentation": {"kind": "markdown", "value": ""}}], - "documentation": {"kind": "markdown", "value": "```rescript\noption\n```"} - }], + "activeParameter": 0, "activeSignature": 0, - "activeParameter": 0 + "signatures": [ + { + "activeParameter": 0, + "documentation": { + "kind": "markdown", + "value": "```rescript\noption\n```" + }, + "label": "Some(bool)", + "parameters": [ + { + "documentation": { "kind": "markdown", "value": "" }, + "label": [ 5, 9 ] + } + ] + } + ] } diff --git a/tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt b/tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt index be53ba25ba4..5b3659ae7ca 100644 --- a/tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt +++ b/tests/analysis_tests/tests/src/expected/TypeArgCtx.res.txt @@ -7,14 +7,19 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath Value[catchResult] Path catchResult -[{ - "label": "{}", - "kind": 22, - "tags": [], +[ + { "detail": "someTyp", - "documentation": {"kind": "markdown", "value": "```rescript\ntype someTyp = {test: bool}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype someTyp = {test: bool}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 22, + "label": "{}", + "sortText": "A", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/TypeAtPosCompletion.res.txt b/tests/analysis_tests/tests/src/expected/TypeAtPosCompletion.res.txt index 499d5fa4b12..d79b5b50ed7 100644 --- a/tests/analysis_tests/tests/src/expected/TypeAtPosCompletion.res.txt +++ b/tests/analysis_tests/tests/src/expected/TypeAtPosCompletion.res.txt @@ -4,19 +4,28 @@ Completable: Cexpression CTypeAtPos()->recordBody Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CTypeAtPos() -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage?: int\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```"} - }, { - "label": "online", + "documentation": { + "kind": "markdown", + "value": "```rescript\nage?: int\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```" + }, "kind": 5, - "tags": [], + "label": "age", + "tags": [] + }, + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nonline?: bool\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nonline?: bool\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```" + }, + "kind": 5, + "label": "online", + "tags": [] + } +] Complete src/TypeAtPosCompletion.res 16:18 posCursor:[16:18] posNoWhite:[16:16] Found expr:[13:8->19:1] @@ -26,19 +35,28 @@ Completable: Cexpression CTypeAtPos()->variantPayload::One($1), recordBody Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CTypeAtPos() -[{ - "label": "age", - "kind": 5, - "tags": [], +[ + { "detail": "int", - "documentation": {"kind": "markdown", "value": "```rescript\nage?: int\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```"} - }, { - "label": "online", + "documentation": { + "kind": "markdown", + "value": "```rescript\nage?: int\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```" + }, "kind": 5, - "tags": [], + "label": "age", + "tags": [] + }, + { "detail": "bool", - "documentation": {"kind": "markdown", "value": "```rescript\nonline?: bool\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```"} - }] + "documentation": { + "kind": "markdown", + "value": "```rescript\nonline?: bool\n```\n\n```rescript\ntype optRecord = {name: string, age: option, online: option}\n```" + }, + "kind": 5, + "label": "online", + "tags": [] + } +] Complete src/TypeAtPosCompletion.res 22:12 posCursor:[22:12] posNoWhite:[22:11] Found expr:[21:10->24:1] @@ -46,14 +64,19 @@ Completable: Cexpression CTypeAtPos()->array Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib ContextPath CTypeAtPos() -[{ - "label": "{}", - "kind": 12, - "tags": [], +[ + { "detail": "optRecord", - "documentation": {"kind": "markdown", "value": "```rescript\ntype optRecord = {name: string, age: option, online: option}\n```"}, - "sortText": "A", + "documentation": { + "kind": "markdown", + "value": "```rescript\ntype optRecord = {name: string, age: option, online: option}\n```" + }, "insertText": "{$0}", - "insertTextFormat": 2 - }] + "insertTextFormat": 2, + "kind": 12, + "label": "{}", + "sortText": "A", + "tags": [] + } +] diff --git a/tests/analysis_tests/tests/src/expected/TypeDefinition.res.txt b/tests/analysis_tests/tests/src/expected/TypeDefinition.res.txt index 46a968e8f35..4dfc5f23aa6 100644 --- a/tests/analysis_tests/tests/src/expected/TypeDefinition.res.txt +++ b/tests/analysis_tests/tests/src/expected/TypeDefinition.res.txt @@ -1,18 +1,54 @@ TypeDefinition src/TypeDefinition.res 2:9 -{"uri": "TypeDefinition.res", "range": {"start": {"line": 2, "character": 5}, "end": {"line": 2, "character": 11}}} +{ + "range": { + "end": { "character": 11, "line": 2 }, + "start": { "character": 5, "line": 2 } + }, + "uri": "file:///TypeDefinition.res" +} TypeDefinition src/TypeDefinition.res 5:4 -{"uri": "TypeDefinition.res", "range": {"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 24}}} +{ + "range": { + "end": { "character": 24, "line": 0 }, + "start": { "character": 0, "line": 0 } + }, + "uri": "file:///TypeDefinition.res" +} TypeDefinition src/TypeDefinition.res 8:4 -{"uri": "TypeDefinition.res", "range": {"start": {"line": 2, "character": 0}, "end": {"line": 2, "character": 28}}} +{ + "range": { + "end": { "character": 28, "line": 2 }, + "start": { "character": 0, "line": 2 } + }, + "uri": "file:///TypeDefinition.res" +} TypeDefinition src/TypeDefinition.res 13:4 -{"uri": "TypeDefinition.res", "range": {"start": {"line": 11, "character": 0}, "end": {"line": 11, "character": 26}}} +{ + "range": { + "end": { "character": 26, "line": 11 }, + "start": { "character": 0, "line": 11 } + }, + "uri": "file:///TypeDefinition.res" +} TypeDefinition src/TypeDefinition.res 16:13 -{"uri": "TypeDefinition.res", "range": {"start": {"line": 2, "character": 0}, "end": {"line": 2, "character": 28}}} +{ + "range": { + "end": { "character": 28, "line": 2 }, + "start": { "character": 0, "line": 2 } + }, + "uri": "file:///TypeDefinition.res" +} TypeDefinition src/TypeDefinition.res 20:9 -{"uri": "TypeDefinition.res", "range": {"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 24}}} +{ + "range": { + "end": { "character": 24, "line": 0 }, + "start": { "character": 0, "line": 0 } + }, + "uri": "file:///TypeDefinition.res" +} diff --git a/tests/analysis_tests/tests/src/expected/Xform.res.txt b/tests/analysis_tests/tests/src/expected/Xform.res.txt index 606adcdd07e..2d54099ce26 100644 --- a/tests/analysis_tests/tests/src/expected/Xform.res.txt +++ b/tests/analysis_tests/tests/src/expected/Xform.res.txt @@ -10,7 +10,10 @@ Resolved opens 1 Stdlib Hit: Replace with switch TextDocumentEdit: Xform.res -{"start": {"line": 6, "character": 0}, "end": {"line": 11, "character": 1}} +{ + "end": { "character": 1, "line": 11 }, + "start": { "character": 0, "line": 6 } +} newText: <--here switch kind { @@ -24,7 +27,10 @@ Xform src/Xform.res 13:15 Hit: Replace with switch TextDocumentEdit: Xform.res -{"start": {"line": 13, "character": 0}, "end": {"line": 13, "character": 79}} +{ + "end": { "character": 79, "line": 13 }, + "start": { "character": 0, "line": 13 } +} newText: <--here switch kind { @@ -36,14 +42,20 @@ Xform src/Xform.res 16:5 Hit: Add type annotation TextDocumentEdit: Xform.res -{"start": {"line": 16, "character": 8}, "end": {"line": 16, "character": 8}} +{ + "end": { "character": 8, "line": 16 }, + "start": { "character": 8, "line": 16 } +} newText: <--here : string Hit: Add Documentation template TextDocumentEdit: Xform.res -{"start": {"line": 16, "character": 0}, "end": {"line": 16, "character": 18}} +{ + "end": { "character": 18, "line": 16 }, + "start": { "character": 0, "line": 16 } +} newText: <--here /** @@ -55,7 +67,10 @@ Xform src/Xform.res 19:5 Hit: Add Documentation template TextDocumentEdit: Xform.res -{"start": {"line": 19, "character": 0}, "end": {"line": 19, "character": 23}} +{ + "end": { "character": 23, "line": 19 }, + "start": { "character": 0, "line": 19 } +} newText: <--here /** @@ -67,7 +82,10 @@ Xform src/Xform.res 26:10 Hit: Add type annotation TextDocumentEdit: Xform.res -{"start": {"line": 26, "character": 10}, "end": {"line": 26, "character": 11}} +{ + "end": { "character": 11, "line": 26 }, + "start": { "character": 10, "line": 26 } +} newText: <--here (x: option) @@ -76,7 +94,10 @@ Xform src/Xform.res 30:9 Hit: Add braces to function TextDocumentEdit: Xform.res -{"start": {"line": 26, "character": 0}, "end": {"line": 32, "character": 3}} +{ + "end": { "character": 3, "line": 32 }, + "start": { "character": 0, "line": 26 } +} newText: <--here let foo = x => { @@ -92,7 +113,10 @@ Xform src/Xform.res 34:21 Hit: Add type annotation TextDocumentEdit: Xform.res -{"start": {"line": 34, "character": 24}, "end": {"line": 34, "character": 24}} +{ + "end": { "character": 24, "line": 34 }, + "start": { "character": 24, "line": 34 } +} newText: <--here : int @@ -101,7 +125,10 @@ Xform src/Xform.res 38:5 Hit: Add Documentation template TextDocumentEdit: Xform.res -{"start": {"line": 37, "character": 0}, "end": {"line": 38, "character": 40}} +{ + "end": { "character": 40, "line": 38 }, + "start": { "character": 0, "line": 37 } +} newText: <--here /** @@ -114,7 +141,10 @@ Xform src/Xform.res 41:9 Hit: Add type annotation TextDocumentEdit: Xform.res -{"start": {"line": 41, "character": 11}, "end": {"line": 41, "character": 11}} +{ + "end": { "character": 11, "line": 41 }, + "start": { "character": 11, "line": 41 } +} newText: <--here : int @@ -131,7 +161,10 @@ Resolved opens 1 Stdlib Hit: Add braces to function TextDocumentEdit: Xform.res -{"start": {"line": 48, "character": 0}, "end": {"line": 48, "character": 25}} +{ + "end": { "character": 25, "line": 48 }, + "start": { "character": 0, "line": 48 } +} newText: <--here let noBraces = () => { @@ -142,7 +175,10 @@ Xform src/Xform.res 52:34 Hit: Add braces to function TextDocumentEdit: Xform.res -{"start": {"line": 51, "character": 0}, "end": {"line": 54, "character": 1}} +{ + "end": { "character": 1, "line": 54 }, + "start": { "character": 0, "line": 51 } +} newText: <--here let nested = () => { @@ -156,7 +192,10 @@ Xform src/Xform.res 62:6 Hit: Add braces to function TextDocumentEdit: Xform.res -{"start": {"line": 58, "character": 4}, "end": {"line": 62, "character": 7}} +{ + "end": { "character": 7, "line": 62 }, + "start": { "character": 4, "line": 58 } +} newText: <--here let foo = (_x, y, _z) => { @@ -172,7 +211,10 @@ Hit: Extract local module "ExtractableModule" to file "ExtractableModule.res" CreateFile: ExtractableModule.res TextDocumentEdit: ExtractableModule.res -{"start": {"line": 0, "character": 0}, "end": {"line": 0, "character": 0}} +{ + "end": { "character": 1, "line": 74 }, + "start": { "character": 0, "line": 68 } +} newText: <--here /** Doc comment. */ @@ -182,8 +224,11 @@ let doStuff = a => a + 1 // ^xfm -TextDocumentEdit: src/Xform.res -{"start": {"line": 68, "character": 0}, "end": {"line": 74, "character": 1}} +TextDocumentEdit: Xform.res +{ + "end": { "character": 1, "line": 74 }, + "start": { "character": 0, "line": 68 } +} newText: <--here @@ -200,7 +245,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 80, "character": 2}, "end": {"line": 80, "character": 3}} +{ + "end": { "character": 3, "line": 80 }, + "start": { "character": 2, "line": 80 } +} newText: <--here Second | Third | Fourth(_) @@ -217,7 +265,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 86, "character": 2}, "end": {"line": 86, "character": 3}} +{ + "end": { "character": 3, "line": 86 }, + "start": { "character": 2, "line": 86 } +} newText: <--here Third | Fourth(_) @@ -234,7 +285,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 93, "character": 2}, "end": {"line": 93, "character": 3}} +{ + "end": { "character": 3, "line": 93 }, + "start": { "character": 2, "line": 93 } +} newText: <--here First | Third | Fourth(_) @@ -251,7 +305,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 101, "character": 2}, "end": {"line": 101, "character": 3}} +{ + "end": { "character": 3, "line": 101 }, + "start": { "character": 2, "line": 101 } +} newText: <--here #second | #"illegal identifier" | #third(_) @@ -268,7 +325,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 107, "character": 2}, "end": {"line": 107, "character": 3}} +{ + "end": { "character": 3, "line": 107 }, + "start": { "character": 2, "line": 107 } +} newText: <--here #"illegal identifier" | #third(_) @@ -285,7 +345,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 115, "character": 2}, "end": {"line": 115, "character": 3}} +{ + "end": { "character": 3, "line": 115 }, + "start": { "character": 2, "line": 115 } +} newText: <--here Some(Second | Third | Fourth(_)) | None @@ -302,7 +365,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 121, "character": 2}, "end": {"line": 121, "character": 3}} +{ + "end": { "character": 3, "line": 121 }, + "start": { "character": 2, "line": 121 } +} newText: <--here Some(Third | Fourth(_)) | None @@ -319,7 +385,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 127, "character": 2}, "end": {"line": 127, "character": 3}} +{ + "end": { "character": 3, "line": 127 }, + "start": { "character": 2, "line": 127 } +} newText: <--here Some(Third | Fourth(_)) | None @@ -336,7 +405,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 136, "character": 2}, "end": {"line": 136, "character": 3}} +{ + "end": { "character": 3, "line": 136 }, + "start": { "character": 2, "line": 136 } +} newText: <--here Some(#"illegal identifier" | #second | #third(_)) @@ -353,7 +425,10 @@ Resolved opens 1 Stdlib Hit: Expand catch-all TextDocumentEdit: Xform.res -{"start": {"line": 142, "character": 2}, "end": {"line": 142, "character": 3}} +{ + "end": { "character": 3, "line": 142 }, + "start": { "character": 2, "line": 142 } +} newText: <--here Some(#"illegal identifier" | #third(_)) | None diff --git a/tests/docstring_tests/DocTest.res b/tests/docstring_tests/DocTest.res index 779fa0cf8fc..f806d9d0176 100644 --- a/tests/docstring_tests/DocTest.res +++ b/tests/docstring_tests/DocTest.res @@ -71,14 +71,8 @@ let extractExamples = async () => { let examples = [] await docFiles->ArrayUtils.forEachAsyncInBatches(~batchSize, async f => { let doc = await extractDocFromFile(Path.join([runtimePath, f])) - switch doc { - | Ok(doc) => - // TODO: Should this be a flag in the actual command instead, to only include code blocks with tests? - examples->Array.pushMany(doc->Array.filter(d => d.code->String.includes("assertEqual("))) - | Error(e) => - Console.error(e) - JsError.panic(`Error extracting code blocks for ${f}`) - } + // TODO: Should this be a flag in the actual command instead, to only include code blocks with tests? + examples->Array.pushMany(doc->Array.filter(d => d.code->String.includes("assertEqual("))) }) examples->Array.sort((a, b) => String.compare(a.id, b.id)) diff --git a/tests/docstring_tests/DocTest.res.js b/tests/docstring_tests/DocTest.res.js index dbe11a97ee1..c372acd3dc5 100644 --- a/tests/docstring_tests/DocTest.res.js +++ b/tests/docstring_tests/DocTest.res.js @@ -77,12 +77,7 @@ async function extractExamples() { let examples = []; await ArrayUtils.forEachAsyncInBatches(docFiles, batchSize, async f => { let doc = await extractDocFromFile(Nodepath.join(runtimePath, f)); - if (doc.TAG === "Ok") { - examples.push(...doc._0.filter(d => d.code.includes("assertEqual("))); - return; - } - console.error(doc._0); - return Stdlib_JsError.panic(`Error extracting code blocks for ` + f); + examples.push(...doc.filter(d => d.code.includes("assertEqual("))); }); examples.sort((a, b) => Primitive_string.compare(a.id, b.id)); return examples; diff --git a/tests/ounit_tests/ounit_json_tests.ml b/tests/ounit_tests/ounit_json_tests.ml index e096bce0757..c33b4068e7e 100644 --- a/tests/ounit_tests/ounit_json_tests.ml +++ b/tests/ounit_tests/ounit_json_tests.ml @@ -4,11 +4,11 @@ let suites = __FILE__ >::: [ ( "escape 'hello'" >:: fun _ -> - let escaped = Json.escape "hello" in - let expected = "hello" in + let escaped = `String "hello" |> Yojson.Safe.to_string in + let expected = "\"hello\"" in OUnit.assert_equal escaped expected ); ( "escape \\x17" >:: fun _ -> - let escaped = Json.escape "\x17" in - let expected = "\\u0017" in + let escaped = `String "\x17" |> Yojson.Safe.to_string in + let expected = "\"\\u0017\"" in OUnit.assert_equal escaped expected ); ] diff --git a/tests/tools_tests/src/expected/DocExtraction2.res.json b/tests/tools_tests/src/expected/DocExtraction2.res.json index bd71cd75607..79eac3729cf 100644 --- a/tests/tools_tests/src/expected/DocExtraction2.res.json +++ b/tests/tools_tests/src/expected/DocExtraction2.res.json @@ -1,117 +1,104 @@ - { "name": "DocExtraction2", - "docstrings": ["Module level doc here."], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 1, - "col": 1 - }, + "docstrings": [ "Module level doc here." ], + "source": { "filepath": "src/DocExtraction2.resi", "line": 1, "col": 1 }, "items": [ - { - "id": "DocExtraction2.t", - "kind": "type", - "name": "t", - "signature": "type t", - "docstrings": ["Type t is pretty cool."], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 4, - "col": 1 - } - }, - { - "id": "DocExtraction2.make", - "kind": "value", - "name": "make", - "signature": "let make: unit => t", - "docstrings": ["Makerz of stuffz."], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 7, - "col": 1 - }, - "detail": - { - "kind": "signature", - "details": { - "parameters": [{ - "path": "unit" - }], - "returnType": { - "path": "t" - } - } - } - }, - { - "id": "DocExtraction2.InnerModule", - "name": "InnerModule", - "kind": "module", - "docstrings": [], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 9, - "col": 8 - }, - "items": [ { - "id": "DocExtraction2.InnerModule.t", + "id": "DocExtraction2.t", "kind": "type", "name": "t", "signature": "type t", - "docstrings": ["This type is also t."], + "docstrings": [ "Type t is pretty cool." ], "source": { "filepath": "src/DocExtraction2.resi", - "line": 13, - "col": 3 + "line": 4, + "col": 1 } - }, + }, { - "id": "DocExtraction2.InnerModule.make", + "id": "DocExtraction2.make", "kind": "value", "name": "make", "signature": "let make: unit => t", - "docstrings": ["Maker of tea."], + "docstrings": [ "Makerz of stuffz." ], "source": { "filepath": "src/DocExtraction2.resi", - "line": 15, - "col": 3 + "line": 7, + "col": 1 }, - "detail": - { + "detail": { "kind": "signature", "details": { - "parameters": [{ - "path": "unit" - }], - "returnType": { - "path": "t" + "parameters": [ { "path": "unit", "genericTypeParameters": [] } ], + "returnType": { "path": "t", "genericTypeParameters": [] } } } - } - }] - }, - { - "id": "DocExtraction2.log", - "kind": "value", - "name": "log", - "deprecated": "Use log instead", - "signature": "let log: 'a => unit", - "docstrings": [], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 25, - "col": 1 }, - "detail": { - "kind": "signature", - "details": { - "returnType": { - "path": "unit" + "id": "DocExtraction2.InnerModule", + "name": "InnerModule", + "kind": "module", + "docstrings": [], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 9, + "col": 8 + }, + "items": [ + { + "id": "DocExtraction2.InnerModule.t", + "kind": "type", + "name": "t", + "signature": "type t", + "docstrings": [ "This type is also t." ], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 13, + "col": 3 + } + }, + { + "id": "DocExtraction2.InnerModule.make", + "kind": "value", + "name": "make", + "signature": "let make: unit => t", + "docstrings": [ "Maker of tea." ], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 15, + "col": 3 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [ + { "path": "unit", "genericTypeParameters": [] } + ], + "returnType": { "path": "t", "genericTypeParameters": [] } + } + } + } + ] + }, + { + "id": "DocExtraction2.log", + "kind": "value", + "name": "log", + "signature": "let log: 'a => unit", + "docstrings": [], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 25, + "col": 1 + }, + "deprecated": "Use log instead", + "detail": { + "kind": "signature", + "details": { + "parameters": [], + "returnType": { "path": "unit", "genericTypeParameters": [] } + } } } - } - }] + ] } diff --git a/tests/tools_tests/src/expected/DocExtraction2.resi.json b/tests/tools_tests/src/expected/DocExtraction2.resi.json index bd71cd75607..79eac3729cf 100644 --- a/tests/tools_tests/src/expected/DocExtraction2.resi.json +++ b/tests/tools_tests/src/expected/DocExtraction2.resi.json @@ -1,117 +1,104 @@ - { "name": "DocExtraction2", - "docstrings": ["Module level doc here."], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 1, - "col": 1 - }, + "docstrings": [ "Module level doc here." ], + "source": { "filepath": "src/DocExtraction2.resi", "line": 1, "col": 1 }, "items": [ - { - "id": "DocExtraction2.t", - "kind": "type", - "name": "t", - "signature": "type t", - "docstrings": ["Type t is pretty cool."], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 4, - "col": 1 - } - }, - { - "id": "DocExtraction2.make", - "kind": "value", - "name": "make", - "signature": "let make: unit => t", - "docstrings": ["Makerz of stuffz."], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 7, - "col": 1 - }, - "detail": - { - "kind": "signature", - "details": { - "parameters": [{ - "path": "unit" - }], - "returnType": { - "path": "t" - } - } - } - }, - { - "id": "DocExtraction2.InnerModule", - "name": "InnerModule", - "kind": "module", - "docstrings": [], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 9, - "col": 8 - }, - "items": [ { - "id": "DocExtraction2.InnerModule.t", + "id": "DocExtraction2.t", "kind": "type", "name": "t", "signature": "type t", - "docstrings": ["This type is also t."], + "docstrings": [ "Type t is pretty cool." ], "source": { "filepath": "src/DocExtraction2.resi", - "line": 13, - "col": 3 + "line": 4, + "col": 1 } - }, + }, { - "id": "DocExtraction2.InnerModule.make", + "id": "DocExtraction2.make", "kind": "value", "name": "make", "signature": "let make: unit => t", - "docstrings": ["Maker of tea."], + "docstrings": [ "Makerz of stuffz." ], "source": { "filepath": "src/DocExtraction2.resi", - "line": 15, - "col": 3 + "line": 7, + "col": 1 }, - "detail": - { + "detail": { "kind": "signature", "details": { - "parameters": [{ - "path": "unit" - }], - "returnType": { - "path": "t" + "parameters": [ { "path": "unit", "genericTypeParameters": [] } ], + "returnType": { "path": "t", "genericTypeParameters": [] } } } - } - }] - }, - { - "id": "DocExtraction2.log", - "kind": "value", - "name": "log", - "deprecated": "Use log instead", - "signature": "let log: 'a => unit", - "docstrings": [], - "source": { - "filepath": "src/DocExtraction2.resi", - "line": 25, - "col": 1 }, - "detail": { - "kind": "signature", - "details": { - "returnType": { - "path": "unit" + "id": "DocExtraction2.InnerModule", + "name": "InnerModule", + "kind": "module", + "docstrings": [], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 9, + "col": 8 + }, + "items": [ + { + "id": "DocExtraction2.InnerModule.t", + "kind": "type", + "name": "t", + "signature": "type t", + "docstrings": [ "This type is also t." ], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 13, + "col": 3 + } + }, + { + "id": "DocExtraction2.InnerModule.make", + "kind": "value", + "name": "make", + "signature": "let make: unit => t", + "docstrings": [ "Maker of tea." ], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 15, + "col": 3 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [ + { "path": "unit", "genericTypeParameters": [] } + ], + "returnType": { "path": "t", "genericTypeParameters": [] } + } + } + } + ] + }, + { + "id": "DocExtraction2.log", + "kind": "value", + "name": "log", + "signature": "let log: 'a => unit", + "docstrings": [], + "source": { + "filepath": "src/DocExtraction2.resi", + "line": 25, + "col": 1 + }, + "deprecated": "Use log instead", + "detail": { + "kind": "signature", + "details": { + "parameters": [], + "returnType": { "path": "unit", "genericTypeParameters": [] } + } } } - } - }] + ] } diff --git a/tests/tools_tests/src/expected/DocExtractionRes.res.json b/tests/tools_tests/src/expected/DocExtractionRes.res.json index c2120b97989..5d3d3c2bdc2 100644 --- a/tests/tools_tests/src/expected/DocExtractionRes.res.json +++ b/tests/tools_tests/src/expected/DocExtractionRes.res.json @@ -1,513 +1,452 @@ - { "name": "DocExtractionRes", - "docstrings": ["Module level documentation goes here."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 1, - "col": 1 - }, + "docstrings": [ "Module level documentation goes here." ], + "source": { "filepath": "src/DocExtractionRes.res", "line": 1, "col": 1 }, "items": [ - { - "id": "DocExtractionRes.t", - "kind": "type", - "name": "t", - "signature": "type t = {name: string, online: bool}", - "docstrings": ["This type represents stuff."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 4, - "col": 1 - }, - "detail": - { - "kind": "record", - "items": [{ - "name": "name", - "optional": false, - "docstrings": ["The name of the stuff."], - "signature": "string" - }, { - "name": "online", - "optional": false, - "docstrings": ["Whether stuff is online."], - "signature": "bool" - }] - } - }, - { - "id": "DocExtractionRes.make", - "kind": "value", - "name": "make", - "signature": "let make: string => t", - "docstrings": ["Create stuff.\n\n```rescript example\nlet stuff = make(\"My name\")\n```"], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 17, - "col": 5 - }, - "detail": - { - "kind": "signature", - "details": { - "parameters": [{ - "path": "string" - }], - "returnType": { - "path": "t" - } - } - } - }, - { - "id": "DocExtractionRes.asOffline", - "kind": "value", - "name": "asOffline", - "signature": "let asOffline: t => t", - "docstrings": ["Stuff goes offline."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 23, - "col": 5 - }, - "detail": - { - "kind": "signature", - "details": { - "parameters": [{ - "path": "t" - }], - "returnType": { - "path": "t" - } - } - } - }, - { - "id": "DocExtractionRes.SomeConstant", - "kind": "value", - "name": "SomeConstant", - "signature": "let SomeConstant: int", - "docstrings": ["exotic identifier"], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 26, - "col": 5 - }, - "detail": { - "kind": "signature", - "details": { - "returnType": { - "path": "int" - } - } - } - }, - { - "id": "DocExtractionRes.SomeInnerModule", - "name": "SomeInnerModule", - "kind": "module", - "docstrings": ["Another module level docstring here."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 28, - "col": 8 - }, - "items": [ - { - "id": "DocExtractionRes.SomeInnerModule.status", + "id": "DocExtractionRes.t", "kind": "type", - "name": "status", - "signature": "type status = Started(t) | Stopped | Idle", - "docstrings": [], + "name": "t", + "signature": "type t = {name: string, online: bool}", + "docstrings": [ "This type represents stuff." ], "source": { "filepath": "src/DocExtractionRes.res", - "line": 30, - "col": 3 + "line": 4, + "col": 1 }, - "detail": - { - "kind": "variant", + "detail": { + "kind": "record", "items": [ - { - "name": "Started", - "docstrings": ["If this is started or not"], - "signature": "Started(t)" - }, - { - "name": "Stopped", - "docstrings": ["Stopped?"], - "signature": "Stopped" - }, - { - "name": "Idle", - "docstrings": ["Now idle."], - "signature": "Idle" - }] - } - }, - { - "id": "DocExtractionRes.SomeInnerModule.validInputs", - "kind": "type", - "name": "validInputs", - "signature": "type validInputs = [\n | #\"needs-escaping\"\n | #something\n | #status(status)\n | #withPayload(int)\n]", - "docstrings": ["These are all the valid inputs."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 39, - "col": 3 - } - }, - { - "id": "DocExtractionRes.SomeInnerModule.callback", - "kind": "type", - "name": "callback", - "signature": "type callback = (t, ~status: status) => unit", - "docstrings": [], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 41, - "col": 3 + { + "name": "name", + "optional": false, + "docstrings": [ "The name of the stuff." ], + "signature": "string" + }, + { + "name": "online", + "optional": false, + "docstrings": [ "Whether stuff is online." ], + "signature": "bool" + } + ] } - }] - }, - { - "id": "DocExtractionRes.AnotherModule", - "name": "AnotherModule", - "kind": "module", - "docstrings": ["Mighty fine module here too!"], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 44, - "col": 8 }, - "items": [ - { - "id": "DocExtractionRes.LinkedModule", - "kind": "moduleAlias", - "name": "LinkedModule", - "docstrings": ["This links another module. Neat."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 48, - "col": 10 - }, - "items": [] - }, - { - "id": "DocExtractionRes.AnotherModule.callback", - "kind": "type", - "name": "callback", - "signature": "type callback = SomeInnerModule.status => unit", - "docstrings": ["Testing what this looks like."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 52, - "col": 3 - } - }, { - "id": "DocExtractionRes.AnotherModule.isGoodStatus", + "id": "DocExtractionRes.make", "kind": "value", - "name": "isGoodStatus", - "signature": "let isGoodStatus: SomeInnerModule.status => bool", - "docstrings": [], + "name": "make", + "signature": "let make: string => t", + "docstrings": [ + "Create stuff.\n\n```rescript example\nlet stuff = make(\"My name\")\n```" + ], "source": { "filepath": "src/DocExtractionRes.res", - "line": 54, - "col": 7 + "line": 17, + "col": 5 }, - "detail": - { + "detail": { "kind": "signature", "details": { - "parameters": [{ - "path": "SomeInnerModule.status" - }], - "returnType": { - "path": "bool" + "parameters": [ { "path": "string", "genericTypeParameters": [] } ], + "returnType": { "path": "t", "genericTypeParameters": [] } } } - } - }, + }, { - "id": "DocExtractionRes.AnotherModule.someVariantWithInlineRecords", - "kind": "type", - "name": "someVariantWithInlineRecords", - "signature": "type someVariantWithInlineRecords =\n | SomeStuff({offline: bool, online?: bool})", - "docstrings": ["Trying how it looks with an inline record in a variant."], + "id": "DocExtractionRes.asOffline", + "kind": "value", + "name": "asOffline", + "signature": "let asOffline: t => t", + "docstrings": [ "Stuff goes offline." ], "source": { "filepath": "src/DocExtractionRes.res", - "line": 57, - "col": 3 + "line": 23, + "col": 5 }, - "detail": - { - "kind": "variant", - "items": [ - { - "name": "SomeStuff", - "docstrings": ["This has inline records..."], - "signature": "SomeStuff({offline: bool, online?: bool})", - "payload": { - "kind": "inlineRecord", - "fields": [{ - "name": "offline", - "optional": false, - "docstrings": [], - "signature": "bool" - }, { - "name": "online", - "optional": true, - "docstrings": ["Is the user online?"], - "signature": "option" - }] - } - }] - } - }, - { - "id": "DocExtractionRes.AnotherModule.domRoot", - "kind": "type", - "name": "domRoot", - "signature": "type domRoot = unit => ReactDOM.Client.Root.t", - "docstrings": ["Callback to get the DOM root..."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 68, - "col": 3 + "detail": { + "kind": "signature", + "details": { + "parameters": [ { "path": "t", "genericTypeParameters": [] } ], + "returnType": { "path": "t", "genericTypeParameters": [] } + } } - }] - }, - { - "id": "DocExtractionRes.ModuleWithThingsThatShouldNotBeExported", - "name": "ModuleWithThingsThatShouldNotBeExported", - "kind": "module", - "docstrings": [], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 1, - "col": 1 }, - "items": [ { - "id": "DocExtractionRes.ModuleWithThingsThatShouldNotBeExported.t", - "kind": "type", - "name": "t", - "signature": "type t", - "docstrings": ["The type t is stuff."], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 75, - "col": 3 - } - }, - { - "id": "DocExtractionRes.ModuleWithThingsThatShouldNotBeExported.make", + "id": "DocExtractionRes.SomeConstant", "kind": "value", - "name": "make", - "signature": "let make: unit => t", - "docstrings": ["The maker of stuff!"], + "name": "SomeConstant", + "signature": "let SomeConstant: int", + "docstrings": [ "exotic identifier" ], "source": { "filepath": "src/DocExtractionRes.res", - "line": 77, - "col": 3 + "line": 26, + "col": 5 }, - "detail": - { + "detail": { "kind": "signature", "details": { - "parameters": [{ - "path": "unit" - }], - "returnType": { - "path": "t" + "parameters": [], + "returnType": { "path": "int", "genericTypeParameters": [] } } } - } - }] - }, - { - "id": "DocExtractionRes.Example", - "name": "Example", - "kind": "moduleType", - "docstrings": [], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 105, - "col": 13 }, - "items": [ { - "id": "DocExtractionRes.Example.t", - "kind": "type", - "name": "t", - "signature": "type t", - "docstrings": ["main type of this module"], + "id": "DocExtractionRes.SomeInnerModule", + "name": "SomeInnerModule", + "kind": "module", + "docstrings": [ "Another module level docstring here." ], "source": { "filepath": "src/DocExtractionRes.res", - "line": 113, - "col": 3 - } - }, + "line": 28, + "col": 8 + }, + "items": [ + { + "id": "DocExtractionRes.SomeInnerModule.status", + "kind": "type", + "name": "status", + "signature": "type status = Started(t) | Stopped | Idle", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 30, + "col": 3 + }, + "detail": { + "kind": "variant", + "items": [ + { + "name": "Started", + "docstrings": [ "If this is started or not" ], + "signature": "Started(t)" + }, + { + "name": "Stopped", + "docstrings": [ "Stopped?" ], + "signature": "Stopped" + }, + { + "name": "Idle", + "docstrings": [ "Now idle." ], + "signature": "Idle" + } + ] + } + }, + { + "id": "DocExtractionRes.SomeInnerModule.validInputs", + "kind": "type", + "name": "validInputs", + "signature": "type validInputs = [\n | #\"needs-escaping\"\n | #something\n | #status(status)\n | #withPayload(int)\n]", + "docstrings": [ "These are all the valid inputs." ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 39, + "col": 3 + } + }, + { + "id": "DocExtractionRes.SomeInnerModule.callback", + "kind": "type", + "name": "callback", + "signature": "type callback = (t, ~status: status) => unit", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 41, + "col": 3 + } + } + ] + }, { - "id": "DocExtractionRes.Example.f", - "kind": "value", - "name": "f", - "signature": "let f: t => t", - "docstrings": ["function from t to t"], + "id": "DocExtractionRes.AnotherModule", + "name": "AnotherModule", + "kind": "module", + "docstrings": [ "Mighty fine module here too!" ], "source": { "filepath": "src/DocExtractionRes.res", - "line": 115, - "col": 3 + "line": 44, + "col": 8 }, - "detail": - { - "kind": "signature", - "details": { - "parameters": [{ - "path": "t" - }], - "returnType": { - "path": "t" + "items": [ + { + "id": "DocExtractionRes.LinkedModule", + "kind": "moduleAlias", + "name": "LinkedModule", + "docstrings": [ "This links another module. Neat." ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 48, + "col": 10 + }, + "items": [] + }, + { + "id": "DocExtractionRes.AnotherModule.callback", + "kind": "type", + "name": "callback", + "signature": "type callback = SomeInnerModule.status => unit", + "docstrings": [ "Testing what this looks like." ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 52, + "col": 3 + } + }, + { + "id": "DocExtractionRes.AnotherModule.isGoodStatus", + "kind": "value", + "name": "isGoodStatus", + "signature": "let isGoodStatus: SomeInnerModule.status => bool", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 54, + "col": 7 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [ + { + "path": "SomeInnerModule.status", + "genericTypeParameters": [] + } + ], + "returnType": { "path": "bool", "genericTypeParameters": [] } + } + } + }, + { + "id": "DocExtractionRes.AnotherModule.someVariantWithInlineRecords", + "kind": "type", + "name": "someVariantWithInlineRecords", + "signature": "type someVariantWithInlineRecords =\n | SomeStuff({offline: bool, online?: bool})", + "docstrings": [ + "Trying how it looks with an inline record in a variant." + ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 57, + "col": 3 + }, + "detail": { + "kind": "variant", + "items": [ + { + "name": "SomeStuff", + "docstrings": [ "This has inline records..." ], + "signature": "SomeStuff({offline: bool, online?: bool})", + "payload": { + "kind": "inlineRecord", + "fields": [ + { + "name": "offline", + "optional": false, + "docstrings": [], + "signature": "bool" + }, + { + "name": "online", + "optional": true, + "docstrings": [ "Is the user online?" ], + "signature": "option" + } + ] + } + } + ] + } + }, + { + "id": "DocExtractionRes.AnotherModule.domRoot", + "kind": "type", + "name": "domRoot", + "signature": "type domRoot = unit => ReactDOM.Client.Root.t", + "docstrings": [ "Callback to get the DOM root..." ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 68, + "col": 3 + } } - } - } - }] - }, - { - "id": "DocExtractionRes.M", - "name": "M", - "kind": "module", - "moduletypeid": "DocExtractionRes.Example", - "docstrings": ["implementation of Example module type"], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 1, - "col": 1 + ] }, - "items": [ { - "id": "DocExtractionRes.M.t", - "kind": "type", - "name": "t", - "signature": "type t = int", - "docstrings": ["main type"], + "id": "DocExtractionRes.ModuleWithThingsThatShouldNotBeExported", + "name": "ModuleWithThingsThatShouldNotBeExported", + "kind": "module", + "docstrings": [], "source": { "filepath": "src/DocExtractionRes.res", - "line": 129, - "col": 3 - } - }, + "line": 1, + "col": 1 + }, + "items": [ + { + "id": "DocExtractionRes.ModuleWithThingsThatShouldNotBeExported.t", + "kind": "type", + "name": "t", + "signature": "type t", + "docstrings": [ "The type t is stuff." ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 75, + "col": 3 + } + }, + { + "id": "DocExtractionRes.ModuleWithThingsThatShouldNotBeExported.make", + "kind": "value", + "name": "make", + "signature": "let make: unit => t", + "docstrings": [ "The maker of stuff!" ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 77, + "col": 3 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [ + { "path": "unit", "genericTypeParameters": [] } + ], + "returnType": { "path": "t", "genericTypeParameters": [] } + } + } + } + ] + }, { - "id": "DocExtractionRes.M.f", - "kind": "value", - "name": "f", - "signature": "let f: int => int", - "docstrings": ["identity function"], + "id": "DocExtractionRes.Example", + "name": "Example", + "kind": "moduleType", + "docstrings": [], "source": { "filepath": "src/DocExtractionRes.res", - "line": 134, - "col": 7 + "line": 105, + "col": 13 }, - "detail": - { - "kind": "signature", - "details": { - "parameters": [{ - "path": "int" - }], - "returnType": { - "path": "int" + "items": [ + { + "id": "DocExtractionRes.Example.t", + "kind": "type", + "name": "t", + "signature": "type t", + "docstrings": [ "main type of this module" ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 113, + "col": 3 + } + }, + { + "id": "DocExtractionRes.Example.f", + "kind": "value", + "name": "f", + "signature": "let f: t => t", + "docstrings": [ "function from t to t" ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 115, + "col": 3 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [ { "path": "t", "genericTypeParameters": [] } ], + "returnType": { "path": "t", "genericTypeParameters": [] } + } + } } - } - } - }] - }, - { - "id": "DocExtractionRes.MT", - "name": "MT", - "kind": "moduleType", - "docstrings": [], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 137, - "col": 13 + ] }, - "items": [ { - "id": "DocExtractionRes.MT.x", - "kind": "value", - "name": "x", - "signature": "let x: int", - "docstrings": [], + "id": "DocExtractionRes.M", + "name": "M", + "kind": "module", + "docstrings": [ "implementation of Example module type" ], "source": { "filepath": "src/DocExtractionRes.res", - "line": 138, - "col": 3 + "line": 1, + "col": 1 }, - "detail": - { - "kind": "signature", - "details": { - "returnType": { - "path": "int" + "items": [ + { + "id": "DocExtractionRes.M.t", + "kind": "type", + "name": "t", + "signature": "type t = int", + "docstrings": [ "main type" ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 129, + "col": 3 + } + }, + { + "id": "DocExtractionRes.M.f", + "kind": "value", + "name": "f", + "signature": "let f: int => int", + "docstrings": [ "identity function" ], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 134, + "col": 7 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [ + { "path": "int", "genericTypeParameters": [] } + ], + "returnType": { "path": "int", "genericTypeParameters": [] } + } + } } - } - } - }] - }, - { - "id": "DocExtractionRes.A", - "name": "A", - "kind": "module", - "moduletypeid": "DocExtractionRes.MT", - "docstrings": [], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 1, - "col": 1 + ], + "moduletypeid": "DocExtractionRes.Example" }, - "items": [ { - "id": "DocExtractionRes.A.x", - "kind": "value", - "name": "x", - "signature": "let x: int", + "id": "DocExtractionRes.MT", + "name": "MT", + "kind": "moduleType", "docstrings": [], "source": { "filepath": "src/DocExtractionRes.res", - "line": 142, - "col": 7 + "line": 137, + "col": 13 }, - "detail": - { - "kind": "signature", - "details": { - "returnType": { - "path": "int" + "items": [ + { + "id": "DocExtractionRes.MT.x", + "kind": "value", + "name": "x", + "signature": "let x: int", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 138, + "col": 3 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [], + "returnType": { "path": "int", "genericTypeParameters": [] } + } + } } - } - } - }] - }, - { - "id": "DocExtractionRes.C", - "name": "C", - "kind": "module", - "docstrings": [], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 145, - "col": 8 + ] }, - "items": [ { - "id": "DocExtractionRes.C.D", - "name": "D", + "id": "DocExtractionRes.A", + "name": "A", "kind": "module", - "moduletypeid": "DocExtractionRes.MT", "docstrings": [], "source": { "filepath": "src/DocExtractionRes.res", @@ -515,27 +454,76 @@ "col": 1 }, "items": [ - { - "id": "DocExtractionRes.C.D.x", - "kind": "value", - "name": "x", - "signature": "let x: int", - "docstrings": [], - "source": { - "filepath": "src/DocExtractionRes.res", - "line": 147, - "col": 9 - }, - "detail": { - "kind": "signature", - "details": { - "returnType": { - "path": "int" + "id": "DocExtractionRes.A.x", + "kind": "value", + "name": "x", + "signature": "let x: int", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 142, + "col": 7 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [], + "returnType": { "path": "int", "genericTypeParameters": [] } + } } } + ], + "moduletypeid": "DocExtractionRes.MT" + }, + { + "id": "DocExtractionRes.C", + "name": "C", + "kind": "module", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 145, + "col": 8 + }, + "items": [ + { + "id": "DocExtractionRes.C.D", + "name": "D", + "kind": "module", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 1, + "col": 1 + }, + "items": [ + { + "id": "DocExtractionRes.C.D.x", + "kind": "value", + "name": "x", + "signature": "let x: int", + "docstrings": [], + "source": { + "filepath": "src/DocExtractionRes.res", + "line": 147, + "col": 9 + }, + "detail": { + "kind": "signature", + "details": { + "parameters": [], + "returnType": { + "path": "int", + "genericTypeParameters": [] + } + } + } + } + ], + "moduletypeid": "DocExtractionRes.MT" } - }] - }] - }] + ] + } + ] } diff --git a/tests/tools_tests/src/expected/ExtractCodeBlocksTest.res.extracted.json.expected b/tests/tools_tests/src/expected/ExtractCodeBlocksTest.res.extracted.json.expected index aa06f3882d2..ef1767b89a9 100644 --- a/tests/tools_tests/src/expected/ExtractCodeBlocksTest.res.extracted.json.expected +++ b/tests/tools_tests/src/expected/ExtractCodeBlocksTest.res.extracted.json.expected @@ -1,8 +1,7 @@ -{ - "TAG": "Ok", - "_0": [{ +[ + { "id": "ExtractCodeBlocksTest.testFunction1", "name": "testFunction1", "code": "let x = 12\nlet y = 12->Array.filter(x => x == 12)\nassertEqual(x, 12)" - }] } +] diff --git a/tests/tools_tests/src/expected/FormatDocstringsTest1.res.extracted.json.expected b/tests/tools_tests/src/expected/FormatDocstringsTest1.res.extracted.json.expected index 5fee63a034c..bc25518b269 100644 --- a/tests/tools_tests/src/expected/FormatDocstringsTest1.res.extracted.json.expected +++ b/tests/tools_tests/src/expected/FormatDocstringsTest1.res.extracted.json.expected @@ -1,20 +1,22 @@ -{ - "TAG": "Ok", - "_0": [{ +[ + { "id": "FormatDocstringsTest1.testFunction3", "name": "testFunction3", "code": "let processUsers = (users: array) => {\n users\n ->Array.map(user => {...user, active: false})\n ->Array.filter(u => u.age > 21)\n}\n\ntype status = Loading | Success(string) | Error(option)" - }, { + }, + { "id": "FormatDocstringsTest1.Nested.testFunction2", "name": "testFunction2", "code": "module UserService = {\n let validate = user => user.age >= 18 && user.name !== \"\"\n let getName = user => user.name\n}" - }, { + }, + { "id": "FormatDocstringsTest1.testFunction1-2", "name": "testFunction1", "code": "type user = {name: string, age: int, active: bool}\nlet createUser = (name, age) => {name, age, active: true}" - }, { + }, + { "id": "FormatDocstringsTest1.testFunction1-1", "name": "testFunction1", "code": "let badly_formatted = (x, y) => {\n let result = x + y\n if result > 0 {\n Console.log(\"positive\")\n } else {\n Console.log(\"negative\")\n }\n result\n}" - }] } +] diff --git a/tests/tools_tests/src/expected/FormatDocstringsTest1.resi.extracted.json.expected b/tests/tools_tests/src/expected/FormatDocstringsTest1.resi.extracted.json.expected index 5fee63a034c..bc25518b269 100644 --- a/tests/tools_tests/src/expected/FormatDocstringsTest1.resi.extracted.json.expected +++ b/tests/tools_tests/src/expected/FormatDocstringsTest1.resi.extracted.json.expected @@ -1,20 +1,22 @@ -{ - "TAG": "Ok", - "_0": [{ +[ + { "id": "FormatDocstringsTest1.testFunction3", "name": "testFunction3", "code": "let processUsers = (users: array) => {\n users\n ->Array.map(user => {...user, active: false})\n ->Array.filter(u => u.age > 21)\n}\n\ntype status = Loading | Success(string) | Error(option)" - }, { + }, + { "id": "FormatDocstringsTest1.Nested.testFunction2", "name": "testFunction2", "code": "module UserService = {\n let validate = user => user.age >= 18 && user.name !== \"\"\n let getName = user => user.name\n}" - }, { + }, + { "id": "FormatDocstringsTest1.testFunction1-2", "name": "testFunction1", "code": "type user = {name: string, age: int, active: bool}\nlet createUser = (name, age) => {name, age, active: true}" - }, { + }, + { "id": "FormatDocstringsTest1.testFunction1-1", "name": "testFunction1", "code": "let badly_formatted = (x, y) => {\n let result = x + y\n if result > 0 {\n Console.log(\"positive\")\n } else {\n Console.log(\"negative\")\n }\n result\n}" - }] } +] diff --git a/tests/tools_tests/src/expected/FormatDocstringsTest2.res.extracted.json.expected b/tests/tools_tests/src/expected/FormatDocstringsTest2.res.extracted.json.expected index 1619063e79a..04113ab46b3 100644 --- a/tests/tools_tests/src/expected/FormatDocstringsTest2.res.extracted.json.expected +++ b/tests/tools_tests/src/expected/FormatDocstringsTest2.res.extracted.json.expected @@ -1,20 +1,22 @@ -{ - "TAG": "Ok", - "_0": [{ +[ + { "id": "FormatDocstringsTest2.testResi", "name": "testResi", "code": "type x = int\nlet x: int => string\nmodule M: {\n let ff: string => int\n}" - }, { + }, + { "id": "FormatDocstringsTest2.testPipes", "name": "testPipes", "code": "let processData = (data: array) => {\n data\n ->Array.filter(x => x > 0)\n ->Array.map(x => x * 2)\n ->Array.reduce(0, (acc, x) => acc + x)\n}\n\nlet asyncExample = async () => {\n let data = await fetchData()\n let processed = await processData(data)\n Console.log(processed)\n}" - }, { + }, + { "id": "FormatDocstringsTest2.testJsx-2", "name": "testJsx", "code": "let handleResult = (result: result) => {\n switch result {\n | Ok(value) => Console.log(`Success: ${value}`)\n | Error(error) => Console.error(`Error: ${error}`)\n }\n}" - }, { + }, + { "id": "FormatDocstringsTest2.testJsx-1", "name": "testJsx", "code": "let component = () => {\n
        \n

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

        \n \n
        \n}" - }] } +] diff --git a/tests/tools_tests/src/expected/FormatDocstringsTestError.res.extracted.json.expected b/tests/tools_tests/src/expected/FormatDocstringsTestError.res.extracted.json.expected index 9f24eec8251..e69de29bb2d 100644 --- a/tests/tools_tests/src/expected/FormatDocstringsTestError.res.extracted.json.expected +++ b/tests/tools_tests/src/expected/FormatDocstringsTestError.res.extracted.json.expected @@ -1,4 +0,0 @@ -{ - "TAG": "Error", - "_0": "\n Syntax error in code block in docstring\n FormatDocstringsTestError.res:5:10-6:3\n\n 3 │ \n 4 │ \n 5 │ let name= \n 6 │ let x=12\n\n This let-binding misses an expression\n\n" - } diff --git a/tests/tools_tests/src/expected/FormatRescriptBlocks.md.extracted.json.expected b/tests/tools_tests/src/expected/FormatRescriptBlocks.md.extracted.json.expected index dabca83343d..0f87bc8d91a 100644 --- a/tests/tools_tests/src/expected/FormatRescriptBlocks.md.extracted.json.expected +++ b/tests/tools_tests/src/expected/FormatRescriptBlocks.md.extracted.json.expected @@ -1,12 +1,12 @@ -{ - "TAG": "Ok", - "_0": [{ +[ + { "id": "codeblock-1", "name": "codeblock-1", "code": "type user = {name: string, age: int, active: bool}\nlet createUser = (name, age) => {name, age, active: true}" - }, { + }, + { "id": "codeblock-2", "name": "codeblock-2", "code": "let badly_formatted = (x, y) => {\n let result = x + y\n if result > 0 {\n Console.log(\"positive\")\n } else {\n Console.log(\"negative\")\n }\n result\n}" - }] } +] diff --git a/tests/tools_tests/src/expected/ModC.res.json b/tests/tools_tests/src/expected/ModC.res.json index f90a09755fc..cc4cce09bba 100644 --- a/tests/tools_tests/src/expected/ModC.res.json +++ b/tests/tools_tests/src/expected/ModC.res.json @@ -1,44 +1,31 @@ - { "name": "ModC", "docstrings": [], - "source": { - "filepath": "src/ModC.resi", - "line": 1, - "col": 1 - }, + "source": { "filepath": "src/ModC.resi", "line": 1, "col": 1 }, "items": [ - { - "id": "ModC.User", - "name": "User", - "kind": "module", - "docstrings": ["User Module from interface file"], - "source": { - "filepath": "src/ModC.resi", - "line": 4, - "col": 8 - }, - "items": [ { - "id": "ModC.User.name", - "kind": "value", - "name": "name", - "signature": "let name: string", - "docstrings": [], - "source": { - "filepath": "src/ModC.resi", - "line": 5, - "col": 3 - }, - "detail": - { - "kind": "signature", - "details": { - "returnType": { - "path": "string" + "id": "ModC.User", + "name": "User", + "kind": "module", + "docstrings": [ "User Module from interface file" ], + "source": { "filepath": "src/ModC.resi", "line": 4, "col": 8 }, + "items": [ + { + "id": "ModC.User.name", + "kind": "value", + "name": "name", + "signature": "let name: string", + "docstrings": [], + "source": { "filepath": "src/ModC.resi", "line": 5, "col": 3 }, + "detail": { + "kind": "signature", + "details": { + "parameters": [], + "returnType": { "path": "string", "genericTypeParameters": [] } + } + } } - } - } - }] - }] + ] + } + ] } diff --git a/tests/tools_tests/src/expected/ModC.resi.json b/tests/tools_tests/src/expected/ModC.resi.json index f90a09755fc..cc4cce09bba 100644 --- a/tests/tools_tests/src/expected/ModC.resi.json +++ b/tests/tools_tests/src/expected/ModC.resi.json @@ -1,44 +1,31 @@ - { "name": "ModC", "docstrings": [], - "source": { - "filepath": "src/ModC.resi", - "line": 1, - "col": 1 - }, + "source": { "filepath": "src/ModC.resi", "line": 1, "col": 1 }, "items": [ - { - "id": "ModC.User", - "name": "User", - "kind": "module", - "docstrings": ["User Module from interface file"], - "source": { - "filepath": "src/ModC.resi", - "line": 4, - "col": 8 - }, - "items": [ { - "id": "ModC.User.name", - "kind": "value", - "name": "name", - "signature": "let name: string", - "docstrings": [], - "source": { - "filepath": "src/ModC.resi", - "line": 5, - "col": 3 - }, - "detail": - { - "kind": "signature", - "details": { - "returnType": { - "path": "string" + "id": "ModC.User", + "name": "User", + "kind": "module", + "docstrings": [ "User Module from interface file" ], + "source": { "filepath": "src/ModC.resi", "line": 4, "col": 8 }, + "items": [ + { + "id": "ModC.User.name", + "kind": "value", + "name": "name", + "signature": "let name: string", + "docstrings": [], + "source": { "filepath": "src/ModC.resi", "line": 5, "col": 3 }, + "detail": { + "kind": "signature", + "details": { + "parameters": [], + "returnType": { "path": "string", "genericTypeParameters": [] } + } + } } - } - } - }] - }] + ] + } + ] } diff --git a/tools.opam b/tools.opam index bfcabac6a9f..e70c57f28f6 100644 --- a/tools.opam +++ b/tools.opam @@ -12,6 +12,7 @@ depends: [ "cmarkit" {>= "0.3.0"} "cppo" {= "1.8.0"} "analysis" + "yojson" {= "2.2.2"} "odoc" {with-doc} ] build: [ diff --git a/tools/bin/main.ml b/tools/bin/main.ml index 130ce24ac74..dcc1a3b71bf 100644 --- a/tools/bin/main.ml +++ b/tools/bin/main.ml @@ -155,21 +155,14 @@ let main () = | "extract-codeblocks" :: rest -> ( match rest with | ["-h"] | ["--help"] -> logAndExit (Ok extractCodeblocksHelp) - | path :: args -> ( + | path :: args -> let transformAssertEqual = List.mem "--transform-assert-equal" args in Clflags.color := Some Misc.Color.Never; (* TODO: Add result/JSON mode *) - match - Tools.ExtractCodeblocks.extractCodeblocksFromFile ~transformAssertEqual - ~entryPointFile:path - with - | Ok _ as r -> - print_endline (Analysis.Protocol.stringifyResult r); - exit 0 - | Error _ as r -> - print_endline (Analysis.Protocol.stringifyResult r); - exit 1) + Tools.ExtractCodeblocks.extractCodeblocksFromFile ~transformAssertEqual + ~entryPointFile:path + |> logAndExit | _ -> logAndExit (Error extractCodeblocksHelp)) | "reanalyze" :: _ -> if Sys.getenv_opt "RESCRIPT_REANALYZE_NO_SERVER" = Some "1" then ( diff --git a/tools/src/dune b/tools/src/dune index 765cece335f..33a51af1da5 100644 --- a/tools/src/dune +++ b/tools/src/dune @@ -4,4 +4,4 @@ (backend bisect_ppx)) (flags (-w "+6+26+27+32+33+39")) - (libraries analysis cmarkit)) + (libraries analysis cmarkit yojson)) diff --git a/tools/src/tools.ml b/tools/src/tools.ml index eb591aa9123..21cf5eea177 100644 --- a/tools/src/tools.ml +++ b/tools/src/tools.ml @@ -77,245 +77,196 @@ and docsForModule = { } let stringifyDocstrings docstrings = - let open Protocol in - docstrings - |> List.map (fun docstring -> docstring |> String.trim |> wrapInQuotes) - |> array + `List + (docstrings + |> List.map (fun docstring -> `String (docstring |> String.trim))) -let stringifyFieldDoc ~indentation (fieldDoc : fieldDoc) = - let open Protocol in - stringifyObject ~indentation:(indentation + 1) - [ - ("name", Some (wrapInQuotes fieldDoc.fieldName)); - ( "deprecated", - match fieldDoc.deprecated with - | Some d -> Some (wrapInQuotes d) - | None -> None ); - ("optional", Some (string_of_bool fieldDoc.optional)); - ("docstrings", Some (stringifyDocstrings fieldDoc.docstrings)); - ("signature", Some (wrapInQuotes fieldDoc.signature)); - ] +let stringifyFieldDoc (fieldDoc : fieldDoc) = + `Assoc + ([ + ("name", `String fieldDoc.fieldName); + ("optional", `Bool fieldDoc.optional); + ("docstrings", stringifyDocstrings fieldDoc.docstrings); + ("signature", `String fieldDoc.signature); + ] + @ + match fieldDoc.deprecated with + | Some d -> [("deprecated", `String d)] + | None -> []) -let stringifyConstructorPayload ~indentation - (constructorPayload : constructorPayload) = - let open Protocol in +let stringifyConstructorPayload (constructorPayload : constructorPayload) = match constructorPayload with | InlineRecord {fieldDocs} -> - stringifyObject ~indentation:(indentation + 1) + `Assoc [ - ("kind", Some (wrapInQuotes "inlineRecord")); - ( "fields", - Some - (fieldDocs - |> List.map (stringifyFieldDoc ~indentation:(indentation + 1)) - |> array) ); + ("kind", `String "inlineRecord"); + ("fields", `List (fieldDocs |> List.map stringifyFieldDoc)); ] -let rec stringifyTypeDoc ~indentation (td : typeDoc) : string = - let open Protocol in +let rec stringifyTypeDoc (td : typeDoc) = let ps = match td.genericParameters with - | [] -> None - | ts -> - ts |> List.map (stringifyTypeDoc ~indentation:(indentation + 1)) - |> fun ts -> Some (array ts) + | [] -> `List [] + | ts -> ts |> List.map stringifyTypeDoc |> fun ts -> `List ts in + `Assoc [("path", `String td.path); ("genericTypeParameters", ps)] - stringifyObject ~indentation:(indentation + 1) - [("path", Some (wrapInQuotes td.path)); ("genericTypeParameters", ps)] - -let stringifyDetail ?(indentation = 0) (detail : docItemDetail) = - let open Protocol in +let stringifyDetail (detail : docItemDetail) = match detail with | Record {fieldDocs} -> - stringifyObject ~startOnNewline:true ~indentation + `Assoc [ - ("kind", Some (wrapInQuotes "record")); - ( "items", - Some (fieldDocs |> List.map (stringifyFieldDoc ~indentation) |> array) - ); + ("kind", `String "record"); + ("items", `List (fieldDocs |> List.map stringifyFieldDoc)); ] | Variant {constructorDocs} -> - stringifyObject ~startOnNewline:true ~indentation + `Assoc [ - ("kind", Some (wrapInQuotes "variant")); + ("kind", `String "variant"); ( "items", - Some + `List (constructorDocs |> List.map (fun constructorDoc -> - stringifyObject ~startOnNewline:true - ~indentation:(indentation + 1) - [ - ( "name", - Some (wrapInQuotes constructorDoc.constructorName) ); - ( "deprecated", - match constructorDoc.deprecated with - | Some d -> Some (wrapInQuotes d) - | None -> None ); - ( "docstrings", - Some (stringifyDocstrings constructorDoc.docstrings) ); - ( "signature", - Some (wrapInQuotes constructorDoc.signature) ); - ( "payload", - match constructorDoc.items with - | None -> None - | Some constructorPayload -> - Some - (stringifyConstructorPayload - ~indentation:(indentation + 1) - constructorPayload) ); - ]) - |> array) ); + `Assoc + ([ + ("name", `String constructorDoc.constructorName); + ( "docstrings", + stringifyDocstrings constructorDoc.docstrings ); + ("signature", `String constructorDoc.signature); + ] + @ (match constructorDoc.deprecated with + | Some d -> [("deprecated", `String d)] + | None -> []) + @ + match constructorDoc.items with + | Some constructorPayload -> + [ + ( "payload", + stringifyConstructorPayload constructorPayload ); + ] + | None -> []))) ); ] | Signature {parameters; returnType} -> let ps = match parameters with - | [] -> None - | ps -> - ps |> List.map (stringifyTypeDoc ~indentation:(indentation + 1)) - |> fun ps -> Some (array ps) + | [] -> `List [] + | ps -> ps |> List.map stringifyTypeDoc |> fun ps -> `List ps in - stringifyObject ~startOnNewline:true ~indentation + `Assoc [ - ("kind", Some (wrapInQuotes "signature")); + ("kind", `String "signature"); ( "details", - Some - (stringifyObject ~startOnNewline:false ~indentation - [ - ("parameters", ps); - ("returnType", Some (stringifyTypeDoc ~indentation returnType)); - ]) ); + `Assoc + [("parameters", ps); ("returnType", stringifyTypeDoc returnType)] ); ] -let stringifySource ~indentation source = - let open Protocol in - stringifyObject ~startOnNewline:false ~indentation +let stringifySource source = + `Assoc [ - ("filepath", Some (source.filepath |> wrapInQuotes)); - ("line", Some (source.line |> string_of_int)); - ("col", Some (source.col |> string_of_int)); + ("filepath", `String source.filepath); + ("line", `Int source.line); + ("col", `Int source.col); ] -let rec stringifyDocItem ?(indentation = 0) ~originalEnv (item : docItem) = - let open Protocol in +let rec stringifyDocItem ~originalEnv (item : docItem) = match item with | Value {id; docstring; signature; name; deprecated; source; detail} -> - stringifyObject ~startOnNewline:true ~indentation - [ - ("id", Some (wrapInQuotes id)); - ("kind", Some (wrapInQuotes "value")); - ("name", Some (name |> wrapInQuotes)); - ( "deprecated", - match deprecated with - | Some d -> Some (wrapInQuotes d) - | None -> None ); - ("signature", Some (signature |> String.trim |> wrapInQuotes)); - ("docstrings", Some (stringifyDocstrings docstring)); - ("source", Some (stringifySource ~indentation:(indentation + 1) source)); - ( "detail", - match detail with - | None -> None - | Some detail -> - Some (stringifyDetail ~indentation:(indentation + 1) detail) ); - ] + `Assoc + ([ + ("id", `String id); + ("kind", `String "value"); + ("name", `String name); + ("signature", `String (signature |> String.trim)); + ("docstrings", stringifyDocstrings docstring); + ("source", stringifySource source); + ] + @ (match deprecated with + | Some d -> [("deprecated", `String d)] + | None -> []) + @ + match detail with + | Some detail -> [("detail", stringifyDetail detail)] + | None -> []) | Type {id; docstring; signature; name; deprecated; detail; source} -> - stringifyObject ~startOnNewline:true ~indentation - [ - ("id", Some (wrapInQuotes id)); - ("kind", Some (wrapInQuotes "type")); - ("name", Some (name |> wrapInQuotes)); - ( "deprecated", - match deprecated with - | Some d -> Some (wrapInQuotes d) - | None -> None ); - ("signature", Some (signature |> wrapInQuotes)); - ("docstrings", Some (stringifyDocstrings docstring)); - ("source", Some (stringifySource ~indentation:(indentation + 1) source)); - ( "detail", - match detail with - | None -> None - | Some detail -> - Some (stringifyDetail ~indentation:(indentation + 1) detail) ); - ] + `Assoc + ([ + ("id", `String id); + ("kind", `String "type"); + ("name", `String name); + ("signature", `String signature); + ("docstrings", stringifyDocstrings docstring); + ("source", stringifySource source); + ] + @ (match deprecated with + | Some d -> [("deprecated", `String d)] + | None -> []) + @ + match detail with + | Some detail -> [("detail", stringifyDetail detail)] + | None -> []) | Module m -> - stringifyObject ~startOnNewline:true ~indentation - [ - ("id", Some (wrapInQuotes m.id)); - ("name", Some (wrapInQuotes m.name)); - ("kind", Some (wrapInQuotes "module")); - ( "deprecated", - match m.deprecated with - | Some d -> Some (wrapInQuotes d) - | None -> None ); - ( "moduletypeid", - match m.moduletypeid with - | Some path -> Some (wrapInQuotes path) - | None -> None ); - ("docstrings", Some (stringifyDocstrings m.docstring)); - ( "source", - Some (stringifySource ~indentation:(indentation + 1) m.source) ); - ( "items", - Some - (m.items - |> List.map - (stringifyDocItem ~originalEnv ~indentation:(indentation + 1)) - |> array) ); - ] + `Assoc + ([ + ("id", `String m.id); + ("name", `String m.name); + ("kind", `String "module"); + ("docstrings", stringifyDocstrings m.docstring); + ("source", stringifySource m.source); + ( "items", + `List + (m.items + |> List.map (fun item -> stringifyDocItem ~originalEnv item)) ); + ] + @ (match m.deprecated with + | Some d -> [("deprecated", `String d)] + | None -> []) + @ + match m.moduletypeid with + | Some path -> [("moduletypeid", `String path)] + | None -> []) | ModuleType m -> - stringifyObject ~startOnNewline:true ~indentation - [ - ("id", Some (wrapInQuotes m.id)); - ("name", Some (wrapInQuotes m.name)); - ("kind", Some (wrapInQuotes "moduleType")); - ( "deprecated", - match m.deprecated with - | Some d -> Some (wrapInQuotes d) - | None -> None ); - ("docstrings", Some (stringifyDocstrings m.docstring)); - ( "source", - Some (stringifySource ~indentation:(indentation + 1) m.source) ); - ( "items", - Some - (m.items - |> List.map - (stringifyDocItem ~originalEnv ~indentation:(indentation + 1)) - |> array) ); - ] + `Assoc + ([ + ("id", `String m.id); + ("name", `String m.name); + ("kind", `String "moduleType"); + ("docstrings", stringifyDocstrings m.docstring); + ("source", stringifySource m.source); + ( "items", + `List + (m.items + |> List.map (fun item -> stringifyDocItem ~originalEnv item)) ); + ] + @ + match m.deprecated with + | Some d -> [("deprecated", `String d)] + | None -> []) | ModuleAlias m -> - stringifyObject ~startOnNewline:true ~indentation + `Assoc [ - ("id", Some (wrapInQuotes m.id)); - ("kind", Some (wrapInQuotes "moduleAlias")); - ("name", Some (wrapInQuotes m.name)); - ("docstrings", Some (stringifyDocstrings m.docstring)); - ( "source", - Some (stringifySource ~indentation:(indentation + 1) m.source) ); - ( "items", - Some - (m.items - |> List.map - (stringifyDocItem ~originalEnv ~indentation:(indentation + 1)) - |> array) ); + ("id", `String m.id); + ("kind", `String "moduleAlias"); + ("name", `String m.name); + ("docstrings", stringifyDocstrings m.docstring); + ("source", stringifySource m.source); + ("items", `List (m.items |> List.map (stringifyDocItem ~originalEnv))); ] -and stringifyDocsForModule ?(indentation = 0) ~originalEnv (d : docsForModule) = - let open Protocol in - stringifyObject ~startOnNewline:true ~indentation - [ - ("name", Some (wrapInQuotes d.name)); - ( "deprecated", - match d.deprecated with - | Some d -> Some (wrapInQuotes d) - | None -> None ); - ("docstrings", Some (stringifyDocstrings d.docstring)); - ("source", Some (stringifySource ~indentation:(indentation + 1) d.source)); - ( "items", - Some - (d.items - |> List.map - (stringifyDocItem ~originalEnv ~indentation:(indentation + 1)) - |> array) ); - ] +and stringifyDocsForModule ~originalEnv (d : docsForModule) = + `Assoc + ([ + ("name", `String d.name); + ("docstrings", stringifyDocstrings d.docstring); + ("source", stringifySource d.source); + ( "items", + `List + (d.items |> List.map (fun item -> stringifyDocItem ~originalEnv item)) + ); + ] + @ + match d.deprecated with + | Some d -> [("deprecated", `String d)] + | None -> []) let fieldToFieldDoc (field : SharedTypes.field) : fieldDoc = { @@ -629,7 +580,9 @@ let extractDocs ~entryPointFile ~debug = } in let docs = extractDocsForModule structure in - Ok (stringifyDocsForModule ~originalEnv:env docs)) + Ok + (stringifyDocsForModule ~originalEnv:env docs + |> Yojson.Safe.pretty_to_string)) | true -> Error (Printf.sprintf @@ -666,16 +619,20 @@ let extractEmbedded ~extensionPoints ~filename = in let iterator = {Ast_iterator.default_iterator with extension} in iterator.structure iterator structure; - let open Analysis.Protocol in - !content - |> List.map (fun (loc, extensionName, contents) -> - stringifyObject - [ - ("extensionName", Some (wrapInQuotes extensionName)); - ("contents", Some (wrapInQuotes contents)); - ("loc", Some (Analysis.Utils.cmtLocToRange loc |> stringifyRange)); - ]) - |> List.rev |> array + let result = + !content + |> List.map (fun (loc, extensionName, contents) -> + `Assoc + [ + ("extensionName", `String extensionName); + ("contents", `String contents); + ( "loc", + Analysis.Utils.cmtLocToRange loc |> Lsp.Types.Range.yojson_of_t + ); + ]) + |> List.rev + in + Yojson.Safe.pretty_to_string (`List result) let readFile path = let ic = open_in path in @@ -1276,21 +1233,20 @@ module ExtractCodeblocks = struct | Ok codeBlocks -> let errors = !errors in if List.length errors > 0 then - let errors = - errors |> List.rev |> String.concat "\n" |> Protocol.wrapInQuotes - in + let errors = errors |> List.rev |> String.concat "\n" in Error errors else Ok - (codeBlocks - |> List.map (fun codeBlock -> - Protocol.stringifyObject - [ - ("id", Some (Protocol.wrapInQuotes codeBlock.id)); - ("name", Some (Protocol.wrapInQuotes codeBlock.name)); - ("code", Some (Protocol.wrapInQuotes codeBlock.code)); - ]) - |> Protocol.array) + (Yojson.Safe.pretty_to_string ~std:true + (`List + (codeBlocks + |> List.map (fun codeBlock -> + `Assoc + [ + ("id", `String codeBlock.id); + ("name", `String codeBlock.name); + ("code", `String codeBlock.code); + ])))) end module Migrate = Migrate From f390dfcb2c4b63366d4dc998e47ded8bad5b6455 Mon Sep 17 00:00:00 2001 From: Pedro Castro Date: Sat, 30 May 2026 21:11:59 -0300 Subject: [PATCH 04/31] Update lsp and yojson dependencies (#8449) * Update lsp and yojson dependencies Relax LSP-related dependencies to allow 1.23.0+ and update yojson pins to 3.0.0 across dune-project and opam package files. Also trims trailing whitespace in the CI workflow. * Update dune-project --- analysis.opam | 4 ++-- dune-project | 10 +++++----- rescript.opam | 4 ++-- tools.opam | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/analysis.opam b/analysis.opam index 209189df6e4..db0433c0aa3 100644 --- a/analysis.opam +++ b/analysis.opam @@ -11,8 +11,8 @@ depends: [ "ocaml" {>= "5.0.0"} "cppo" {= "1.8.0"} "odoc" {with-doc} - "lsp" {= "1.22.0"} - "yojson" {= "2.2.2"} + "lsp" {>= "1.23.0"} + "yojson" {= "3.0.0"} ] build: [ ["dune" "subst"] {dev} diff --git a/dune-project b/dune-project index 7ea218fc1bd..112c97df1b6 100644 --- a/dune-project +++ b/dune-project @@ -28,12 +28,12 @@ (ocamlformat (and :with-test (= 0.27.0))) (yojson - (and :with-test (= 2.2.2))) + (and :with-test (= 3.0.0))) (ounit2 (and :with-test (= 2.2.7))) (odoc :with-doc) (ocaml-lsp-server - (and :with-dev-setup (= 1.22.0))) + (and :with-dev-setup (>= 1.23.0))) (bisect_ppx (and :with-dev-setup (>= 2.8.0))) (js_of_ocaml @@ -57,9 +57,9 @@ (= 1.8.0)) (odoc :with-doc) (lsp - (= 1.22.0)) + (>= 1.23.0)) (yojson - (= 2.2.2)))) + (= 3.0.0)))) (package (name tools) @@ -73,5 +73,5 @@ (= 1.8.0)) analysis (yojson - (= 2.2.2)) + (= 3.0.0)) (odoc :with-doc))) diff --git a/rescript.opam b/rescript.opam index 4f2a69ced75..61b36bafb86 100644 --- a/rescript.opam +++ b/rescript.opam @@ -12,10 +12,10 @@ depends: [ "cppo" {= "1.8.0"} "flow_parser" {= "0.267.0"} "ocamlformat" {with-test & = "0.27.0"} - "yojson" {with-test & = "2.2.2"} + "yojson" {with-test & = "3.0.0"} "ounit2" {with-test & = "2.2.7"} "odoc" {with-doc} - "ocaml-lsp-server" {with-dev-setup & = "1.22.0"} + "ocaml-lsp-server" {with-dev-setup & >= "1.23.0"} "bisect_ppx" {with-dev-setup & >= "2.8.0"} "js_of_ocaml" {os != "win32" & with-test & = "6.0.1"} "wasm_of_ocaml-compiler" {os != "win32" & with-test & = "6.0.1"} diff --git a/tools.opam b/tools.opam index e70c57f28f6..202ba62686f 100644 --- a/tools.opam +++ b/tools.opam @@ -12,7 +12,7 @@ depends: [ "cmarkit" {>= "0.3.0"} "cppo" {= "1.8.0"} "analysis" - "yojson" {= "2.2.2"} + "yojson" {= "3.0.0"} "odoc" {with-doc} ] build: [ From f0636e01ecd296445f60d4aa64ee9ac822168455 Mon Sep 17 00:00:00 2001 From: Florian Hammerschmidt Date: Sun, 31 May 2026 14:05:39 +0200 Subject: [PATCH 05/31] analysis: fix namespace parsing after Yojson migration (#8454) * analysis: fix namespace parsing after Yojson migration * Changelog * Move yojson helpers to reanalyze and reuse them there * Some more tests --- CHANGELOG.md | 1 + analysis/reanalyze/src/Paths.ml | 11 +-- analysis/reanalyze/src/Reanalyze.ml | 1 + analysis/reanalyze/src/YojsonHelpers.ml | 19 ++++++ analysis/src/FindFiles.ml | 44 ++++++------ analysis/src/Packages.ml | 2 +- analysis/src/YojsonHelpers.ml | 10 +-- .../ounit_analysis_config_tests.ml | 67 +++++++++++++++++++ tests/ounit_tests/ounit_tests_main.ml | 1 + 9 files changed, 118 insertions(+), 38 deletions(-) create mode 100644 analysis/reanalyze/src/YojsonHelpers.ml create mode 100644 tests/ounit_tests/ounit_analysis_config_tests.ml diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e17898f54e..b9f45bdab89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ - Rewatch: use a single timestamp per compile pass. https://github.com/rescript-lang/rescript/pull/8428 - Fix rewatch warning replay after early compile errors. https://github.com/rescript-lang/rescript/pull/8408 - Fix formatting of trailing comments before `=` in let bindings. https://github.com/rescript-lang/rescript/pull/8444 +- Fix analysis namespace parsing after the Yojson migration. https://github.com/rescript-lang/rescript/pull/8454 #### :memo: Documentation diff --git a/analysis/reanalyze/src/Paths.ml b/analysis/reanalyze/src/Paths.ml index f47282ee089..fe588385b67 100644 --- a/analysis/reanalyze/src/Paths.ml +++ b/analysis/reanalyze/src/Paths.ml @@ -154,19 +154,14 @@ let readCmtScan () = get key json |> Option.to_list |> List.filter_map fn in let read_entry (json : Yojson.Safe.t) = - let build_root = - json |> get_fn "build_root" Yojson.Safe.Util.to_string_option - in + let build_root = json |> get_fn "build_root" YojsonHelpers.string_opt in let scan_dirs = match json |> get "scan_dirs" with - | Some (`List arr) -> - arr |> List.filter_map Yojson.Safe.Util.to_string_option + | Some (`List arr) -> arr |> List.filter_map YojsonHelpers.string_opt | _ -> [] in let also_scan_build_root = - match - json |> get_fn "also_scan_build_root" Yojson.Safe.Util.to_bool_option - with + match json |> get_fn "also_scan_build_root" YojsonHelpers.bool_opt with | [b] -> b | _ -> false in diff --git a/analysis/reanalyze/src/Reanalyze.ml b/analysis/reanalyze/src/Reanalyze.ml index 64db1247b0d..68aa938993b 100644 --- a/analysis/reanalyze/src/Reanalyze.ml +++ b/analysis/reanalyze/src/Reanalyze.ml @@ -776,3 +776,4 @@ module ReanalyzeServer = ReanalyzeServer module RunConfig = RunConfig module DceConfig = DceConfig module Log_ = Log_ +module YojsonHelpers = YojsonHelpers diff --git a/analysis/reanalyze/src/YojsonHelpers.ml b/analysis/reanalyze/src/YojsonHelpers.ml new file mode 100644 index 00000000000..a1d1fbd70d6 --- /dev/null +++ b/analysis/reanalyze/src/YojsonHelpers.ml @@ -0,0 +1,19 @@ +let get key (t : Yojson.Safe.t) : Yojson.Safe.t option = + match t with + | `Assoc items -> List.assoc_opt key items + | _ -> None + +let bool_opt = function + | `Bool value -> Some value + | _ -> None + +let string_opt = function + | `String value -> Some value + | _ -> None + +let to_list_opt = function + | `List items -> Some items + | _ -> None + +let from_string_opt text = + try Some (Yojson.Safe.from_string text) with _ -> None diff --git a/analysis/src/FindFiles.ml b/analysis/src/FindFiles.ml index 9457640f958..07a5a35eda8 100644 --- a/analysis/src/FindFiles.ml +++ b/analysis/src/FindFiles.ml @@ -11,14 +11,14 @@ let getSourceDirectories ~includeDev ~baseDir config = | `Assoc _ -> ( let dir = item |> YojsonHelpers.get "dir" - |> bind Yojson.Safe.Util.to_string_option + |> bind YojsonHelpers.string_opt |> Option.value ~default:"Must specify directory" in let typ = if includeDev then "lib" else item |> YojsonHelpers.get "type" - |> bind Yojson.Safe.Util.to_string_option + |> bind YojsonHelpers.string_opt |> Option.value ~default:"lib" in @@ -94,22 +94,27 @@ let nameSpaceToName n = |> List.map String.capitalize_ascii |> String.concat "" +type namespace_config = + | NamespaceDisabled + | NamespaceFromPackageName + | NamespaceExplicit of string + +let getNamespaceConfig config = + match config |> YojsonHelpers.get "namespace" with + | None | Some (`Bool false) -> NamespaceDisabled + | Some (`Bool true) -> NamespaceFromPackageName + | Some (`String namespace) -> NamespaceExplicit namespace + | Some _ -> NamespaceDisabled + let getNamespace config = - let ns = config |> YojsonHelpers.get "namespace" in - let fromString = ns |> bind Yojson.Safe.Util.to_string_option in - let isNamespaced = - ns - |> bind Yojson.Safe.Util.to_bool_option - |> Option.value ~default:(fromString |> Option.is_some) - in - let either x y = if x = None then y else x in - if isNamespaced then + match getNamespaceConfig config with + | NamespaceDisabled -> None + | NamespaceExplicit namespace -> Some (nameSpaceToName namespace) + | NamespaceFromPackageName -> let fromName = - config |> YojsonHelpers.get "name" - |> bind Yojson.Safe.Util.to_string_option + config |> YojsonHelpers.get "name" |> bind YojsonHelpers.string_opt in - either fromString fromName |> Option.map nameSpaceToName - else None + fromName |> Option.map nameSpaceToName module StringSet = Set.Make (String) @@ -122,9 +127,8 @@ let getPublic config = | None -> None | Some public -> Some - (public - |> List.filter_map Yojson.Safe.Util.to_string_option - |> StringSet.of_list)) + (public |> List.filter_map YojsonHelpers.string_opt |> StringSet.of_list) + ) let collectFiles directory = let allFiles = Files.readDirectory directory in @@ -262,7 +266,7 @@ let findDependencyFiles base config = with | None, None -> [] | Some deps, None | _, Some deps -> - deps |> List.filter_map Yojson.Safe.Util.to_string_option + deps |> List.filter_map YojsonHelpers.string_opt in let devDeps = match @@ -275,7 +279,7 @@ let findDependencyFiles base config = with | None, None -> [] | Some devDeps, None | _, Some devDeps -> - devDeps |> List.filter_map (fun x -> Some (Yojson.Safe.Util.to_string x)) + devDeps |> List.filter_map YojsonHelpers.string_opt in let deps = deps @ devDeps in Log.log ("Dependencies: " ^ String.concat " " deps); diff --git a/analysis/src/Packages.ml b/analysis/src/Packages.ml index 5edab49e2cf..d07bfa17850 100644 --- a/analysis/src/Packages.ml +++ b/analysis/src/Packages.ml @@ -151,7 +151,7 @@ let newBsPackage ~rootPath = let opens_from_compiler_flags = List.fold_left (fun opens item -> - match item |> Yojson.Safe.Util.to_string_option with + match item |> YojsonHelpers.string_opt with | None -> opens | Some s -> ( let parts = String.split_on_char ' ' s in diff --git a/analysis/src/YojsonHelpers.ml b/analysis/src/YojsonHelpers.ml index 0cae226f44b..bca4f707ebe 100644 --- a/analysis/src/YojsonHelpers.ml +++ b/analysis/src/YojsonHelpers.ml @@ -1,9 +1 @@ -let get key (t : Yojson.Safe.t) : Yojson.Safe.t option = - match t with - | `Assoc items -> List.assoc_opt key items - | _ -> None - -let to_list_opt json = try Some (Yojson.Safe.Util.to_list json) with _ -> None - -let from_string_opt text = - try Some (Yojson.Safe.from_string text) with _ -> None +include Reanalyze.YojsonHelpers diff --git a/tests/ounit_tests/ounit_analysis_config_tests.ml b/tests/ounit_tests/ounit_analysis_config_tests.ml new file mode 100644 index 00000000000..57cc3dbdd2a --- /dev/null +++ b/tests/ounit_tests/ounit_analysis_config_tests.ml @@ -0,0 +1,67 @@ +let ( >:: ), ( >::: ) = OUnit.(( >:: ), ( >::: )) + +let json raw = + match Yojson.Safe.from_string raw with + | json -> json + | exception Yojson.Json_error message -> failwith message + +let assert_namespace ~expected raw = + OUnit.assert_equal + ~printer:(function + | Some s -> "Some " ^ s + | None -> "None") + expected + (Analysis.FindFiles.getNamespace (json raw)) + +let assert_string_opt ~expected actual = + OUnit.assert_equal + ~printer:(function + | Some s -> "Some " ^ s + | None -> "None") + expected actual + +let assert_bool_opt ~expected actual = + OUnit.assert_equal + ~printer:(function + | Some b -> "Some " ^ string_of_bool b + | None -> "None") + expected actual + +let suites = + __FILE__ + >::: [ + ( "yojson helpers do not raise on type mismatch" >:: fun _ -> + assert_string_opt ~expected:(Some "value") + (Analysis.YojsonHelpers.string_opt (`String "value")); + assert_string_opt ~expected:None + (Analysis.YojsonHelpers.string_opt (`Bool true)); + assert_bool_opt ~expected:(Some true) + (Analysis.YojsonHelpers.bool_opt (`Bool true)); + assert_bool_opt ~expected:None + (Analysis.YojsonHelpers.bool_opt (`String "true")); + OUnit.assert_equal ~printer:string_of_int 1 + (Analysis.YojsonHelpers.to_list_opt (`List [`Null]) + |> Option.fold ~none:0 ~some:List.length); + OUnit.assert_equal ~printer:string_of_int 0 + (Analysis.YojsonHelpers.to_list_opt (`String "not a list") + |> Option.fold ~none:0 ~some:List.length); + OUnit.assert_bool "valid JSON parses" + (Analysis.YojsonHelpers.from_string_opt {|{"ok": true}|} + |> Option.is_some); + OUnit.assert_bool "invalid JSON is ignored" + (Analysis.YojsonHelpers.from_string_opt {|{|} |> Option.is_none) ); + ( "absent namespace is disabled" >:: fun _ -> + assert_namespace ~expected:None {|{"name": "@tests/pkg"}|} ); + ( "false namespace is disabled" >:: fun _ -> + assert_namespace ~expected:None + {|{"name": "@tests/pkg", "namespace": false}|} ); + ( "non-string non-bool namespace is disabled" >:: fun _ -> + assert_namespace ~expected:None + {|{"name": "@tests/pkg", "namespace": 1}|} ); + ( "true namespace uses package name" >:: fun _ -> + assert_namespace ~expected:(Some "TestsNamespacedReferences") + {|{"name": "@tests/namespaced-references", "namespace": true}|} ); + ( "string namespace uses explicit value" >:: fun _ -> + assert_namespace ~expected:(Some "MyNamespace") + {|{"name": "@tests/pkg", "namespace": "my-namespace"}|} ); + ] diff --git a/tests/ounit_tests/ounit_tests_main.ml b/tests/ounit_tests/ounit_tests_main.ml index 2be7b9d1674..05d374732b6 100644 --- a/tests/ounit_tests/ounit_tests_main.ml +++ b/tests/ounit_tests/ounit_tests_main.ml @@ -19,6 +19,7 @@ let suites = Ounit_util_tests.suites; Ounit_js_analyzer_tests.suites; Ounit_jsx_loc_tests.suites; + Ounit_analysis_config_tests.suites; ] let _ = OUnit.run_test_tt_main suites From 178f3520938af973247ff1a0ce7a953131005ba1 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 22 May 2026 16:06:55 +0000 Subject: [PATCH 06/31] Remove dead Ctype diagnostic relays Drop Ctype.Tags and Ctype.Recursive_abbrev because both exceptions were declared and caught but had no raise site anywhere under compiler/. This also removes the unreachable Typetexp.Variant_tags and Typecore.Recursive_local_constraint wrappers that only existed to report those exceptions. Validation: rg found no remaining references to the removed constructors, and make completed successfully. --- compiler/ml/ctype.ml | 21 --------------------- compiler/ml/ctype.mli | 3 --- compiler/ml/typecore.ml | 18 +----------------- compiler/ml/typecore.mli | 1 - compiler/ml/typetexp.ml | 6 ------ compiler/ml/typetexp.mli | 1 - 6 files changed, 1 insertion(+), 49 deletions(-) diff --git a/compiler/ml/ctype.ml b/compiler/ml/ctype.ml index e15adf31b43..1291da7880c 100644 --- a/compiler/ml/ctype.ml +++ b/compiler/ml/ctype.ml @@ -57,19 +57,6 @@ type type_pairs = (type_expr * type_expr) list exception Unify of type_pairs -exception Tags of label * label - -let () = - Location.register_error_of_exn (function - | Tags (l, l') -> - Some - Location.( - errorf ~loc:(in_file !input_name) - "In this program,@ variant constructors@ #%s and #%s@ have the \ - same hash value.@ Change one of them." - l l') - | _ -> None) - type subtype_context = | Generic of {errorCode: string} | Coercion_target_variant_not_unboxed of { @@ -107,11 +94,6 @@ exception Cannot_expand exception Cannot_apply -exception Recursive_abbrev - -(* GADT: recursive abbrevs can appear as a result of local constraints *) -exception Unification_recursive_abbrev of type_pairs - (**** Type level management ****) let current_level = ref 0 @@ -2731,9 +2713,6 @@ let unify env ty1 ty2 = | Unify trace -> undo_compress snap; raise (Unify (expand_trace !env trace)) - | Recursive_abbrev -> - undo_compress snap; - raise (Unification_recursive_abbrev (expand_trace !env [(ty1, ty2)])) let unify_gadt ~newtype_level:lev (env : Env.t ref) ty1 ty2 = try diff --git a/compiler/ml/ctype.mli b/compiler/ml/ctype.mli index 6785374ac92..b671730402a 100644 --- a/compiler/ml/ctype.mli +++ b/compiler/ml/ctype.mli @@ -54,12 +54,9 @@ type subtype_context = type type_pairs = (type_expr * type_expr) list exception Unify of type_pairs -exception Tags of label * label exception Subtype of type_pairs * type_pairs * subtype_context option exception Cannot_expand exception Cannot_apply -exception Recursive_abbrev -exception Unification_recursive_abbrev of type_pairs val init_def : int -> unit (* Set the initial variable level *) diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index 4f0b3be38e4..d6b42771b96 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -69,7 +69,6 @@ type error = | Modules_not_allowed | Cannot_infer_signature | Not_a_packed_module of type_expr - | Recursive_local_constraint of (type_expr * type_expr) list | Unexpected_existential | Unqualified_gadt_pattern of Path.t * string | Invalid_interval @@ -338,15 +337,11 @@ let check_optional_attr env ld optional loc = let unify_pat_types loc env ty ty' = try unify env ty ty' with | Unify trace -> raise (Error (loc, env, Pattern_type_clash trace)) - | Tags (l1, l2) -> - raise (Typetexp.Error (loc, env, Typetexp.Variant_tags (l1, l2))) (* unification inside type_exp and type_expect *) let unify_exp_types ~context loc env ty expected_ty = try unify env ty expected_ty with | Unify trace -> raise (Error (loc, env, Expr_type_clash {trace; context})) - | Tags (l1, l2) -> - raise (Typetexp.Error (loc, env, Typetexp.Variant_tags (l1, l2))) (* level at which to create the local type declarations *) let newtype_level = ref None @@ -363,10 +358,6 @@ let unify_pat_types_gadt loc env ty ty' = in try unify_gadt ~newtype_level env ty ty' with | Unify trace -> raise (Error (loc, !env, Pattern_type_clash trace)) - | Tags (l1, l2) -> - raise (Typetexp.Error (loc, !env, Typetexp.Variant_tags (l1, l2))) - | Unification_recursive_abbrev trace -> - raise (Error (loc, !env, Recursive_local_constraint trace)) (* Creating new conjunctive types is not allowed when typing patterns *) @@ -4520,8 +4511,7 @@ let type_expression ~context env sexp = (match sexp.pexp_desc with | Pexp_apply _ -> Some (return_type, FunctionCall) | _ -> Some (return_type, Other))) - | Tags _ -> - Location.prerr_warning sexp.pexp_loc (Bs_toplevel_expression_unit None)); + ); end_def (); if not (is_nonexpansive exp) then generalize_expansive env exp.exp_type; generalize exp.exp_type; @@ -4801,12 +4791,6 @@ let report_error env loc ppf error = | Not_a_packed_module ty -> fprintf ppf "This expression is packed module, but the expected type is@ %a" type_expr ty - | Recursive_local_constraint trace -> - (* modified *) - super_report_unification_error ppf env trace - (function - | ppf -> fprintf ppf "Recursive local constraint when unifying") - (function ppf -> fprintf ppf "with") | Unexpected_existential -> fprintf ppf "Unexpected existential" | Unqualified_gadt_pattern (tpath, name) -> fprintf ppf "@[The GADT constructor %s of type %a@ %s.@]" name Printtyp.path diff --git a/compiler/ml/typecore.mli b/compiler/ml/typecore.mli index 2a57356e73b..de89a516b76 100644 --- a/compiler/ml/typecore.mli +++ b/compiler/ml/typecore.mli @@ -102,7 +102,6 @@ type error = | Modules_not_allowed | Cannot_infer_signature | Not_a_packed_module of type_expr - | Recursive_local_constraint of (type_expr * type_expr) list | Unexpected_existential | Unqualified_gadt_pattern of Path.t * string | Invalid_interval diff --git a/compiler/ml/typetexp.ml b/compiler/ml/typetexp.ml index 9867baac11a..2e735329db8 100644 --- a/compiler/ml/typetexp.ml +++ b/compiler/ml/typetexp.ml @@ -36,7 +36,6 @@ type error = | Present_has_no_type of string | Constructor_mismatch of type_expr * type_expr | Not_a_variant of type_expr - | Variant_tags of string * string | Invalid_variable_name of string | Cannot_quantify of string * type_expr | Multiple_constraints_on_type of Longident.t @@ -824,11 +823,6 @@ let report_error env ppf = function (* PR#7012: help the user that wrote 'Foo instead of `Foo *) Misc.did_you_mean ppf (fun () -> ["`" ^ s]) | _ -> ()) - | Variant_tags (lab1, lab2) -> - fprintf ppf "@[Variant tags %s@ and %s have the same hash value.@ %s@]" - (!Printtyp.print_res_poly_identifier lab1) - (!Printtyp.print_res_poly_identifier lab2) - "Change one of them." | Invalid_variable_name name -> fprintf ppf "The type variable name %s is not allowed in programs" name | Cannot_quantify (name, v) -> diff --git a/compiler/ml/typetexp.mli b/compiler/ml/typetexp.mli index 8f40096392f..cff8910482a 100644 --- a/compiler/ml/typetexp.mli +++ b/compiler/ml/typetexp.mli @@ -45,7 +45,6 @@ type error = | Present_has_no_type of string | Constructor_mismatch of type_expr * type_expr | Not_a_variant of type_expr - | Variant_tags of string * string | Invalid_variable_name of string | Cannot_quantify of string * type_expr | Multiple_constraints_on_type of Longident.t From 2671c120324533c01cdfc204f3908b9e5ca0e76e Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 22 May 2026 16:07:56 +0000 Subject: [PATCH 07/31] Remove unused bs_syntaxerr conflict variant Drop Conflict_bs_bs_this_bs_meth because the constructor was only declared and printed; rg found no Bs_syntaxerr.err call or other construction site for it under compiler/. Validation: rg found no remaining references. The full rebuild is delayed by an unrelated coverage Dune process that currently holds _build/.lock. --- compiler/frontend/bs_syntaxerr.ml | 3 --- compiler/frontend/bs_syntaxerr.mli | 1 - 2 files changed, 4 deletions(-) diff --git a/compiler/frontend/bs_syntaxerr.ml b/compiler/frontend/bs_syntaxerr.ml index 668853bdf84..9cadcb58971 100644 --- a/compiler/frontend/bs_syntaxerr.ml +++ b/compiler/frontend/bs_syntaxerr.ml @@ -26,7 +26,6 @@ type untagged_variant = OnlyOneUnknown | AtMostOneObject | AtMostOneArray type error = | Unsupported_predicates - | Conflict_bs_bs_this_bs_meth | Duplicated_bs_deriving | Conflict_attributes | Expect_int_literal @@ -65,8 +64,6 @@ let pp_error fmt err = | Not_supported_directive_in_bs_return -> "Not supported return directive" | Illegal_attribute -> "Illegal attributes" | Unsupported_predicates -> "unsupported predicates" - | Conflict_bs_bs_this_bs_meth -> - "%@this and %@bs can not be applied at the same time" | Duplicated_bs_deriving -> "duplicate @deriving attribute" | Conflict_attributes -> "conflicting attributes " | Expect_string_literal -> "expect string literal " diff --git a/compiler/frontend/bs_syntaxerr.mli b/compiler/frontend/bs_syntaxerr.mli index ecdaaaa0e6c..9c6a9ff9b5d 100644 --- a/compiler/frontend/bs_syntaxerr.mli +++ b/compiler/frontend/bs_syntaxerr.mli @@ -26,7 +26,6 @@ type untagged_variant = OnlyOneUnknown | AtMostOneObject | AtMostOneArray type error = | Unsupported_predicates - | Conflict_bs_bs_this_bs_meth | Duplicated_bs_deriving | Conflict_attributes | Expect_int_literal From ffabe811026b7ee75e474a9657f5915f21485d5a Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 22 May 2026 16:09:08 +0000 Subject: [PATCH 08/31] Remove unreachable typecore label diagnostics Drop Label_mismatch, Abstract_wrong_label, and Incoherent_label_order. Label_mismatch's pattern path was catching Ctype.Unify around unify_pat_types even though that helper already translates Unify to Pattern_type_clash. The expression path now uses the existing Expr_type_clash machinery if the defensive invariant ever fails. Abstract_wrong_label and Incoherent_label_order were defensive branches behind modern function and labeled-argument normalization; any fallback now uses the existing Too_many_arguments or Apply_wrong_label diagnostics. Validation: rg found no remaining references. A full rebuild will run once the unrelated coverage Dune process releases _build/.lock. --- compiler/ml/typecore.ml | 43 ++++++---------------------------------- compiler/ml/typecore.mli | 3 --- 2 files changed, 6 insertions(+), 40 deletions(-) diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index d6b42771b96..dded160fc4c 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -32,7 +32,6 @@ type error = expected: int; provided: int; } - | Label_mismatch of Longident.t * (type_expr * type_expr) list | Pattern_type_clash of (type_expr * type_expr) list | Or_pattern_type_clash of Ident.t * (type_expr * type_expr) list | Multiply_bound_variable of string @@ -61,10 +60,8 @@ type error = | Not_subtype of Ctype.type_pairs * Ctype.type_pairs * Ctype.subtype_context option | Too_many_arguments of bool * type_expr - | Abstract_wrong_label of arg_label * type_expr | Scoping_let_module of string * type_expr | Not_a_variant_type of Longident.t - | Incoherent_label_order | Less_general of string * (type_expr * type_expr) list | Modules_not_allowed | Cannot_infer_signature @@ -1528,10 +1525,7 @@ and type_pat_aux ~constrs ~labels ~no_existentials ~mode ~explode ~env sp begin_def (); let vars, ty_arg, ty_res = instance_label false label in if vars = [] then end_def (); - (try unify_pat_types loc !env ty_res record_ty - with Unify trace -> - raise - (Error (label_lid.loc, !env, Label_mismatch (label_lid.txt, trace)))); + unify_pat_types loc !env ty_res record_ty; type_pat sarg ty_arg (fun arg -> if vars <> [] then ( end_def (); @@ -3488,12 +3482,8 @@ and type_function ?in_function ~arity ~async loc attrs env ty_expected_ l let ty_arg, ty_res = try filter_arrow ~env ~arity (instance env ty_expected) l with Unify _ -> ( - match expand_head env ty_expected with - | {desc = Tarrow _} as ty -> - raise (Error (loc, env, Abstract_wrong_label (l, ty))) - | _ -> - raise - (Error (loc_fun, env, Too_many_arguments (in_function <> None, ty_fun)))) + raise + (Error (loc_fun, env, Too_many_arguments (in_function <> None, ty_fun)))) in let ty_arg = if is_optional l then ( @@ -3575,9 +3565,8 @@ and type_label_exp ~call_context create env loc ty_expected (* Generalize label information *) generalize_structure ty_arg; generalize_structure ty_res); - (try unify env (instance_def ty_res) (instance env ty_expected) - with Unify trace -> - raise (Error (lid.loc, env, Label_mismatch (lid.txt, trace)))); + unify_exp_types ~context:None lid.loc env (instance_def ty_res) + (instance env ty_expected); (* Instantiate so that we can generalize internal nodes *) let ty_arg = instance_def ty_arg in if separate then ( @@ -3879,10 +3868,9 @@ and type_application ~context total_app env funct (sargs : sargs) : raise (Error (sarg1.pexp_loc, env, Apply_wrong_label (l1, funct.exp_type))) - else if not (has_label l1 ty_fun) then + else raise (Error (sarg1.pexp_loc, env, Apply_wrong_label (l1, ty_res))) - else raise (Error (funct.exp_loc, env, Incoherent_label_order)) | _ -> raise (Error @@ -4595,13 +4583,6 @@ let report_error env loc ppf error = (if expected == 1 then "argument" else "arguments") (if provided < expected then " only" else "") provided - | Label_mismatch (lid, trace) -> - (* modified *) - super_report_unification_error ppf env trace - (function - | ppf -> - fprintf ppf "The record field %a@ belongs to the type" longident lid) - (function ppf -> fprintf ppf "but is mixed here with fields of type") | Pattern_type_clash trace -> (* modified *) super_report_unification_error ppf env trace @@ -4756,14 +4737,6 @@ let report_error env loc ppf error = else ( fprintf ppf "@[This expression should not be a function,@ "; fprintf ppf "the expected type is@ %a@]" type_expr ty) - | Abstract_wrong_label (l, ty) -> - let label_mark = function - | Nolabel -> "but its first argument is not labelled" - | l -> - sprintf "but its first argument is labelled %s" (prefixed_label_name l) - in - fprintf ppf "@[@[<2>This function should have type@ %a@]@,%s@]" type_expr - ty (label_mark l) | Scoping_let_module (id, ty) -> fprintf ppf "This `let module' expression has type@ %a@ " type_expr ty; fprintf ppf @@ -4775,10 +4748,6 @@ let report_error env loc ppf error = type_expr ty | Not_a_variant_type lid -> fprintf ppf "The type %a@ is not a variant type" longident lid - | Incoherent_label_order -> - fprintf ppf "This labeled function is applied to arguments@ "; - fprintf ppf "in an order different from other calls.@ "; - fprintf ppf "This is only allowed when the real type is known." | Less_general (kind, trace) -> (* modified *) super_report_unification_error ppf env trace diff --git a/compiler/ml/typecore.mli b/compiler/ml/typecore.mli index de89a516b76..337c654bdab 100644 --- a/compiler/ml/typecore.mli +++ b/compiler/ml/typecore.mli @@ -65,7 +65,6 @@ type error = expected: int; provided: int; } - | Label_mismatch of Longident.t * (type_expr * type_expr) list | Pattern_type_clash of (type_expr * type_expr) list | Or_pattern_type_clash of Ident.t * (type_expr * type_expr) list | Multiply_bound_variable of string @@ -94,10 +93,8 @@ type error = | Not_subtype of Ctype.type_pairs * Ctype.type_pairs * Ctype.subtype_context option | Too_many_arguments of bool * type_expr - | Abstract_wrong_label of arg_label * type_expr | Scoping_let_module of string * type_expr | Not_a_variant_type of Longident.t - | Incoherent_label_order | Less_general of string * (type_expr * type_expr) list | Modules_not_allowed | Cannot_infer_signature From 1d061e8584b8a1f1303f73c2a69afad9c58b2f22 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 22 May 2026 16:09:49 +0000 Subject: [PATCH 09/31] Remove parser-blocked typecore variants Drop Invalid_interval and Invalid_for_of_pattern from Typecore.error. The ReScript parser has no source construction site for Ppat_interval, and normalize_for_of_pattern reports destructuring for...of syntax before replacing it with Ppat_any. The old typer guards now use direct Location errors only as malformed-AST fallbacks. Validation: rg found no remaining references to the removed named variants. --- compiler/ml/typecore.ml | 19 +++++++++---------- compiler/ml/typecore.mli | 2 -- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index dded160fc4c..eb164f77d04 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -68,9 +68,7 @@ type error = | Not_a_packed_module of type_expr | Unexpected_existential | Unqualified_gadt_pattern of Path.t * string - | Invalid_interval | Invalid_for_loop_index - | Invalid_for_of_pattern | No_value_clauses | Exception_pattern_below_toplevel | Inlined_record_escape @@ -1334,7 +1332,9 @@ and type_pat_aux ~constrs ~labels ~no_existentials ~mode ~explode ~env sp let p = {p with ppat_loc = loc} in type_pat ~explode:0 p expected_ty k (* TODO: record 'extra' to remember about interval *) - | Ppat_interval _ -> raise (Error (loc, !env, Invalid_interval)) + | Ppat_interval _ -> + Location.raise_errorf ~loc + "Only character intervals are supported in patterns." | Ppat_tuple spl -> assert (List.length spl >= 2); let spl_ann = List.map (fun p -> (p, newvar ())) spl in @@ -3102,7 +3102,9 @@ and type_expect_ ?deprecated_context ~context ?in_function ?(recarg = Rejected) val_kind = Val_reg; Types.val_loc = loc; } env ~check:(fun s -> Warnings.Unused_for_index s) - | _ -> raise (Error (param.ppat_loc, env, Invalid_for_of_pattern)) + | _ -> + Location.raise_errorf ~loc:param.ppat_loc + "Invalid for...of binding: only variables and _ are allowed." in let body = with_depth loop_depth (fun () -> @@ -3134,7 +3136,9 @@ and type_expect_ ?deprecated_context ~context ?in_function ?(recarg = Rejected) val_kind = Val_reg; Types.val_loc = loc; } env ~check:(fun s -> Warnings.Unused_for_index s) - | _ -> raise (Error (param.ppat_loc, env, Invalid_for_of_pattern)) + | _ -> + Location.raise_errorf ~loc:param.ppat_loc + "Invalid for...of binding: only variables and _ are allowed." in let body = with_depth loop_depth (fun () -> @@ -4764,13 +4768,8 @@ let report_error env loc ppf error = | Unqualified_gadt_pattern (tpath, name) -> fprintf ppf "@[The GADT constructor %s of type %a@ %s.@]" name Printtyp.path tpath "must be qualified in this pattern" - | Invalid_interval -> - fprintf ppf "@[Only character intervals are supported in patterns.@]" | Invalid_for_loop_index -> fprintf ppf "@[Invalid for-loop index: only variables and _ are allowed.@]" - | Invalid_for_of_pattern -> - fprintf ppf - "@[Invalid for...of binding: only variables and _ are allowed.@]" | No_value_clauses -> fprintf ppf "None of the patterns in this 'match' expression match values." | Exception_pattern_below_toplevel -> diff --git a/compiler/ml/typecore.mli b/compiler/ml/typecore.mli index 337c654bdab..cc63ed4fe72 100644 --- a/compiler/ml/typecore.mli +++ b/compiler/ml/typecore.mli @@ -101,9 +101,7 @@ type error = | Not_a_packed_module of type_expr | Unexpected_existential | Unqualified_gadt_pattern of Path.t * string - | Invalid_interval | Invalid_for_loop_index - | Invalid_for_of_pattern | No_value_clauses | Exception_pattern_below_toplevel | Inlined_record_escape From e77abe3d234de76a322f03d61a923ac05210ea93 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 22 May 2026 16:10:52 +0000 Subject: [PATCH 10/31] Remove parser-blocked typetexp variants Drop Unbound_type_constructor_2, Ill_typed_functor_application, and Apply_structure_as_functor from Typetexp.error. The first needs an inherited constructor whose body expands to a bare Tvar, which ReScript source cannot construct; the latter two only sit under Longident.Lapply, which the parser does not emit. The old guard sites now use direct Location errors as malformed-AST fallbacks. Validation: rg found no remaining references to the named variants. --- compiler/ml/typetexp.ml | 23 ++++++++++------------- compiler/ml/typetexp.mli | 3 --- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/compiler/ml/typetexp.ml b/compiler/ml/typetexp.ml index 2e735329db8..12e1a36edf9 100644 --- a/compiler/ml/typetexp.ml +++ b/compiler/ml/typetexp.ml @@ -28,7 +28,6 @@ exception Already_bound type error = | Unbound_type_variable of string | Unbound_type_constructor of Longident.t - | Unbound_type_constructor_2 of Path.t | Type_arity_mismatch of Longident.t * int * int | Type_mismatch of (type_expr * type_expr) list | Alias_type_mismatch of (type_expr * type_expr) list @@ -45,10 +44,8 @@ type error = | Unbound_label of Longident.t * type_expr option | Unbound_module of Longident.t | Unbound_modtype of Longident.t - | Ill_typed_functor_application of Longident.t | Illegal_reference_to_recursive_module | Access_functor_as_structure of Longident.t - | Apply_structure_as_functor of Longident.t | Cannot_scrape_alias of Longident.t * Path.t | Opened_object of Path.t option | Not_an_object of type_expr @@ -89,7 +86,8 @@ let rec narrow_unbound_lid_error : 'a. _ -> _ -> _ -> _ -> 'a = let fmd = Env.find_module (Env.lookup_module ~load:true flid env) env in (match Env.scrape_alias env fmd.md_type with | Mty_signature _ -> - raise (Error (loc, env, Apply_structure_as_functor flid)) + Location.raise_errorf ~loc "The module %a is a structure, not a functor" + Printtyp.longident flid | Mty_alias (_, p) -> raise (Error (loc, env, Cannot_scrape_alias (flid, p))) | _ -> ()); @@ -98,7 +96,9 @@ let rec narrow_unbound_lid_error : 'a. _ -> _ -> _ -> _ -> 'a = match Env.scrape_alias env mmd.md_type with | Mty_alias (_, p) -> raise (Error (loc, env, Cannot_scrape_alias (mlid, p))) - | _ -> raise (Error (loc, env, Ill_typed_functor_application lid)))); + | _ -> + Location.raise_errorf ~loc "Ill-typed functor application %a" + Printtyp.longident lid)); raise (Error (loc, env, make_error lid)) let find_component (lookup : ?loc:_ -> _) make_error env loc lid = @@ -471,7 +471,9 @@ and transl_type_aux env policy styp = let row = Btype.row_repr row in row.row_fields | {desc = Tvar _}, Some (p, _) -> - raise (Error (sty.ptyp_loc, env, Unbound_type_constructor_2 p)) + Location.raise_errorf ~loc:sty.ptyp_loc + "The type constructor %a is not yet completely defined" + Printtyp.path p | _ -> raise (Error (sty.ptyp_loc, env, Not_a_variant ty)) in List.iter @@ -615,7 +617,8 @@ and transl_fields env policy o fields = iter_add tf; OTinherit cty | {desc = Tvar _}, Some p -> - raise (Error (sty.ptyp_loc, env, Unbound_type_constructor_2 p)) + Location.raise_errorf ~loc:sty.ptyp_loc + "The type constructor %a is not yet completely defined" Printtyp.path p | _ -> raise (Error (sty.ptyp_loc, env, Not_an_object t))) in let object_fields = List.map add_field fields in @@ -779,8 +782,6 @@ let report_error env ppf = function Format.fprintf ppf "If you wanted to write a recursive type, don't forget the `rec` in \ `type rec`@]" - | Unbound_type_constructor_2 p -> - fprintf ppf "The type constructor@ %a@ is not yet completely defined" path p | Type_arity_mismatch (lid, expected, provided) -> if expected == 0 then fprintf ppf @@ -954,14 +955,10 @@ let report_error env ppf = function | Unbound_modtype lid -> fprintf ppf "Unbound module type %a" longident lid; spellcheck ppf fold_modtypes env lid - | Ill_typed_functor_application lid -> - fprintf ppf "Ill-typed functor application %a" longident lid | Illegal_reference_to_recursive_module -> fprintf ppf "Illegal recursive module reference" | Access_functor_as_structure lid -> fprintf ppf "The module %a is a functor, not a structure" longident lid - | Apply_structure_as_functor lid -> - fprintf ppf "The module %a is a structure, not a functor" longident lid | Cannot_scrape_alias (lid, p) -> fprintf ppf "The module %a is an alias for module %a, which is missing" longident lid path p diff --git a/compiler/ml/typetexp.mli b/compiler/ml/typetexp.mli index cff8910482a..565535cb093 100644 --- a/compiler/ml/typetexp.mli +++ b/compiler/ml/typetexp.mli @@ -37,7 +37,6 @@ exception Already_bound type error = | Unbound_type_variable of string | Unbound_type_constructor of Longident.t - | Unbound_type_constructor_2 of Path.t | Type_arity_mismatch of Longident.t * int * int | Type_mismatch of (type_expr * type_expr) list | Alias_type_mismatch of (type_expr * type_expr) list @@ -54,10 +53,8 @@ type error = | Unbound_label of Longident.t * type_expr option | Unbound_module of Longident.t | Unbound_modtype of Longident.t - | Ill_typed_functor_application of Longident.t | Illegal_reference_to_recursive_module | Access_functor_as_structure of Longident.t - | Apply_structure_as_functor of Longident.t | Cannot_scrape_alias of Longident.t * Path.t | Opened_object of Path.t option | Not_an_object of type_expr From 6f4508d1469178a81c69b0f3a2f2a57dbd098ce5 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 22 May 2026 16:12:00 +0000 Subject: [PATCH 11/31] Remove unreachable typedecl variants Drop Type_clash, Parameters_differ, Null_arity_external, Rebind_wrong_type, Bad_fixed_type, Varying_anonymous, and Val_in_structure from Typedecl.error. These guarded paths are rejected or normalized before the named diagnostics can fire in modern ReScript: recursive aliases are caught earlier, external declarations are encoded or rejected earlier, extension rebind result types unify by construction, fixed rows preserve their open row shape, anonymous type parameters are not parsed, and structure val declarations with empty prims do not reach the typer from source. The old guard sites now use direct Location errors as malformed-AST fallbacks. Validation: rg found no remaining references to the named variants. --- compiler/ml/typedecl.ml | 67 +++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 43 deletions(-) diff --git a/compiler/ml/typedecl.ml b/compiler/ml/typedecl.ml index 0f44d4595f4..39eef5fed4f 100644 --- a/compiler/ml/typedecl.ml +++ b/compiler/ml/typedecl.ml @@ -34,22 +34,15 @@ type error = | Definition_mismatch of type_expr * Includecore.type_mismatch list | Constraint_failed of type_expr * type_expr | Inconsistent_constraint of Env.t * (type_expr * type_expr) list - | Type_clash of Env.t * (type_expr * type_expr) list - | Parameters_differ of Path.t * type_expr * type_expr - | Null_arity_external | Unbound_type_var of type_expr * type_declaration | Cannot_extend_private_type of Path.t | Not_extensible_type of Path.t | Extension_mismatch of Path.t * Includecore.type_mismatch list - | Rebind_wrong_type of Longident.t * Env.t * (type_expr * type_expr) list | Rebind_mismatch of Longident.t * Path.t * Path.t | Rebind_private of Longident.t | Bad_variance of int * (bool * bool * bool) * (bool * bool * bool) | Unavailable_type_constructor of Path.t - | Bad_fixed_type of string | Unbound_type_var_ext of type_expr * extension_constructor - | Varying_anonymous - | Val_in_structure | Invalid_attribute of string | Bad_immediate_attribute | Bad_unboxed_attribute of string @@ -122,7 +115,9 @@ let update_type temp_env env id loc = | Some ty -> ( let params = List.map (fun _ -> Ctype.newvar ()) decl.type_params in try Ctype.unify env (Ctype.newconstr path params) ty - with Ctype.Unify trace -> raise (Error (loc, Type_clash (env, trace)))) + with Ctype.Unify _ -> + Location.raise_errorf ~loc + "This type constructor expands to an incompatible type.") (* We use the Ctype.expand_head_opt version of expand_head to get access to the manifest type of private abbreviations. *) @@ -187,10 +182,12 @@ let set_fixed_row env loc p decl = tm.desc <- Tvariant {row with row_fixed = true}; if Btype.static_row row then Btype.newgenty Tnil else row.row_more | Tobject (ty, _) -> snd (Ctype.flatten_fields ty) - | _ -> raise (Error (loc, Bad_fixed_type "is not an object or variant")) + | _ -> + Location.raise_errorf ~loc + "This fixed type is not an object or variant" in if not (Btype.is_Tvar rv) then - raise (Error (loc, Bad_fixed_type "has no row variable")); + Location.raise_errorf ~loc "This fixed type has no row variable"; rv.desc <- Tconstr (p, decl.type_params, ref Mnil) (* Translate one type declaration *) @@ -982,11 +979,9 @@ let check_recursion env loc path decl to_check = | Tconstr (path', args', _) -> (if Path.same path path' then ( if not (Ctype.equal env false args args') then - raise - (Error - ( loc, - Parameters_differ (cpath, ty, Ctype.newconstr path args) - ))) + Location.raise_errorf ~loc + "In the definition of %s, recursive type parameters differ." + (Path.name cpath)) else if (* Attempt to expand a type abbreviation if: 1- [to_check path'] holds @@ -1260,7 +1255,9 @@ let compute_variance_gadt env check ((required, loc) as rloc) decl | fv :: fv2 -> (* fv1 @ fv2 = free_variables of other parameters *) if (c || n) && constrained (fv1 @ fv2) ty then - raise (Error (loc, Varying_anonymous)); + Location.raise_errorf ~loc + "In this GADT definition, the variance of some parameter \ + cannot be checked."; (fv :: fv1, fv2)) ([], fvl) tyl required in @@ -1649,8 +1646,11 @@ let transl_extension_constructor env type_path type_params typext_params priv else (Ctype.newconstr type_path typext_params, None) in (try Ctype.unify env cstr_res res - with Ctype.Unify trace -> - raise (Error (lid.loc, Rebind_wrong_type (lid.txt, env, trace)))); + with Ctype.Unify _ -> + Location.raise_errorf ~loc:lid.loc + "The constructor %a has a type that is incompatible with this \ + extension" + Printtyp.longident lid.txt); (* Remove "_" names from parameters used in the constructor *) (if not cdescr.cstr_generalized then let vars = Ctype.free_variables (Btype.newgenty (Ttuple args)) in @@ -1884,7 +1884,9 @@ let transl_value_decl env loc valdecl = Types.val_loc = loc; val_attributes = valdecl.pval_attributes; } - | [] -> raise (Error (valdecl.pval_loc, Val_in_structure)) + | [] -> + Location.raise_errorf ~loc:valdecl.pval_loc + "Value declarations are only allowed in signatures" | _ -> let arity, from_constructor = parse_arity env valdecl.pval_type ty in let prim = Primitive.parse_declaration valdecl ~arity ~from_constructor in @@ -1897,7 +1899,9 @@ let transl_value_decl env loc valdecl = && String.unsafe_get prim_native_name 1 = '\149')) && (prim.prim_name = "" || (prim.prim_name.[0] <> '%' && prim.prim_name.[0] <> '#')) - then raise (Error (valdecl.pval_type.ptyp_loc, Null_arity_external)); + then + Location.raise_errorf ~loc:valdecl.pval_type.ptyp_loc + "External identifiers must be functions"; { val_type = ty; val_kind = Val_prim prim; @@ -2153,22 +2157,11 @@ let report_error ppf = function fprintf ppf "@[%s@ @[Type@ %a@ should be an instance of@ %a@]@]" "Constraints are not satisfied in this type." Printtyp.type_expr ty Printtyp.type_expr ty' - | Parameters_differ (path, ty, ty') -> - Printtyp.reset_and_mark_loops ty; - Printtyp.mark_loops ty'; - fprintf ppf "@[In the definition of %s, type@ %a@ should be@ %a@]" - (Path.name path) Printtyp.type_expr ty Printtyp.type_expr ty' | Inconsistent_constraint (env, trace) -> fprintf ppf "The type constraints are not consistent.@."; Printtyp.report_unification_error ppf env trace (fun ppf -> fprintf ppf "Type") (fun ppf -> fprintf ppf "is not compatible with type") - | Type_clash (env, trace) -> - Printtyp.report_unification_error ppf env trace - (function - | ppf -> fprintf ppf "This type constructor expands to type") - (function ppf -> fprintf ppf "but is used here with type") - | Null_arity_external -> fprintf ppf "External identifiers must be functions" | Unbound_type_var (ty, decl) -> ( fprintf ppf "A type variable is unbound in this type declaration"; let ty = Ctype.repr ty in @@ -2204,12 +2197,6 @@ let report_error ppf = function "does not match the definition of type" (Path.name path) (Includecore.report_type_mismatch "the type" "this extension" "definition") errs - | Rebind_wrong_type (lid, env, trace) -> - Printtyp.report_unification_error ppf env trace - (function - | ppf -> - fprintf ppf "The constructor %a@ has type" Printtyp.longident lid) - (function ppf -> fprintf ppf "but was expected to be of type") | Rebind_mismatch (lid, p, p') -> fprintf ppf "@[%s@ %a@ %s@ %s@ %s@ %s@ %s@]" "The constructor" Printtyp.longident lid "extends type" (Path.name p) @@ -2256,12 +2243,6 @@ let report_error ppf = function (variance v1) | Unavailable_type_constructor p -> fprintf ppf "The definition of type %a@ is unavailable" Printtyp.path p - | Bad_fixed_type r -> fprintf ppf "This fixed type %s" r - | Varying_anonymous -> - fprintf ppf "@[%s@ %s@ %s@]" "In this GADT definition," - "the variance of some parameter" "cannot be checked" - | Val_in_structure -> - fprintf ppf "Value declarations are only allowed in signatures" | Bad_immediate_attribute -> fprintf ppf "@[%s@ %s@]" "Types marked with the immediate attribute must be" "non-pointer types like int or bool" From e7206b08cd436f49842c0279e819585b43182a13 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 22 May 2026 16:12:57 +0000 Subject: [PATCH 12/31] Remove unreachable typemod variants Drop Cannot_eliminate_dependency, With_makes_applicative_functor_ill_typed, With_cannot_remove_constrained_type, and Scoping_pack from Typemod.error. The dead reports were guarded by paths the current module pipeline does not reach: nondep_supertype falls back instead of raising Not_found, applicative Papply constraints are not parsed from source, destructive type substitutions only get fresh type variables, and the package scoping mismatch is a defensive fallback. The old guard sites now use direct Location errors as malformed-AST fallbacks. Validation: rg found no remaining references to the named variants. --- compiler/ml/typemod.ml | 54 +++++++++++++++-------------------------- compiler/ml/typemod.mli | 5 ---- 2 files changed, 19 insertions(+), 40 deletions(-) diff --git a/compiler/ml/typemod.ml b/compiler/ml/typemod.ml index 0932c62f347..7fec8d74db0 100644 --- a/compiler/ml/typemod.ml +++ b/compiler/ml/typemod.ml @@ -24,15 +24,11 @@ open Format type error = | Cannot_apply of module_type | Not_included of Includemod.error list - | Cannot_eliminate_dependency of module_type | Signature_expected | Structure_expected of module_type | With_no_component of Longident.t | With_mismatch of Longident.t * Includemod.error list - | With_makes_applicative_functor_ill_typed of - Longident.t * Path.t * Includemod.error list | With_changes_module_alias of Longident.t * Ident.t * Path.t - | With_cannot_remove_constrained_type | Repeated_name of string * string * Warnings.loc | Non_generalizable of type_expr | Non_generalizable_module of module_type @@ -40,7 +36,6 @@ type error = | Not_allowed_in_functor_body | Not_a_packed_module of type_expr | Incomplete_packed_module of type_expr - | Scoping_pack of Longident.t * type_expr | Recursive_module_require_explicit_type | Apply_generative | Cannot_scrape_alias of Path.t @@ -251,12 +246,12 @@ let check_usage_of_path_of_substituted_item paths env signature ~loc ~lid = let env = !env in try retype_applicative_functor_type ~loc env funct arg with Includemod.Error explanation -> - raise - (Error - ( loc, - env, - With_makes_applicative_functor_ill_typed - (lid.txt, referenced_path, explanation) )))); + Location.raise_errorf ~loc + "@[@[This `with' constraint on %a makes the \ + applicative functor type %s ill-typed in the constrained \ + signature:@]@ %a@]" + Printtyp.longident lid.txt (Path.name referenced_path) + Includemod.report_error explanation)); } in iterator.Btype.it_signature iterator signature; @@ -439,8 +434,10 @@ let merge_constraint initial_env loc sg constr = in let params = tdecl.typ_type.type_params in if params_are_constrained params then - raise - (Error (loc, initial_env, With_cannot_remove_constrained_type)); + Location.raise_errorf ~loc + "@[Destructive substitutions are not supported for \ + constrained types (other than when replacing a type \ + constructor with a type constructor with the same arguments).@]"; fun s path -> Subst.add_type_function path ~params ~body s in let sub = List.fold_left how_to_extend_subst Subst.identity !real_ids in @@ -1330,9 +1327,11 @@ and type_module_aux ~alias sttn funct_body anchor env smod = (Env.add_module ~arg:true param arg.mod_type env) param mty_res with Not_found -> - raise - (Error - (smod.pmod_loc, env, Cannot_eliminate_dependency mty_functor)) + Location.raise_errorf ~loc:smod.pmod_loc + "@[This functor has type@ %a@ The parameter cannot be \ + eliminated in the result type.@ Bind the argument to a \ + module identifier.@]" + Printtyp.modtype mty_functor ) in rm @@ -1714,7 +1713,10 @@ let type_package env m p nl = (fun n ty -> try Ctype.unify env ty (Ctype.newvar ()) with Ctype.Unify _ -> - raise (Error (m.pmod_loc, env, Scoping_pack (n, ty)))) + Location.raise_errorf ~loc:m.pmod_loc + "@[The type %a in this module cannot be exported.@ Its type \ + contains local dependencies:@ %a@]" + Printtyp.longident n Printtyp.type_expr ty) nl tl'; (wrap_constraint env modl mty Tmodtype_implicit, tl') @@ -1818,11 +1820,6 @@ let report_error ppf = function fprintf ppf "@[This module is not a functor; it has type@ %a@]" modtype mty | Not_included errs -> fprintf ppf "@[Signature mismatch:@ %a@]" Includemod.report_error errs - | Cannot_eliminate_dependency mty -> - fprintf ppf - "@[This functor has type@ %a@ The parameter cannot be eliminated in the \ - result type.@ Bind the argument to a module identifier.@]" - modtype mty | Signature_expected -> fprintf ppf "This module type is not a signature" | Structure_expected mty -> fprintf ppf "@[This module is not a structure; it has type@ %a" modtype mty @@ -1835,21 +1832,11 @@ let report_error ppf = function "@[@[In this `with' constraint, the new definition of %a@ does not \ match its original definition@ in the constrained signature:@]@ %a@]" longident lid Includemod.report_error explanation - | With_makes_applicative_functor_ill_typed (lid, path, explanation) -> - fprintf ppf - "@[@[This `with' constraint on %a makes the applicative functor @ \ - type %s ill-typed in the constrained signature:@]@ %a@]" - longident lid (Path.name path) Includemod.report_error explanation | With_changes_module_alias (lid, id, path) -> fprintf ppf "@[@[This `with' constraint on %a changes %s, which is aliased @ in \ the constrained signature (as %s)@].@]" longident lid (Path.name path) (Ident.name id) - | With_cannot_remove_constrained_type -> - fprintf ppf - "@[Destructive substitutions are not supported for constrained @ \ - types (other than when replacing a type constructor with @ a type \ - constructor with the same arguments).@]" | Repeated_name (kind, name, repeated_loc) -> fprintf ppf "@[Multiple definition of the %s name %s @ at @{%a@}@ @ Names must \ @@ -1887,9 +1874,6 @@ let report_error ppf = function | Incomplete_packed_module ty -> fprintf ppf "The type of this packed module contains variables:@ %a" type_expr ty - | Scoping_pack (lid, ty) -> - fprintf ppf "The type %a in this module cannot be exported.@ " longident lid; - fprintf ppf "Its type contains local dependencies:@ %a" type_expr ty | Recursive_module_require_explicit_type -> fprintf ppf "Recursive modules require an explicit module type." | Apply_generative -> diff --git a/compiler/ml/typemod.mli b/compiler/ml/typemod.mli index 0f36cf6afd8..8eea12e2f6b 100644 --- a/compiler/ml/typemod.mli +++ b/compiler/ml/typemod.mli @@ -64,15 +64,11 @@ val save_signature : type error = | Cannot_apply of module_type | Not_included of Includemod.error list - | Cannot_eliminate_dependency of module_type | Signature_expected | Structure_expected of module_type | With_no_component of Longident.t | With_mismatch of Longident.t * Includemod.error list - | With_makes_applicative_functor_ill_typed of - Longident.t * Path.t * Includemod.error list | With_changes_module_alias of Longident.t * Ident.t * Path.t - | With_cannot_remove_constrained_type | Repeated_name of string * string * Warnings.loc | Non_generalizable of type_expr | Non_generalizable_module of module_type @@ -80,7 +76,6 @@ type error = | Not_allowed_in_functor_body | Not_a_packed_module of type_expr | Incomplete_packed_module of type_expr - | Scoping_pack of Longident.t * type_expr | Recursive_module_require_explicit_type | Apply_generative | Cannot_scrape_alias of Path.t From 403ae1791c8a0a530361da5b4ec8024feca012c1 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 22 May 2026 16:13:32 +0000 Subject: [PATCH 13/31] Remove parser-blocked frontend syntax variants Drop Unhandled_poly_type and Misplaced_label_syntax from Bs_syntaxerr.error. Inline polytypes in external arrow chains and labeled arguments to the legacy ->/#=/## rewrites are not emitted by the ReScript parser. The old guard sites now raise direct Location errors as malformed-AST fallbacks. Validation: rg found no remaining references to the named variants. --- compiler/frontend/ast_core_type.ml | 3 +-- compiler/frontend/bs_syntaxerr.ml | 10 ++-------- compiler/frontend/bs_syntaxerr.mli | 2 -- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/compiler/frontend/ast_core_type.ml b/compiler/frontend/ast_core_type.ml index b93c4586bf5..3f056c2bb4f 100644 --- a/compiler/frontend/ast_core_type.ml +++ b/compiler/frontend/ast_core_type.ml @@ -137,8 +137,7 @@ let list_of_arrow (ty : t) : t * Parsetree.arg list = | Ptyp_arrow {arg; ret; arity} when arity = None || acc = [] -> aux ret (arg :: acc) | Ptyp_poly (_, ty) -> - (* should not happen? *) - Bs_syntaxerr.err ty.ptyp_loc Unhandled_poly_type + Location.raise_errorf ~loc:ty.ptyp_loc "Unhandled poly type" | _ -> (ty, List.rev acc) in aux ty [] diff --git a/compiler/frontend/bs_syntaxerr.ml b/compiler/frontend/bs_syntaxerr.ml index 9cadcb58971..7ef491e6f9d 100644 --- a/compiler/frontend/bs_syntaxerr.ml +++ b/compiler/frontend/bs_syntaxerr.ml @@ -31,7 +31,6 @@ type error = | Expect_int_literal | Expect_string_literal | Expect_int_or_string_or_json_literal - | Unhandled_poly_type | Invalid_underscore_type_in_external | Invalid_bs_string_type | Invalid_bs_int_type @@ -43,7 +42,6 @@ type error = *) | Not_supported_directive_in_bs_return | Expect_opt_in_bs_return_to_opt - | Misplaced_label_syntax | Optional_in_uncurried_bs_attribute | Bs_this_simple_pattern | Experimental_feature_not_enabled of Experimental_features.feature @@ -52,10 +50,6 @@ type error = let pp_error fmt err = Format.pp_print_string fmt (match err with - | Misplaced_label_syntax -> "Label syntax is not support in this position" - (* - let fn x = ((##) x ~hi) ~lo:1 ~hi:2 - *) | Optional_in_uncurried_bs_attribute -> "Uncurried function doesn't support optional arguments yet" | Expect_opt_in_bs_return_to_opt -> @@ -70,7 +64,6 @@ let pp_error fmt err = | Expect_int_literal -> "expect int literal " | Expect_int_or_string_or_json_literal -> "expect int, string literal or json literal {json|text here|json} " - | Unhandled_poly_type -> "Unhandled poly type" | Invalid_underscore_type_in_external -> "_ is not allowed in combination with external optional type" | Invalid_bs_string_type -> "Not a valid type for %@string" @@ -110,4 +103,5 @@ let optional_err loc (lbl : Asttypes.arg_label) = | _ -> () let err_if_label loc (lbl : Asttypes.arg_label) = - if lbl <> Nolabel then raise (Error (loc, Misplaced_label_syntax)) + if lbl <> Nolabel then + Location.raise_errorf ~loc "Label syntax is not supported in this position" diff --git a/compiler/frontend/bs_syntaxerr.mli b/compiler/frontend/bs_syntaxerr.mli index 9c6a9ff9b5d..c174245fb1b 100644 --- a/compiler/frontend/bs_syntaxerr.mli +++ b/compiler/frontend/bs_syntaxerr.mli @@ -31,7 +31,6 @@ type error = | Expect_int_literal | Expect_string_literal | Expect_int_or_string_or_json_literal - | Unhandled_poly_type | Invalid_underscore_type_in_external | Invalid_bs_string_type | Invalid_bs_int_type @@ -43,7 +42,6 @@ type error = *) | Not_supported_directive_in_bs_return | Expect_opt_in_bs_return_to_opt - | Misplaced_label_syntax | Optional_in_uncurried_bs_attribute | Bs_this_simple_pattern | Experimental_feature_not_enabled of Experimental_features.feature From 02fef7c0b23439eae4a7980b4e4dd69f94f1b078 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 22 May 2026 16:14:04 +0000 Subject: [PATCH 14/31] Remove parser-blocked env value-name variant Drop Illegal_value_name from Env.error. The ReScript parser does not emit value identifiers named -> or containing #, so the named environment error is unreachable from source. The check_value_name guard now raises a direct Location error for malformed PPX-forged identifiers. Validation: rg found no remaining references to the named variant. --- compiler/ml/env.ml | 14 +++++--------- compiler/ml/env.mli | 1 - 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/compiler/ml/env.ml b/compiler/ml/env.ml index 970634be03d..b6e23e8def8 100644 --- a/compiler/ml/env.ml +++ b/compiler/ml/env.ml @@ -58,7 +58,6 @@ type error = | Illegal_renaming of string * string * string | Inconsistent_import of string * string * string | Missing_module of Location.t * Path.t * Path.t - | Illegal_value_name of Location.t * string exception Error of error @@ -730,7 +729,6 @@ let check_pers_struct name = Location.print_filename filename ps_name name | Inconsistent_import _ -> assert false | Missing_module _ -> assert false - | Illegal_value_name _ -> assert false in let warn = Warnings.No_cmi_file (name, Some msg) in Location.prerr_warning Location.none warn @@ -1619,10 +1617,12 @@ and check_value_name name loc = (* Note: we could also check here general validity of the identifier, to protect against bad identifiers forged by -pp or -ppx preprocessors. *) - if name = "->" then raise (Error (Illegal_value_name (loc, name))) + if name = "->" then + Location.raise_errorf ~loc "'%s' is not a valid value identifier." name else if String.length name > 0 && name.[0] = '#' then for i = 1 to String.length name - 1 do - if name.[i] = '#' then raise (Error (Illegal_value_name (loc, name))) + if name.[i] = '#' then + Location.raise_errorf ~loc "'%s' is not a valid value identifier." name done and store_value ?check id decl env = @@ -2129,13 +2129,9 @@ let report_error ppf = function fprintf ppf "@]@ @[%s@ %s@ %s.@]@]" "The compiled interface for module" (Ident.name (Path.head path2)) "was not found" - | Illegal_value_name (_loc, name) -> - fprintf ppf "'%s' is not a valid value identifier." name - let () = Location.register_error_of_exn (function - | Error ((Missing_module (loc, _, _) | Illegal_value_name (loc, _)) as err) - when loc <> Location.none -> + | Error (Missing_module (loc, _, _) as err) when loc <> Location.none -> Some (Location.error_of_printer loc report_error err) | Error err -> Some (Location.error_of_printer_file report_error err) | _ -> None) diff --git a/compiler/ml/env.mli b/compiler/ml/env.mli index 48eaba1c10d..90946f94e36 100644 --- a/compiler/ml/env.mli +++ b/compiler/ml/env.mli @@ -236,7 +236,6 @@ type error = | Illegal_renaming of string * string * string | Inconsistent_import of string * string * string | Missing_module of Location.t * Path.t * Path.t - | Illegal_value_name of Location.t * string exception Error of error From 6a1947f2082b3697b24e0191c8699c070ce1b519 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 22 May 2026 16:15:54 +0000 Subject: [PATCH 15/31] Remove leftover typecore label helper Drop has_label after removing the unreachable Incoherent_label_order path. The full make checkpoint caught it as an unused helper under the repository warning policy. Validation: make -j2 completed successfully after this cleanup. --- compiler/ml/typecore.ml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index eb164f77d04..8e6da258c69 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -3734,10 +3734,6 @@ and type_application ~context total_app env funct (sargs : sargs) : newty2 lv (Tarrow ({lbl = l; typ = ty}, ty_fun, Cok, None))) ty_fun omitted in - let has_label l ty_fun = - let ls, tvar = list_labels env ty_fun in - tvar || List.mem l ls - in let ignored = ref [] in let force_tvar = let t = funct.exp_type in From d70ef8fb80ddce024836518dae899abb4fdc11c7 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 22 May 2026 16:21:37 +0000 Subject: [PATCH 16/31] Remove dead warning constructors Drop warning constructors that have no live raise path: old OCaml lexer/class/docstring warnings, unused BuckleScript warnings, Statement_type, Unerasable_optional_argument, and Bs_uninterpreted_delimiters. Statement_type was guarded by a check_application_result argument that is only ever false. Unerasable_optional_argument was disabled around its only check. Bs_uninterpreted_delimiters only covered the old unprocessed js delimiter warning path, which modern string handling no longer uses. The warning numbers remain holes; no existing warning numbers were reused. Validation: rg found no remaining references to the removed warning constructors, and make -j2 completed successfully. --- compiler/common/bs_warnings.ml | 3 - compiler/common/bs_warnings.mli | 2 - compiler/ext/warnings.ml | 104 ------------------- compiler/ext/warnings.mli | 14 --- compiler/frontend/ast_utf8_string_interp.ml | 3 - compiler/frontend/ast_utf8_string_interp.mli | 1 - compiler/frontend/bs_ast_invariant.ml | 3 - compiler/ml/typecore.ml | 34 +----- 8 files changed, 3 insertions(+), 161 deletions(-) diff --git a/compiler/common/bs_warnings.ml b/compiler/common/bs_warnings.ml index aeea997b82d..61e55032eea 100644 --- a/compiler/common/bs_warnings.ml +++ b/compiler/common/bs_warnings.ml @@ -24,6 +24,3 @@ let warn_literal_overflow loc = Location.prerr_warning loc Bs_integer_literal_overflow - -let error_unescaped_delimiter loc txt = - Location.prerr_warning loc (Bs_uninterpreted_delimiters txt) diff --git a/compiler/common/bs_warnings.mli b/compiler/common/bs_warnings.mli index 3807bbf32c6..d31e0846070 100644 --- a/compiler/common/bs_warnings.mli +++ b/compiler/common/bs_warnings.mli @@ -23,5 +23,3 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) val warn_literal_overflow : Location.t -> unit - -val error_unescaped_delimiter : Location.t -> string -> unit diff --git a/compiler/ext/warnings.ml b/compiler/ext/warnings.ml index 936f34c4e02..3bbb738346c 100644 --- a/compiler/ext/warnings.ml +++ b/compiler/ext/warnings.ml @@ -29,21 +29,13 @@ type loc = { type top_level_unit_help = FunctionCall | Other type t = - | Comment_start (* 1 *) - | Comment_not_end (* 2 *) | Deprecated of string * loc * loc * bool (* 3 *) | Fragile_match of string (* 4 *) | Partial_application (* 5 *) - | Method_override of string list (* 7 *) | Partial_match of string (* 8 *) | Non_closed_record_pattern of string (* 9 *) - | Statement_type (* 10 *) | Unused_match (* 11 *) | Unused_pat (* 12 *) - | Instance_variable_override of string list (* 13 *) - | Illegal_backslash (* 14 *) - | Implicit_public_methods of string list (* 15 *) - | Unerasable_optional_argument (* 16 *) | Unused_argument (* 20 *) | Nonreturning_statement (* 21 *) | Preprocessor of string (* 22 *) @@ -53,7 +45,6 @@ type t = | Unused_var of string (* 26 *) | Unused_var_strict of string (* 27 *) | Wildcard_arg_to_constant_constr (* 28 *) - | Eol_in_string (* 29 *) | Duplicate_definitions of string * string * string * string (*30 *) | Unused_value_declaration of string (* 32 *) | Unused_open of string (* 33 *) @@ -67,9 +58,7 @@ type t = | Open_shadow_identifier of string * string (* 44 *) | Open_shadow_label_constructor of string * string (* 45 *) | Attribute_payload of string * string (* 47 *) - | Eliminated_optional_arguments of string list (* 48 *) | No_cmi_file of string * string option (* 49 *) - | Bad_docstring of bool (* 50 *) | Fragile_literal_pattern (* 52 *) | Misplaced_attribute of string (* 53 *) | Duplicated_attribute of string (* 54 *) @@ -81,10 +70,7 @@ type t = | Bs_polymorphic_comparison (* 102 *) | Bs_ffi_warning of string (* 103 *) | Bs_derive_warning of string (* 104 *) - | Bs_fragile_external of string (* 105 *) - | Bs_unimplemented_primitive of string (* 106 *) | Bs_integer_literal_overflow (* 107 *) - | Bs_uninterpreted_delimiters of string (* 108 *) | Bs_toplevel_expression_unit of (string * top_level_unit_help) option (* 109 *) | Bs_todo of string option (* 110 *) @@ -96,21 +82,13 @@ type t = *) let number = function - | Comment_start -> 1 - | Comment_not_end -> 2 | Deprecated _ -> 3 | Fragile_match _ -> 4 | Partial_application -> 5 - | Method_override _ -> 7 | Partial_match _ -> 8 | Non_closed_record_pattern _ -> 9 - | Statement_type -> 10 | Unused_match -> 11 | Unused_pat -> 12 - | Instance_variable_override _ -> 13 - | Illegal_backslash -> 14 - | Implicit_public_methods _ -> 15 - | Unerasable_optional_argument -> 16 | Unused_argument -> 20 | Nonreturning_statement -> 21 | Preprocessor _ -> 22 @@ -120,7 +98,6 @@ let number = function | Unused_var _ -> 26 | Unused_var_strict _ -> 27 | Wildcard_arg_to_constant_constr -> 28 - | Eol_in_string -> 29 | Duplicate_definitions _ -> 30 | Unused_value_declaration _ -> 32 | Unused_open _ -> 33 @@ -134,9 +111,7 @@ let number = function | Open_shadow_identifier _ -> 44 | Open_shadow_label_constructor _ -> 45 | Attribute_payload _ -> 47 - | Eliminated_optional_arguments _ -> 48 | No_cmi_file _ -> 49 - | Bad_docstring _ -> 50 | Fragile_literal_pattern -> 52 | Misplaced_attribute _ -> 53 | Duplicated_attribute _ -> 54 @@ -148,10 +123,7 @@ let number = function | Bs_polymorphic_comparison -> 102 | Bs_ffi_warning _ -> 103 | Bs_derive_warning _ -> 104 - | Bs_fragile_external _ -> 105 - | Bs_unimplemented_primitive _ -> 106 | Bs_integer_literal_overflow -> 107 - | Bs_uninterpreted_delimiters _ -> 108 | Bs_toplevel_expression_unit _ -> 109 | Bs_todo _ -> 110 @@ -297,8 +269,6 @@ let reset () = let () = reset () let message = function - | Comment_start -> "this is the start of a comment." - | Comment_not_end -> "this is not the end of a comment." | Deprecated (s, _, _, can_be_automigrated) -> (* Reduce \r\n to \n: - Prevents any \r characters being printed on Unix when processing @@ -321,12 +291,6 @@ let message = function It will remain exhaustive when constructors are added to type " ^ s ^ "." | Partial_application -> "this function application is partial,\nmaybe some arguments are missing." - | Method_override [lab] -> "the method " ^ lab ^ " is overridden." - | Method_override (cname :: slist) -> - String.concat " " - ("the following methods are overridden by the class" :: cname :: ":\n " - :: slist) - | Method_override [] -> assert false | Partial_match "" -> "You forgot to handle a possible case here, though we don't have more \ information on the value." @@ -335,42 +299,8 @@ let message = function | Non_closed_record_pattern s -> "the following labels are not bound in this record pattern: " ^ s ^ "\nEither bind these labels explicitly or add ', _' to the pattern." - | Statement_type -> - "This expression returns a value, but you're not doing anything with it. \ - If this is on purpose, wrap it with `ignore`." | Unused_match -> "this match case is unused." | Unused_pat -> "this sub-pattern is unused." - | Instance_variable_override [lab] -> - "the instance variable " ^ lab ^ " is overridden.\n" - ^ "The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)" - | Instance_variable_override (cname :: slist) -> - String.concat " " - ("the following instance variables are overridden by the class" :: cname - :: ":\n " :: slist) - ^ "\nThe behaviour changed in ocaml 3.10 (previous behaviour was hiding.)" - | Instance_variable_override [] -> assert false - | Illegal_backslash -> "illegal backslash escape in string." - | Implicit_public_methods l -> - "the following private methods were made public implicitly:\n " - ^ String.concat " " l ^ "." - | Unerasable_optional_argument -> - String.concat "" - [ - "This optional parameter in final position will, in practice, not be \ - optional.\n"; - " Reorder the parameters so that at least one non-optional one is in \ - final position or, if all parameters are optional, insert a final \ - ().\n\n"; - " Explanation: If the final parameter is optional, it'd be unclear \ - whether a function application that omits it should be considered \ - fully applied, or partially applied. Imagine writing `let title = \ - display(\"hello!\")`, only to realize `title` isn't your desired \ - result, but a curried call that takes a final optional argument, e.g. \ - `~showDate`.\n\n"; - " Formal rule: an optional argument is considered intentionally \ - omitted when the 1st positional (i.e. neither labeled nor optional) \ - argument defined after it is passed in."; - ] | Unused_argument -> "this argument will not be used by the function." | Nonreturning_statement -> "This statement does not continue execution; following code is unreachable." @@ -398,8 +328,6 @@ let message = function v v | Wildcard_arg_to_constant_constr -> "wildcard pattern given as argument to a constant constructor" - | Eol_in_string -> - "unescaped end-of-line in a string constant (non-portable code)" | Duplicate_definitions (kind, cname, tc1, tc2) -> Printf.sprintf "the %s %s is defined in both types %s and %s." kind cname tc1 tc2 @@ -446,18 +374,11 @@ let message = function kind s | Attribute_payload (a, s) -> Printf.sprintf "illegal payload for attribute '%s'.\n%s" a s - | Eliminated_optional_arguments sl -> - Printf.sprintf "implicit elimination of optional argument%s %s" - (if List.length sl = 1 then "" else "s") - (String.concat ", " sl) | No_cmi_file (name, None) -> "no cmi file was found in path for module " ^ name | No_cmi_file (name, Some msg) -> Printf.sprintf "no valid cmi file was found in path for module %s. %s" name msg - | Bad_docstring unattached -> - if unattached then "unattached documentation comment (ignored)" - else "ambiguous documentation comment" | Fragile_literal_pattern -> Printf.sprintf "Code should not depend on the actual values of\n\ @@ -495,15 +416,8 @@ let message = function "Polymorphic comparison introduced (maybe unsafe)" | Bs_ffi_warning s -> "FFI warning: " ^ s | Bs_derive_warning s -> "@deriving warning: " ^ s - | Bs_fragile_external s -> - s - ^ " : using an empty string as a shorthand to infer the external's name \ - from the value's name is dangerous when refactoring, and therefore \ - deprecated" - | Bs_unimplemented_primitive s -> "Unimplemented primitive used: " ^ s | Bs_integer_literal_overflow -> "Integer literal exceeds the range of representable integers of type int" - | Bs_uninterpreted_delimiters s -> "Uninterpreted delimiters " ^ s | Bs_toplevel_expression_unit help -> Printf.sprintf "This%sis at the top level and is expected to return `unit`. But it's \ @@ -581,8 +495,6 @@ let check_fatal () = let descriptions = [ - (1, "Suspicious-looking start-of-comment mark."); - (2, "Suspicious-looking end-of-comment mark."); (3, "Deprecated feature."); ( 4, "Fragile pattern matching: matching that will remain complete even\n\ @@ -591,18 +503,10 @@ let descriptions = ( 5, "Partially applied function: expression whose result has function\n\ \ type and is ignored." ); - (7, "Method overridden."); (8, "Partial match: missing cases in pattern-matching."); (9, "Missing fields in a record pattern."); - ( 10, - "Expression on the left-hand side of a sequence that doesn't have type\n\ - \ \"unit\" (and that is not a function, see warning number 5)." ); (11, "Redundant case in a pattern matching (unused match case)."); (12, "Redundant sub-pattern in a pattern-matching."); - (13, "Instance variable overridden."); - (14, "Illegal backslash escape in a string constant."); - (15, "Private method made public implicitly."); - (16, "Unerasable optional argument."); (17, "Undeclared virtual method."); (18, "Non-principal type."); (19, "Type without principality."); @@ -623,7 +527,6 @@ let descriptions = \ \"let\" nor \"as\", and doesn't start with an underscore (\"_\")\n\ \ character." ); (28, "Wildcard pattern given as argument to a constant constructor."); - (29, "Unescaped end-of-line in a string constant (non-portable code)."); ( 30, "Two labels or constructors of the same name are defined in two\n\ \ mutually recursive types." ); @@ -642,9 +545,7 @@ let descriptions = (45, "Open statement shadows an already defined label or constructor."); (46, "Error in environment variable."); (47, "Illegal attribute payload."); - (48, "Implicit elimination of optional arguments."); (49, "Absent cmi file when looking up module alias."); - (50, "Unexpected documentation comment."); (52, "Fragile constant pattern."); (53, "Attribute cannot appear in this context"); (54, "Attribute used more than once on an expression"); @@ -658,14 +559,9 @@ let descriptions = (102, "Polymorphic comparison introduced (maybe unsafe)"); (103, "Fragile FFI definitions"); (104, "@deriving warning with customized message "); - ( 105, - "External name is inferred from val name is unsafe from refactoring when \ - changing value name" ); - (106, "Unimplemented primitive used:"); ( 107, "Integer literal exceeds the range of representable integers of type int" ); - (108, "Uninterpreted delimiters (for unicode)"); (109, "Toplevel expression has unit type"); (110, "Todo found"); ] diff --git a/compiler/ext/warnings.mli b/compiler/ext/warnings.mli index ba1a03ceec5..5ebdfa4b248 100644 --- a/compiler/ext/warnings.mli +++ b/compiler/ext/warnings.mli @@ -22,21 +22,13 @@ type loc = { type top_level_unit_help = FunctionCall | Other type t = - | Comment_start (* 1 *) - | Comment_not_end (* 2 *) | Deprecated of string * loc * loc * bool (* 3 *) | Fragile_match of string (* 4 *) | Partial_application (* 5 *) - | Method_override of string list (* 7 *) | Partial_match of string (* 8 *) | Non_closed_record_pattern of string (* 9 *) - | Statement_type (* 10 *) | Unused_match (* 11 *) | Unused_pat (* 12 *) - | Instance_variable_override of string list (* 13 *) - | Illegal_backslash (* 14 *) - | Implicit_public_methods of string list (* 15 *) - | Unerasable_optional_argument (* 16 *) | Unused_argument (* 20 *) | Nonreturning_statement (* 21 *) | Preprocessor of string (* 22 *) @@ -46,7 +38,6 @@ type t = | Unused_var of string (* 26 *) | Unused_var_strict of string (* 27 *) | Wildcard_arg_to_constant_constr (* 28 *) - | Eol_in_string (* 29 *) | Duplicate_definitions of string * string * string * string (* 30 *) | Unused_value_declaration of string (* 32 *) | Unused_open of string (* 33 *) @@ -60,9 +51,7 @@ type t = | Open_shadow_identifier of string * string (* 44 *) | Open_shadow_label_constructor of string * string (* 45 *) | Attribute_payload of string * string (* 47 *) - | Eliminated_optional_arguments of string list (* 48 *) | No_cmi_file of string * string option (* 49 *) - | Bad_docstring of bool (* 50 *) | Fragile_literal_pattern (* 52 *) | Misplaced_attribute of string (* 53 *) | Duplicated_attribute of string (* 54 *) @@ -74,10 +63,7 @@ type t = | Bs_polymorphic_comparison (* 102 *) | Bs_ffi_warning of string (* 103 *) | Bs_derive_warning of string (* 104 *) - | Bs_fragile_external of string (* 105 *) - | Bs_unimplemented_primitive of string (* 106 *) | Bs_integer_literal_overflow (* 107 *) - | Bs_uninterpreted_delimiters of string (* 108 *) | Bs_toplevel_expression_unit of (string * top_level_unit_help) option (* 109 *) | Bs_todo of string option (* 110 *) diff --git a/compiler/frontend/ast_utf8_string_interp.ml b/compiler/frontend/ast_utf8_string_interp.ml index 90c5043256e..e3e65018a77 100644 --- a/compiler/frontend/ast_utf8_string_interp.ml +++ b/compiler/frontend/ast_utf8_string_interp.ml @@ -289,7 +289,6 @@ module Delim = struct let escaped_j_delimiter = "*j" (* not user level syntax allowed *) let escaped_back_quote_delimiter = "bq" let some_escaped_back_quote_delimiter = Some "bq" - let unescaped_js_delimiter = "js" let some_escaped_j_delimiter = Some escaped_j_delimiter end @@ -339,6 +338,4 @@ let is_unicode_string opt = Ext_string.equal opt Delim.escaped_j_delimiter || Ext_string.equal opt Delim.escaped_back_quote_delimiter -let is_unescaped s = Ext_string.equal s Delim.unescaped_js_delimiter - let parse_processed_delim = Delim.parse_processed diff --git a/compiler/frontend/ast_utf8_string_interp.mli b/compiler/frontend/ast_utf8_string_interp.mli index 5e8ec9c8a91..bc0b13c93ee 100644 --- a/compiler/frontend/ast_utf8_string_interp.mli +++ b/compiler/frontend/ast_utf8_string_interp.mli @@ -59,5 +59,4 @@ val transform_exp : Parsetree.expression -> string -> string -> Parsetree.expression val transform_pat : Parsetree.pattern -> string -> string -> Parsetree.pattern val is_unicode_string : string -> bool -val is_unescaped : string -> bool val parse_processed_delim : string option -> External_arg_spec.delim option diff --git a/compiler/frontend/bs_ast_invariant.ml b/compiler/frontend/bs_ast_invariant.ml index 60e1ad285d0..023043f9f44 100644 --- a/compiler/frontend/bs_ast_invariant.ml +++ b/compiler/frontend/bs_ast_invariant.ml @@ -52,9 +52,6 @@ let super = Ast_iterator.default_iterator let check_constant loc (const : Parsetree.constant) = match const with - | Pconst_string (_, Some s) -> - if Ast_utf8_string_interp.is_unescaped s then - Bs_warnings.error_unescaped_delimiter loc s | Pconst_integer (s, None) -> ( (* range check using int32 It is better to give a warning instead of error to avoid make people unhappy. diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index 8e6da258c69..182a43e8632 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -1986,19 +1986,6 @@ let rec type_approx env sexp = ty2 | _ -> newvar () -(* List labels in a function type, and whether return type is a variable *) -let rec list_labels_aux env visited ls ty_fun = - let ty = expand_head env ty_fun in - if List.memq ty visited then (List.rev ls, false) - else - match ty.desc with - | Tarrow (arg, ty_res, _, arity) when arity = None || visited = [] -> - list_labels_aux env (ty :: visited) (arg.lbl :: ls) ty_res - | _ -> (List.rev ls, is_Tvar ty) - -let list_labels env ty = - wrap_trace_gadt_instances env (list_labels_aux env [] []) ty - (* Check that all univars are safe in a type *) let check_univars env expans kind exp ty_expected vars = if expans && not (is_nonexpansive exp) then @@ -2028,13 +2015,12 @@ let check_univars env expans kind exp ty_expected vars = Less_general (kind, [(ty, ty); (ty_expected, ty_expected)]) )) (* Check that a type is not a function *) -let check_application_result env statement exp = - let loc = exp.exp_loc in +let check_application_result env exp = match (expand_head env exp.exp_type).desc with | Tarrow _ -> Location.prerr_warning exp.exp_loc Warnings.Partial_application | Tvar _ -> () | Tconstr (p, _, _) when Path.same p Predef.path_unit -> () - | _ -> if statement then Location.prerr_warning loc Warnings.Statement_type + | _ -> () (* Check that a type is generalizable at some level *) let generalizable level ty = @@ -2271,10 +2257,6 @@ let rec lower_args env seen ty_fun = lower_args env (ty :: seen) ty_fun | _ -> () -let not_function env ty = - let ls, tvar = list_labels env ty in - ls = [] && not tvar - let extract_function_name funct = match funct.exp_desc with | Texp_ident (path, _, _) -> Some (Longident.parse (Path.name path)) @@ -3460,12 +3442,6 @@ and type_expect_ ?deprecated_context ~context ?in_function ?(recarg = Rejected) and type_function ?in_function ~arity ~async loc attrs env ty_expected_ l caselist = - let state = Warnings.backup () in - (* Disable Unerasable_optional_argument for uncurried functions *) - let unerasable_optional_argument = - Warnings.number Unerasable_optional_argument - in - Warnings.parse_options false ("-" ^ string_of_int unerasable_optional_argument); let ty_expected = match arity with | None -> ty_expected_ @@ -3506,15 +3482,11 @@ and type_function ?in_function ~arity ~async loc attrs env ty_expected_ l ty_arg ty_res true loc caselist) in let case = List.hd cases in - if is_optional l && not_function env ty_res then - Location.prerr_warning case.c_lhs.pat_loc - Warnings.Unerasable_optional_argument; let param = name_pattern "param" cases in let exp_type = instance env (newgenty (Tarrow ({lbl = l; typ = ty_arg}, ty_res, Cok, arity))) in - Warnings.restore state; re { exp_desc = @@ -3959,7 +3931,7 @@ and type_application ~context total_app env funct (sargs : sargs) : Location.prerr_warning exp.exp_loc Warnings.Partial_application | Tvar _ -> Delayed_checks.add_delayed_check (fun () -> - check_application_result env false exp) + check_application_result env exp) | _ -> ()); ([(Nolabel, Some exp)], ty_res, false) | _ -> From bcf2d8693922d583f220020ffe7cc4fc448cc152 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 22 May 2026 16:31:11 +0000 Subject: [PATCH 17/31] Format dead error cleanup Run the repository formatter after removing the unreachable diagnostics. This keeps the edited compiler modules passing make checkformat without changing behavior. --- compiler/ml/ctype.ml | 4 ++-- compiler/ml/typecore.ml | 44 ++++++++++++++++++++--------------------- compiler/ml/typedecl.ml | 9 ++++----- compiler/ml/typemod.ml | 13 ++++++------ compiler/ml/typetexp.ml | 3 ++- 5 files changed, 37 insertions(+), 36 deletions(-) diff --git a/compiler/ml/ctype.ml b/compiler/ml/ctype.ml index 1291da7880c..6eba569edad 100644 --- a/compiler/ml/ctype.ml +++ b/compiler/ml/ctype.ml @@ -2709,8 +2709,8 @@ and unify_row_field env fixed1 fixed2 more l f1 f2 = let unify env ty1 ty2 = let snap = Btype.snapshot () in - try unify env ty1 ty2 with - | Unify trace -> + try unify env ty1 ty2 + with Unify trace -> undo_compress snap; raise (Unify (expand_trace !env trace)) diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index 182a43e8632..a3774ffed24 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -330,13 +330,14 @@ let check_optional_attr env ld optional loc = (* unification inside type_pat*) let unify_pat_types loc env ty ty' = - try unify env ty ty' with - | Unify trace -> raise (Error (loc, env, Pattern_type_clash trace)) + try unify env ty ty' + with Unify trace -> raise (Error (loc, env, Pattern_type_clash trace)) (* unification inside type_exp and type_expect *) let unify_exp_types ~context loc env ty expected_ty = - try unify env ty expected_ty with - | Unify trace -> raise (Error (loc, env, Expr_type_clash {trace; context})) + try unify env ty expected_ty + with Unify trace -> + raise (Error (loc, env, Expr_type_clash {trace; context})) (* level at which to create the local type declarations *) let newtype_level = ref None @@ -351,8 +352,8 @@ let unify_pat_types_gadt loc env ty ty' = | None -> assert false | Some x -> x in - try unify_gadt ~newtype_level env ty ty' with - | Unify trace -> raise (Error (loc, !env, Pattern_type_clash trace)) + try unify_gadt ~newtype_level env ty ty' + with Unify trace -> raise (Error (loc, !env, Pattern_type_clash trace)) (* Creating new conjunctive types is not allowed when typing patterns *) @@ -3461,9 +3462,9 @@ and type_function ?in_function ~arity ~async loc attrs env ty_expected_ l if separate then begin_def (); let ty_arg, ty_res = try filter_arrow ~env ~arity (instance env ty_expected) l - with Unify _ -> ( + with Unify _ -> raise - (Error (loc_fun, env, Too_many_arguments (in_function <> None, ty_fun)))) + (Error (loc_fun, env, Too_many_arguments (in_function <> None, ty_fun))) in let ty_arg = if is_optional l then ( @@ -4458,20 +4459,19 @@ let type_expression ~context env sexp = Typetexp.reset_type_variables (); begin_def (); let exp = type_exp ~context env sexp in - (if Warnings.is_active (Bs_toplevel_expression_unit None) then - try unify env exp.exp_type (instance_def Predef.type_unit) with - | Unify _ -> - let buffer = Buffer.create 10 in - let formatter = Format.formatter_of_buffer buffer in - Printtyp.type_expr formatter exp.exp_type; - Format.pp_print_flush formatter (); - let return_type = Buffer.contents buffer in - Location.prerr_warning sexp.pexp_loc - (Bs_toplevel_expression_unit - (match sexp.pexp_desc with - | Pexp_apply _ -> Some (return_type, FunctionCall) - | _ -> Some (return_type, Other))) - ); + if Warnings.is_active (Bs_toplevel_expression_unit None) then ( + try unify env exp.exp_type (instance_def Predef.type_unit) + with Unify _ -> + let buffer = Buffer.create 10 in + let formatter = Format.formatter_of_buffer buffer in + Printtyp.type_expr formatter exp.exp_type; + Format.pp_print_flush formatter (); + let return_type = Buffer.contents buffer in + Location.prerr_warning sexp.pexp_loc + (Bs_toplevel_expression_unit + (match sexp.pexp_desc with + | Pexp_apply _ -> Some (return_type, FunctionCall) + | _ -> Some (return_type, Other)))); end_def (); if not (is_nonexpansive exp) then generalize_expansive env exp.exp_type; generalize exp.exp_type; diff --git a/compiler/ml/typedecl.ml b/compiler/ml/typedecl.ml index 39eef5fed4f..4e0f6d31cab 100644 --- a/compiler/ml/typedecl.ml +++ b/compiler/ml/typedecl.ml @@ -183,8 +183,7 @@ let set_fixed_row env loc p decl = if Btype.static_row row then Btype.newgenty Tnil else row.row_more | Tobject (ty, _) -> snd (Ctype.flatten_fields ty) | _ -> - Location.raise_errorf ~loc - "This fixed type is not an object or variant" + Location.raise_errorf ~loc "This fixed type is not an object or variant" in if not (Btype.is_Tvar rv) then Location.raise_errorf ~loc "This fixed type has no row variable"; @@ -979,9 +978,9 @@ let check_recursion env loc path decl to_check = | Tconstr (path', args', _) -> (if Path.same path path' then ( if not (Ctype.equal env false args args') then - Location.raise_errorf ~loc - "In the definition of %s, recursive type parameters differ." - (Path.name cpath)) + Location.raise_errorf ~loc + "In the definition of %s, recursive type parameters differ." + (Path.name cpath)) else if (* Attempt to expand a type abbreviation if: 1- [to_check path'] holds diff --git a/compiler/ml/typemod.ml b/compiler/ml/typemod.ml index 7fec8d74db0..48cfba0b627 100644 --- a/compiler/ml/typemod.ml +++ b/compiler/ml/typemod.ml @@ -247,10 +247,11 @@ let check_usage_of_path_of_substituted_item paths env signature ~loc ~lid = try retype_applicative_functor_type ~loc env funct arg with Includemod.Error explanation -> Location.raise_errorf ~loc - "@[@[This `with' constraint on %a makes the \ - applicative functor type %s ill-typed in the constrained \ + "@[@[This `with' constraint on %a makes the applicative \ + functor type %s ill-typed in the constrained \ signature:@]@ %a@]" - Printtyp.longident lid.txt (Path.name referenced_path) + Printtyp.longident lid.txt + (Path.name referenced_path) Includemod.report_error explanation)); } in @@ -437,7 +438,8 @@ let merge_constraint initial_env loc sg constr = Location.raise_errorf ~loc "@[Destructive substitutions are not supported for \ constrained types (other than when replacing a type \ - constructor with a type constructor with the same arguments).@]"; + constructor with a type constructor with the same \ + arguments).@]"; fun s path -> Subst.add_type_function path ~params ~body s in let sub = List.fold_left how_to_extend_subst Subst.identity !real_ids in @@ -1331,8 +1333,7 @@ and type_module_aux ~alias sttn funct_body anchor env smod = "@[This functor has type@ %a@ The parameter cannot be \ eliminated in the result type.@ Bind the argument to a \ module identifier.@]" - Printtyp.modtype mty_functor - ) + Printtyp.modtype mty_functor) in rm { diff --git a/compiler/ml/typetexp.ml b/compiler/ml/typetexp.ml index 12e1a36edf9..c958eb4b1db 100644 --- a/compiler/ml/typetexp.ml +++ b/compiler/ml/typetexp.ml @@ -618,7 +618,8 @@ and transl_fields env policy o fields = OTinherit cty | {desc = Tvar _}, Some p -> Location.raise_errorf ~loc:sty.ptyp_loc - "The type constructor %a is not yet completely defined" Printtyp.path p + "The type constructor %a is not yet completely defined" Printtyp.path + p | _ -> raise (Error (sty.ptyp_loc, env, Not_an_object t))) in let object_fields = List.map add_field fields in From 5590d821291931caf1192923edf183757ae805fd Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 22 May 2026 16:31:26 +0000 Subject: [PATCH 18/31] Update error variant removal audit Record the diagnostics removed on jono/remove-dead-errors and remove their table rows. Reclassify the audited items that are not completely dead, including stale-CMI module-type paths, the live Syntaxerr printer gap, and UTF-8 helper errors retained for defensive/test entry points. --- tests/ERROR_VARIANTS.md | 255 ++++++++++++---------------------------- 1 file changed, 72 insertions(+), 183 deletions(-) diff --git a/tests/ERROR_VARIANTS.md b/tests/ERROR_VARIANTS.md index 6f45ebbbf4b..d9f8a00ac24 100644 --- a/tests/ERROR_VARIANTS.md +++ b/tests/ERROR_VARIANTS.md @@ -11,8 +11,7 @@ The catalog has two practical uses: AST shape. 2. **Dead-code removal** — rows tagged `⚠` are variants whose trigger site is unreachable in the current parser / compiler, with a named - blocker. They can be deleted in a follow-up PR. The "Confirmed dead" - summary at the bottom groups them by reason. + blocker. They can be deleted in a follow-up PR. ## Status legend @@ -23,7 +22,8 @@ The catalog has two practical uses: | ☐ | Reachable but no fixture yet; would be valuable to add. | | ? | Trigger site is live but reachability from regular ReScript source isn't confirmed. Distinct from ⚠: a `?` means "I couldn't find a fixture that reaches it" rather than "the path is provably blocked". | -The "Confirmed dead" summary section at the bottom only includes ⚠. +The removal audit section below records variants that have already been +deleted or retained after re-validation. ## Scope @@ -55,6 +55,41 @@ If a variant turns out to be unreachable, document the named blocker here (so it gets ⚠ instead of `?`) and file a follow-up to delete the dead code. +## Removed in `jono/remove-dead-errors` + +The following named error and warning variants were re-validated as +unreachable and removed. Guard sites that could still be reached by +malformed PPX-produced ASTs now use direct `Location.raise_errorf` +fallbacks instead of catalogued variants. + +- `typecore`: `Label_mismatch`, `Abstract_wrong_label`, + `Incoherent_label_order`, `Recursive_local_constraint`, + `Invalid_interval`, `Invalid_for_of_pattern` +- `typedecl`: `Type_clash`, `Parameters_differ`, + `Null_arity_external`, `Rebind_wrong_type`, `Bad_fixed_type`, + `Varying_anonymous`, `Val_in_structure` +- `typemod`: `Cannot_eliminate_dependency`, + `With_makes_applicative_functor_ill_typed`, + `With_cannot_remove_constrained_type`, `Scoping_pack` +- `typetexp`: `Unbound_type_constructor_2`, `Variant_tags`, + `Ill_typed_functor_application`, `Apply_structure_as_functor` +- `bs_syntaxerr`: `Conflict_bs_bs_this_bs_meth`, + `Unhandled_poly_type`, `Misplaced_label_syntax` +- `env`: `Illegal_value_name` +- `warnings`: `Comment_start`, `Comment_not_end`, `Method_override`, + `Statement_type`, `Instance_variable_override`, `Illegal_backslash`, + `Implicit_public_methods`, `Unerasable_optional_argument`, + `Eol_in_string`, `Eliminated_optional_arguments`, `Bad_docstring`, + `Bs_fragile_external`, `Bs_unimplemented_primitive`, + `Bs_uninterpreted_delimiters` + +Re-validation also found a few previously-flagged items that are not +completely dead: `includemod.Unbound_modtype_path` can still represent a +stale compiled-interface failure, `Syntaxerr.Variable_in_scope` is live +but lacks a registered printer, and the UTF-8 helper error families are +still raised by test/defensive helper entry points. Those are retained +below with updated notes. + --- ## `compiler/ml/typecore.ml` @@ -66,7 +101,6 @@ Source: [typecore.ml:27](../compiler/ml/typecore.ml). |---|---|---|---| | `Polymorphic_label` | ✓ | `polymorphic_label.res` | Pattern that instantiates a polymorphic record field: `({f: (f: int => int)}: t) =>` constrains the universal `'a` of `f: 'a. 'a => 'a` to `int => int`. | | `Constructor_arity_mismatch` | ✓ | `constructor_arity_mismatch.res`, `constructor_arity_mismatch_pattern.res`, `arity_mismatch*.res` | Triggers in both expression (4028) and pattern (1426) paths. | -| `Label_mismatch` | ⚠ | — | typecore.ml:1543/3589. Defensive `try unify ty_res ty_expected with Unify -> Label_mismatch`. The only way to reach the unify is after label disambiguation (`type_label_a_list` / `type_label_pat` / `Wrong_name`-style logic), which always locks `ty_res` to a record type already unifiable with the expected. The unify therefore can't fail in practice — every reproduction hits `Wrong_name`, `Pattern_type_clash`, or `Expr_type_clash` instead. The constructor is a defensive leftover from the OCaml inheritance. | | `Pattern_type_clash` | ✓ | many `*_pattern_type_clash.res` etc. | Most-fired pattern error. Sub-case fixtures: `pattern_matching_on_option_but_value_not_option.res` and `pattern_matching_on_value_but_is_option.res` (option-vs-non-option trace), `pattern_type_clash_polyvariant.res` (polyvariant tag against concrete type), `pattern_type_clash_tuple_arity.res` (tuple arity mismatch). | | `Or_pattern_type_clash` | ✓ | `or_pattern_type_clash.res` | | | `Multiply_bound_variable` | ✓ | `multiply_bound_variable.res` | | @@ -84,20 +118,15 @@ Source: [typecore.ml:27](../compiler/ml/typecore.ml). | `Private_label` | ✓ | `private_label.res` | | | `Not_subtype` | ✓ | `subtype_*.res`, `dict_show_no_coercion.res`, etc. | | | `Too_many_arguments` | ✓ | `too_many_arguments.res`, `moreArguments*.res` | | -| `Abstract_wrong_label` | ⚠ | — | typecore.ml:3502. Fires in `type_function` when `filter_arrow` with the literal's label fails *and* the expected type is `Tarrow`. In modern ReScript the function literal's type is fully inferred from its own args first, then unified — that path emits `Expr_type_clash`, not `Abstract_wrong_label`. Several attempted reproductions all surfaced as `Expr_type_clash`. Treating as effectively dead. | | `Scoping_let_module` | ✓ | `scoping_let_module.res` | | | `Not_a_variant_type` | ✓ | `variant_spread_pattern_not_a_variant.res` | Pattern-level variant spread of a non-variant type. | -| `Incoherent_label_order` | ⚠ | — | typecore.ml:3894. Reached only after `arity_ok` is true *and* the label is present in `ty_fun` but not at the current arrow position. ReScript's labeled-argument reordering happens earlier in `type_args` / `type_unknown_args`, so by the time we hit this branch the label is already at the right position. Every attempted reproduction landed on `Apply_wrong_label` or `Expr_type_clash`. | | `Less_general` | ✓ | `less_general_universal.res` | | | `Modules_not_allowed` | ✓ | `super_errors_multi/Modules_not_allowed_toplevel` | Toplevel `let module(M) = …` pattern with `allow_modules=false`. | | `Cannot_infer_signature` | ✓ | `cannot_infer_signature.res` | | | `Not_a_packed_module` | ✓ | `not_a_packed_module.res` | | -| `Recursive_local_constraint` | ⚠ | — | typecore.ml:369. Routed via `Unification_recursive_abbrev` in `ctype.ml`, which is raised only when `ctype.ml`'s `Recursive_abbrev` exception fires. **`Recursive_abbrev` is defined (ctype.ml:110, ctype.mli:61) but never raised anywhere in `compiler/`.** Confirmed dead. | | `Unexpected_existential` | ✓ | `super_errors_multi/Unexpected_existential_in_let` | Destructuring GADT constructor with existential in toplevel `let`. | | `Unqualified_gadt_pattern` | ✓ | `super_errors_multi/Cross_gadt_pattern` | Only reachable via cross-module GADT disambiguation; in single-file matching the constructor would resolve before this check. | -| `Invalid_interval` | ⚠ | — | typecore.ml:1349. Triggered by `Ppat_interval` pattern. **Verified: `Ppat_interval` has no construction site in `compiler/syntax/src/res_core.ml`** — only printer and ast_debugger handle it. | | `Invalid_for_loop_index` | ✓ | `invalid_for_loop_index.res` | | -| `Invalid_for_of_pattern` | ⚠ | — | typecore.ml:3120/3152. Verified: parser `normalize_for_of_pattern` (`res_core.ml:3841`) replaces non-var / non-`_` patterns with `Ppat_any` before the typer sees them. | | `No_value_clauses` | ✓ | `no_value_clauses.res` | | | `Exception_pattern_below_toplevel` | ✓ | `exception_pattern_below_toplevel.res` | | | `Inlined_record_escape` | ✓ | `inline_record_escape.res` | | @@ -133,22 +162,15 @@ Type-declaration errors. Source: [typedecl.ml:27](../compiler/ml/typedecl.ml). | `Definition_mismatch` | ✓ | `definition_mismatch.res` | | | `Constraint_failed` | ✓ | `constraint_failed.res` | | | `Inconsistent_constraint` | ✓ | `inconsistent_constraint.res` | | -| `Type_clash` | ⚠ | — | typedecl.ml:125. Fires when `Ctype.unify env (newconstr path params) manifest` fails inside `update_type` for a `type rec` block. For ReScript types this unify either trivially succeeds (aliases unify with their manifest because the cycle/arity machinery has already accepted the shape) or the declaration is rejected earlier by `Cycle_in_def` / `Recursive_abbrev`. I couldn't construct a recursive shape that reaches the failing unify without being caught first. | -| `Parameters_differ` | ⚠ | — | typedecl.ml:988. Fires for non-uniform recursive type *abbreviations* (`type rec t<'a> = … t …`). ReScript treats variant types as having a manifest of None, so `check_regular` is a no-op for them. For abbreviations, `Cycle_in_def` fires first because the recursive reference is direct. I couldn't construct an abbreviation shape that hits Parameters_differ without being cyclic. | -| `Null_arity_external` | ⚠ | — | typedecl.ml:1900. The guard requires `prim_arity = 0` and `prim_native_name` not having the magic 20-byte encoding (`\132\149...`) and `prim_name` not starting with `%` or `#`. The encoding gets applied to every concrete external by `Primitive.parse_declaration`, and empty `prim_name` is rejected earlier by `external_ffi_types.ml` with "Not a valid global name". No path through the parser reaches it. | | `Unbound_type_var` | ✓ | `unbound_type_var.res` | | | `Cannot_extend_private_type` | ✓ | `cannot_extend_private_type.res` | | | `Not_extensible_type` | ✓ | `not_extensible_type.res` | | | `Extension_mismatch` | ✓ | `extension_arity_mismatch.res` | `type t<'a> = ..` extended with `type t += A(int)` — arity differs from the extensible type. | -| `Rebind_wrong_type` | ⚠ | — | typedecl.ml:1653. The unify is `cstr_res` (source constructor's result, freshly instantiated) against `res` (extension's target type with fresh param vars). For non-GADT sources both sides are `t` and trivially unify; for GADT-style sources (`type t<'a> += A: t`) `cstr_res = t` against `res = t` still unifies (`v1 := int`). The parser doesn't allow rebinding with explicit args (`exception B(string) = A` is rejected at `res_core.ml:6660`), so the result-type relationship is always compatible by construction. | | `Rebind_mismatch` | ✓ | `extension_rebind_mismatch.res` | Rebinding constructor into a different extensible type. | | `Rebind_private` | ✓ | `extension_rebind_private.res` | Rebinding a private extension constructor as public. | | `Bad_variance` | ✓ | `bad_variance.res`, `bad_variance_contra.res` | | | `Unavailable_type_constructor` | ☐ (needs build harness) | — | typedecl.ml:778. Requires a type path findable at parse time but missing during constraint enforcement; only cross-unit scenarios where a `.cmi` was found but later removed. | -| `Bad_fixed_type` | ⚠ | — | typedecl.ml:190/193. `set_fixed_row` runs only when `is_fixed_type` returns true, which requires a `private` abstract type with a syntactically open object / polyvariant manifest (typedecl.ml:160-174). For a manifest written that way, `expand_head` returns exactly the same `Tobject` / `Tvariant`, so the check at line 190 passes and the row variable check at line 193 also passes (rows from those syntactic forms have a Tvar `row_more`). No alias chain in ReScript syntax can collapse the open row while still passing `has_row_var` on the syntactic side. | | `Unbound_type_var_ext` | ✓ | `unbound_type_var_extension.res` | | -| `Varying_anonymous` | ⚠ | — | typedecl.ml:1263. Fires in variance computation when an anonymous (`_`) type parameter is constrained against other params under specific variance requirements. ReScript's parser doesn't produce `_` in type parameter position for `type` declarations (`type t<_>` is rejected) — only explicit `'x`-style params, which are never "anonymous" in the sense `Varying_anonymous` checks. | -| `Val_in_structure` | ⚠ | — | typedecl.ml:1887 requires `pval_prim = []` outside a signature. The parser's `external` recovery sets `prim = []` (`res_core.ml:6617`) but only after emitting a `Syntax error`, so the typechecker never reaches the value declaration. From plain source there's no path that produces a non-signature `Val` with empty `pval_prim` — only PPX-rewritten AST could, and the AST shape would have to bypass the parser. | | `Invalid_attribute` | ✓ | `invalid_attribute_not_undefined.res` | | | `Bad_immediate_attribute` | ✓ | `bad_immediate_attribute.res` | | | `Bad_unboxed_attribute` | ✓ | `bad_unboxed_attribute_abstract.res`, `bad_unboxed_attribute_mutable.res`, `bad_unboxed_attribute_many_fields.res`, `bad_unboxed_attribute_extensible.res` | All 4 sub-cases covered. | @@ -167,14 +189,11 @@ Module-level errors. Source: [typemod.ml:24](../compiler/ml/typemod.ml). |---|---|---|---| | `Cannot_apply` | ✓ | `cannot_apply_non_functor.res` | | | `Not_included` | ✓ | All `super_errors_multi/Iface_*` fixtures wrap to this via `compunit`. | | -| `Cannot_eliminate_dependency` | ⚠ | — | typemod.ml:1335. Reached only when `Mtype.nondep_supertype` raises `Not_found` for an anonymous functor application. ReScript's `nondep_supertype` falls back to existential abstraction for any module-typed binding it can't eliminate cleanly, so the `Not_found` branch never fires. Multiple anonymous functor applications (including ones where the result genuinely references the argument's abstract type) all type-check. | | `Signature_expected` | ✓ | `typemod_signature_expected.res` | `with type M.t = …` where `M` is functor-typed inside the outer signature. | | `Structure_expected` | ✓ | `super_errors_multi/Smoke_unbound_module_reference` (indirect); also `open_functor.res` | | | `With_no_component` | ✓ | `with_no_component.res` | | | `With_mismatch` | ✓ | `with_mismatch.res` | | -| `With_makes_applicative_functor_ill_typed` | ⚠ | — | typemod.ml:258. Reached only through the applicative-functor path of `Btype.it_path` (`Papply`); ReScript's parser doesn't emit `Papply` (no parsed construction site in `res_core.ml`), so the iterator never visits this branch. | | `With_changes_module_alias` | ☐ (needs build harness) | — | typemod.ml:240. Fires during `with module := M2` substitution when an aliased sub-module inside the constrained signature is affected. ReScript parses `with module N := M2` (destructive substitution), but constructing a sub-module alias chain that gets invalidated requires multiple `.resi` files and a specific shape I couldn't reproduce single-file. | -| `With_cannot_remove_constrained_type` | ⚠ | — | typemod.ml:443. Fires for `Twith_typesubst` (the `:=` form) when `params_are_constrained` returns true — i.e. the substitution's params are non-`Tvar`. The parser only accepts `'x`-style identifiers in `with type X<…>` param positions (`res_core.ml` rejects `with type x := …` with "Type params start with a singlequote"), so the params are always fresh `Tvar`s and the check never triggers. | | `Repeated_name` | ✓ | `repeated_def_*.res` (multiple) | | | `Non_generalizable` | ✓ | `non_generalizable.res` | | | `Non_generalizable_module` | ✓ | `non_generalizable_module.res` | Nested module containing `let r = ref(None)` — the outer module's `md_type` carries the free `'_weak1` from the inner ref, so `closed_modtype` returns false and the `Sig_module` branch fires. | @@ -182,7 +201,6 @@ Module-level errors. Source: [typemod.ml:24](../compiler/ml/typemod.ml). | `Not_allowed_in_functor_body` | ✓ | `super_errors_multi/not_allowed_in_functor_body` (TODO: confirm path) | | | `Not_a_packed_module` | ✓ | `not_a_packed_module.res` | | | `Incomplete_packed_module` | ✓ | `incomplete_packed_module.res` | | -| `Scoping_pack` | ⚠ | — | typemod.ml:1717. Requires first-class module pack where a constraint type has a level mismatch; very contrived. | | `Recursive_module_require_explicit_type` | ✓ | `recursive_module_require_explicit_type.res` | | | `Apply_generative` | ✓ | `apply_generative.res` | | | `Cannot_scrape_alias` | ☐ (needs build harness) | — | typemod.ml:77, 83, 1347. Requires `Env.scrape_alias` to return `Mty_alias` for an alias whose target `.cmi` couldn't be loaded. The `super_errors_multi` runner pre-compiles every file in the fixture, so the alias target is always present. | @@ -197,7 +215,6 @@ Type-expression errors. Source: [typetexp.ml:28](../compiler/ml/typetexp.ml). |---|---|---|---| | `Unbound_type_variable` | ✓ | (covered indirectly via many fixtures) | | | `Unbound_type_constructor` | ✓ | `typetexp_unbound_type_constructor.res` | | -| `Unbound_type_constructor_2` | ⚠ | — | typetexp.ml:475/619. Reached in two object/polyvariant-inherit code paths when the inherited type is `Tconstr p` and after `expand_head` is still `Tvar` (the body of `p`'s declaration is a bare type variable). ReScript's parser doesn't accept `type t = 'a` at the top level (only via `with type t<'a> = 'a` which doesn't apply here), so the lookup never returns a Tvar-bodied Tconstr. Every reproduction lands on `Not_an_object` or `Not_a_variant`. | | `Type_arity_mismatch` | ✓ | `type_arity_mismatch.res` | | | `Type_mismatch` | ✓ | `typetexp_type_mismatch.res` | Type-constructor application that violates a `constraint 'a = …` on the declaration. | | `Alias_type_mismatch` | ✓ | `typetexp_alias_type_mismatch.res` | | @@ -205,7 +222,6 @@ Type-expression errors. Source: [typetexp.ml:28](../compiler/ml/typetexp.ml). | `Present_has_no_type` | ✓ | `polyvariant_present_has_no_type.res` | `[< #B > #A]` — `#A` is listed as a "present" tag but isn't defined in the polyvariant body. | | `Constructor_mismatch` | ✓ | `polyvariant_constructor_mismatch.res` | | | `Not_a_variant` | ✓ | `typetexp_not_a_variant.res` | Polyvariant `[#X \| a]` where `a` is not a polyvariant. | -| `Variant_tags` | ⚠ | — | typetexp.ml:39. Raised at typecore.ml:342, 349, 367 via `Tags` exception from `ctype.ml`. **Verified: `exception Tags` is defined (ctype.ml:60) but never raised in `compiler/`.** Confirmed dead. | | `Invalid_variable_name` | ✓ | `invalid_type_variable_name.res` | | | `Cannot_quantify` | ✓ | `cannot_quantify.res` | `type t = {f: 'a. (int as 'a) => int}` — `'a` is universally quantified but the alias `int as 'a` rebinds it to `int`, so the proxy is no longer a fresh `Tvar` when the quantification check runs. | | `Multiple_constraints_on_type` | ✓ | `multiple_constraints_on_type.res` | | @@ -215,10 +231,8 @@ Type-expression errors. Source: [typetexp.ml:28](../compiler/ml/typetexp.ml). | `Unbound_label` | ✓ | `typetexp_unbound_label.res` | | | `Unbound_module` | ✓ | `suggest_module_for_missing_identifier.res`, `super_errors_multi/Smoke_unbound_module_reference` | | | `Unbound_modtype` | ✓ | `typetexp_unbound_modtype.res` | | -| `Ill_typed_functor_application` | ⚠ | — | typetexp.ml:102. In the `Longident.Lapply` branch. **Verified: parser has no construction site for `Longident.Lapply`** (no result in `res_core.ml`). Confirmed dead. | | `Illegal_reference_to_recursive_module` | ✓ | `illegal_recursive_module_reference.res` | `module rec A: B.S = …` references another recmodule's module-type before signatures are sealed. During `approx_modtype` of A, `Env.lookup_module B` returns the `#recmod#` placeholder and raises `Env.Recmodule`. | | `Access_functor_as_structure` | ✓ | `access_functor_as_structure.res` | | -| `Apply_structure_as_functor` | ⚠ | — | typetexp.ml:93. In the `Longident.Lapply` branch. Same dead reason as `Ill_typed_functor_application`. | | `Cannot_scrape_alias` | ☐ (needs build harness) | — | typetexp.ml:86 (Ldot path, live), 95/101 (Lapply path, dead since `Lapply` isn't parsed). The live Ldot trigger needs `Env.scrape_alias` to return `Mty_alias` — an alias whose target `.cmi` couldn't be loaded. The `super_errors_multi` harness pre-compiles every alias target. | | `Opened_object` | ✓ | `object_inherit_opened.res` | | | `Not_an_object` | ✓ | `object_inherit_not_an_object.res` | | @@ -239,7 +253,7 @@ Wrapper symptoms attached to inclusion failures. Source: [includemod.ml:23](../c | `Modtype_infos` | ✓ | `super_errors_multi/Iface_modtype_infos` | | | `Modtype_permutation` | ✓ | `super_errors_multi/include_modtype_permutation` | | | `Interface_mismatch` | ✓ | wrapper added to all `Iface_*` failures (line 476). | | -| `Unbound_modtype_path` | ⚠ | — | includemod.ml:94. Fires inside `modtype_path` comparison when `Env.find_modtype` raises `Not_found`. The only callers run after both signatures have been fully typed, so the module-type path is always findable from the local env — `Not_found` would imply a stale `.cmi`, which the multi-file harness can't produce since it always pre-compiles. Treating as dead from the source-only harnesses' point of view. | +| `Unbound_modtype_path` | ☐ (needs stale-cmi harness) | — | includemod.ml:94. Re-validated during removal: not completely dead. It represents `Env.find_modtype` failing during module-type path comparison, which can happen only with a stale or inconsistent compiled interface. The source-only harness cannot produce that state because it pre-compiles every fixture, so this needs a build/binary-state harness rather than deletion. | | `Unbound_module_path` | ☐ (needs build harness) | — | includemod.ml:226/233. Alias comparison where `Env.normalize_path` raises `Not_found`. Requires a module alias whose target `.cmi` is absent at inclusion time — multi-unit only. | | `Invalid_module_alias` | ☐ (needs build harness) | — | includemod.ml:211. Requires both sides `Mty_alias` with one pointing to a functor argument. Reachable only when the alias chain crosses a functor application that the `super_errors_multi` harness doesn't construct. | @@ -279,13 +293,11 @@ FFI / attribute / experimental-feature errors. Source: [bs_syntaxerr.ml:27](../c | Variant | Status | Fixture | Notes | |---|---|---|---| | `Unsupported_predicates` | ✓ | `bs_unsupported_predicates.res` | `@get({weird: true})` on object type field. | -| `Conflict_bs_bs_this_bs_meth` | ⚠ | — | bs_syntaxerr.ml:29 declares the variant but `Bs_syntaxerr.err _ Conflict_bs_bs_this_bs_meth` is **never raised** anywhere in `compiler/`. | | `Duplicated_bs_deriving` | ✓ | `duplicated_bs_deriving.res` | | | `Conflict_attributes` | ✓ | `bs_conflict_attributes.res` | | | `Expect_int_literal` | ✓ | `bs_expect_int_literal.res` | | | `Expect_string_literal` | ✓ | `bs_expect_string_literal.res` | | | `Expect_int_or_string_or_json_literal` | ✓ | `bs_expect_int_or_string_or_json_literal.res` | `@as(true)` on a wildcard external argument. | -| `Unhandled_poly_type` | ⚠ | — | ast_core_type.ml:141. Reached only when an external's arrow chain contains `Ptyp_poly` inline. The parser's `parse_poly_type_expr` only emits `Ptyp_poly` for record field types and explicit `let f: type t. …` annotations; inside arrow chains, the `'a.` is misread as the deprecated `(. …)` uncurried syntax (`res_core.ml` lexer). Inline polytypes in an external's arrow can only come from PPX-rewritten AST. | | `Invalid_underscore_type_in_external` | ✓ | `bs_invalid_underscore_type_in_external.res` | `@obj external make: (~x: _) => _ = ""` — `_` at an optional-label position without `@as`. | | `Invalid_bs_string_type` | ✓ | `bs_invalid_bs_string_type.res` | | | `Invalid_bs_int_type` | ✓ | `bs_invalid_bs_int_type.res` | | @@ -294,7 +306,6 @@ FFI / attribute / experimental-feature errors. Source: [bs_syntaxerr.ml:27](../c | `Illegal_attribute` | ✓ | `bs_illegal_attribute_scope.res` | | | `Not_supported_directive_in_bs_return` | ✓ | `bs_not_supported_directive_in_bs_return.res` | | | `Expect_opt_in_bs_return_to_opt` | ✓ | `bs_expect_opt_in_bs_return_to_opt.res` | | -| `Misplaced_label_syntax` | ⚠ | — | bs_syntaxerr.ml:116. Only fires from `check_and_discard` in `ast_exp_apply.ml:49`, applied to the args of `->`, `#=`, `##` operators. The parser always emits those args as `Nolabel`. | | `Optional_in_uncurried_bs_attribute` | ✓ | `bs_optional_in_uncurried_bs_attribute.res` | `@this` function with optional argument. | | `Bs_this_simple_pattern` | ✓ | `bs_this_simple_pattern.res` | `@this` with destructured self pattern. | | `Experimental_feature_not_enabled` | ✓ | `let_unwrap_on_top_level_not_enabled.res` (and other let-unwrap variants) | Currently only `LetUnwrap` is checked. | @@ -361,7 +372,6 @@ Environment / `.cmi`-consistency errors. Source: [env.ml:57](../compiler/ml/env. | `Illegal_renaming` | ☐ (needs build harness) | — | Triggered when a `.cmi` filename and the module name inside it disagree. Reachable via `rescript.json` setups that rename the produced artefact, but not from a single-process `bsc` invocation that always writes `Module.cmi` to match the source. | | `Inconsistent_import` | ☐ (needs build harness) | — | Triggered when two `.cmi` files transitively imported by the same unit declare different CRCs for the same type. Needs an artificially-mutated build state across multiple compile invocations. | | `Missing_module` | ☐ (needs build harness) | — | `.cmi` referenced but absent from `-I` paths at compile time. The `super_errors_multi` runner pre-compiles every fixture file via `-bs-read-cmi`, so it never reaches this code path. | -| `Illegal_value_name` | ⚠ | — | env.ml:1622/1625 raises when an identifier is `"->"` or starts/contains `#`. The ReScript parser never emits such identifiers; only PPX-rewritten AST could reach the check. | --- @@ -403,160 +413,55 @@ multi-file harnesses, which never set `-ppx`. | `compiler/ml/translmod.ml` | `Fragile_pattern_in_toplevel` | ✓ | `fragile_pattern_toplevel.res` | | | `compiler/ml/transl_recmodule.ml` | `Circular_dependency` | ✓ | `recmodule_circular_dependency.res` | | | `compiler/ml/rec_check.ml` | `Illegal_letrec_expr` | ✓ | `illegal_letrec_expr.res` | | -| `compiler/ml/syntaxerr.ml` | `Variable_in_scope` | ⚠ | — | Reachable via `let f: type t. (t, 't) => t = …` (locally-abstract `t` collides with type variable `'t` during `varify_constructors`), but `Syntaxerr.error` has no registered pretty-printer, so it propagates as an uncaught `Fatal error: exception Syntaxerr.Error(_)`. The variant is live; the printer is dead. Treat as broken until either the printer is wired up or the variant is removed in favor of a proper diagnostic. | +| `compiler/ml/syntaxerr.ml` | `Variable_in_scope` | ? (live, broken printer) | — | Reachable via `let f: type t. (t, 't) => t = …` (locally-abstract `t` collides with type variable `'t` during `varify_constructors`), but `Syntaxerr.error` has no registered pretty-printer, so it propagates as an uncaught `Fatal error: exception Syntaxerr.Error(_)`. Not removed because the variant is live; the fix should wire up a printer or convert the check into a regular typed diagnostic. | | `compiler/ml/cmt_format.cppo.ml` | `Not_a_typedtree` | ☐ (needs binary harness) | — | cmt_format.cppo.ml:147. Fires when a tool reads a `.cmt` file whose first block isn't a typed tree. Reachable in principle by pointing the analyzer at an arbitrary file with a `.cmt` extension; out of scope for the source-only fixture harnesses. | | `compiler/ext/bsc_args.ml` | `Unknown` | ☐ (needs CLI harness) | — | bsc_args.ml:45. Reachable trivially via `bsc --bogus`, but the `super_errors{,_multi}` runners only pass `bsc` a fixed flag list plus the source file — they can't exercise CLI-level errors. | | `compiler/ext/bsc_args.ml` | `Missing` | ☐ (needs CLI harness) | — | Same as above: `bsc -o` (no following filename). Needs a harness that invokes `bsc` with crafted argv. | --- -## `compiler/frontend/ast_utf8_string.ml` (dead family) +## `compiler/frontend/ast_utf8_string.ml` (retained defensive family) -Source: [ast_utf8_string.ml:25](../compiler/frontend/ast_utf8_string.ml). All variants here are reached only via the legacy `{j|…|j}` delimiter, which the modern ReScript parser doesn't emit. Backtick template strings skip the transform entirely. +Source: [ast_utf8_string.ml:25](../compiler/frontend/ast_utf8_string.ml). Re-validation found these are source-unreachable for regular ReScript, but not completely dead: `transform_test` and the defensive string-transform path still raise them, and the OUnit unicode tests assert their offsets. Retained. | Variant | Status | |---|---| -| `Invalid_code_point` | ⚠ Dead | -| `Unterminated_backslash` | ⚠ Dead | -| `Invalid_hex_escape` | ⚠ Dead | -| `Invalid_unicode_escape` | ⚠ Dead | -| `Invalid_unicode_codepoint_escape` | ⚠ Dead | +| `Invalid_code_point` | ? (source-unreachable, retained defensive/test helper) | +| `Unterminated_backslash` | ? (source-unreachable, retained defensive/test helper) | +| `Invalid_hex_escape` | ? (source-unreachable, retained defensive/test helper) | +| `Invalid_unicode_escape` | ? (source-unreachable, retained defensive/test helper) | +| `Invalid_unicode_codepoint_escape` | ? (source-unreachable, retained defensive/test helper) | -## `compiler/frontend/ast_utf8_string_interp.ml` (dead family) +## `compiler/frontend/ast_utf8_string_interp.ml` (retained test family) Source: [ast_utf8_string_interp.ml:25](../compiler/frontend/ast_utf8_string_interp.ml). -`pos_error` is reached only through `check_and_transform`, whose only -caller in `compiler/` is `transform_test` — used by OUnit tests, not the -production pipeline. Modern ReScript backtick templates take the -`BackQuotes` branch of `transform_exp` (line 311) and skip the -interpolation parser entirely. The legacy `{j|…|j}` delimiter the -parser would otherwise route here is no longer accepted by the -scanner. All variants below are unreachable from regular ReScript -source. +`pos_error` is reached through `transform_test`, which is intentionally +used by OUnit tests. Modern ReScript backtick templates take the +`BackQuotes` branch of `transform_exp` and skip the interpolation parser, +so these are source-unreachable for regular ReScript, but not completely +dead. Retained. | Variant | Status | |---|---| -| `Invalid_code_point` | ⚠ Dead | -| `Unterminated_backslash` | ⚠ Dead | -| `Invalid_escape_code` | ⚠ Dead | -| `Invalid_hex_escape` | ⚠ Dead | -| `Invalid_unicode_escape` | ⚠ Dead | -| `Unterminated_variable` | ⚠ Dead | -| `Unmatched_paren` | ⚠ Dead | -| `Invalid_syntax_of_var` | ⚠ Dead | +| `Invalid_code_point` | ? (source-unreachable, retained test helper) | +| `Unterminated_backslash` | ? (source-unreachable, retained test helper) | +| `Invalid_escape_code` | ? (source-unreachable, retained test helper) | +| `Invalid_hex_escape` | ? (source-unreachable, retained test helper) | +| `Invalid_unicode_escape` | ? (source-unreachable, retained test helper) | +| `Unterminated_variable` | ? (source-unreachable, retained test helper) | +| `Unmatched_paren` | ? (source-unreachable, retained test helper) | +| `Invalid_syntax_of_var` | ? (source-unreachable, retained test helper) | --- -## Confirmed dead variants — candidates for removal - -Only variants with a concrete, source-level reason are listed. Each row -has been re-verified against the source as of this audit. Variants marked -`?` in the tables above are **not** included here — those may turn out to -be live and just hard to reproduce. - -**Verified dead by missing raise / construction site:** - -- `typecore.Variant_tags`, `typetexp.Variant_tags` — relayed via the - `Tags` exception which is declared in `ctype.ml:60` / `ctype.mli:57` - but **never raised** in `compiler/`. -- `typecore.Recursive_local_constraint` — relayed via - `Unification_recursive_abbrev`, raised only from the `Recursive_abbrev` - exception which is declared (`ctype.ml:110`, `ctype.mli:61`) but - **never raised**. -- `typecore.Invalid_interval` — needs `Ppat_interval`; **no construction - site** for that AST node in `compiler/syntax/src/`. -- `typecore.Invalid_for_of_pattern` — parser's - `normalize_for_of_pattern` (`res_core.ml:3841`) replaces every non-var, - non-`_` pattern with `Ppat_any` before the typer runs. -- `bs_syntaxerr.Conflict_bs_bs_this_bs_meth` — variant is declared but - no `Bs_syntaxerr.err _ Conflict_bs_bs_this_bs_meth` call exists in - `compiler/`. - -**Verified dead because parser doesn't produce required AST shape:** - -- `typetexp.Ill_typed_functor_application`, - `typetexp.Apply_structure_as_functor` — in the - `Longident.Lapply` branch; `Lapply` has no construction site in - the parser (`res_core.ml`). -- `bs_syntaxerr.Misplaced_label_syntax` — fires for labeled args to - `->`/`#=`/`##` operators; the parser always emits those with - `Nolabel`. -- `typedecl.Null_arity_external` — primitives parsed by - `Primitive.parse_declaration` always get the magic 20-byte - `prim_native_name` encoding, which bypasses the trigger; empty - `prim_name` is rejected earlier with "Not a valid global name". -- `ast_utf8_string.*` (Invalid_code_point, Unterminated_backslash, - Invalid_hex_escape, Invalid_unicode_escape, - Invalid_unicode_codepoint_escape) — the scanner - (`res_scanner.ml:350-417`) already validates escape sequences and - unicode code points; the transform never sees a string that would - fail its own re-validation. -- `ast_utf8_string_interp.*` (the whole module's error variants) — - `check_and_transform` is only ever called from `transform_test`, which - exists for OUnit tests, not the production pipeline. Modern ReScript - backtick templates take the `BackQuotes` branch of `transform_exp` - and skip the interpolation parser entirely. -- `typedecl.Val_in_structure` — typedecl.ml:1887 requires `pval_prim - = []` outside a signature; the parser's `external` recovery sets - `prim = []` only after emitting a syntax error, so the typechecker - never reaches the value declaration. -- `env.Illegal_value_name` — env.ml:1622/1625 rejects `"->"` and - identifiers containing `#`. The parser never produces such names; - PPX-rewritten AST is the only path that could trigger it. -- `bs_warnings.Statement_type` (warning 10) — only caller of - `check_application_result` passes `statement = false`, so the - `if statement then …` branch never fires. -- `bs_warnings.Unerasable_optional_argument` (warning 16) — - `type_function` (typecore.ml:3479) explicitly disables this warning - via `Warnings.parse_options false "-16"` before the check runs. -- `bs_warnings.Bs_uninterpreted_delimiters` (warning 108) — raised at - `bs_warnings.ml:29` for `Pconst_string` with delimiter `"js"`, but - the modern scanner has no `{js|…|js}` form and template strings tag - with `"bq"` after rewriting. - -**`Syntaxerr.Variable_in_scope` is a special case** — reachable from -`let f: type t. (t, 't) => t = …` but raised without a registered -printer, so it surfaces as `Fatal error: exception Syntaxerr.Error(_)`. -The variant is live; the diagnostic path is broken. Fix should either -wire up a printer or convert the check into a regular typed error. - -**Newly verified dead** (the variants the second-pass audit promoted -from `?` to ⚠, with the reason in the table): - -- `typecore.Label_mismatch`, `Abstract_wrong_label`, - `Incoherent_label_order` — defensive `try unify with Unify ->` paths - that are subsumed by `Wrong_name` / `Expr_type_clash` / - `Apply_wrong_label` in modern ReScript. -- `typedecl.Type_clash` — every recursive `type` shape that would reach - the failing `unify` is rejected earlier by `Cycle_in_def` / - `Recursive_abbrev`. -- `typedecl.Parameters_differ` — `check_regular` runs only on - abbreviations, and ReScript's parser produces `Cycle_in_def` for - every recursive abbreviation shape before this check. -- `typedecl.Rebind_wrong_type` — the parser refuses extension rebind - syntax that carries args or a result type, so source and target's - result types always unify trivially. -- `typedecl.Bad_fixed_type` — `is_fixed_type` checks the syntactic - manifest for an open row, and `expand_head` preserves that row; - there's no ReScript syntax that satisfies one check and fails the - other. -- `typedecl.Varying_anonymous` — needs `_` in a `type` parameter - position, which the parser doesn't accept. -- `typetexp.Unbound_type_constructor_2` — needs an inherited type - whose `Tconstr` body is a bare `Tvar`; the parser rejects - `type t = 'a` at top-level. -- `typemod.Cannot_eliminate_dependency` — `Mtype.nondep_supertype` - falls back to existential abstraction in every reachable case; - the `Not_found` branch never fires. -- `typemod.With_cannot_remove_constrained_type` — the parser only - accepts `'x`-style identifiers in `with type` param positions, so - the params are always fresh `Tvar`s and `params_are_constrained` - returns false. -- `bs_syntaxerr.Unhandled_poly_type` — the only way an external's - arrow chain gets an inline `Ptyp_poly` is via PPX-rewritten AST; - the parser misreads `'a.` inline as the deprecated `(. …)` - uncurried syntax. +## Removal audit notes + +All variants that were confirmed completely dead in this pass are listed +in **Removed in `jono/remove-dead-errors`** above and no longer appear in +the module tables. Previously flagged entries that were only unreachable +from regular source, but still possible through stale build artifacts, +PPX/malformed ASTs, or test helper APIs, were retained and reclassified. --- @@ -572,27 +477,11 @@ warnings still fire. Fixtures follow the naming convention `warning__.res` so coverage gaps stay greppable. -### Confirmed dead (no `prerr_warning` site in the compiler) +### Removed warnings -These warning constructors exist in `warnings.ml` but are never raised -anywhere in `compiler/`. They are candidates for removal. - -| Number | Variant | Reason | -|---|---|---| -| 1 | `Comment_start` | Lexer warning; modern parser doesn't emit. | -| 2 | `Comment_not_end` | Lexer warning; modern parser doesn't emit. | -| 7 | `Method_override` | OCaml class system, not exposed by ReScript. | -| 13 | `Instance_variable_override` | OCaml class system. | -| 14 | `Illegal_backslash` | Lexer-level escape warning; parser doesn't emit. | -| 15 | `Implicit_public_methods` | OCaml class system. | -| 29 | `Eol_in_string` | Lexer-level string warning. | -| 48 | `Eliminated_optional_arguments` | Declared but never raised. | -| 50 | `Bad_docstring` | Declared but never raised; also default-disabled. | -| 105 | `Bs_fragile_external` | Declared but never raised. | -| 106 | `Bs_unimplemented_primitive` | Declared but never raised. | -| 10 | `Statement_type` | Raised at typecore.ml:2052 inside `check_application_result`, but `statement` is always `false` at the only call site (typecore.ml:3983); sequence statements hit `Expr_type_clash` via `type_statement` unifying to `unit`. | -| 16 | `Unerasable_optional_argument` | Raised at typecore.ml:3526, but `type_function` (typecore.ml:3479) explicitly disables this warning before the check runs (`Warnings.parse_options false "-16"`). | -| 108 | `Bs_uninterpreted_delimiters` | Raised at bs_warnings.ml:29 for `Pconst_string` with delimiter `"js"`; the modern scanner has no `{js\|...\|js}` form and template strings don't tag with `"js"`. | +The warning constructors listed in **Removed in `jono/remove-dead-errors`** +were deleted. Their numeric warning slots remain holes; no warning number +was reused. ### Live but no fixture yet From a792a7c9ea9e3c2a6fe527464cabd1023900d09a Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Fri, 22 May 2026 16:36:36 +0000 Subject: [PATCH 19/31] Restore live typedecl rebind diagnostic Full build testing showed extension_rebind_mismatch.res exercises Rebind_wrong_type, not Rebind_mismatch. Restore the typed unification diagnostic and update the audit to mark Rebind_wrong_type live while leaving Rebind_mismatch unconfirmed. --- compiler/ml/typedecl.ml | 14 +++++++++----- tests/ERROR_VARIANTS.md | 19 +++++++++++-------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/compiler/ml/typedecl.ml b/compiler/ml/typedecl.ml index 4e0f6d31cab..fe6abdf406d 100644 --- a/compiler/ml/typedecl.ml +++ b/compiler/ml/typedecl.ml @@ -38,6 +38,7 @@ type error = | Cannot_extend_private_type of Path.t | Not_extensible_type of Path.t | Extension_mismatch of Path.t * Includecore.type_mismatch list + | Rebind_wrong_type of Longident.t * Env.t * (type_expr * type_expr) list | Rebind_mismatch of Longident.t * Path.t * Path.t | Rebind_private of Longident.t | Bad_variance of int * (bool * bool * bool) * (bool * bool * bool) @@ -1645,11 +1646,8 @@ let transl_extension_constructor env type_path type_params typext_params priv else (Ctype.newconstr type_path typext_params, None) in (try Ctype.unify env cstr_res res - with Ctype.Unify _ -> - Location.raise_errorf ~loc:lid.loc - "The constructor %a has a type that is incompatible with this \ - extension" - Printtyp.longident lid.txt); + with Ctype.Unify trace -> + raise (Error (lid.loc, Rebind_wrong_type (lid.txt, env, trace)))); (* Remove "_" names from parameters used in the constructor *) (if not cdescr.cstr_generalized then let vars = Ctype.free_variables (Btype.newgenty (Ttuple args)) in @@ -2196,6 +2194,12 @@ let report_error ppf = function "does not match the definition of type" (Path.name path) (Includecore.report_type_mismatch "the type" "this extension" "definition") errs + | Rebind_wrong_type (lid, env, trace) -> + Printtyp.report_unification_error ppf env trace + (function + | ppf -> + fprintf ppf "The constructor %a@ has type" Printtyp.longident lid) + (function ppf -> fprintf ppf "but was expected to be of type") | Rebind_mismatch (lid, p, p') -> fprintf ppf "@[%s@ %a@ %s@ %s@ %s@ %s@ %s@]" "The constructor" Printtyp.longident lid "extends type" (Path.name p) diff --git a/tests/ERROR_VARIANTS.md b/tests/ERROR_VARIANTS.md index d9f8a00ac24..728658c82f0 100644 --- a/tests/ERROR_VARIANTS.md +++ b/tests/ERROR_VARIANTS.md @@ -66,8 +66,8 @@ fallbacks instead of catalogued variants. `Incoherent_label_order`, `Recursive_local_constraint`, `Invalid_interval`, `Invalid_for_of_pattern` - `typedecl`: `Type_clash`, `Parameters_differ`, - `Null_arity_external`, `Rebind_wrong_type`, `Bad_fixed_type`, - `Varying_anonymous`, `Val_in_structure` + `Null_arity_external`, `Bad_fixed_type`, `Varying_anonymous`, + `Val_in_structure` - `typemod`: `Cannot_eliminate_dependency`, `With_makes_applicative_functor_ill_typed`, `With_cannot_remove_constrained_type`, `Scoping_pack` @@ -84,11 +84,13 @@ fallbacks instead of catalogued variants. `Bs_uninterpreted_delimiters` Re-validation also found a few previously-flagged items that are not -completely dead: `includemod.Unbound_modtype_path` can still represent a -stale compiled-interface failure, `Syntaxerr.Variable_in_scope` is live -but lacks a registered printer, and the UTF-8 helper error families are -still raised by test/defensive helper entry points. Those are retained -below with updated notes. +completely dead: `typedecl.Rebind_wrong_type` is live via extension +rebinding across incompatible extension types, +`includemod.Unbound_modtype_path` can still represent a stale +compiled-interface failure, `Syntaxerr.Variable_in_scope` is live but +lacks a registered printer, and the UTF-8 helper error families are still +raised by test/defensive helper entry points. Those are retained below +with updated notes. --- @@ -166,7 +168,8 @@ Type-declaration errors. Source: [typedecl.ml:27](../compiler/ml/typedecl.ml). | `Cannot_extend_private_type` | ✓ | `cannot_extend_private_type.res` | | | `Not_extensible_type` | ✓ | `not_extensible_type.res` | | | `Extension_mismatch` | ✓ | `extension_arity_mismatch.res` | `type t<'a> = ..` extended with `type t += A(int)` — arity differs from the extensible type. | -| `Rebind_mismatch` | ✓ | `extension_rebind_mismatch.res` | Rebinding constructor into a different extensible type. | +| `Rebind_wrong_type` | ✓ | `extension_rebind_mismatch.res` | Rebinding constructor into a different extensible type fails while unifying the source constructor result with the extension target. | +| `Rebind_mismatch` | ? | — | The later declaration-shape check after `Rebind_wrong_type`; no source fixture was confirmed in this pass. | | `Rebind_private` | ✓ | `extension_rebind_private.res` | Rebinding a private extension constructor as public. | | `Bad_variance` | ✓ | `bad_variance.res`, `bad_variance_contra.res` | | | `Unavailable_type_constructor` | ☐ (needs build harness) | — | typedecl.ml:778. Requires a type path findable at parse time but missing during constraint enforcement; only cross-unit scenarios where a `.cmi` was found but later removed. | From 27e91e3659ddb8f71979ce2439cf907b1666db29 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Wed, 27 May 2026 17:29:28 +0000 Subject: [PATCH 20/31] Restore live typecore label diagnostics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reproductions during PR review showed that two of the three typecore label variants removed by 52bed6c7f are still reachable from regular ReScript source: - Label_mismatch fires when a record literal without an expected type mixes fields from two different record types — disambiguation picks one type per label and the cross-type unify inside type_label_exp fails. Fixture: label_mismatch_record_literal.res. - Abstract_wrong_label fires when a multi-arg function literal has an inner argument label that doesn't match the expected arrow's label. Fixture: abstract_wrong_label.res. Restore both variants, their raise sites, and reporter cases. The third removed variant (Incoherent_label_order) stays removed — every attempt to reach it routed through Expr_type_clash via the modern arity-aware unify path. Update tests/ERROR_VARIANTS.md to mark both rows ✓ with the new fixtures and drop them from the removal list. The pattern-path catch in type_pat_aux stays removed (was genuinely dead because unify_pat_types already translates Ctype.Unify to Pattern_type_clash). --- compiler/ml/typecore.ml | 32 ++++++++++++++++--- compiler/ml/typecore.mli | 2 ++ tests/ERROR_VARIANTS.md | 10 ++++-- .../abstract_wrong_label.res.expected | 9 ++++++ ...label_mismatch_record_literal.res.expected | 11 +++++++ .../fixtures/abstract_wrong_label.res | 1 + .../label_mismatch_record_literal.res | 3 ++ 7 files changed, 61 insertions(+), 7 deletions(-) create mode 100644 tests/build_tests/super_errors/expected/abstract_wrong_label.res.expected create mode 100644 tests/build_tests/super_errors/expected/label_mismatch_record_literal.res.expected create mode 100644 tests/build_tests/super_errors/fixtures/abstract_wrong_label.res create mode 100644 tests/build_tests/super_errors/fixtures/label_mismatch_record_literal.res diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index a3774ffed24..b709ce1954a 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -32,6 +32,7 @@ type error = expected: int; provided: int; } + | Label_mismatch of Longident.t * (type_expr * type_expr) list | Pattern_type_clash of (type_expr * type_expr) list | Or_pattern_type_clash of Ident.t * (type_expr * type_expr) list | Multiply_bound_variable of string @@ -42,6 +43,7 @@ type error = } | Apply_non_function of type_expr | Apply_wrong_label of arg_label * type_expr + | Abstract_wrong_label of arg_label * type_expr | Label_multiply_defined of { label: string; jsx_component_info: jsx_prop_error_info option; @@ -3462,9 +3464,13 @@ and type_function ?in_function ~arity ~async loc attrs env ty_expected_ l if separate then begin_def (); let ty_arg, ty_res = try filter_arrow ~env ~arity (instance env ty_expected) l - with Unify _ -> - raise - (Error (loc_fun, env, Too_many_arguments (in_function <> None, ty_fun))) + with Unify _ -> ( + match expand_head env ty_expected with + | {desc = Tarrow _} as ty -> + raise (Error (loc, env, Abstract_wrong_label (l, ty))) + | _ -> + raise + (Error (loc_fun, env, Too_many_arguments (in_function <> None, ty_fun)))) in let ty_arg = if is_optional l then ( @@ -3542,8 +3548,9 @@ and type_label_exp ~call_context create env loc ty_expected (* Generalize label information *) generalize_structure ty_arg; generalize_structure ty_res); - unify_exp_types ~context:None lid.loc env (instance_def ty_res) - (instance env ty_expected); + (try unify env (instance_def ty_res) (instance env ty_expected) + with Unify trace -> + raise (Error (lid.loc, env, Label_mismatch (lid.txt, trace)))); (* Instantiate so that we can generalize internal nodes *) let ty_arg = instance_def ty_arg in if separate then ( @@ -4555,6 +4562,13 @@ let report_error env loc ppf error = (if expected == 1 then "argument" else "arguments") (if provided < expected then " only" else "") provided + | Label_mismatch (lid, trace) -> + (* modified *) + super_report_unification_error ppf env trace + (function + | ppf -> + fprintf ppf "The record field %a@ belongs to the type" longident lid) + (function ppf -> fprintf ppf "but is mixed here with fields of type") | Pattern_type_clash trace -> (* modified *) super_report_unification_error ppf env trace @@ -4637,6 +4651,14 @@ let report_error env loc ppf error = in fprintf ppf "@[@[<2>%a@]@,This function has type: %a@]" print_message l type_expr ty + | Abstract_wrong_label (l, ty) -> + let label_mark = function + | Nolabel -> "but its first argument is not labelled" + | l -> + sprintf "but its first argument is labelled %s" (prefixed_label_name l) + in + fprintf ppf "@[@[<2>This function should have type@ %a@]@,%s@]" type_expr + ty (label_mark l) | Label_multiply_defined {label; jsx_component_info = Some jsx_component_info} -> fprintf ppf diff --git a/compiler/ml/typecore.mli b/compiler/ml/typecore.mli index cc63ed4fe72..10ff2ad8cab 100644 --- a/compiler/ml/typecore.mli +++ b/compiler/ml/typecore.mli @@ -65,6 +65,7 @@ type error = expected: int; provided: int; } + | Label_mismatch of Longident.t * (type_expr * type_expr) list | Pattern_type_clash of (type_expr * type_expr) list | Or_pattern_type_clash of Ident.t * (type_expr * type_expr) list | Multiply_bound_variable of string @@ -75,6 +76,7 @@ type error = } | Apply_non_function of type_expr | Apply_wrong_label of arg_label * type_expr + | Abstract_wrong_label of arg_label * type_expr | Label_multiply_defined of { label: string; jsx_component_info: Error_message_utils.jsx_prop_error_info option; diff --git a/tests/ERROR_VARIANTS.md b/tests/ERROR_VARIANTS.md index 728658c82f0..f07deea6635 100644 --- a/tests/ERROR_VARIANTS.md +++ b/tests/ERROR_VARIANTS.md @@ -62,8 +62,7 @@ unreachable and removed. Guard sites that could still be reached by malformed PPX-produced ASTs now use direct `Location.raise_errorf` fallbacks instead of catalogued variants. -- `typecore`: `Label_mismatch`, `Abstract_wrong_label`, - `Incoherent_label_order`, `Recursive_local_constraint`, +- `typecore`: `Incoherent_label_order`, `Recursive_local_constraint`, `Invalid_interval`, `Invalid_for_of_pattern` - `typedecl`: `Type_clash`, `Parameters_differ`, `Null_arity_external`, `Bad_fixed_type`, `Varying_anonymous`, @@ -86,6 +85,11 @@ fallbacks instead of catalogued variants. Re-validation also found a few previously-flagged items that are not completely dead: `typedecl.Rebind_wrong_type` is live via extension rebinding across incompatible extension types, +`typecore.Label_mismatch` is live when a record literal without an +expected type mixes fields from two different record types (see +`label_mismatch_record_literal.res`), `typecore.Abstract_wrong_label` +is live when a multi-arg function literal has a mislabelled inner +argument (see `abstract_wrong_label.res`), `includemod.Unbound_modtype_path` can still represent a stale compiled-interface failure, `Syntaxerr.Variable_in_scope` is live but lacks a registered printer, and the UTF-8 helper error families are still @@ -110,6 +114,8 @@ Source: [typecore.ml:27](../compiler/ml/typecore.ml). | `Expr_type_clash` | ✓ | many `*.res` | Most-fired expression error. Trace-shape sub-cases covered: `if_return_type_mismatch.res` (IfReturn), `maybe_unwrap_option.res` (MaybeUnwrapOption), `string_concat_non_string.res` (StringConcat), `labeled_fn_argument_type_clash.res` (FunctionArgument with explicit label), `math_operator_*.res` (MathOperator family), `ternary_branch_mismatch.res`, `switch_different_types.res`, `try_catch_same_type.res`, `comparison_operator.res`, `array_item_type_mismatch.res`, `array_literal_passed_to_tuple.res`, `if_condition_mismatch.res`, `while_condition.res`, `for_loop_condition.res`, `assert_condition.res`, `function_call_mismatch.res`, `awaiting_non_promise.res`, multiple `jsx_*` fixtures. | | `Apply_non_function` | ✓ | `apply_non_function.res` | | | `Apply_wrong_label` | ✓ | `apply_wrong_label.res` | | +| `Abstract_wrong_label` | ✓ | `abstract_wrong_label.res` | Multi-arg function literal where an inner argument label doesn't match the expected arrow's label (e.g. `let f: (~a, ~b) => int = (~a, ~c) => …`). | +| `Label_mismatch` | ✓ | `label_mismatch_record_literal.res` | Record literal without expected type mixing fields from two different record types — disambiguation picks one type per label, and the cross-type unify fails inside `type_label_exp`. | | `Label_multiply_defined` | ✓ | `label_multiply_defined_literal.res` | | | `Labels_missing` | ✓ | `missing_label.res`, `missing_labels.res` | | | `Label_not_mutable` | ✓ | `label_not_mutable.res` | | diff --git a/tests/build_tests/super_errors/expected/abstract_wrong_label.res.expected b/tests/build_tests/super_errors/expected/abstract_wrong_label.res.expected new file mode 100644 index 00000000000..272b06a71b5 --- /dev/null +++ b/tests/build_tests/super_errors/expected/abstract_wrong_label.res.expected @@ -0,0 +1,9 @@ + + We've found a bug for you! + /.../fixtures/abstract_wrong_label.res:1:41-52 + + 1 │ let f: (~a: int, ~b: int) => int = (~a, ~c) => a + c + 2 │ + + This function should have type (~b: int) => int + but its first argument is labelled ~c \ No newline at end of file diff --git a/tests/build_tests/super_errors/expected/label_mismatch_record_literal.res.expected b/tests/build_tests/super_errors/expected/label_mismatch_record_literal.res.expected new file mode 100644 index 00000000000..aa9a0e5d466 --- /dev/null +++ b/tests/build_tests/super_errors/expected/label_mismatch_record_literal.res.expected @@ -0,0 +1,11 @@ + + We've found a bug for you! + /.../fixtures/label_mismatch_record_literal.res:3:16 + + 1 │ type a = {x: int} + 2 │ type b = {y: int} + 3 │ let _ = {x: 1, y: 2} + 4 │ + + The record field y belongs to the type b + but is mixed here with fields of type a \ No newline at end of file diff --git a/tests/build_tests/super_errors/fixtures/abstract_wrong_label.res b/tests/build_tests/super_errors/fixtures/abstract_wrong_label.res new file mode 100644 index 00000000000..25fc0aaf18e --- /dev/null +++ b/tests/build_tests/super_errors/fixtures/abstract_wrong_label.res @@ -0,0 +1 @@ +let f: (~a: int, ~b: int) => int = (~a, ~c) => a + c diff --git a/tests/build_tests/super_errors/fixtures/label_mismatch_record_literal.res b/tests/build_tests/super_errors/fixtures/label_mismatch_record_literal.res new file mode 100644 index 00000000000..640d3ee57f7 --- /dev/null +++ b/tests/build_tests/super_errors/fixtures/label_mismatch_record_literal.res @@ -0,0 +1,3 @@ +type a = {x: int} +type b = {y: int} +let _ = {x: 1, y: 2} From 977bee00eb4526cc7158d468d0c4725428384ce6 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Wed, 27 May 2026 20:00:18 +0000 Subject: [PATCH 21/31] Switch defensive raise sites to assert false; revert typemod/Misplaced_label_syntax PR-review feedback: replacing dead raise sites with Location.raise_errorf moves code rather than removing it, and introduces a pattern that doesn't exist anywhere else in the typer modules (which use raise (Error ...) for real errors and assert false for unreachable defensive code; zero inline Location.raise_errorf calls in master). This commit aligns the cleanup with the existing convention: 1. Variants whose raise sites are confirmed unreachable from the ReScript parser have those sites rewritten to `assert false (* reason *)` with a comment citing the parser block or sibling check. The named variant (decl + reporter) stays removed. - typecore.Invalid_interval, Invalid_for_of_pattern (parser blocks / normalizes the AST) - typetexp.Unbound_type_constructor_2, Ill_typed_functor_application, Apply_structure_as_functor (parser doesn't construct Lapply or bare-Tvar Tconstr body) - typedecl.Type_clash, Parameters_differ (Cycle_in_def fires first), Null_arity_external (Primitive.parse_declaration sets prim_native_name always), Bad_fixed_type (is_fixed_type and expand_head agree), Varying_anonymous (parser rejects `_` type params), Val_in_structure (parser rejects val outside .resi) - bs_syntaxerr.Unhandled_poly_type (parser misreads inline 'a. as deprecated uncurried syntax) - env.Illegal_value_name (parser doesn't emit '->' or # identifiers) - typecore.Incoherent_label_order: collapsed into Apply_wrong_label with a comment explaining why the original second arm was unreachable 2. Variants where reproduction confirmed they ARE reachable, or where I couldn't prove unreachability, are restored to named-variant form: - typemod.Cannot_eliminate_dependency (couldn't reproduce, but reachable from non-generative functor application paths in principle - retained conservatively) - typemod.With_makes_applicative_functor_ill_typed (couldn't reproduce - retained conservatively) - typemod.With_cannot_remove_constrained_type (REACHABLE via destructive substitution on a constrained type, fixture with_cannot_remove_constrained_type.res) - typemod.Scoping_pack (couldn't reproduce - retained conservatively) - bs_syntaxerr.Misplaced_label_syntax (REACHABLE via operator-as- identifier syntax with labelled arg, fixture misplaced_label_syntax.res) 3. tests/ERROR_VARIANTS.md updated to (a) split the Removed section into "Truly dead" and "Defensive unreachable" categories, (b) note the restored typemod variants with `?` status, (c) add covered rows for the two new fixtures. Truly-dead removals (no raise site, transitively dead, or always-false guard) are unchanged: 3 Ctype exceptions, 2 relay variants (typecore.Recursive_local_constraint, typetexp.Variant_tags), bs_syntaxerr.Conflict_bs_bs_this_bs_meth, 14 warning constructors. Validation: rg confirmed no remaining references to the removed variants. make compiler, super_errors (745 fixtures), super_errors_multi (54 fixtures) all pass. make checkformat clean. --- compiler/frontend/ast_core_type.ml | 8 +- compiler/frontend/bs_syntaxerr.ml | 7 +- compiler/frontend/bs_syntaxerr.mli | 1 + compiler/ml/env.ml | 13 +- compiler/ml/typecore.ml | 26 +++- compiler/ml/typedecl.ml | 58 ++++++--- compiler/ml/typemod.ml | 57 +++++---- compiler/ml/typemod.mli | 5 + compiler/ml/typetexp.ml | 28 +++-- tests/ERROR_VARIANTS.md | 116 ++++++++++++------ .../misplaced_label_syntax.res.expected | 9 ++ ...annot_remove_constrained_type.res.expected | 12 ++ .../fixtures/misplaced_label_syntax.res | 2 + .../with_cannot_remove_constrained_type.res | 5 + 14 files changed, 245 insertions(+), 102 deletions(-) create mode 100644 tests/build_tests/super_errors/expected/misplaced_label_syntax.res.expected create mode 100644 tests/build_tests/super_errors/expected/with_cannot_remove_constrained_type.res.expected create mode 100644 tests/build_tests/super_errors/fixtures/misplaced_label_syntax.res create mode 100644 tests/build_tests/super_errors/fixtures/with_cannot_remove_constrained_type.res diff --git a/compiler/frontend/ast_core_type.ml b/compiler/frontend/ast_core_type.ml index 3f056c2bb4f..f834d6f4b9e 100644 --- a/compiler/frontend/ast_core_type.ml +++ b/compiler/frontend/ast_core_type.ml @@ -136,8 +136,12 @@ let list_of_arrow (ty : t) : t * Parsetree.arg list = match ty.ptyp_desc with | Ptyp_arrow {arg; ret; arity} when arity = None || acc = [] -> aux ret (arg :: acc) - | Ptyp_poly (_, ty) -> - Location.raise_errorf ~loc:ty.ptyp_loc "Unhandled poly type" + | Ptyp_poly _ -> + (* unreachable: this would require an inline Ptyp_poly inside an + external's arrow chain. The ReScript parser misreads inline `'a.` + prefix syntax as the deprecated uncurried `(. …)` form and rejects + it, so the typer never sees the required AST shape. *) + assert false | _ -> (ty, List.rev acc) in aux ty [] diff --git a/compiler/frontend/bs_syntaxerr.ml b/compiler/frontend/bs_syntaxerr.ml index 7ef491e6f9d..7509f328f1a 100644 --- a/compiler/frontend/bs_syntaxerr.ml +++ b/compiler/frontend/bs_syntaxerr.ml @@ -46,6 +46,7 @@ type error = | Bs_this_simple_pattern | Experimental_feature_not_enabled of Experimental_features.feature | LetUnwrap_not_supported_in_position of [`Toplevel | `Unsupported_type] + | Misplaced_label_syntax let pp_error fmt err = Format.pp_print_string fmt @@ -86,7 +87,8 @@ let pp_error fmt err = | `Toplevel -> "`let?` is not allowed for top-level bindings." | `Unsupported_type -> "`let?` is only supported in let bindings targeting the `result` or \ - `option` type.")) + `option` type.") + | Misplaced_label_syntax -> "Label syntax is not supported in this position") type exn += Error of Location.t * error @@ -103,5 +105,4 @@ let optional_err loc (lbl : Asttypes.arg_label) = | _ -> () let err_if_label loc (lbl : Asttypes.arg_label) = - if lbl <> Nolabel then - Location.raise_errorf ~loc "Label syntax is not supported in this position" + if lbl <> Nolabel then raise (Error (loc, Misplaced_label_syntax)) diff --git a/compiler/frontend/bs_syntaxerr.mli b/compiler/frontend/bs_syntaxerr.mli index c174245fb1b..4851c3adcb5 100644 --- a/compiler/frontend/bs_syntaxerr.mli +++ b/compiler/frontend/bs_syntaxerr.mli @@ -46,6 +46,7 @@ type error = | Bs_this_simple_pattern | Experimental_feature_not_enabled of Experimental_features.feature | LetUnwrap_not_supported_in_position of [`Toplevel | `Unsupported_type] + | Misplaced_label_syntax val err : Location.t -> error -> 'a diff --git a/compiler/ml/env.ml b/compiler/ml/env.ml index b6e23e8def8..14664670330 100644 --- a/compiler/ml/env.ml +++ b/compiler/ml/env.ml @@ -1616,13 +1616,16 @@ and check_usage loc id warn tbl = and check_value_name name loc = (* Note: we could also check here general validity of the identifier, to protect against bad identifiers forged by -pp or - -ppx preprocessors. *) - if name = "->" then - Location.raise_errorf ~loc "'%s' is not a valid value identifier." name + -ppx preprocessors. + + Both guarded paths below are unreachable: the ReScript parser never + emits value identifiers named "->" or containing "#" — both shapes + are rejected as syntax errors. *) + ignore loc; + if name = "->" then assert false else if String.length name > 0 && name.[0] = '#' then for i = 1 to String.length name - 1 do - if name.[i] = '#' then - Location.raise_errorf ~loc "'%s' is not a valid value identifier." name + if name.[i] = '#' then assert false done and store_value ?check id decl env = diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index b709ce1954a..1d666ab142e 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -1336,8 +1336,10 @@ and type_pat_aux ~constrs ~labels ~no_existentials ~mode ~explode ~env sp type_pat ~explode:0 p expected_ty k (* TODO: record 'extra' to remember about interval *) | Ppat_interval _ -> - Location.raise_errorf ~loc - "Only character intervals are supported in patterns." + (* unreachable: the ReScript parser (compiler/syntax/src/res_core.ml) has + no construction site for Ppat_interval — interval patterns are OCaml + syntax not part of the ReScript grammar *) + assert false | Ppat_tuple spl -> assert (List.length spl >= 2); let spl_ann = List.map (fun p -> (p, newvar ())) spl in @@ -3088,8 +3090,11 @@ and type_expect_ ?deprecated_context ~context ?in_function ?(recarg = Rejected) Types.val_loc = loc; } env ~check:(fun s -> Warnings.Unused_for_index s) | _ -> - Location.raise_errorf ~loc:param.ppat_loc - "Invalid for...of binding: only variables and _ are allowed." + (* unreachable: the parser's normalize_for_of_pattern + (compiler/syntax/src/res_core.ml:3841) catches every non-var, + non-`_` pattern, emits a syntax error, and replaces the pattern + with Ppat_any before the typer runs *) + assert false in let body = with_depth loop_depth (fun () -> @@ -3122,8 +3127,11 @@ and type_expect_ ?deprecated_context ~context ?in_function ?(recarg = Rejected) Types.val_loc = loc; } env ~check:(fun s -> Warnings.Unused_for_index s) | _ -> - Location.raise_errorf ~loc:param.ppat_loc - "Invalid for...of binding: only variables and _ are allowed." + (* unreachable: the parser's normalize_for_of_pattern + (compiler/syntax/src/res_core.ml:3841) catches every non-var, + non-`_` pattern, emits a syntax error, and replaces the pattern + with Ppat_any before the typer runs *) + assert false in let body = with_depth loop_depth (fun () -> @@ -3849,6 +3857,12 @@ and type_application ~context total_app env funct (sargs : sargs) : (Error (sarg1.pexp_loc, env, Apply_wrong_label (l1, funct.exp_type))) else + (* Originally split between Apply_wrong_label (label not in + ty_fun) and Incoherent_label_order (label in ty_fun but at + a different position). The latter is unreachable: modern + arity-aware unify in type_function eagerly compares against + ty_expected, raising Expr_type_clash before this branch + fires. Both label problems now surface as Apply_wrong_label. *) raise (Error (sarg1.pexp_loc, env, Apply_wrong_label (l1, ty_res))) | _ -> diff --git a/compiler/ml/typedecl.ml b/compiler/ml/typedecl.ml index fe6abdf406d..07ce0746225 100644 --- a/compiler/ml/typedecl.ml +++ b/compiler/ml/typedecl.ml @@ -108,7 +108,7 @@ let enter_type rec_flag env sdecl id = in Env.add_type ~check:true id decl env -let update_type temp_env env id loc = +let update_type temp_env env id _loc = let path = Path.Pident id in let decl = Env.find_type path temp_env in match decl.type_manifest with @@ -117,8 +117,10 @@ let update_type temp_env env id loc = let params = List.map (fun _ -> Ctype.newvar ()) decl.type_params in try Ctype.unify env (Ctype.newconstr path params) ty with Ctype.Unify _ -> - Location.raise_errorf ~loc - "This type constructor expands to an incompatible type.") + (* unreachable: every recursive abbreviation shape that would reach + this unify failure hits Cycle_in_def in check_recursive_type + (see line ~902 below) before check_coherence runs *) + assert false) (* We use the Ctype.expand_head_opt version of expand_head to get access to the manifest type of private abbreviations. *) @@ -170,7 +172,7 @@ let is_fixed_type sd = && sd.ptype_private = Private && has_row_var sty (* Set the row variable in a fixed type *) -let set_fixed_row env loc p decl = +let set_fixed_row env _loc p decl = let tm = match decl.type_manifest with | None -> assert false @@ -184,10 +186,16 @@ let set_fixed_row env loc p decl = if Btype.static_row row then Btype.newgenty Tnil else row.row_more | Tobject (ty, _) -> snd (Ctype.flatten_fields ty) | _ -> - Location.raise_errorf ~loc "This fixed type is not an object or variant" + (* unreachable: gated by `is_fixed_type decl`, which only returns true + when the syntactic manifest carries an open polymorphic-variant or + object row. `expand_head` preserves that row, so the manifest's + desc is always Tvariant or Tobject here. *) + assert false in if not (Btype.is_Tvar rv) then - Location.raise_errorf ~loc "This fixed type has no row variable"; + (* unreachable: same is_fixed_type invariant — the row is always a Tvar + (or extended-Tvar) when is_fixed_type passes *) + assert false; rv.desc <- Tconstr (p, decl.type_params, ref Mnil) (* Translate one type declaration *) @@ -978,10 +986,14 @@ let check_recursion env loc path decl to_check = match ty.desc with | Tconstr (path', args', _) -> (if Path.same path path' then ( - if not (Ctype.equal env false args args') then - Location.raise_errorf ~loc - "In the definition of %s, recursive type parameters differ." - (Path.name cpath)) + if not (Ctype.equal env false args args') then ( + (* unreachable: check_regular runs only on abbreviations, + and every recursive-abbreviation shape hits Cycle_in_def + in the earlier check_recursive_type pass before reaching + here. Variant constructors with non-uniform recursion + (`type rec t<'a> = T(t)`) don't trigger check_regular. *) + ignore cpath; + assert false)) else if (* Attempt to expand a type abbreviation if: 1- [to_check path'] holds @@ -1234,7 +1246,7 @@ let for_constr = function (fun {Types.ld_mutable; ld_type} -> (ld_mutable = Mutable, ld_type)) l -let compute_variance_gadt env check ((required, loc) as rloc) decl +let compute_variance_gadt env check ((required, _loc) as rloc) decl (tl, ret_type_opt) = match ret_type_opt with | None -> @@ -1255,9 +1267,11 @@ let compute_variance_gadt env check ((required, loc) as rloc) decl | fv :: fv2 -> (* fv1 @ fv2 = free_variables of other parameters *) if (c || n) && constrained (fv1 @ fv2) ty then - Location.raise_errorf ~loc - "In this GADT definition, the variance of some parameter \ - cannot be checked."; + (* unreachable: this would fire on a GADT parameter that's + `_` (anonymous). ReScript's parser rejects `_` in + `type t<...>` parameter positions, so the typer never + sees the required AST shape. *) + assert false; (fv :: fv1, fv2)) ([], fvl) tyl required in @@ -1882,8 +1896,12 @@ let transl_value_decl env loc valdecl = val_attributes = valdecl.pval_attributes; } | [] -> - Location.raise_errorf ~loc:valdecl.pval_loc - "Value declarations are only allowed in signatures" + (* unreachable: `pval_prim = []` outside a signature can only arise + from the parser's `external` recovery, which sets `prim = []` + *after* emitting a syntax error, so the typer never sees the + declaration. A bare `val x: int` in a .res is also rejected at + parse time. *) + assert false | _ -> let arity, from_constructor = parse_arity env valdecl.pval_type ty in let prim = Primitive.parse_declaration valdecl ~arity ~from_constructor in @@ -1897,8 +1915,12 @@ let transl_value_decl env loc valdecl = && (prim.prim_name = "" || (prim.prim_name.[0] <> '%' && prim.prim_name.[0] <> '#')) then - Location.raise_errorf ~loc:valdecl.pval_type.ptyp_loc - "External identifiers must be functions"; + (* unreachable: Primitive.parse_declaration always assigns the + magic 20-byte prim_native_name encoding to externals; the + `prim_native_name = ""` precondition can't be satisfied alongside + `prim_arity = 0` from any externals that survive parsing. Empty + prim names are rejected earlier with `Not a valid global name`. *) + assert false; { val_type = ty; val_kind = Val_prim prim; diff --git a/compiler/ml/typemod.ml b/compiler/ml/typemod.ml index 48cfba0b627..e823d4ac825 100644 --- a/compiler/ml/typemod.ml +++ b/compiler/ml/typemod.ml @@ -24,11 +24,15 @@ open Format type error = | Cannot_apply of module_type | Not_included of Includemod.error list + | Cannot_eliminate_dependency of module_type | Signature_expected | Structure_expected of module_type | With_no_component of Longident.t | With_mismatch of Longident.t * Includemod.error list + | With_makes_applicative_functor_ill_typed of + Longident.t * Path.t * Includemod.error list | With_changes_module_alias of Longident.t * Ident.t * Path.t + | With_cannot_remove_constrained_type | Repeated_name of string * string * Warnings.loc | Non_generalizable of type_expr | Non_generalizable_module of module_type @@ -36,6 +40,7 @@ type error = | Not_allowed_in_functor_body | Not_a_packed_module of type_expr | Incomplete_packed_module of type_expr + | Scoping_pack of Longident.t * type_expr | Recursive_module_require_explicit_type | Apply_generative | Cannot_scrape_alias of Path.t @@ -246,13 +251,12 @@ let check_usage_of_path_of_substituted_item paths env signature ~loc ~lid = let env = !env in try retype_applicative_functor_type ~loc env funct arg with Includemod.Error explanation -> - Location.raise_errorf ~loc - "@[@[This `with' constraint on %a makes the applicative \ - functor type %s ill-typed in the constrained \ - signature:@]@ %a@]" - Printtyp.longident lid.txt - (Path.name referenced_path) - Includemod.report_error explanation)); + raise + (Error + ( loc, + env, + With_makes_applicative_functor_ill_typed + (lid.txt, referenced_path, explanation) )))); } in iterator.Btype.it_signature iterator signature; @@ -435,11 +439,8 @@ let merge_constraint initial_env loc sg constr = in let params = tdecl.typ_type.type_params in if params_are_constrained params then - Location.raise_errorf ~loc - "@[Destructive substitutions are not supported for \ - constrained types (other than when replacing a type \ - constructor with a type constructor with the same \ - arguments).@]"; + raise + (Error (loc, initial_env, With_cannot_remove_constrained_type)); fun s path -> Subst.add_type_function path ~params ~body s in let sub = List.fold_left how_to_extend_subst Subst.identity !real_ids in @@ -1329,11 +1330,10 @@ and type_module_aux ~alias sttn funct_body anchor env smod = (Env.add_module ~arg:true param arg.mod_type env) param mty_res with Not_found -> - Location.raise_errorf ~loc:smod.pmod_loc - "@[This functor has type@ %a@ The parameter cannot be \ - eliminated in the result type.@ Bind the argument to a \ - module identifier.@]" - Printtyp.modtype mty_functor) + raise + (Error + (smod.pmod_loc, env, Cannot_eliminate_dependency mty_functor)) + ) in rm { @@ -1714,10 +1714,7 @@ let type_package env m p nl = (fun n ty -> try Ctype.unify env ty (Ctype.newvar ()) with Ctype.Unify _ -> - Location.raise_errorf ~loc:m.pmod_loc - "@[The type %a in this module cannot be exported.@ Its type \ - contains local dependencies:@ %a@]" - Printtyp.longident n Printtyp.type_expr ty) + raise (Error (m.pmod_loc, env, Scoping_pack (n, ty)))) nl tl'; (wrap_constraint env modl mty Tmodtype_implicit, tl') @@ -1833,6 +1830,16 @@ let report_error ppf = function "@[@[In this `with' constraint, the new definition of %a@ does not \ match its original definition@ in the constrained signature:@]@ %a@]" longident lid Includemod.report_error explanation + | With_makes_applicative_functor_ill_typed (lid, path, explanation) -> + fprintf ppf + "@[@[This `with' constraint on %a makes the applicative functor @ \ + type %s ill-typed in the constrained signature:@]@ %a@]" + longident lid (Path.name path) Includemod.report_error explanation + | With_cannot_remove_constrained_type -> + fprintf ppf + "@[Destructive substitutions are not supported for constrained @ \ + types (other than when replacing a type constructor with @ a type \ + constructor with the same arguments).@]" | With_changes_module_alias (lid, id, path) -> fprintf ppf "@[@[This `with' constraint on %a changes %s, which is aliased @ in \ @@ -1866,6 +1873,11 @@ let report_error ppf = function | Interface_not_compiled intf_name -> fprintf ppf "@[Could not find the .cmi file for interface@ %a.@]" Location.print_filename intf_name + | Cannot_eliminate_dependency mty -> + fprintf ppf + "@[This functor has type@ %a@ The parameter cannot be eliminated in the \ + result type.@ Bind the argument to a module identifier.@]" + modtype mty | Not_allowed_in_functor_body -> fprintf ppf "@[This expression creates fresh types.@ %s@]" "It is not allowed inside applicative functors." @@ -1875,6 +1887,9 @@ let report_error ppf = function | Incomplete_packed_module ty -> fprintf ppf "The type of this packed module contains variables:@ %a" type_expr ty + | Scoping_pack (lid, ty) -> + fprintf ppf "The type %a in this module cannot be exported.@ " longident lid; + fprintf ppf "Its type contains local dependencies:@ %a" type_expr ty | Recursive_module_require_explicit_type -> fprintf ppf "Recursive modules require an explicit module type." | Apply_generative -> diff --git a/compiler/ml/typemod.mli b/compiler/ml/typemod.mli index 8eea12e2f6b..0f36cf6afd8 100644 --- a/compiler/ml/typemod.mli +++ b/compiler/ml/typemod.mli @@ -64,11 +64,15 @@ val save_signature : type error = | Cannot_apply of module_type | Not_included of Includemod.error list + | Cannot_eliminate_dependency of module_type | Signature_expected | Structure_expected of module_type | With_no_component of Longident.t | With_mismatch of Longident.t * Includemod.error list + | With_makes_applicative_functor_ill_typed of + Longident.t * Path.t * Includemod.error list | With_changes_module_alias of Longident.t * Ident.t * Path.t + | With_cannot_remove_constrained_type | Repeated_name of string * string * Warnings.loc | Non_generalizable of type_expr | Non_generalizable_module of module_type @@ -76,6 +80,7 @@ type error = | Not_allowed_in_functor_body | Not_a_packed_module of type_expr | Incomplete_packed_module of type_expr + | Scoping_pack of Longident.t * type_expr | Recursive_module_require_explicit_type | Apply_generative | Cannot_scrape_alias of Path.t diff --git a/compiler/ml/typetexp.ml b/compiler/ml/typetexp.ml index c958eb4b1db..fb248c01989 100644 --- a/compiler/ml/typetexp.ml +++ b/compiler/ml/typetexp.ml @@ -86,8 +86,11 @@ let rec narrow_unbound_lid_error : 'a. _ -> _ -> _ -> _ -> 'a = let fmd = Env.find_module (Env.lookup_module ~load:true flid env) env in (match Env.scrape_alias env fmd.md_type with | Mty_signature _ -> - Location.raise_errorf ~loc "The module %a is a structure, not a functor" - Printtyp.longident flid + (* unreachable: this branch handles Longident.Lapply paths, but + Lapply has no construction site in compiler/syntax/src/ — ReScript's + type-level applicative-functor syntax (OCaml's M(X).t) isn't part + of the grammar *) + assert false | Mty_alias (_, p) -> raise (Error (loc, env, Cannot_scrape_alias (flid, p))) | _ -> ()); @@ -97,8 +100,8 @@ let rec narrow_unbound_lid_error : 'a. _ -> _ -> _ -> _ -> 'a = | Mty_alias (_, p) -> raise (Error (loc, env, Cannot_scrape_alias (mlid, p))) | _ -> - Location.raise_errorf ~loc "Ill-typed functor application %a" - Printtyp.longident lid)); + (* unreachable: same Lapply path as above *) + assert false)); raise (Error (loc, env, make_error lid)) let find_component (lookup : ?loc:_ -> _) make_error env loc lid = @@ -471,9 +474,13 @@ and transl_type_aux env policy styp = let row = Btype.row_repr row in row.row_fields | {desc = Tvar _}, Some (p, _) -> - Location.raise_errorf ~loc:sty.ptyp_loc - "The type constructor %a is not yet completely defined" - Printtyp.path p + (* unreachable: this requires the inherited type's body to be a + bare Tvar Tconstr, which only arises from `type 'a t = 'a`- + style declarations. ReScript syntax requires type parameters + in angle brackets (`type t<'a> = 'a`); the leading-`'a` form + is rejected at parse time *) + ignore p; + assert false | _ -> raise (Error (sty.ptyp_loc, env, Not_a_variant ty)) in List.iter @@ -617,9 +624,10 @@ and transl_fields env policy o fields = iter_add tf; OTinherit cty | {desc = Tvar _}, Some p -> - Location.raise_errorf ~loc:sty.ptyp_loc - "The type constructor %a is not yet completely defined" Printtyp.path - p + (* unreachable: same `type 'a t = 'a` shape as above; the bare-Tvar + Tconstr body can't be constructed from ReScript syntax *) + ignore p; + assert false | _ -> raise (Error (sty.ptyp_loc, env, Not_an_object t))) in let object_fields = List.map add_field fields in diff --git a/tests/ERROR_VARIANTS.md b/tests/ERROR_VARIANTS.md index f07deea6635..22ca2a50f34 100644 --- a/tests/ERROR_VARIANTS.md +++ b/tests/ERROR_VARIANTS.md @@ -57,44 +57,81 @@ dead code. ## Removed in `jono/remove-dead-errors` -The following named error and warning variants were re-validated as -unreachable and removed. Guard sites that could still be reached by -malformed PPX-produced ASTs now use direct `Location.raise_errorf` -fallbacks instead of catalogued variants. - -- `typecore`: `Incoherent_label_order`, `Recursive_local_constraint`, - `Invalid_interval`, `Invalid_for_of_pattern` -- `typedecl`: `Type_clash`, `Parameters_differ`, - `Null_arity_external`, `Bad_fixed_type`, `Varying_anonymous`, - `Val_in_structure` -- `typemod`: `Cannot_eliminate_dependency`, - `With_makes_applicative_functor_ill_typed`, - `With_cannot_remove_constrained_type`, `Scoping_pack` -- `typetexp`: `Unbound_type_constructor_2`, `Variant_tags`, - `Ill_typed_functor_application`, `Apply_structure_as_functor` -- `bs_syntaxerr`: `Conflict_bs_bs_this_bs_meth`, - `Unhandled_poly_type`, `Misplaced_label_syntax` -- `env`: `Illegal_value_name` +Two classes of removal. **Truly dead** variants — no raise site under +`compiler/`, or a guard whose predicate is always false — are deleted +entirely (declaration, raise, reporter, supporting helpers). **Defensive +unreachable** variants whose raise sites exist but are unreachable from +the ReScript parser keep their named-variant form removed and the raise +site is replaced with `assert false (* reason *)`, matching the +established convention in the typer modules (57 existing uses). + +**Truly dead — declaration + raise + reporter all removed:** + +- `ctype`: `Tags`, `Recursive_abbrev`, + `Unification_recursive_abbrev` exceptions (declared, never raised) +- `typecore`: `Recursive_local_constraint` (relay wrapper for the dead + `Unification_recursive_abbrev`) +- `typetexp`: `Variant_tags` (relay wrapper for the dead `Tags`) +- `bs_syntaxerr`: `Conflict_bs_bs_this_bs_meth` (no construction site) - `warnings`: `Comment_start`, `Comment_not_end`, `Method_override`, - `Statement_type`, `Instance_variable_override`, `Illegal_backslash`, - `Implicit_public_methods`, `Unerasable_optional_argument`, - `Eol_in_string`, `Eliminated_optional_arguments`, `Bad_docstring`, - `Bs_fragile_external`, `Bs_unimplemented_primitive`, - `Bs_uninterpreted_delimiters` - -Re-validation also found a few previously-flagged items that are not -completely dead: `typedecl.Rebind_wrong_type` is live via extension -rebinding across incompatible extension types, -`typecore.Label_mismatch` is live when a record literal without an -expected type mixes fields from two different record types (see -`label_mismatch_record_literal.res`), `typecore.Abstract_wrong_label` -is live when a multi-arg function literal has a mislabelled inner -argument (see `abstract_wrong_label.res`), -`includemod.Unbound_modtype_path` can still represent a stale -compiled-interface failure, `Syntaxerr.Variable_in_scope` is live but -lacks a registered printer, and the UTF-8 helper error families are still -raised by test/defensive helper entry points. Those are retained below -with updated notes. + `Instance_variable_override`, `Illegal_backslash`, + `Implicit_public_methods`, `Eol_in_string`, + `Eliminated_optional_arguments`, `Bad_docstring`, + `Bs_fragile_external`, `Bs_unimplemented_primitive` (declared, + never raised); `Statement_type` (caller hard-codes `statement=false`), + `Unerasable_optional_argument` (disabled around its only check), + `Bs_uninterpreted_delimiters` (trigger AST rewritten by builtin PPX + before the warning iterator runs) + +**Defensive unreachable — raise site becomes `assert false (* reason *)`, +variant + reporter removed:** + +- `typecore`: `Incoherent_label_order` (modern arity-aware unify fires + `Expr_type_clash` before this branch), `Invalid_interval` (parser + doesn't construct `Ppat_interval`), `Invalid_for_of_pattern` (parser's + `normalize_for_of_pattern` replaces non-var patterns with `Ppat_any`) +- `typetexp`: `Unbound_type_constructor_2` (needs bare-`Tvar` Tconstr + body via `type 'a t = 'a`, parser-rejected), + `Ill_typed_functor_application`, `Apply_structure_as_functor` (both + need `Longident.Lapply`, never constructed by the parser) +- `typedecl`: `Type_clash`, `Parameters_differ` (every recursive + abbreviation hits `Cycle_in_def` first), `Null_arity_external` + (`Primitive.parse_declaration` always assigns the magic + `prim_native_name` encoding), `Bad_fixed_type` (`is_fixed_type` and + `expand_head` agree on every parser-produced shape), + `Varying_anonymous` (parser rejects `_` in type parameter positions), + `Val_in_structure` (`pval_prim = []` outside a signature is only + produced by external-recovery after a syntax error) +- `bs_syntaxerr`: `Unhandled_poly_type` (parser misreads inline `'a.` + as deprecated uncurried syntax) +- `env`: `Illegal_value_name` (parser doesn't emit `"->"` or + `#`-containing identifiers) + +Re-validation found a number of previously-flagged items that are not +completely dead and have been retained as named variants: + +- `typedecl.Rebind_wrong_type` — live via extension rebinding across + incompatible extension types. +- `typecore.Label_mismatch` — live when a record literal without an + expected type mixes fields from two different record types + (`label_mismatch_record_literal.res`). +- `typecore.Abstract_wrong_label` — live when a multi-arg function + literal has a mislabelled inner argument (`abstract_wrong_label.res`). +- `typemod.With_cannot_remove_constrained_type` — live when destructive + substitution is applied to a constrained type + (`with_cannot_remove_constrained_type.res`). +- `bs_syntaxerr.Misplaced_label_syntax` — live when labelled args are + passed via operator-identifier syntax like `\"->"(x, ~b=...)` + (`misplaced_label_syntax.res`). +- `typemod.Cannot_eliminate_dependency`, `typemod.Scoping_pack`, + `typemod.With_makes_applicative_functor_ill_typed` — reproduction + attempts couldn't reach them but couldn't conclusively prove + unreachability either; retained on the conservative side. +- `includemod.Unbound_modtype_path` can still represent a stale + compiled-interface failure. +- `Syntaxerr.Variable_in_scope` is live but lacks a registered printer. +- The UTF-8 helper error families are still raised by test/defensive + helper entry points. --- @@ -202,7 +239,11 @@ Module-level errors. Source: [typemod.ml:24](../compiler/ml/typemod.ml). | `Structure_expected` | ✓ | `super_errors_multi/Smoke_unbound_module_reference` (indirect); also `open_functor.res` | | | `With_no_component` | ✓ | `with_no_component.res` | | | `With_mismatch` | ✓ | `with_mismatch.res` | | +| `With_makes_applicative_functor_ill_typed` | ? | — | typemod.ml:249. Fires when a `with` constraint on a signature containing a `Path.Papply` makes that application ill-typed. Reachable via destructive substitution on applicative functors; reproduction attempts surfaced `not a signature` first. Retained on the conservative side. | +| `With_cannot_remove_constrained_type` | ✓ | `with_cannot_remove_constrained_type.res` | Destructive substitution on a constrained type, e.g. `S with type t<'a> := 'a` where `S` has `type t<'a> constraint 'a = int`. | | `With_changes_module_alias` | ☐ (needs build harness) | — | typemod.ml:240. Fires during `with module := M2` substitution when an aliased sub-module inside the constrained signature is affected. ReScript parses `with module N := M2` (destructive substitution), but constructing a sub-module alias chain that gets invalidated requires multiple `.resi` files and a specific shape I couldn't reproduce single-file. | +| `Cannot_eliminate_dependency` | ? | — | typemod.ml:1332. Fires when `Mtype.nondep_supertype` raises `Not_found` during functor-application result-type computation. Reproduction attempts routed through `Incomplete_packed_module` or `escapes its scope`. Retained on the conservative side. | +| `Scoping_pack` | ? | — | typemod.ml:1717. Fires during first-class module packing with `with type` constraints whose constrained type isn't a free `Tvar`. Reproduction attempts routed through `Incomplete_packed_module`. Retained on the conservative side. | | `Repeated_name` | ✓ | `repeated_def_*.res` (multiple) | | | `Non_generalizable` | ✓ | `non_generalizable.res` | | | `Non_generalizable_module` | ✓ | `non_generalizable_module.res` | Nested module containing `let r = ref(None)` — the outer module's `md_type` carries the free `'_weak1` from the inner ref, so `closed_modtype` returns false and the `Sig_module` branch fires. | @@ -319,6 +360,7 @@ FFI / attribute / experimental-feature errors. Source: [bs_syntaxerr.ml:27](../c | `Bs_this_simple_pattern` | ✓ | `bs_this_simple_pattern.res` | `@this` with destructured self pattern. | | `Experimental_feature_not_enabled` | ✓ | `let_unwrap_on_top_level_not_enabled.res` (and other let-unwrap variants) | Currently only `LetUnwrap` is checked. | | `LetUnwrap_not_supported_in_position` | ✓ | `let_unwrap_on_top_level.res`, `let_unwrap_on_not_supported_variant.res` | | +| `Misplaced_label_syntax` | ✓ | `misplaced_label_syntax.res` | Labelled args passed via the operator-identifier syntax `(->)`, `(#=)`, `(##)`, e.g. `\"->"(x, ~b=...)`. | --- diff --git a/tests/build_tests/super_errors/expected/misplaced_label_syntax.res.expected b/tests/build_tests/super_errors/expected/misplaced_label_syntax.res.expected new file mode 100644 index 00000000000..552907d081f --- /dev/null +++ b/tests/build_tests/super_errors/expected/misplaced_label_syntax.res.expected @@ -0,0 +1,9 @@ + + We've found a bug for you! + /.../fixtures/misplaced_label_syntax.res:2:21-27 + + 1 │ let f = (~a, x) => x + a + 2 │ let _ = \"->"(1, ~b=f(~a=2)) + 3 │ + + Label syntax is not supported in this position \ No newline at end of file diff --git a/tests/build_tests/super_errors/expected/with_cannot_remove_constrained_type.res.expected b/tests/build_tests/super_errors/expected/with_cannot_remove_constrained_type.res.expected new file mode 100644 index 00000000000..f57ad8791db --- /dev/null +++ b/tests/build_tests/super_errors/expected/with_cannot_remove_constrained_type.res.expected @@ -0,0 +1,12 @@ + + We've found a bug for you! + /.../fixtures/with_cannot_remove_constrained_type.res:5:17-39 + + 3 │ } + 4 │ + 5 │ module type T = S with type t<'a> := 'a + 6 │ + + Destructive substitutions are not supported for constrained + types (other than when replacing a type constructor with + a type constructor with the same arguments). \ No newline at end of file diff --git a/tests/build_tests/super_errors/fixtures/misplaced_label_syntax.res b/tests/build_tests/super_errors/fixtures/misplaced_label_syntax.res new file mode 100644 index 00000000000..ae964b7c870 --- /dev/null +++ b/tests/build_tests/super_errors/fixtures/misplaced_label_syntax.res @@ -0,0 +1,2 @@ +let f = (~a, x) => x + a +let _ = \"->"(1, ~b=f(~a=2)) diff --git a/tests/build_tests/super_errors/fixtures/with_cannot_remove_constrained_type.res b/tests/build_tests/super_errors/fixtures/with_cannot_remove_constrained_type.res new file mode 100644 index 00000000000..4ed2a0f70ba --- /dev/null +++ b/tests/build_tests/super_errors/fixtures/with_cannot_remove_constrained_type.res @@ -0,0 +1,5 @@ +module type S = { + type t<'a> constraint 'a = int +} + +module type T = S with type t<'a> := 'a From 5fa4a00bfb8c8e56799b43a7dfb535c69b7bf448 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Mon, 1 Jun 2026 16:36:01 +0000 Subject: [PATCH 22/31] Restore reachable error variants wrongly removed as dead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Re-audited the defensive "unreachable" removals in this branch by driving each assert false to a real crash with a minimal .res (against a master oracle build). 8 were actually reachable or unproven and are restored: Reachable (each was a confirmed compiler crash; regression fixtures added): - typetexp.Unbound_type_constructor_2 (identity alias in inherit position) - typecore.Invalid_interval (non-char interval pattern, e.g. `1 .. 5`) - typedecl.Null_arity_external (`?`-prefixed external name, arity 0) - typedecl.Varying_anonymous (variance annotation on constrained GADT param) - typedecl.Parameters_differ (non-uniform recursion via object manifest) - typedecl.Bad_fixed_type (fully-bounded closed private polymorphic variant) - env.Illegal_value_name (escaped identifier `\"->"`) Appear dead but unproven (no structural proof, no repro found) — retained as named variants with explanatory comments at definition and raise site rather than assert false, pending further investigation: - typecore.Incoherent_label_order - typedecl.Type_clash Also restores the helpers needed by these paths (list_labels/list_labels_aux/ has_label) and updates tests/ERROR_VARIANTS.md with the corrected reachability and a re-audit correction note. The genuinely-dead removals (14 warnings, the Longident.Lapply functor paths, Tags/Variant_tags, ctype Recursive_abbrev/Unification_recursive_abbrev, Unhandled_poly_type, Conflict_bs_bs_this_bs_meth, the unescaped-"js"-delimiter path, Invalid_for_of_pattern, Val_in_structure) are kept removed. --- compiler/ml/env.ml | 19 ++--- compiler/ml/env.mli | 1 + compiler/ml/typecore.ml | 49 ++++++++--- compiler/ml/typecore.mli | 2 + compiler/ml/typedecl.ml | 80 +++++++++--------- compiler/ml/typetexp.ml | 16 ++-- compiler/ml/typetexp.mli | 1 + tests/ERROR_VARIANTS.md | 81 ++++++++++++++----- .../expected/external_null_arity.res.expected | 8 ++ .../fixed_type_no_row_variable.res.expected | 8 ++ .../gadt_varying_anonymous.res.expected | 8 ++ .../expected/illegal_value_name.res.expected | 8 ++ ...plete_type_constructor_object.res.expected | 10 +++ ..._type_constructor_polyvariant.res.expected | 10 +++ .../pattern_interval_non_char.res.expected | 11 +++ ...ursive_type_parameters_differ.res.expected | 8 ++ .../fixtures/external_null_arity.res | 1 + .../fixtures/fixed_type_no_row_variable.res | 1 + .../fixtures/gadt_varying_anonymous.res | 1 + .../fixtures/illegal_value_name.res | 1 + .../incomplete_type_constructor_object.res | 2 + ...ncomplete_type_constructor_polyvariant.res | 2 + .../fixtures/pattern_interval_non_char.res | 5 ++ .../recursive_type_parameters_differ.res | 1 + 24 files changed, 245 insertions(+), 89 deletions(-) create mode 100644 tests/build_tests/super_errors/expected/external_null_arity.res.expected create mode 100644 tests/build_tests/super_errors/expected/fixed_type_no_row_variable.res.expected create mode 100644 tests/build_tests/super_errors/expected/gadt_varying_anonymous.res.expected create mode 100644 tests/build_tests/super_errors/expected/illegal_value_name.res.expected create mode 100644 tests/build_tests/super_errors/expected/incomplete_type_constructor_object.res.expected create mode 100644 tests/build_tests/super_errors/expected/incomplete_type_constructor_polyvariant.res.expected create mode 100644 tests/build_tests/super_errors/expected/pattern_interval_non_char.res.expected create mode 100644 tests/build_tests/super_errors/expected/recursive_type_parameters_differ.res.expected create mode 100644 tests/build_tests/super_errors/fixtures/external_null_arity.res create mode 100644 tests/build_tests/super_errors/fixtures/fixed_type_no_row_variable.res create mode 100644 tests/build_tests/super_errors/fixtures/gadt_varying_anonymous.res create mode 100644 tests/build_tests/super_errors/fixtures/illegal_value_name.res create mode 100644 tests/build_tests/super_errors/fixtures/incomplete_type_constructor_object.res create mode 100644 tests/build_tests/super_errors/fixtures/incomplete_type_constructor_polyvariant.res create mode 100644 tests/build_tests/super_errors/fixtures/pattern_interval_non_char.res create mode 100644 tests/build_tests/super_errors/fixtures/recursive_type_parameters_differ.res diff --git a/compiler/ml/env.ml b/compiler/ml/env.ml index 14664670330..970634be03d 100644 --- a/compiler/ml/env.ml +++ b/compiler/ml/env.ml @@ -58,6 +58,7 @@ type error = | Illegal_renaming of string * string * string | Inconsistent_import of string * string * string | Missing_module of Location.t * Path.t * Path.t + | Illegal_value_name of Location.t * string exception Error of error @@ -729,6 +730,7 @@ let check_pers_struct name = Location.print_filename filename ps_name name | Inconsistent_import _ -> assert false | Missing_module _ -> assert false + | Illegal_value_name _ -> assert false in let warn = Warnings.No_cmi_file (name, Some msg) in Location.prerr_warning Location.none warn @@ -1616,16 +1618,11 @@ and check_usage loc id warn tbl = and check_value_name name loc = (* Note: we could also check here general validity of the identifier, to protect against bad identifiers forged by -pp or - -ppx preprocessors. - - Both guarded paths below are unreachable: the ReScript parser never - emits value identifiers named "->" or containing "#" — both shapes - are rejected as syntax errors. *) - ignore loc; - if name = "->" then assert false + -ppx preprocessors. *) + if name = "->" then raise (Error (Illegal_value_name (loc, name))) else if String.length name > 0 && name.[0] = '#' then for i = 1 to String.length name - 1 do - if name.[i] = '#' then assert false + if name.[i] = '#' then raise (Error (Illegal_value_name (loc, name))) done and store_value ?check id decl env = @@ -2132,9 +2129,13 @@ let report_error ppf = function fprintf ppf "@]@ @[%s@ %s@ %s.@]@]" "The compiled interface for module" (Ident.name (Path.head path2)) "was not found" + | Illegal_value_name (_loc, name) -> + fprintf ppf "'%s' is not a valid value identifier." name + let () = Location.register_error_of_exn (function - | Error (Missing_module (loc, _, _) as err) when loc <> Location.none -> + | Error ((Missing_module (loc, _, _) | Illegal_value_name (loc, _)) as err) + when loc <> Location.none -> Some (Location.error_of_printer loc report_error err) | Error err -> Some (Location.error_of_printer_file report_error err) | _ -> None) diff --git a/compiler/ml/env.mli b/compiler/ml/env.mli index 90946f94e36..48eaba1c10d 100644 --- a/compiler/ml/env.mli +++ b/compiler/ml/env.mli @@ -236,6 +236,7 @@ type error = | Illegal_renaming of string * string * string | Inconsistent_import of string * string * string | Missing_module of Location.t * Path.t * Path.t + | Illegal_value_name of Location.t * string exception Error of error diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index 1d666ab142e..696ec65d762 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -64,12 +64,18 @@ type error = | Too_many_arguments of bool * type_expr | Scoping_let_module of string * type_expr | Not_a_variant_type of Longident.t + (* Appears to be dead: no reproduction found that reaches the raise site + (modern arity-aware application reconciles reordered labels via + unification before the positional fallback). Retained pending further + investigation rather than replaced with [assert false]. *) + | Incoherent_label_order | Less_general of string * (type_expr * type_expr) list | Modules_not_allowed | Cannot_infer_signature | Not_a_packed_module of type_expr | Unexpected_existential | Unqualified_gadt_pattern of Path.t * string + | Invalid_interval | Invalid_for_loop_index | No_value_clauses | Exception_pattern_below_toplevel @@ -1335,11 +1341,7 @@ and type_pat_aux ~constrs ~labels ~no_existentials ~mode ~explode ~env sp let p = {p with ppat_loc = loc} in type_pat ~explode:0 p expected_ty k (* TODO: record 'extra' to remember about interval *) - | Ppat_interval _ -> - (* unreachable: the ReScript parser (compiler/syntax/src/res_core.ml) has - no construction site for Ppat_interval — interval patterns are OCaml - syntax not part of the ReScript grammar *) - assert false + | Ppat_interval _ -> raise (Error (loc, !env, Invalid_interval)) | Ppat_tuple spl -> assert (List.length spl >= 2); let spl_ann = List.map (fun p -> (p, newvar ())) spl in @@ -2252,6 +2254,18 @@ let is_ignore ~env ~arity funct = with Unify _ -> false) | _ -> false +let rec list_labels_aux env visited ls ty_fun = + let ty = expand_head env ty_fun in + if List.memq ty visited then (List.rev ls, false) + else + match ty.desc with + | Tarrow (arg, ty_res, _, arity) when arity = None || visited = [] -> + list_labels_aux env (ty :: visited) (arg.lbl :: ls) ty_res + | _ -> (List.rev ls, is_Tvar ty) + +let list_labels env ty = + wrap_trace_gadt_instances env (list_labels_aux env [] []) ty + let rec lower_args env seen ty_fun = let ty = expand_head env ty_fun in if List.memq ty seen then () @@ -3722,6 +3736,10 @@ and type_application ~context total_app env funct (sargs : sargs) : newty2 lv (Tarrow ({lbl = l; typ = ty}, ty_fun, Cok, None))) ty_fun omitted in + let has_label l ty_fun = + let ls, tvar = list_labels env ty_fun in + tvar || List.mem l ls + in let ignored = ref [] in let force_tvar = let t = funct.exp_type in @@ -3856,15 +3874,16 @@ and type_application ~context total_app env funct (sargs : sargs) : raise (Error (sarg1.pexp_loc, env, Apply_wrong_label (l1, funct.exp_type))) - else - (* Originally split between Apply_wrong_label (label not in - ty_fun) and Incoherent_label_order (label in ty_fun but at - a different position). The latter is unreachable: modern - arity-aware unify in type_function eagerly compares against - ty_expected, raising Expr_type_clash before this branch - fires. Both label problems now surface as Apply_wrong_label. *) + else if not (has_label l1 ty_fun) then raise (Error (sarg1.pexp_loc, env, Apply_wrong_label (l1, ty_res))) + else + (* Appears to be dead: no reproduction found that reaches this + branch (modern arity-aware unify in type_function eagerly + compares against ty_expected, so reordered labels reconcile + before reaching here). Retained pending further investigation + rather than replaced with [assert false]. *) + raise (Error (funct.exp_loc, env, Incoherent_label_order)) | _ -> raise (Error @@ -4756,6 +4775,10 @@ let report_error env loc ppf error = type_expr ty | Not_a_variant_type lid -> fprintf ppf "The type %a@ is not a variant type" longident lid + | Incoherent_label_order -> + fprintf ppf "This labeled function is applied to arguments@ "; + fprintf ppf "in an order different from other calls.@ "; + fprintf ppf "This is only allowed when the real type is known." | Less_general (kind, trace) -> (* modified *) super_report_unification_error ppf env trace @@ -4772,6 +4795,8 @@ let report_error env loc ppf error = | Unqualified_gadt_pattern (tpath, name) -> fprintf ppf "@[The GADT constructor %s of type %a@ %s.@]" name Printtyp.path tpath "must be qualified in this pattern" + | Invalid_interval -> + fprintf ppf "@[Only character intervals are supported in patterns.@]" | Invalid_for_loop_index -> fprintf ppf "@[Invalid for-loop index: only variables and _ are allowed.@]" | No_value_clauses -> diff --git a/compiler/ml/typecore.mli b/compiler/ml/typecore.mli index 10ff2ad8cab..7ffbd8f3d45 100644 --- a/compiler/ml/typecore.mli +++ b/compiler/ml/typecore.mli @@ -97,12 +97,14 @@ type error = | Too_many_arguments of bool * type_expr | Scoping_let_module of string * type_expr | Not_a_variant_type of Longident.t + | Incoherent_label_order | Less_general of string * (type_expr * type_expr) list | Modules_not_allowed | Cannot_infer_signature | Not_a_packed_module of type_expr | Unexpected_existential | Unqualified_gadt_pattern of Path.t * string + | Invalid_interval | Invalid_for_loop_index | No_value_clauses | Exception_pattern_below_toplevel diff --git a/compiler/ml/typedecl.ml b/compiler/ml/typedecl.ml index 07ce0746225..2c9d77d4d2b 100644 --- a/compiler/ml/typedecl.ml +++ b/compiler/ml/typedecl.ml @@ -34,6 +34,13 @@ type error = | Definition_mismatch of type_expr * Includecore.type_mismatch list | Constraint_failed of type_expr * type_expr | Inconsistent_constraint of Env.t * (type_expr * type_expr) list + (* Appears to be dead: no reproduction found that reaches the raise site + (non-uniform recursion surfaces as Parameters_differ and direct cycles + as Cycle_in_def before the coherence check clashes). Retained pending + further investigation rather than replaced with [assert false]. *) + | Type_clash of Env.t * (type_expr * type_expr) list + | Parameters_differ of Path.t * type_expr * type_expr + | Null_arity_external | Unbound_type_var of type_expr * type_declaration | Cannot_extend_private_type of Path.t | Not_extensible_type of Path.t @@ -43,7 +50,9 @@ type error = | Rebind_private of Longident.t | Bad_variance of int * (bool * bool * bool) * (bool * bool * bool) | Unavailable_type_constructor of Path.t + | Bad_fixed_type of string | Unbound_type_var_ext of type_expr * extension_constructor + | Varying_anonymous | Invalid_attribute of string | Bad_immediate_attribute | Bad_unboxed_attribute of string @@ -108,19 +117,20 @@ let enter_type rec_flag env sdecl id = in Env.add_type ~check:true id decl env -let update_type temp_env env id _loc = +let update_type temp_env env id loc = let path = Path.Pident id in let decl = Env.find_type path temp_env in match decl.type_manifest with | None -> () | Some ty -> ( let params = List.map (fun _ -> Ctype.newvar ()) decl.type_params in + (* The [Type_clash] handler appears to be dead: no reproduction found + that reaches this unify failure (non-uniform recursion surfaces as + Parameters_differ and direct cycles as Cycle_in_def first). Retained + pending further investigation rather than replaced with + [assert false]. *) try Ctype.unify env (Ctype.newconstr path params) ty - with Ctype.Unify _ -> - (* unreachable: every recursive abbreviation shape that would reach - this unify failure hits Cycle_in_def in check_recursive_type - (see line ~902 below) before check_coherence runs *) - assert false) + with Ctype.Unify trace -> raise (Error (loc, Type_clash (env, trace)))) (* We use the Ctype.expand_head_opt version of expand_head to get access to the manifest type of private abbreviations. *) @@ -172,7 +182,7 @@ let is_fixed_type sd = && sd.ptype_private = Private && has_row_var sty (* Set the row variable in a fixed type *) -let set_fixed_row env _loc p decl = +let set_fixed_row env loc p decl = let tm = match decl.type_manifest with | None -> assert false @@ -185,17 +195,10 @@ let set_fixed_row env _loc p decl = tm.desc <- Tvariant {row with row_fixed = true}; if Btype.static_row row then Btype.newgenty Tnil else row.row_more | Tobject (ty, _) -> snd (Ctype.flatten_fields ty) - | _ -> - (* unreachable: gated by `is_fixed_type decl`, which only returns true - when the syntactic manifest carries an open polymorphic-variant or - object row. `expand_head` preserves that row, so the manifest's - desc is always Tvariant or Tobject here. *) - assert false + | _ -> raise (Error (loc, Bad_fixed_type "is not an object or variant")) in if not (Btype.is_Tvar rv) then - (* unreachable: same is_fixed_type invariant — the row is always a Tvar - (or extended-Tvar) when is_fixed_type passes *) - assert false; + raise (Error (loc, Bad_fixed_type "has no row variable")); rv.desc <- Tconstr (p, decl.type_params, ref Mnil) (* Translate one type declaration *) @@ -986,14 +989,12 @@ let check_recursion env loc path decl to_check = match ty.desc with | Tconstr (path', args', _) -> (if Path.same path path' then ( - if not (Ctype.equal env false args args') then ( - (* unreachable: check_regular runs only on abbreviations, - and every recursive-abbreviation shape hits Cycle_in_def - in the earlier check_recursive_type pass before reaching - here. Variant constructors with non-uniform recursion - (`type rec t<'a> = T(t)`) don't trigger check_regular. *) - ignore cpath; - assert false)) + if not (Ctype.equal env false args args') then + raise + (Error + ( loc, + Parameters_differ (cpath, ty, Ctype.newconstr path args) + ))) else if (* Attempt to expand a type abbreviation if: 1- [to_check path'] holds @@ -1246,7 +1247,7 @@ let for_constr = function (fun {Types.ld_mutable; ld_type} -> (ld_mutable = Mutable, ld_type)) l -let compute_variance_gadt env check ((required, _loc) as rloc) decl +let compute_variance_gadt env check ((required, loc) as rloc) decl (tl, ret_type_opt) = match ret_type_opt with | None -> @@ -1267,11 +1268,7 @@ let compute_variance_gadt env check ((required, _loc) as rloc) decl | fv :: fv2 -> (* fv1 @ fv2 = free_variables of other parameters *) if (c || n) && constrained (fv1 @ fv2) ty then - (* unreachable: this would fire on a GADT parameter that's - `_` (anonymous). ReScript's parser rejects `_` in - `type t<...>` parameter positions, so the typer never - sees the required AST shape. *) - assert false; + raise (Error (loc, Varying_anonymous)); (fv :: fv1, fv2)) ([], fvl) tyl required in @@ -1914,13 +1911,7 @@ let transl_value_decl env loc valdecl = && String.unsafe_get prim_native_name 1 = '\149')) && (prim.prim_name = "" || (prim.prim_name.[0] <> '%' && prim.prim_name.[0] <> '#')) - then - (* unreachable: Primitive.parse_declaration always assigns the - magic 20-byte prim_native_name encoding to externals; the - `prim_native_name = ""` precondition can't be satisfied alongside - `prim_arity = 0` from any externals that survive parsing. Empty - prim names are rejected earlier with `Not a valid global name`. *) - assert false; + then raise (Error (valdecl.pval_type.ptyp_loc, Null_arity_external)); { val_type = ty; val_kind = Val_prim prim; @@ -2176,11 +2167,22 @@ let report_error ppf = function fprintf ppf "@[%s@ @[Type@ %a@ should be an instance of@ %a@]@]" "Constraints are not satisfied in this type." Printtyp.type_expr ty Printtyp.type_expr ty' + | Parameters_differ (path, ty, ty') -> + Printtyp.reset_and_mark_loops ty; + Printtyp.mark_loops ty'; + fprintf ppf "@[In the definition of %s, type@ %a@ should be@ %a@]" + (Path.name path) Printtyp.type_expr ty Printtyp.type_expr ty' | Inconsistent_constraint (env, trace) -> fprintf ppf "The type constraints are not consistent.@."; Printtyp.report_unification_error ppf env trace (fun ppf -> fprintf ppf "Type") (fun ppf -> fprintf ppf "is not compatible with type") + | Type_clash (env, trace) -> + Printtyp.report_unification_error ppf env trace + (function + | ppf -> fprintf ppf "This type constructor expands to type") + (function ppf -> fprintf ppf "but is used here with type") + | Null_arity_external -> fprintf ppf "External identifiers must be functions" | Unbound_type_var (ty, decl) -> ( fprintf ppf "A type variable is unbound in this type declaration"; let ty = Ctype.repr ty in @@ -2268,6 +2270,10 @@ let report_error ppf = function (variance v1) | Unavailable_type_constructor p -> fprintf ppf "The definition of type %a@ is unavailable" Printtyp.path p + | Bad_fixed_type r -> fprintf ppf "This fixed type %s" r + | Varying_anonymous -> + fprintf ppf "@[%s@ %s@ %s@]" "In this GADT definition," + "the variance of some parameter" "cannot be checked" | Bad_immediate_attribute -> fprintf ppf "@[%s@ %s@]" "Types marked with the immediate attribute must be" "non-pointer types like int or bool" diff --git a/compiler/ml/typetexp.ml b/compiler/ml/typetexp.ml index fb248c01989..75e6b2b38d4 100644 --- a/compiler/ml/typetexp.ml +++ b/compiler/ml/typetexp.ml @@ -28,6 +28,7 @@ exception Already_bound type error = | Unbound_type_variable of string | Unbound_type_constructor of Longident.t + | Unbound_type_constructor_2 of Path.t | Type_arity_mismatch of Longident.t * int * int | Type_mismatch of (type_expr * type_expr) list | Alias_type_mismatch of (type_expr * type_expr) list @@ -474,13 +475,7 @@ and transl_type_aux env policy styp = let row = Btype.row_repr row in row.row_fields | {desc = Tvar _}, Some (p, _) -> - (* unreachable: this requires the inherited type's body to be a - bare Tvar Tconstr, which only arises from `type 'a t = 'a`- - style declarations. ReScript syntax requires type parameters - in angle brackets (`type t<'a> = 'a`); the leading-`'a` form - is rejected at parse time *) - ignore p; - assert false + raise (Error (sty.ptyp_loc, env, Unbound_type_constructor_2 p)) | _ -> raise (Error (sty.ptyp_loc, env, Not_a_variant ty)) in List.iter @@ -624,10 +619,7 @@ and transl_fields env policy o fields = iter_add tf; OTinherit cty | {desc = Tvar _}, Some p -> - (* unreachable: same `type 'a t = 'a` shape as above; the bare-Tvar - Tconstr body can't be constructed from ReScript syntax *) - ignore p; - assert false + raise (Error (sty.ptyp_loc, env, Unbound_type_constructor_2 p)) | _ -> raise (Error (sty.ptyp_loc, env, Not_an_object t))) in let object_fields = List.map add_field fields in @@ -791,6 +783,8 @@ let report_error env ppf = function Format.fprintf ppf "If you wanted to write a recursive type, don't forget the `rec` in \ `type rec`@]" + | Unbound_type_constructor_2 p -> + fprintf ppf "The type constructor@ %a@ is not yet completely defined" path p | Type_arity_mismatch (lid, expected, provided) -> if expected == 0 then fprintf ppf diff --git a/compiler/ml/typetexp.mli b/compiler/ml/typetexp.mli index 565535cb093..a4d0ee95cdd 100644 --- a/compiler/ml/typetexp.mli +++ b/compiler/ml/typetexp.mli @@ -37,6 +37,7 @@ exception Already_bound type error = | Unbound_type_variable of string | Unbound_type_constructor of Longident.t + | Unbound_type_constructor_2 of Path.t | Type_arity_mismatch of Longident.t * int * int | Type_mismatch of (type_expr * type_expr) list | Alias_type_mismatch of (type_expr * type_expr) list diff --git a/tests/ERROR_VARIANTS.md b/tests/ERROR_VARIANTS.md index 22ca2a50f34..04e9cce7b73 100644 --- a/tests/ERROR_VARIANTS.md +++ b/tests/ERROR_VARIANTS.md @@ -86,26 +86,28 @@ established convention in the typer modules (57 existing uses). **Defensive unreachable — raise site becomes `assert false (* reason *)`, variant + reporter removed:** -- `typecore`: `Incoherent_label_order` (modern arity-aware unify fires - `Expr_type_clash` before this branch), `Invalid_interval` (parser - doesn't construct `Ppat_interval`), `Invalid_for_of_pattern` (parser's - `normalize_for_of_pattern` replaces non-var patterns with `Ppat_any`) -- `typetexp`: `Unbound_type_constructor_2` (needs bare-`Tvar` Tconstr - body via `type 'a t = 'a`, parser-rejected), - `Ill_typed_functor_application`, `Apply_structure_as_functor` (both - need `Longident.Lapply`, never constructed by the parser) -- `typedecl`: `Type_clash`, `Parameters_differ` (every recursive - abbreviation hits `Cycle_in_def` first), `Null_arity_external` - (`Primitive.parse_declaration` always assigns the magic - `prim_native_name` encoding), `Bad_fixed_type` (`is_fixed_type` and - `expand_head` agree on every parser-produced shape), - `Varying_anonymous` (parser rejects `_` in type parameter positions), - `Val_in_structure` (`pval_prim = []` outside a signature is only - produced by external-recovery after a syntax error) -- `bs_syntaxerr`: `Unhandled_poly_type` (parser misreads inline `'a.` - as deprecated uncurried syntax) -- `env`: `Illegal_value_name` (parser doesn't emit `"->"` or - `#`-containing identifiers) +- `typecore`: `Invalid_for_of_pattern` (parser's + `normalize_for_of_pattern` replaces non-var patterns with `Ppat_any`, + so the typer only ever sees `Ppat_var`/`Ppat_any` in for-of bindings) +- `typetexp`: `Ill_typed_functor_application`, `Apply_structure_as_functor` + (both need `Longident.Lapply`, never constructed by the parser — + `compiler/syntax/src/` only builds `Lident`/`Ldot`) +- `typedecl`: `Val_in_structure` (`pval_prim = []` / a bare `val` outside + a signature is only produced by the parser's external-recovery, which + emits a syntax error and aborts before the typer runs) +- `bs_syntaxerr`: `Unhandled_poly_type` (its only raise site is in + `ast_core_type.list_of_arrow`; `Ptyp_poly` cannot appear in an + external's arrow chain — external types never route through + `parse_poly_type_expr`, and any `Ptyp_poly` in a record/object field is + an opaque arg leaf, never the recursed return type) + +> ⚠️ **Reachability re-audit correction.** An earlier pass mislabelled +> several of these as unreachable on plausible-but-untested reasoning. A +> follow-up audit (empirical: each `assert false` was driven to a real +> crash with a minimal `.res`) found **8** that are actually reachable or +> unproven, and they were restored as named variants (see the retained +> list below). The remaining entries above are backed by either a parser +> grammar fact or a structural proof, not just a guess. Re-validation found a number of previously-flagged items that are not completely dead and have been retained as named variants: @@ -120,6 +122,45 @@ completely dead and have been retained as named variants: - `typemod.With_cannot_remove_constrained_type` — live when destructive substitution is applied to a constrained type (`with_cannot_remove_constrained_type.res`). +- `typetexp.Unbound_type_constructor_2` — live when an identity type + alias `type t<'a> = 'a` is used in an inherit position with a + type-variable argument: `expand_head` collapses `t<'b>` to a bare + `Tvar` while the unexpanded repr is still `Tconstr`. Reachable from + both poly-variant inherit + (`incomplete_type_constructor_polyvariant.res`) and object spread + (`incomplete_type_constructor_object.res`). The earlier + "parser-rejected leading-`'a`" reasoning was wrong; both raise sites + reproduce as a compiler crash if removed. +- `typecore.Invalid_interval` — live: the parser **does** construct + `Ppat_interval` (`res_core.ml`, ` .. `). Only the + `Pconst_char` interval is rewritten; any other constant interval (e.g. + `1 .. 5`) reaches this branch (`pattern_interval_non_char.res`). +- `typedecl.Null_arity_external` — live: an external whose name starts + with `?` (e.g. `external x: int = "?nodeFs"`) skips the magic + `prim_native_name` encoding and reaches the typer with arity 0 + (`external_null_arity.res`). +- `typedecl.Varying_anonymous` — live: a **variance annotation** on a + GADT parameter whose return type constrains it (e.g. + `type rec t<+'a> = K(int): t`) triggers it — not `_` params + (`gadt_varying_anonymous.res`). +- `typedecl.Parameters_differ` — live: non-uniform recursion through an + object/record manifest (e.g. `type rec t<'a> = {"f": t}`) is + caught by `check_regular`, not `Cycle_in_def` + (`recursive_type_parameters_differ.res`). +- `typedecl.Bad_fixed_type` — live: a fully-bounded closed private + polymorphic variant (e.g. `type t = private [< #A | #B > #A #B]`) + satisfies `is_fixed_type` but has a static (non-`Tvar`) row + (`fixed_type_no_row_variable.res`). +- `env.Illegal_value_name` — live: escaped-identifier syntax reaches + `check_value_name` during definition; `let \"->" = 1` is rejected with + a clean diagnostic (`illegal_value_name.res`). The parser does **not** + reject `\"->"`. +- `typecore.Incoherent_label_order` and `typedecl.Type_clash` — retained + but **appear dead**: no reproduction was found that reaches either + raise site, yet neither has a structural unreachability proof (both are + live OCaml branches guarded by runtime conditions). Kept as named + variants with an explanatory comment at the definition and raise site, + pending further investigation, rather than `assert false`. - `bs_syntaxerr.Misplaced_label_syntax` — live when labelled args are passed via operator-identifier syntax like `\"->"(x, ~b=...)` (`misplaced_label_syntax.res`). diff --git a/tests/build_tests/super_errors/expected/external_null_arity.res.expected b/tests/build_tests/super_errors/expected/external_null_arity.res.expected new file mode 100644 index 00000000000..b8f73e017db --- /dev/null +++ b/tests/build_tests/super_errors/expected/external_null_arity.res.expected @@ -0,0 +1,8 @@ + + We've found a bug for you! + /.../fixtures/external_null_arity.res:1:13-15 + + 1 │ external x: int = "?nodeFs" + 2 │ + + External identifiers must be functions \ No newline at end of file diff --git a/tests/build_tests/super_errors/expected/fixed_type_no_row_variable.res.expected b/tests/build_tests/super_errors/expected/fixed_type_no_row_variable.res.expected new file mode 100644 index 00000000000..5de503d3c09 --- /dev/null +++ b/tests/build_tests/super_errors/expected/fixed_type_no_row_variable.res.expected @@ -0,0 +1,8 @@ + + We've found a bug for you! + /.../fixtures/fixed_type_no_row_variable.res:1:1-36 + + 1 │ type t = private [< #A | #B > #A #B] + 2 │ + + This fixed type has no row variable \ No newline at end of file diff --git a/tests/build_tests/super_errors/expected/gadt_varying_anonymous.res.expected b/tests/build_tests/super_errors/expected/gadt_varying_anonymous.res.expected new file mode 100644 index 00000000000..d6c699960b6 --- /dev/null +++ b/tests/build_tests/super_errors/expected/gadt_varying_anonymous.res.expected @@ -0,0 +1,8 @@ + + We've found a bug for you! + /.../fixtures/gadt_varying_anonymous.res:1:1-32 + + 1 │ type rec t<+'a> = K(int): t + 2 │ + + In this GADT definition, the variance of some parameter cannot be checked \ No newline at end of file diff --git a/tests/build_tests/super_errors/expected/illegal_value_name.res.expected b/tests/build_tests/super_errors/expected/illegal_value_name.res.expected new file mode 100644 index 00000000000..1833a18d160 --- /dev/null +++ b/tests/build_tests/super_errors/expected/illegal_value_name.res.expected @@ -0,0 +1,8 @@ + + We've found a bug for you! + /.../fixtures/illegal_value_name.res:1:5-9 + + 1 │ let \"->" = 1 + 2 │ + + '->' is not a valid value identifier. \ No newline at end of file diff --git a/tests/build_tests/super_errors/expected/incomplete_type_constructor_object.res.expected b/tests/build_tests/super_errors/expected/incomplete_type_constructor_object.res.expected new file mode 100644 index 00000000000..a4f936d0664 --- /dev/null +++ b/tests/build_tests/super_errors/expected/incomplete_type_constructor_object.res.expected @@ -0,0 +1,10 @@ + + We've found a bug for you! + /.../fixtures/incomplete_type_constructor_object.res:2:18-22 + + 1 │ type t<'a> = 'a + 2 │ type o<'b> = {...t<'b>, "x": int} + 3 │ + + The type constructor t +is not yet completely defined \ No newline at end of file diff --git a/tests/build_tests/super_errors/expected/incomplete_type_constructor_polyvariant.res.expected b/tests/build_tests/super_errors/expected/incomplete_type_constructor_polyvariant.res.expected new file mode 100644 index 00000000000..b005967e9d9 --- /dev/null +++ b/tests/build_tests/super_errors/expected/incomplete_type_constructor_polyvariant.res.expected @@ -0,0 +1,10 @@ + + We've found a bug for you! + /.../fixtures/incomplete_type_constructor_polyvariant.res:2:20-24 + + 1 │ type t<'a> = 'a + 2 │ type x<'b> = [#a | t<'b>] + 3 │ + + The type constructor t +is not yet completely defined \ No newline at end of file diff --git a/tests/build_tests/super_errors/expected/pattern_interval_non_char.res.expected b/tests/build_tests/super_errors/expected/pattern_interval_non_char.res.expected new file mode 100644 index 00000000000..8048b4c37fa --- /dev/null +++ b/tests/build_tests/super_errors/expected/pattern_interval_non_char.res.expected @@ -0,0 +1,11 @@ + + We've found a bug for you! + /.../fixtures/pattern_interval_non_char.res:3:5-10 + + 1 │ let f = x => + 2 │ switch x { + 3 │ | 1 .. 5 => "low" + 4 │ | _ => "other" + 5 │ } + + Only character intervals are supported in patterns. \ No newline at end of file diff --git a/tests/build_tests/super_errors/expected/recursive_type_parameters_differ.res.expected b/tests/build_tests/super_errors/expected/recursive_type_parameters_differ.res.expected new file mode 100644 index 00000000000..5cf943c7d8e --- /dev/null +++ b/tests/build_tests/super_errors/expected/recursive_type_parameters_differ.res.expected @@ -0,0 +1,8 @@ + + We've found a bug for you! + /.../fixtures/recursive_type_parameters_differ.res:1:1-30 + + 1 │ type rec t<'a> = {"f": t} + 2 │ + + In the definition of t, type t should be t<'a> \ No newline at end of file diff --git a/tests/build_tests/super_errors/fixtures/external_null_arity.res b/tests/build_tests/super_errors/fixtures/external_null_arity.res new file mode 100644 index 00000000000..4f15f35dc15 --- /dev/null +++ b/tests/build_tests/super_errors/fixtures/external_null_arity.res @@ -0,0 +1 @@ +external x: int = "?nodeFs" diff --git a/tests/build_tests/super_errors/fixtures/fixed_type_no_row_variable.res b/tests/build_tests/super_errors/fixtures/fixed_type_no_row_variable.res new file mode 100644 index 00000000000..d7ecd99e099 --- /dev/null +++ b/tests/build_tests/super_errors/fixtures/fixed_type_no_row_variable.res @@ -0,0 +1 @@ +type t = private [< #A | #B > #A #B] diff --git a/tests/build_tests/super_errors/fixtures/gadt_varying_anonymous.res b/tests/build_tests/super_errors/fixtures/gadt_varying_anonymous.res new file mode 100644 index 00000000000..b60c16fb5ff --- /dev/null +++ b/tests/build_tests/super_errors/fixtures/gadt_varying_anonymous.res @@ -0,0 +1 @@ +type rec t<+'a> = K(int): t diff --git a/tests/build_tests/super_errors/fixtures/illegal_value_name.res b/tests/build_tests/super_errors/fixtures/illegal_value_name.res new file mode 100644 index 00000000000..e4d9a2153ea --- /dev/null +++ b/tests/build_tests/super_errors/fixtures/illegal_value_name.res @@ -0,0 +1 @@ +let \"->" = 1 diff --git a/tests/build_tests/super_errors/fixtures/incomplete_type_constructor_object.res b/tests/build_tests/super_errors/fixtures/incomplete_type_constructor_object.res new file mode 100644 index 00000000000..dadf0f2db71 --- /dev/null +++ b/tests/build_tests/super_errors/fixtures/incomplete_type_constructor_object.res @@ -0,0 +1,2 @@ +type t<'a> = 'a +type o<'b> = {...t<'b>, "x": int} diff --git a/tests/build_tests/super_errors/fixtures/incomplete_type_constructor_polyvariant.res b/tests/build_tests/super_errors/fixtures/incomplete_type_constructor_polyvariant.res new file mode 100644 index 00000000000..2c6de84986c --- /dev/null +++ b/tests/build_tests/super_errors/fixtures/incomplete_type_constructor_polyvariant.res @@ -0,0 +1,2 @@ +type t<'a> = 'a +type x<'b> = [#a | t<'b>] diff --git a/tests/build_tests/super_errors/fixtures/pattern_interval_non_char.res b/tests/build_tests/super_errors/fixtures/pattern_interval_non_char.res new file mode 100644 index 00000000000..ebde9ef093d --- /dev/null +++ b/tests/build_tests/super_errors/fixtures/pattern_interval_non_char.res @@ -0,0 +1,5 @@ +let f = x => + switch x { + | 1 .. 5 => "low" + | _ => "other" + } diff --git a/tests/build_tests/super_errors/fixtures/recursive_type_parameters_differ.res b/tests/build_tests/super_errors/fixtures/recursive_type_parameters_differ.res new file mode 100644 index 00000000000..403d08c0ebd --- /dev/null +++ b/tests/build_tests/super_errors/fixtures/recursive_type_parameters_differ.res @@ -0,0 +1 @@ +type rec t<'a> = {"f": t} From a3a6278815e67a5580cc4922eda35895f3be7f1b Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Mon, 1 Jun 2026 16:45:46 +0000 Subject: [PATCH 23/31] Prove Incoherent_label_order reachable; refine Type_clash rationale MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Continued the reachability investigation of the two variants that were restored-but-unproven. - typecore.Incoherent_label_order: now PROVEN reachable. A not-yet- generalized function value applied more than once with labelled args in conflicting orders (`let f = g => (g(~a=1, ~b=2), g(~b=3, ~a=4))`) reaches the leftover/tvar path in type_unknown_args (type_args reconciles labels by name, so only this path is left). Added fixture labeled_args_incoherent_order.res and replaced the "appears dead" comments with the real trigger. - typedecl.Type_clash: still no reproduction after ~37 recursive / mutual / constraint / row / object / alias shapes. update_type unifies t against t's own manifest — a type against an alpha-renamed copy of itself — which cannot head-clash; every real inconsistency is caught by Cycle_in_def / Recursive_abbrev / Parameters_differ / Constraint_failed / Type_arity_mismatch first. Kept as a named variant (not assert false) with the strengthened structural rationale, pending an airtight proof. 7 of the 8 restored variants now have reproducing fixtures. --- compiler/ml/typecore.ml | 15 ++++------ compiler/ml/typedecl.ml | 23 +++++++++------ tests/ERROR_VARIANTS.md | 28 +++++++++++++------ ...labeled_args_incoherent_order.res.expected | 10 +++++++ .../labeled_args_incoherent_order.res | 1 + 5 files changed, 51 insertions(+), 26 deletions(-) create mode 100644 tests/build_tests/super_errors/expected/labeled_args_incoherent_order.res.expected create mode 100644 tests/build_tests/super_errors/fixtures/labeled_args_incoherent_order.res diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index 696ec65d762..a0d2b7e2a5c 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -64,10 +64,6 @@ type error = | Too_many_arguments of bool * type_expr | Scoping_let_module of string * type_expr | Not_a_variant_type of Longident.t - (* Appears to be dead: no reproduction found that reaches the raise site - (modern arity-aware application reconciles reordered labels via - unification before the positional fallback). Retained pending further - investigation rather than replaced with [assert false]. *) | Incoherent_label_order | Less_general of string * (type_expr * type_expr) list | Modules_not_allowed @@ -3878,11 +3874,12 @@ and type_application ~context total_app env funct (sargs : sargs) : raise (Error (sarg1.pexp_loc, env, Apply_wrong_label (l1, ty_res))) else - (* Appears to be dead: no reproduction found that reaches this - branch (modern arity-aware unify in type_function eagerly - compares against ty_expected, so reordered labels reconcile - before reaching here). Retained pending further investigation - rather than replaced with [assert false]. *) + (* Reached when a not-yet-generalized function value is applied + more than once with labelled arguments in conflicting orders + (e.g. `g => (g(~a, ~b), g(~b, ~a))`): the first call fixes the + arrow order, and the second reordered call lands here via the + leftover/tvar path. See + fixtures/labeled_args_incoherent_order.res. *) raise (Error (funct.exp_loc, env, Incoherent_label_order)) | _ -> raise diff --git a/compiler/ml/typedecl.ml b/compiler/ml/typedecl.ml index 2c9d77d4d2b..2e3806fa964 100644 --- a/compiler/ml/typedecl.ml +++ b/compiler/ml/typedecl.ml @@ -34,10 +34,14 @@ type error = | Definition_mismatch of type_expr * Includecore.type_mismatch list | Constraint_failed of type_expr * type_expr | Inconsistent_constraint of Env.t * (type_expr * type_expr) list - (* Appears to be dead: no reproduction found that reaches the raise site - (non-uniform recursion surfaces as Parameters_differ and direct cycles - as Cycle_in_def before the coherence check clashes). Retained pending - further investigation rather than replaced with [assert false]. *) + (* Appears to be dead. Its only raise site (update_type) unifies + [t] against [t]'s own manifest — i.e. a type against an + alpha-renamed copy of itself — which cannot produce a head clash; and + every genuine inconsistency is caught by a dedicated check instead + (Cycle_in_def, Recursive_abbrev, Parameters_differ, Constraint_failed, + Type_arity_mismatch). ~37 recursive/mutual/constraint/row/object/alias + shapes were tried without reaching it. Retained as a named variant + pending an airtight proof rather than replaced with [assert false]. *) | Type_clash of Env.t * (type_expr * type_expr) list | Parameters_differ of Path.t * type_expr * type_expr | Null_arity_external @@ -124,11 +128,12 @@ let update_type temp_env env id loc = | None -> () | Some ty -> ( let params = List.map (fun _ -> Ctype.newvar ()) decl.type_params in - (* The [Type_clash] handler appears to be dead: no reproduction found - that reaches this unify failure (non-uniform recursion surfaces as - Parameters_differ and direct cycles as Cycle_in_def first). Retained - pending further investigation rather than replaced with - [assert false]. *) + (* The [Type_clash] handler appears to be dead: this unifies + [t] against [t]'s own manifest [ty], i.e. a type against + an alpha-renamed copy of itself, which cannot head-clash. Genuine + inconsistencies are caught elsewhere (Cycle_in_def, Recursive_abbrev, + Parameters_differ, ...). Retained pending an airtight proof rather than + replaced with [assert false]. *) try Ctype.unify env (Ctype.newconstr path params) ty with Ctype.Unify trace -> raise (Error (loc, Type_clash (env, trace)))) diff --git a/tests/ERROR_VARIANTS.md b/tests/ERROR_VARIANTS.md index 04e9cce7b73..8a0ac9e0509 100644 --- a/tests/ERROR_VARIANTS.md +++ b/tests/ERROR_VARIANTS.md @@ -106,8 +106,12 @@ variant + reporter removed:** > follow-up audit (empirical: each `assert false` was driven to a real > crash with a minimal `.res`) found **8** that are actually reachable or > unproven, and they were restored as named variants (see the retained -> list below). The remaining entries above are backed by either a parser -> grammar fact or a structural proof, not just a guess. +> list below). **7 of the 8 now have a reproducing fixture** confirming +> they are live; the last (`typedecl.Type_clash`) resisted ~37 attempts +> and has a structural argument for unreachability but no airtight proof, +> so it is retained rather than removed. The remaining entries above are +> backed by either a parser grammar fact or a structural proof, not just a +> guess. Re-validation found a number of previously-flagged items that are not completely dead and have been retained as named variants: @@ -155,12 +159,20 @@ completely dead and have been retained as named variants: `check_value_name` during definition; `let \"->" = 1` is rejected with a clean diagnostic (`illegal_value_name.res`). The parser does **not** reject `\"->"`. -- `typecore.Incoherent_label_order` and `typedecl.Type_clash` — retained - but **appear dead**: no reproduction was found that reaches either - raise site, yet neither has a structural unreachability proof (both are - live OCaml branches guarded by runtime conditions). Kept as named - variants with an explanatory comment at the definition and raise site, - pending further investigation, rather than `assert false`. +- `typecore.Incoherent_label_order` — live: a not-yet-generalized + function value applied more than once with labelled arguments in + conflicting orders (`let f = g => (g(~a=1, ~b=2), g(~b=3, ~a=4))`) hits + the leftover/tvar path in `type_unknown_args` after the first call fixes + the arrow order (`labeled_args_incoherent_order.res`). +- `typedecl.Type_clash` — retained but **appears dead**: its only raise + site (`update_type`) unifies `t` against `t`'s own + manifest — a type against an alpha-renamed copy of itself — which cannot + head-clash, and every genuine inconsistency is caught by a dedicated + check (`Cycle_in_def`, `Recursive_abbrev`, `Parameters_differ`, + `Constraint_failed`, `Type_arity_mismatch`). ~37 recursive / mutual / + constraint / row / object / alias shapes were tried without reaching it. + Kept as a named variant with an explanatory comment at the definition + and raise site, pending an airtight proof, rather than `assert false`. - `bs_syntaxerr.Misplaced_label_syntax` — live when labelled args are passed via operator-identifier syntax like `\"->"(x, ~b=...)` (`misplaced_label_syntax.res`). diff --git a/tests/build_tests/super_errors/expected/labeled_args_incoherent_order.res.expected b/tests/build_tests/super_errors/expected/labeled_args_incoherent_order.res.expected new file mode 100644 index 00000000000..a7b057c2156 --- /dev/null +++ b/tests/build_tests/super_errors/expected/labeled_args_incoherent_order.res.expected @@ -0,0 +1,10 @@ + + We've found a bug for you! + /.../fixtures/labeled_args_incoherent_order.res:1:30 + + 1 │ let f = g => (g(~a=1, ~b=2), g(~b=3, ~a=4)) + 2 │ + + This labeled function is applied to arguments +in an order different from other calls. +This is only allowed when the real type is known. \ No newline at end of file diff --git a/tests/build_tests/super_errors/fixtures/labeled_args_incoherent_order.res b/tests/build_tests/super_errors/fixtures/labeled_args_incoherent_order.res new file mode 100644 index 00000000000..76d09d7fc49 --- /dev/null +++ b/tests/build_tests/super_errors/fixtures/labeled_args_incoherent_order.res @@ -0,0 +1 @@ +let f = g => (g(~a=1, ~b=2), g(~b=3, ~a=4)) From 6b291378e8fe6f5bf92a9110268c08ec08bbf1fe Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Mon, 1 Jun 2026 17:06:54 +0000 Subject: [PATCH 24/31] Fix Unhandled_poly_type assert comment to the real reason MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The comment claimed the parser "misreads inline `'a.` as the deprecated uncurried `(. …)` form and rejects it" — that is wrong. Validated the unreachability from scratch (structural + ~13 empirical externals): - list_of_arrow only recurses an arrow's return and is only called on an external's type annotation. The external type, and every arrow arg/return, is parsed by parse_typ_expr, which never routes to parse_poly_type_expr. - An inline `'a. …` in an external's arg/return position is a plain syntax error ("Did you forget a `=` here?"), not a misread uncurried dot. - Ptyp_poly is produced only for record/object field types and signature `val` descriptions; a field-nested poly is a non-arrow leaf that list_of_arrow stops at, never the recursed return. Conclusion (unreachable) unchanged; only the rationale is corrected. No behavioral change. ERROR_VARIANTS.md already stated the correct reason. --- compiler/frontend/ast_core_type.ml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/compiler/frontend/ast_core_type.ml b/compiler/frontend/ast_core_type.ml index f834d6f4b9e..ee05b07ef8b 100644 --- a/compiler/frontend/ast_core_type.ml +++ b/compiler/frontend/ast_core_type.ml @@ -137,10 +137,15 @@ let list_of_arrow (ty : t) : t * Parsetree.arg list = | Ptyp_arrow {arg; ret; arity} when arity = None || acc = [] -> aux ret (arg :: acc) | Ptyp_poly _ -> - (* unreachable: this would require an inline Ptyp_poly inside an - external's arrow chain. The ReScript parser misreads inline `'a.` - prefix syntax as the deprecated uncurried `(. …)` form and rejects - it, so the typer never sees the required AST shape. *) + (* unreachable: [list_of_arrow] only recurses into an arrow's return + (and is only ever called on an external's type annotation), so to get + here a [Ptyp_poly] would have to sit in an external's arg/return + position. The external type — and every arrow arg/return — is parsed + by [parse_typ_expr], which never routes to [parse_poly_type_expr]; an + inline `'a. …` there is a plain syntax error ("Did you forget a `=`"). + [Ptyp_poly] is produced only for record/object field types and + signature `val` descriptions, and a field-nested poly is a non-arrow + leaf that [list_of_arrow] stops at, never the recursed return. *) assert false | _ -> (ty, List.rev acc) in From d43d92a5fa8941f55258b41aa1cc5522dbced967 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Mon, 1 Jun 2026 18:19:59 +0000 Subject: [PATCH 25/31] Restore Abstract_wrong_label to its original position The branch's earlier label-diagnostic churn left Abstract_wrong_label moved from after Too_many_arguments (master) to after Apply_wrong_label, in the typecore error type (.ml + .mli) and the report_error printer. The move is purely cosmetic (sum-type constructor order / match-arm order) and only created needless diff noise. Moved all three back to match master. --- compiler/ml/typecore.ml | 18 +++++++++--------- compiler/ml/typecore.mli | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index a0d2b7e2a5c..88370ee3298 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -43,7 +43,6 @@ type error = } | Apply_non_function of type_expr | Apply_wrong_label of arg_label * type_expr - | Abstract_wrong_label of arg_label * type_expr | Label_multiply_defined of { label: string; jsx_component_info: jsx_prop_error_info option; @@ -62,6 +61,7 @@ type error = | Not_subtype of Ctype.type_pairs * Ctype.type_pairs * Ctype.subtype_context option | Too_many_arguments of bool * type_expr + | Abstract_wrong_label of arg_label * type_expr | Scoping_let_module of string * type_expr | Not_a_variant_type of Longident.t | Incoherent_label_order @@ -4681,14 +4681,6 @@ let report_error env loc ppf error = in fprintf ppf "@[@[<2>%a@]@,This function has type: %a@]" print_message l type_expr ty - | Abstract_wrong_label (l, ty) -> - let label_mark = function - | Nolabel -> "but its first argument is not labelled" - | l -> - sprintf "but its first argument is labelled %s" (prefixed_label_name l) - in - fprintf ppf "@[@[<2>This function should have type@ %a@]@,%s@]" type_expr - ty (label_mark l) | Label_multiply_defined {label; jsx_component_info = Some jsx_component_info} -> fprintf ppf @@ -4761,6 +4753,14 @@ let report_error env loc ppf error = else ( fprintf ppf "@[This expression should not be a function,@ "; fprintf ppf "the expected type is@ %a@]" type_expr ty) + | Abstract_wrong_label (l, ty) -> + let label_mark = function + | Nolabel -> "but its first argument is not labelled" + | l -> + sprintf "but its first argument is labelled %s" (prefixed_label_name l) + in + fprintf ppf "@[@[<2>This function should have type@ %a@]@,%s@]" type_expr + ty (label_mark l) | Scoping_let_module (id, ty) -> fprintf ppf "This `let module' expression has type@ %a@ " type_expr ty; fprintf ppf diff --git a/compiler/ml/typecore.mli b/compiler/ml/typecore.mli index 7ffbd8f3d45..9524ac834a9 100644 --- a/compiler/ml/typecore.mli +++ b/compiler/ml/typecore.mli @@ -76,7 +76,6 @@ type error = } | Apply_non_function of type_expr | Apply_wrong_label of arg_label * type_expr - | Abstract_wrong_label of arg_label * type_expr | Label_multiply_defined of { label: string; jsx_component_info: Error_message_utils.jsx_prop_error_info option; @@ -95,6 +94,7 @@ type error = | Not_subtype of Ctype.type_pairs * Ctype.type_pairs * Ctype.subtype_context option | Too_many_arguments of bool * type_expr + | Abstract_wrong_label of arg_label * type_expr | Scoping_let_module of string * type_expr | Not_a_variant_type of Longident.t | Incoherent_label_order From 839bb3d624cbb190cf44cc9fd62858f2ac66f732 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Mon, 1 Jun 2026 18:29:08 +0000 Subject: [PATCH 26/31] Remove needless line-move noise from the diff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed the whole diff vs master and reverted reorderings that were not real changes, so the review shows only the actual edits in place: - typemod.ml: reverted entirely to master. Its only diff was two report_error arms (Cannot_eliminate_dependency, With_changes_module_alias) reordered — pure cosmetic churn, both still raised, no content change. - typecore.ml: moved list_labels/list_labels_aux back to their original spot (after type_approx, before check_univars) with the original comment. I had re-added them before lower_args when restoring, creating a spurious delete+add pair. - bs_syntaxerr.ml/.mli: restored to master and re-applied only the intended change in place — Misplaced_label_syntax had been relocated to the end of the error type and pp_error; now it stays in its original position and the only diff is the message typo fix ("support" -> "supported"), which the fixture already expects. env.ml/.mli were already byte-identical to master. No behavioral change; build + format clean, super_errors suite green. --- compiler/frontend/bs_syntaxerr.ml | 14 +++++++++++--- compiler/frontend/bs_syntaxerr.mli | 4 +++- compiler/ml/typecore.ml | 25 +++++++++++++------------ compiler/ml/typemod.ml | 20 ++++++++++---------- 4 files changed, 37 insertions(+), 26 deletions(-) diff --git a/compiler/frontend/bs_syntaxerr.ml b/compiler/frontend/bs_syntaxerr.ml index 7509f328f1a..31d2b9a0a2d 100644 --- a/compiler/frontend/bs_syntaxerr.ml +++ b/compiler/frontend/bs_syntaxerr.ml @@ -26,11 +26,13 @@ type untagged_variant = OnlyOneUnknown | AtMostOneObject | AtMostOneArray type error = | Unsupported_predicates + | Conflict_bs_bs_this_bs_meth | Duplicated_bs_deriving | Conflict_attributes | Expect_int_literal | Expect_string_literal | Expect_int_or_string_or_json_literal + | Unhandled_poly_type | Invalid_underscore_type_in_external | Invalid_bs_string_type | Invalid_bs_int_type @@ -42,15 +44,19 @@ type error = *) | Not_supported_directive_in_bs_return | Expect_opt_in_bs_return_to_opt + | Misplaced_label_syntax | Optional_in_uncurried_bs_attribute | Bs_this_simple_pattern | Experimental_feature_not_enabled of Experimental_features.feature | LetUnwrap_not_supported_in_position of [`Toplevel | `Unsupported_type] - | Misplaced_label_syntax let pp_error fmt err = Format.pp_print_string fmt (match err with + | Misplaced_label_syntax -> "Label syntax is not supported in this position" + (* + let fn x = ((##) x ~hi) ~lo:1 ~hi:2 + *) | Optional_in_uncurried_bs_attribute -> "Uncurried function doesn't support optional arguments yet" | Expect_opt_in_bs_return_to_opt -> @@ -59,12 +65,15 @@ let pp_error fmt err = | Not_supported_directive_in_bs_return -> "Not supported return directive" | Illegal_attribute -> "Illegal attributes" | Unsupported_predicates -> "unsupported predicates" + | Conflict_bs_bs_this_bs_meth -> + "%@this and %@bs can not be applied at the same time" | Duplicated_bs_deriving -> "duplicate @deriving attribute" | Conflict_attributes -> "conflicting attributes " | Expect_string_literal -> "expect string literal " | Expect_int_literal -> "expect int literal " | Expect_int_or_string_or_json_literal -> "expect int, string literal or json literal {json|text here|json} " + | Unhandled_poly_type -> "Unhandled poly type" | Invalid_underscore_type_in_external -> "_ is not allowed in combination with external optional type" | Invalid_bs_string_type -> "Not a valid type for %@string" @@ -87,8 +96,7 @@ let pp_error fmt err = | `Toplevel -> "`let?` is not allowed for top-level bindings." | `Unsupported_type -> "`let?` is only supported in let bindings targeting the `result` or \ - `option` type.") - | Misplaced_label_syntax -> "Label syntax is not supported in this position") + `option` type.")) type exn += Error of Location.t * error diff --git a/compiler/frontend/bs_syntaxerr.mli b/compiler/frontend/bs_syntaxerr.mli index 4851c3adcb5..ecdaaaa0e6c 100644 --- a/compiler/frontend/bs_syntaxerr.mli +++ b/compiler/frontend/bs_syntaxerr.mli @@ -26,11 +26,13 @@ type untagged_variant = OnlyOneUnknown | AtMostOneObject | AtMostOneArray type error = | Unsupported_predicates + | Conflict_bs_bs_this_bs_meth | Duplicated_bs_deriving | Conflict_attributes | Expect_int_literal | Expect_string_literal | Expect_int_or_string_or_json_literal + | Unhandled_poly_type | Invalid_underscore_type_in_external | Invalid_bs_string_type | Invalid_bs_int_type @@ -42,11 +44,11 @@ type error = *) | Not_supported_directive_in_bs_return | Expect_opt_in_bs_return_to_opt + | Misplaced_label_syntax | Optional_in_uncurried_bs_attribute | Bs_this_simple_pattern | Experimental_feature_not_enabled of Experimental_features.feature | LetUnwrap_not_supported_in_position of [`Toplevel | `Unsupported_type] - | Misplaced_label_syntax val err : Location.t -> error -> 'a diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index 88370ee3298..6098f7c58db 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -1989,6 +1989,19 @@ let rec type_approx env sexp = ty2 | _ -> newvar () +(* List labels in a function type, and whether return type is a variable *) +let rec list_labels_aux env visited ls ty_fun = + let ty = expand_head env ty_fun in + if List.memq ty visited then (List.rev ls, false) + else + match ty.desc with + | Tarrow (arg, ty_res, _, arity) when arity = None || visited = [] -> + list_labels_aux env (ty :: visited) (arg.lbl :: ls) ty_res + | _ -> (List.rev ls, is_Tvar ty) + +let list_labels env ty = + wrap_trace_gadt_instances env (list_labels_aux env [] []) ty + (* Check that all univars are safe in a type *) let check_univars env expans kind exp ty_expected vars = if expans && not (is_nonexpansive exp) then @@ -2250,18 +2263,6 @@ let is_ignore ~env ~arity funct = with Unify _ -> false) | _ -> false -let rec list_labels_aux env visited ls ty_fun = - let ty = expand_head env ty_fun in - if List.memq ty visited then (List.rev ls, false) - else - match ty.desc with - | Tarrow (arg, ty_res, _, arity) when arity = None || visited = [] -> - list_labels_aux env (ty :: visited) (arg.lbl :: ls) ty_res - | _ -> (List.rev ls, is_Tvar ty) - -let list_labels env ty = - wrap_trace_gadt_instances env (list_labels_aux env [] []) ty - let rec lower_args env seen ty_fun = let ty = expand_head env ty_fun in if List.memq ty seen then () diff --git a/compiler/ml/typemod.ml b/compiler/ml/typemod.ml index e823d4ac825..0932c62f347 100644 --- a/compiler/ml/typemod.ml +++ b/compiler/ml/typemod.ml @@ -1818,6 +1818,11 @@ let report_error ppf = function fprintf ppf "@[This module is not a functor; it has type@ %a@]" modtype mty | Not_included errs -> fprintf ppf "@[Signature mismatch:@ %a@]" Includemod.report_error errs + | Cannot_eliminate_dependency mty -> + fprintf ppf + "@[This functor has type@ %a@ The parameter cannot be eliminated in the \ + result type.@ Bind the argument to a module identifier.@]" + modtype mty | Signature_expected -> fprintf ppf "This module type is not a signature" | Structure_expected mty -> fprintf ppf "@[This module is not a structure; it has type@ %a" modtype mty @@ -1835,16 +1840,16 @@ let report_error ppf = function "@[@[This `with' constraint on %a makes the applicative functor @ \ type %s ill-typed in the constrained signature:@]@ %a@]" longident lid (Path.name path) Includemod.report_error explanation - | With_cannot_remove_constrained_type -> - fprintf ppf - "@[Destructive substitutions are not supported for constrained @ \ - types (other than when replacing a type constructor with @ a type \ - constructor with the same arguments).@]" | With_changes_module_alias (lid, id, path) -> fprintf ppf "@[@[This `with' constraint on %a changes %s, which is aliased @ in \ the constrained signature (as %s)@].@]" longident lid (Path.name path) (Ident.name id) + | With_cannot_remove_constrained_type -> + fprintf ppf + "@[Destructive substitutions are not supported for constrained @ \ + types (other than when replacing a type constructor with @ a type \ + constructor with the same arguments).@]" | Repeated_name (kind, name, repeated_loc) -> fprintf ppf "@[Multiple definition of the %s name %s @ at @{%a@}@ @ Names must \ @@ -1873,11 +1878,6 @@ let report_error ppf = function | Interface_not_compiled intf_name -> fprintf ppf "@[Could not find the .cmi file for interface@ %a.@]" Location.print_filename intf_name - | Cannot_eliminate_dependency mty -> - fprintf ppf - "@[This functor has type@ %a@ The parameter cannot be eliminated in the \ - result type.@ Bind the argument to a module identifier.@]" - modtype mty | Not_allowed_in_functor_body -> fprintf ppf "@[This expression creates fresh types.@ %s@]" "It is not allowed inside applicative functors." From 6e1be661aeb235296a38d10da02f4ea21f8ecdf6 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Mon, 1 Jun 2026 19:14:54 +0000 Subject: [PATCH 27/31] Shorten Type_clash definition comment Keep the one-liner at the definition; the full rationale lives at the update_type raise site it points to. --- compiler/ml/typedecl.ml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/compiler/ml/typedecl.ml b/compiler/ml/typedecl.ml index 2e3806fa964..a6dfa7c95e5 100644 --- a/compiler/ml/typedecl.ml +++ b/compiler/ml/typedecl.ml @@ -34,14 +34,7 @@ type error = | Definition_mismatch of type_expr * Includecore.type_mismatch list | Constraint_failed of type_expr * type_expr | Inconsistent_constraint of Env.t * (type_expr * type_expr) list - (* Appears to be dead. Its only raise site (update_type) unifies - [t] against [t]'s own manifest — i.e. a type against an - alpha-renamed copy of itself — which cannot produce a head clash; and - every genuine inconsistency is caught by a dedicated check instead - (Cycle_in_def, Recursive_abbrev, Parameters_differ, Constraint_failed, - Type_arity_mismatch). ~37 recursive/mutual/constraint/row/object/alias - shapes were tried without reaching it. Retained as a named variant - pending an airtight proof rather than replaced with [assert false]. *) + (* Appears dead; retained pending proof. See update_type for details. *) | Type_clash of Env.t * (type_expr * type_expr) list | Parameters_differ of Path.t * type_expr * type_expr | Null_arity_external From ed53dcd946c289f92188b8349830ea7e474a8217 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Mon, 1 Jun 2026 19:25:36 +0000 Subject: [PATCH 28/31] Drop Incoherent_label_order raise-site comment It's a live variant with a fixture (labeled_args_incoherent_order.res), so the behavior is captured by the test, not a comment. Comments are reserved for removals. The raise site is now identical to master. --- compiler/ml/typecore.ml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/compiler/ml/typecore.ml b/compiler/ml/typecore.ml index 6098f7c58db..b6f4f803e61 100644 --- a/compiler/ml/typecore.ml +++ b/compiler/ml/typecore.ml @@ -3874,14 +3874,7 @@ and type_application ~context total_app env funct (sargs : sargs) : else if not (has_label l1 ty_fun) then raise (Error (sarg1.pexp_loc, env, Apply_wrong_label (l1, ty_res))) - else - (* Reached when a not-yet-generalized function value is applied - more than once with labelled arguments in conflicting orders - (e.g. `g => (g(~a, ~b), g(~b, ~a))`): the first call fixes the - arrow order, and the second reordered call lands here via the - leftover/tvar path. See - fixtures/labeled_args_incoherent_order.res. *) - raise (Error (funct.exp_loc, env, Incoherent_label_order)) + else raise (Error (funct.exp_loc, env, Incoherent_label_order)) | _ -> raise (Error From e243b2c79e051044e594f7c3912a2d907153dccb Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Mon, 1 Jun 2026 19:25:36 +0000 Subject: [PATCH 29/31] Restore changed catalog rows to their master table positions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 9 re-audited variants (Type_clash, Parameters_differ, Null_arity_external, Bad_fixed_type, Varying_anonymous, Invalid_interval, Incoherent_label_order, Illegal_value_name, Unbound_type_constructor_2) had their per-module table rows deleted and the info relocated to the prose list, causing line drift. Each row is now back in its master position with an in-place status update (⚠ -> ✓ + fixture; Type_clash stays ⚠ "appears dead, retained"), so the diff reads as a row-level edit instead of a move. Verified all four module tables (typecore/typedecl/env/typetexp) now match master row order; remaining gaps are only the genuinely-removed variants. --- tests/ERROR_VARIANTS.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/ERROR_VARIANTS.md b/tests/ERROR_VARIANTS.md index 8a0ac9e0509..b37e62fdcbe 100644 --- a/tests/ERROR_VARIANTS.md +++ b/tests/ERROR_VARIANTS.md @@ -197,6 +197,7 @@ Source: [typecore.ml:27](../compiler/ml/typecore.ml). |---|---|---|---| | `Polymorphic_label` | ✓ | `polymorphic_label.res` | Pattern that instantiates a polymorphic record field: `({f: (f: int => int)}: t) =>` constrains the universal `'a` of `f: 'a. 'a => 'a` to `int => int`. | | `Constructor_arity_mismatch` | ✓ | `constructor_arity_mismatch.res`, `constructor_arity_mismatch_pattern.res`, `arity_mismatch*.res` | Triggers in both expression (4028) and pattern (1426) paths. | +| `Label_mismatch` | ✓ | `label_mismatch_record_literal.res` | Record literal without expected type mixing fields from two different record types — disambiguation picks one type per label, and the cross-type unify fails inside `type_label_exp`. | | `Pattern_type_clash` | ✓ | many `*_pattern_type_clash.res` etc. | Most-fired pattern error. Sub-case fixtures: `pattern_matching_on_option_but_value_not_option.res` and `pattern_matching_on_value_but_is_option.res` (option-vs-non-option trace), `pattern_type_clash_polyvariant.res` (polyvariant tag against concrete type), `pattern_type_clash_tuple_arity.res` (tuple arity mismatch). | | `Or_pattern_type_clash` | ✓ | `or_pattern_type_clash.res` | | | `Multiply_bound_variable` | ✓ | `multiply_bound_variable.res` | | @@ -204,8 +205,6 @@ Source: [typecore.ml:27](../compiler/ml/typecore.ml). | `Expr_type_clash` | ✓ | many `*.res` | Most-fired expression error. Trace-shape sub-cases covered: `if_return_type_mismatch.res` (IfReturn), `maybe_unwrap_option.res` (MaybeUnwrapOption), `string_concat_non_string.res` (StringConcat), `labeled_fn_argument_type_clash.res` (FunctionArgument with explicit label), `math_operator_*.res` (MathOperator family), `ternary_branch_mismatch.res`, `switch_different_types.res`, `try_catch_same_type.res`, `comparison_operator.res`, `array_item_type_mismatch.res`, `array_literal_passed_to_tuple.res`, `if_condition_mismatch.res`, `while_condition.res`, `for_loop_condition.res`, `assert_condition.res`, `function_call_mismatch.res`, `awaiting_non_promise.res`, multiple `jsx_*` fixtures. | | `Apply_non_function` | ✓ | `apply_non_function.res` | | | `Apply_wrong_label` | ✓ | `apply_wrong_label.res` | | -| `Abstract_wrong_label` | ✓ | `abstract_wrong_label.res` | Multi-arg function literal where an inner argument label doesn't match the expected arrow's label (e.g. `let f: (~a, ~b) => int = (~a, ~c) => …`). | -| `Label_mismatch` | ✓ | `label_mismatch_record_literal.res` | Record literal without expected type mixing fields from two different record types — disambiguation picks one type per label, and the cross-type unify fails inside `type_label_exp`. | | `Label_multiply_defined` | ✓ | `label_multiply_defined_literal.res` | | | `Labels_missing` | ✓ | `missing_label.res`, `missing_labels.res` | | | `Label_not_mutable` | ✓ | `label_not_mutable.res` | | @@ -216,14 +215,17 @@ Source: [typecore.ml:27](../compiler/ml/typecore.ml). | `Private_label` | ✓ | `private_label.res` | | | `Not_subtype` | ✓ | `subtype_*.res`, `dict_show_no_coercion.res`, etc. | | | `Too_many_arguments` | ✓ | `too_many_arguments.res`, `moreArguments*.res` | | +| `Abstract_wrong_label` | ✓ | `abstract_wrong_label.res` | Multi-arg function literal where an inner argument label doesn't match the expected arrow's label (e.g. `let f: (~a, ~b) => int = (~a, ~c) => …`). | | `Scoping_let_module` | ✓ | `scoping_let_module.res` | | | `Not_a_variant_type` | ✓ | `variant_spread_pattern_not_a_variant.res` | Pattern-level variant spread of a non-variant type. | +| `Incoherent_label_order` | ✓ | `labeled_args_incoherent_order.res` | A not-yet-generalized function value applied more than once with labelled args in conflicting orders (`g => (g(~a, ~b), g(~b, ~a))`); the reordered second call hits the leftover/tvar path in `type_unknown_args`. | | `Less_general` | ✓ | `less_general_universal.res` | | | `Modules_not_allowed` | ✓ | `super_errors_multi/Modules_not_allowed_toplevel` | Toplevel `let module(M) = …` pattern with `allow_modules=false`. | | `Cannot_infer_signature` | ✓ | `cannot_infer_signature.res` | | | `Not_a_packed_module` | ✓ | `not_a_packed_module.res` | | | `Unexpected_existential` | ✓ | `super_errors_multi/Unexpected_existential_in_let` | Destructuring GADT constructor with existential in toplevel `let`. | | `Unqualified_gadt_pattern` | ✓ | `super_errors_multi/Cross_gadt_pattern` | Only reachable via cross-module GADT disambiguation; in single-file matching the constructor would resolve before this check. | +| `Invalid_interval` | ✓ | `pattern_interval_non_char.res` | Non-char constant interval pattern (e.g. `1 .. 5`); the parser builds `Ppat_interval` and only the `Pconst_char` interval is rewritten. | | `Invalid_for_loop_index` | ✓ | `invalid_for_loop_index.res` | | | `No_value_clauses` | ✓ | `no_value_clauses.res` | | | `Exception_pattern_below_toplevel` | ✓ | `exception_pattern_below_toplevel.res` | | @@ -260,6 +262,9 @@ Type-declaration errors. Source: [typedecl.ml:27](../compiler/ml/typedecl.ml). | `Definition_mismatch` | ✓ | `definition_mismatch.res` | | | `Constraint_failed` | ✓ | `constraint_failed.res` | | | `Inconsistent_constraint` | ✓ | `inconsistent_constraint.res` | | +| `Type_clash` | ⚠ | — | Appears dead; retained pending proof. `update_type` unifies `t` against `t`'s own manifest (an alpha-renamed copy of itself), which can't head-clash; real inconsistencies hit `Cycle_in_def`/`Recursive_abbrev`/`Parameters_differ` first. ~37 shapes tried without reaching it. | +| `Parameters_differ` | ✓ | `recursive_type_parameters_differ.res` | Non-uniform recursion through an object/record manifest (`type rec t<'a> = {"f": t}`), caught by `check_regular` rather than `Cycle_in_def`. | +| `Null_arity_external` | ✓ | `external_null_arity.res` | External whose name starts with `?` (e.g. `external x: int = "?nodeFs"`) skips the magic `prim_native_name` encoding and reaches the typer with arity 0. | | `Unbound_type_var` | ✓ | `unbound_type_var.res` | | | `Cannot_extend_private_type` | ✓ | `cannot_extend_private_type.res` | | | `Not_extensible_type` | ✓ | `not_extensible_type.res` | | @@ -269,7 +274,9 @@ Type-declaration errors. Source: [typedecl.ml:27](../compiler/ml/typedecl.ml). | `Rebind_private` | ✓ | `extension_rebind_private.res` | Rebinding a private extension constructor as public. | | `Bad_variance` | ✓ | `bad_variance.res`, `bad_variance_contra.res` | | | `Unavailable_type_constructor` | ☐ (needs build harness) | — | typedecl.ml:778. Requires a type path findable at parse time but missing during constraint enforcement; only cross-unit scenarios where a `.cmi` was found but later removed. | +| `Bad_fixed_type` | ✓ | `fixed_type_no_row_variable.res` | Fully-bounded closed private polymorphic variant (`type t = private [< #A | #B > #A #B]`) satisfies `is_fixed_type` but has a static (non-`Tvar`) row. | | `Unbound_type_var_ext` | ✓ | `unbound_type_var_extension.res` | | +| `Varying_anonymous` | ✓ | `gadt_varying_anonymous.res` | Variance annotation on a GADT parameter whose return type constrains it (`type rec t<+'a> = K(int): t`). | | `Invalid_attribute` | ✓ | `invalid_attribute_not_undefined.res` | | | `Bad_immediate_attribute` | ✓ | `bad_immediate_attribute.res` | | | `Bad_unboxed_attribute` | ✓ | `bad_unboxed_attribute_abstract.res`, `bad_unboxed_attribute_mutable.res`, `bad_unboxed_attribute_many_fields.res`, `bad_unboxed_attribute_extensible.res` | All 4 sub-cases covered. | @@ -318,6 +325,7 @@ Type-expression errors. Source: [typetexp.ml:28](../compiler/ml/typetexp.ml). |---|---|---|---| | `Unbound_type_variable` | ✓ | (covered indirectly via many fixtures) | | | `Unbound_type_constructor` | ✓ | `typetexp_unbound_type_constructor.res` | | +| `Unbound_type_constructor_2` | ✓ | `incomplete_type_constructor_polyvariant.res`, `incomplete_type_constructor_object.res` | Identity alias `type t<'a> = 'a` used in an inherit position with a type-variable arg; `expand_head` collapses `t<'b>` to a bare `Tvar` while the repr stays `Tconstr`. Reachable from poly-variant inherit and object spread. | | `Type_arity_mismatch` | ✓ | `type_arity_mismatch.res` | | | `Type_mismatch` | ✓ | `typetexp_type_mismatch.res` | Type-constructor application that violates a `constraint 'a = …` on the declaration. | | `Alias_type_mismatch` | ✓ | `typetexp_alias_type_mismatch.res` | | @@ -476,6 +484,7 @@ Environment / `.cmi`-consistency errors. Source: [env.ml:57](../compiler/ml/env. | `Illegal_renaming` | ☐ (needs build harness) | — | Triggered when a `.cmi` filename and the module name inside it disagree. Reachable via `rescript.json` setups that rename the produced artefact, but not from a single-process `bsc` invocation that always writes `Module.cmi` to match the source. | | `Inconsistent_import` | ☐ (needs build harness) | — | Triggered when two `.cmi` files transitively imported by the same unit declare different CRCs for the same type. Needs an artificially-mutated build state across multiple compile invocations. | | `Missing_module` | ☐ (needs build harness) | — | `.cmi` referenced but absent from `-I` paths at compile time. The `super_errors_multi` runner pre-compiles every fixture file via `-bs-read-cmi`, so it never reaches this code path. | +| `Illegal_value_name` | ✓ | `illegal_value_name.res` | Escaped identifier reaching `check_value_name` during definition (`let \"->" = 1`); the parser does not reject `\"->"`. | --- From 635ad4b851b075e98c7c70d45665431a75a1bb48 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Mon, 1 Jun 2026 19:54:50 +0000 Subject: [PATCH 30/31] Add changelog entry for dead-variant removal --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9f45bdab89..01d233ee348 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ - Cache OPAM env, rewatch build, and instrumented dune state in the coverage workflow. https://github.com/rescript-lang/rescript/pull/8434 - Add a multi-file fixture harness (`super_errors_multi`) for cross-module errors and warnings. https://github.com/rescript-lang/rescript/pull/8433 - Catalog every named compiler error variant in `tests/ERROR_VARIANTS.md` and add fixtures for the remaining reachable ones. https://github.com/rescript-lang/rescript/pull/8446 +- Remove dead and unreachable compiler error and warning variants; add fixtures for the ones found to be reachable. https://github.com/rescript-lang/rescript/pull/8459 # 13.0.0-alpha.4 From 890bcc0a8808f906082c1263e7caa4533995f577 Mon Sep 17 00:00:00 2001 From: Jono Prest Date: Mon, 1 Jun 2026 19:58:13 +0000 Subject: [PATCH 31/31] Re-remove dead bs_syntaxerr variants (Conflict_bs_bs_this_bs_meth, Unhandled_poly_type) A prior revert that fixed the Misplaced_label_syntax line move also restored these two dead variants. Neither is reachable: Conflict_bs_bs_this_bs_meth is never raised, and Unhandled_poly_type's only use was replaced with assert false in ast_core_type. Remove both again; keep Misplaced_label_syntax in place. --- compiler/frontend/bs_syntaxerr.ml | 5 ----- compiler/frontend/bs_syntaxerr.mli | 2 -- 2 files changed, 7 deletions(-) diff --git a/compiler/frontend/bs_syntaxerr.ml b/compiler/frontend/bs_syntaxerr.ml index 31d2b9a0a2d..80cd1b461f1 100644 --- a/compiler/frontend/bs_syntaxerr.ml +++ b/compiler/frontend/bs_syntaxerr.ml @@ -26,13 +26,11 @@ type untagged_variant = OnlyOneUnknown | AtMostOneObject | AtMostOneArray type error = | Unsupported_predicates - | Conflict_bs_bs_this_bs_meth | Duplicated_bs_deriving | Conflict_attributes | Expect_int_literal | Expect_string_literal | Expect_int_or_string_or_json_literal - | Unhandled_poly_type | Invalid_underscore_type_in_external | Invalid_bs_string_type | Invalid_bs_int_type @@ -65,15 +63,12 @@ let pp_error fmt err = | Not_supported_directive_in_bs_return -> "Not supported return directive" | Illegal_attribute -> "Illegal attributes" | Unsupported_predicates -> "unsupported predicates" - | Conflict_bs_bs_this_bs_meth -> - "%@this and %@bs can not be applied at the same time" | Duplicated_bs_deriving -> "duplicate @deriving attribute" | Conflict_attributes -> "conflicting attributes " | Expect_string_literal -> "expect string literal " | Expect_int_literal -> "expect int literal " | Expect_int_or_string_or_json_literal -> "expect int, string literal or json literal {json|text here|json} " - | Unhandled_poly_type -> "Unhandled poly type" | Invalid_underscore_type_in_external -> "_ is not allowed in combination with external optional type" | Invalid_bs_string_type -> "Not a valid type for %@string" diff --git a/compiler/frontend/bs_syntaxerr.mli b/compiler/frontend/bs_syntaxerr.mli index ecdaaaa0e6c..9800cdaf96f 100644 --- a/compiler/frontend/bs_syntaxerr.mli +++ b/compiler/frontend/bs_syntaxerr.mli @@ -26,13 +26,11 @@ type untagged_variant = OnlyOneUnknown | AtMostOneObject | AtMostOneArray type error = | Unsupported_predicates - | Conflict_bs_bs_this_bs_meth | Duplicated_bs_deriving | Conflict_attributes | Expect_int_literal | Expect_string_literal | Expect_int_or_string_or_json_literal - | Unhandled_poly_type | Invalid_underscore_type_in_external | Invalid_bs_string_type | Invalid_bs_int_type