From 0be19887bb2a0ffa3e6e81b48408c272ec34974a Mon Sep 17 00:00:00 2001 From: Bart Waardenburg Date: Tue, 12 May 2026 21:00:33 +0200 Subject: [PATCH 1/6] feat(overrides): detect unused / misconfigured pnpm dependency overrides (Phase A) Two new issue types in one drop, mirroring the unused-catalog-entries + unresolved-catalog-references shape from #329/#334. - types/results: UnusedDependencyOverride + MisconfiguredDependencyOverride structs with raw_key, target_package, parent_package, version_constraint, version_range, source, path, line, and an optional transitive-CVE hint on the unused variant. - types/suppress: IssueKind discriminants 23 (UnusedDependencyOverride) and 24 (MisconfiguredDependencyOverride), parse aliases for the kebab singular / plural forms. - config: 2 new rule fields (default warn + error), IgnoreDependencyOverrideRule + CompiledIgnoreDependencyOverrideRule, ignoreDependencyOverrides on FallowConfig. - config/workspace/pnpm_overrides: new parser for the overrides: section of pnpm-workspace.yaml AND the pnpm.overrides section of root package.json. Handles bare names, scoped packages, version selectors on the target (@types/react@<18), parent matchers (react>react-dom, including scoped parents and chains with version selectors on the parent). Allowlists pnpm idioms (-, $ref, npm:alias) so they are never flagged as misconfigured. - core/analyze/unused_overrides: detector module with find_unused_dependency_overrides + find_misconfigured_dependency_overrides. Conservative static algorithm walks every workspace package.json dep section to compute the declared-packages set. Parent-chain semantics per the panel: USED when EITHER parent OR target is declared, covering the CVE-fix pattern where the override forces a transitive version under a declared parent. Bare-target unused findings carry a hint flagging the transitive-dependency possibility. Phase A scope: detector + types + config + JSON output + integration tests. Subsequent phases add CLI report formats (human, SARIF, compact, markdown, CodeClimate), LSP / MCP / NAPI / VS Code surfaces, and CI wrappers (action/jq, ci/jq, fixtures). 8 integration tests at tests/fixtures/issue-336-unused-overrides/ cover: both sources, parent-chain rule, version selectors, misconfigured detection, ignoreDependencyOverrides suppression with source scoping, severity-off short-circuit, transitive-CVE hint. Refs #336 --- CHANGELOG.md | 2 + crates/cli/src/check/output.rs | 1 + crates/cli/src/check/rules.rs | 13 + crates/cli/src/watch.rs | 1 + crates/cli/tests/snapshot_tests.rs | 4 + ...apshot_tests__json_circular_deps_only.snap | 4 +- ...ot_tests__json_duplicate_exports_only.snap | 4 +- .../snapshots/snapshot_tests__json_empty.snap | 4 +- .../snapshot_tests__json_mixed_severity.snap | 4 +- ...ests__json_multiple_exports_same_file.snap | 4 +- .../snapshot_tests__json_output.snap | 4 +- ...napshot_tests__json_re_export_variant.snap | 4 +- .../snapshot_tests__json_type_only_deps.snap | 4 +- ...apshot_tests__json_unlisted_deps_only.snap | 4 +- ...t_tests__json_unresolved_imports_only.snap | 4 +- ...tests__json_unused_class_members_only.snap | 4 +- ...snapshot_tests__json_unused_deps_only.snap | 4 +- ...shot_tests__json_unused_dev_deps_only.snap | 4 +- ..._tests__json_unused_enum_members_only.snap | 4 +- ...pshot_tests__json_unused_exports_only.snap | 4 +- ...napshot_tests__json_unused_files_only.snap | 4 +- ...tests__json_unused_optional_deps_only.snap | 4 +- ...napshot_tests__json_unused_types_only.snap | 4 +- .../snapshot_tests__json_workspace_deps.snap | 4 +- crates/config/src/config/mod.rs | 15 +- crates/config/src/config/resolution.rs | 70 ++ crates/config/src/config/rules.rs | 29 + crates/config/src/workspace/mod.rs | 6 + crates/config/src/workspace/pnpm_catalog.rs | 4 +- crates/config/src/workspace/pnpm_overrides.rs | 622 ++++++++++++++++++ crates/core/benches/helpers.rs | 1 + crates/core/src/analyze/mod.rs | 27 + crates/core/src/analyze/unused_overrides.rs | 309 +++++++++ crates/core/src/discover/entry_points.rs | 2 + crates/core/src/discover/walk.rs | 1 + crates/core/src/suppress.rs | 8 +- crates/core/tests/integration_test.rs | 2 + .../integration_test/boundary_violations.rs | 7 + crates/core/tests/integration_test/common.rs | 2 + .../tests/integration_test/dependencies.rs | 1 + .../integration_test/external_plugins.rs | 1 + ...sue_317_namespace_barrel_ignore_exports.rs | 1 + .../issue_334_unresolved_catalog_ref.rs | 1 + .../issue_336_unused_overrides.rs | 227 +++++++ .../tests/integration_test/production_mode.rs | 1 + .../tests/integration_test/rules_config.rs | 3 + .../tests/integration_test/type_only_deps.rs | 1 + crates/types/src/results.rs | 119 ++++ crates/types/src/suppress.rs | 40 +- .../issue-336-unused-overrides/package.json | 13 + .../packages/app/package.json | 9 + .../packages/lib/package.json | 8 + .../pnpm-workspace.yaml | 8 + 53 files changed, 1609 insertions(+), 26 deletions(-) create mode 100644 crates/config/src/workspace/pnpm_overrides.rs create mode 100644 crates/core/src/analyze/unused_overrides.rs create mode 100644 crates/core/tests/integration_test/issue_336_unused_overrides.rs create mode 100644 tests/fixtures/issue-336-unused-overrides/package.json create mode 100644 tests/fixtures/issue-336-unused-overrides/packages/app/package.json create mode 100644 tests/fixtures/issue-336-unused-overrides/packages/lib/package.json create mode 100644 tests/fixtures/issue-336-unused-overrides/pnpm-workspace.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 43ca24662..272d1036a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **`fallow fix` now auto-removes unused pnpm catalog entries from `pnpm-workspace.yaml`.** The `unused-catalog-entries` detector shipped in v2.70.0, but until now the only available action was `# fallow-ignore-next-line unused-catalog-entry`; users had to hand-edit the YAML to drop the entry. The fix is line-aware (preserves comments and stylistic choices in the file) and detects object-form entries such as `react:\n specifier: ^18.2.0\n publishConfig: {}` by consuming subsequent lines whose indent is strictly greater than the entry's own. When removing the last entry of a catalog group (default `catalog:` or a named `catalogs.:`) leaves the header with no children, the fix rewrites the header to `catalog: {}` / `: {}` so the file stays installable; bare `key:` in YAML parses as null which pnpm rejects with `Cannot convert undefined or null to object` at install time. Entries whose `hardcoded_consumers` is non-empty are skipped: removing the catalog entry while a workspace package still pins a hardcoded version of the same package would break the user's next `pnpm install`. The skip is surfaced in the human stderr summary and in the JSON output (`{"type": "remove_catalog_entry", "applied": false, "skipped": true, "skip_reason": "hardcoded_consumers", "consumers": [...], "description": "..."}`), and the per-instance `auto_fixable` bool on the check-command action correctly flips to `false` for findings with hardcoded consumers so agents that filter on the bool skip those automatically. After a successful run the CLI emits a one-line `Run \`pnpm install\` to refresh pnpm-lock.yaml` reminder so the workspace stays internally consistent. The fix output's top-level envelope adds a `"skipped"` count alongside the existing `"total_fixed"` so consumers can gate on partial-fix runs. The LSP `unused-catalog-entry` diagnostic now exposes a matching `Remove unused catalog entry` quick-fix code action with the same hardcoded-consumer guard, the same empty-parent rewrite, and an anchored key-prefix sanity check so sibling entries with shared prefixes (`react` vs `react-native`, `lodash` vs `lodash-es`) cannot be deleted by mistake. (Closes [#335](https://github.com/fallow-rs/fallow/issues/335).) +- **Detects unused and misconfigured pnpm `overrides` entries (Phase A).** **Upgrade note:** the new `misconfigured-dependency-overrides` rule defaults to `error`, so a workspace with a malformed override key or empty value will flip from a green `fallow check` on v2.72 to a red one on the next minor. To absorb the change without action, set `rules.misconfigured-dependency-overrides: "warn"` in your fallow config before upgrading. Two new rules read both `pnpm-workspace.yaml`'s `overrides:` top-level (canonical, pnpm 9+) and the root `package.json`'s `pnpm.overrides` (legacy form). `unused-dependency-overrides` (default `warn`) flags entries whose target package is not declared in any workspace `package.json`; conservative static algorithm uses the parent-chain rule (`react>react-dom` is considered USED when EITHER `react` OR `react-dom` is declared, covering the CVE-fix pattern where the parent is declared and the override forces a transitive version). Findings carry the raw key, structured `target_package` / `parent_package` / `version_constraint` / `version_range` decomposition, the source file (`pnpm-workspace.yaml` or `package.json`), 1-based line number, and an optional `hint` flagging parent-chain shapes that may target a purely transitive dependency. `misconfigured-dependency-overrides` (default `error`) catches entries whose key cannot be parsed (empty key, dangling separators) or whose value is missing; `pnpm install` refuses to honor these. Special pnpm values (`-` removal, `$ref` self-reference, `npm:alias@^1`) are explicitly allowlisted and never flagged as misconfigured. Suppression is config-only via `ignoreDependencyOverrides: [{ package, source? }]` (inline YAML / JSON comments are not feasible since `pnpm-workspace.yaml` uses YAML and `package.json` has no comment syntax); the optional `source` field scopes a suppression to `"pnpm-workspace.yaml"` or `"package.json"`. New `IssueKind::UnusedDependencyOverride` (discriminant 23) and `IssueKind::MisconfiguredDependencyOverride` (discriminant 24); new `UnusedDependencyOverride` + `MisconfiguredDependencyOverride` structs on `AnalysisResults`. Phase A wires the detector, types, config, integration tests, and JSON output; subsequent phases will extend the CLI report formats (human / SARIF / compact / markdown / CodeClimate), LSP / MCP / VS Code surfaces, and CI wrappers. (Refs [#336](https://github.com/fallow-rs/fallow/issues/336)) + ## [2.72.0] - 2026-05-12 ### Added diff --git a/crates/cli/src/check/output.rs b/crates/cli/src/check/output.rs index 1b630ffec..ee95ff5b5 100644 --- a/crates/cli/src/check/output.rs +++ b/crates/cli/src/check/output.rs @@ -218,6 +218,7 @@ mod tests { ignore_export_rules: vec![], compiled_ignore_exports: vec![], compiled_ignore_catalog_references: vec![], + compiled_ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: fallow_config::DuplicatesConfig::default(), diff --git a/crates/cli/src/check/rules.rs b/crates/cli/src/check/rules.rs index 60de918bb..a0e015a19 100644 --- a/crates/cli/src/check/rules.rs +++ b/crates/cli/src/check/rules.rs @@ -379,6 +379,7 @@ mod tests { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: fallow_config::DuplicatesConfig::default(), @@ -469,6 +470,8 @@ mod tests { stale_suppressions: Severity::Off, unused_catalog_entries: Severity::Off, unresolved_catalog_references: Severity::Off, + unused_dependency_overrides: Severity::Off, + misconfigured_dependency_overrides: Severity::Off, }; let config = config_with_rules(rules); apply_rules(&mut results, &config); @@ -579,6 +582,8 @@ mod tests { stale_suppressions: Severity::Warn, unused_catalog_entries: Severity::Warn, unresolved_catalog_references: Severity::Error, + unused_dependency_overrides: Severity::Warn, + misconfigured_dependency_overrides: Severity::Error, }; assert!(!has_error_severity_issues(&results, &rules, None)); } @@ -611,6 +616,8 @@ mod tests { stale_suppressions: Severity::Warn, unused_catalog_entries: Severity::Warn, unresolved_catalog_references: Severity::Error, + unused_dependency_overrides: Severity::Warn, + misconfigured_dependency_overrides: Severity::Error, }; // Only unused_files present, but set to Warn — should not trigger assert!(!has_error_severity_issues(&results, &rules, None)); @@ -652,6 +659,7 @@ mod tests { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: fallow_config::DuplicatesConfig::default(), @@ -697,6 +705,7 @@ mod tests { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: fallow_config::DuplicatesConfig::default(), @@ -921,6 +930,8 @@ mod tests { stale_suppressions: Severity::Warn, unused_catalog_entries: Severity::Warn, unresolved_catalog_references: Severity::Error, + unused_dependency_overrides: Severity::Warn, + misconfigured_dependency_overrides: Severity::Error, }; promote_warns_to_errors(&mut rules); @@ -967,6 +978,8 @@ mod tests { stale_suppressions: Severity::Off, unused_catalog_entries: Severity::Off, unresolved_catalog_references: Severity::Off, + unused_dependency_overrides: Severity::Off, + misconfigured_dependency_overrides: Severity::Off, }; promote_warns_to_errors(&mut rules); diff --git a/crates/cli/src/watch.rs b/crates/cli/src/watch.rs index 988d9b0a3..72e07f3d5 100644 --- a/crates/cli/src/watch.rs +++ b/crates/cli/src/watch.rs @@ -398,6 +398,7 @@ mod tests { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: fallow_config::DuplicatesConfig::default(), diff --git a/crates/cli/tests/snapshot_tests.rs b/crates/cli/tests/snapshot_tests.rs index 823a95718..1ddb2603b 100644 --- a/crates/cli/tests/snapshot_tests.rs +++ b/crates/cli/tests/snapshot_tests.rs @@ -533,6 +533,8 @@ fn sarif_mixed_severity_snapshot() { stale_suppressions: fallow_config::Severity::Warn, unused_catalog_entries: fallow_config::Severity::Warn, unresolved_catalog_references: fallow_config::Severity::Error, + unused_dependency_overrides: fallow_config::Severity::Warn, + misconfigured_dependency_overrides: fallow_config::Severity::Error, }; let sarif = build_sarif(&results, &root, &rules); let json_str = serde_json::to_string_pretty(&sarif).expect("should serialize"); @@ -1272,6 +1274,8 @@ fn codeclimate_mixed_severity_snapshot() { stale_suppressions: fallow_config::Severity::Warn, unused_catalog_entries: fallow_config::Severity::Warn, unresolved_catalog_references: fallow_config::Severity::Error, + unused_dependency_overrides: fallow_config::Severity::Warn, + misconfigured_dependency_overrides: fallow_config::Severity::Error, }; let cc = build_codeclimate(&results, &root, &rules); let json_str = serde_json::to_string_pretty(&cc).expect("should serialize"); diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_circular_deps_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_circular_deps_only.snap index 650564b83..f214bcc88 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_circular_deps_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_circular_deps_only.snap @@ -69,5 +69,7 @@ expression: redact_version(&json_str) "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_duplicate_exports_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_duplicate_exports_only.snap index c47b0d30f..4f14290df 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_duplicate_exports_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_duplicate_exports_only.snap @@ -97,5 +97,7 @@ expression: redact_version(&json_str) "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_empty.snap b/crates/cli/tests/snapshots/snapshot_tests__json_empty.snap index 138f71005..a9d522e71 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_empty.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_empty.snap @@ -45,5 +45,7 @@ expression: "json_str.replace(&format!(\"\\\"version\\\": \\\"{}\\\"\", env!(\"C "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap b/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap index 5af366a8b..54984b671 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap @@ -433,5 +433,7 @@ expression: redact_version(&json_str) ] } ], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_multiple_exports_same_file.snap b/crates/cli/tests/snapshots/snapshot_tests__json_multiple_exports_same_file.snap index cb2cd97f9..8357cc82d 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_multiple_exports_same_file.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_multiple_exports_same_file.snap @@ -112,5 +112,7 @@ expression: redact_version(&json_str) "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_output.snap b/crates/cli/tests/snapshots/snapshot_tests__json_output.snap index 3962512ae..596ca56bb 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_output.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_output.snap @@ -433,5 +433,7 @@ expression: "json_str.replace(&format!(\"\\\"version\\\": \\\"{}\\\"\", env!(\"C ] } ], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_re_export_variant.snap b/crates/cli/tests/snapshots/snapshot_tests__json_re_export_variant.snap index 8cd761d81..7227e1d9c 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_re_export_variant.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_re_export_variant.snap @@ -69,5 +69,7 @@ expression: "json_str.replace(&format!(\"\\\"version\\\": \\\"{}\\\"\", env!(\"C "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_type_only_deps.snap b/crates/cli/tests/snapshots/snapshot_tests__json_type_only_deps.snap index 288ce2afb..fb7d5b53e 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_type_only_deps.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_type_only_deps.snap @@ -88,5 +88,7 @@ expression: "json_str.replace(&format!(\"\\\"version\\\": \\\"{}\\\"\", env!(\"C "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unlisted_deps_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unlisted_deps_only.snap index b26a6e735..eaa049672 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unlisted_deps_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unlisted_deps_only.snap @@ -72,5 +72,7 @@ expression: redact_version(&json_str) "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unresolved_imports_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unresolved_imports_only.snap index 7a4fb2208..8db7220bb 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unresolved_imports_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unresolved_imports_only.snap @@ -67,5 +67,7 @@ expression: redact_version(&json_str) "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_class_members_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_class_members_only.snap index 5596e7da1..86456fd52 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_class_members_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_class_members_only.snap @@ -68,5 +68,7 @@ expression: redact_version(&json_str) "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_deps_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_deps_only.snap index fda4d4892..1b98318a5 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_deps_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_deps_only.snap @@ -67,5 +67,7 @@ expression: redact_version(&json_str) "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_dev_deps_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_dev_deps_only.snap index 6c04fe07d..88489c361 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_dev_deps_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_dev_deps_only.snap @@ -67,5 +67,7 @@ expression: redact_version(&json_str) "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_enum_members_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_enum_members_only.snap index 1c20ee9da..7c6ae3ee7 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_enum_members_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_enum_members_only.snap @@ -67,5 +67,7 @@ expression: redact_version(&json_str) "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_exports_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_exports_only.snap index 9585f80c2..7c1ce3bb6 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_exports_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_exports_only.snap @@ -68,5 +68,7 @@ expression: redact_version(&json_str) "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_files_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_files_only.snap index 199248b4b..7a725b1fc 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_files_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_files_only.snap @@ -63,5 +63,7 @@ expression: redact_version(&json_str) "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_optional_deps_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_optional_deps_only.snap index df777137c..a6740ce10 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_optional_deps_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_optional_deps_only.snap @@ -67,5 +67,7 @@ expression: redact_version(&json_str) "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_types_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_types_only.snap index 46a2713d9..893fe4932 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_types_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_types_only.snap @@ -68,5 +68,7 @@ expression: redact_version(&json_str) "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_workspace_deps.snap b/crates/cli/tests/snapshots/snapshot_tests__json_workspace_deps.snap index fa73d73c0..e0076a88b 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_workspace_deps.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_workspace_deps.snap @@ -89,5 +89,7 @@ expression: redact_version(&json_str) "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/crates/config/src/config/mod.rs b/crates/config/src/config/mod.rs index f25267f3d..1ff0d2662 100644 --- a/crates/config/src/config/mod.rs +++ b/crates/config/src/config/mod.rs @@ -20,8 +20,9 @@ pub use flags::{FlagsConfig, SdkPattern}; pub use format::OutputFormat; pub use health::{EmailMode, HealthConfig, OwnershipConfig}; pub use resolution::{ - CompiledIgnoreCatalogReferenceRule, CompiledIgnoreExportRule, ConfigOverride, - IgnoreCatalogReferenceRule, IgnoreExportRule, ResolvedConfig, ResolvedOverride, + CompiledIgnoreCatalogReferenceRule, CompiledIgnoreDependencyOverrideRule, + CompiledIgnoreExportRule, ConfigOverride, IgnoreCatalogReferenceRule, + IgnoreDependencyOverrideRule, IgnoreExportRule, ResolvedConfig, ResolvedOverride, }; pub use resolve::ResolveConfig; pub use rules::{PartialRulesConfig, RulesConfig, Severity}; @@ -186,6 +187,16 @@ pub struct FallowConfig { #[serde(default, skip_serializing_if = "Vec::is_empty")] pub ignore_catalog_references: Vec, + /// Rules for suppressing `unused-dependency-override` and + /// `misconfigured-dependency-override` findings. + /// + /// Each rule matches by override target package, optionally scoped to the + /// declaring source file (`pnpm-workspace.yaml` or `package.json`). Useful + /// for overrides targeting purely-transitive packages (CVE-fix pattern) + /// where the conservative static algorithm would otherwise cry wolf. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub ignore_dependency_overrides: Vec, + /// Suppress unused-export findings when the exported symbol is referenced /// inside the file that declares it. This mirrors Knip's /// `ignoreExportsUsedInFile` option while still reporting exports that have diff --git a/crates/config/src/config/resolution.rs b/crates/config/src/config/resolution.rs index d55501796..2c295397d 100644 --- a/crates/config/src/config/resolution.rs +++ b/crates/config/src/config/resolution.rs @@ -151,6 +151,57 @@ impl CompiledIgnoreCatalogReferenceRule { } } +/// Rule for suppressing an `unused-dependency-override` or +/// `misconfigured-dependency-override` finding. +/// +/// A finding is suppressed when ALL provided fields match the finding: +/// - `package` matches the override's target package name exactly +/// (case-sensitive). For parent-chain overrides (`react>react-dom`), the +/// target is the rightmost segment (`react-dom`). +/// - `source`, if set, scopes the suppression to overrides declared in that +/// source file. Accepts `"pnpm-workspace.yaml"` or `"package.json"`. +/// When omitted, both sources match. +/// +/// Typical use cases: +/// - Library-internal CI tooling overrides we cannot drop yet +/// - Overrides targeting purely-transitive packages (CVE-fix pattern) +#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct IgnoreDependencyOverrideRule { + /// Override target package name (exact match; case-sensitive). + pub package: String, + /// Source file scope: `"pnpm-workspace.yaml"` or `"package.json"`. + /// `None` matches both sources. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub source: Option, +} + +/// `IgnoreDependencyOverrideRule` ready for matching. +#[derive(Debug)] +pub struct CompiledIgnoreDependencyOverrideRule { + pub package: String, + /// `None` matches any source; `Some` matches only the named source. + pub source: Option, +} + +impl CompiledIgnoreDependencyOverrideRule { + /// Whether this rule suppresses a dependency-override finding for the + /// given (target_package, source_label) pair. `source_label` should be + /// `"pnpm-workspace.yaml"` or `"package.json"`. + #[must_use] + pub fn matches(&self, package: &str, source_label: &str) -> bool { + if self.package != package { + return false; + } + if let Some(source_filter) = &self.source + && source_filter != source_label + { + return false; + } + true + } +} + /// Per-file override entry. #[derive(Debug, Clone, Deserialize, Serialize, JsonSchema)] #[serde(rename_all = "camelCase")] @@ -189,6 +240,9 @@ pub struct ResolvedConfig { pub compiled_ignore_exports: Vec, /// Pre-compiled rules for suppressing `unresolved-catalog-reference` findings. pub compiled_ignore_catalog_references: Vec, + /// Pre-compiled rules for suppressing dependency-override findings (both + /// `unused-dependency-override` and `misconfigured-dependency-override`). + pub compiled_ignore_dependency_overrides: Vec, /// Whether same-file references should suppress unused-export findings. pub ignore_exports_used_in_file: IgnoreExportsUsedInFileConfig, /// Class member names that should never be flagged as unused-class-members. @@ -409,6 +463,15 @@ impl FallowConfig { }) .collect(); + let compiled_ignore_dependency_overrides: Vec = self + .ignore_dependency_overrides + .iter() + .map(|rule| CompiledIgnoreDependencyOverrideRule { + package: rule.package.clone(), + source: rule.source.clone(), + }) + .collect(); + ResolvedConfig { root, entry_patterns: self.entry, @@ -421,6 +484,7 @@ impl FallowConfig { ignore_export_rules: self.ignore_exports, compiled_ignore_exports, compiled_ignore_catalog_references, + compiled_ignore_dependency_overrides, ignore_exports_used_in_file: self.ignore_exports_used_in_file, used_class_members: self.used_class_members, duplicates: self.duplicates, @@ -507,6 +571,7 @@ mod tests { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: DuplicatesConfig::default(), @@ -549,6 +614,7 @@ mod tests { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: DuplicatesConfig::default(), @@ -604,6 +670,7 @@ mod tests { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: DuplicatesConfig::default(), @@ -672,6 +739,7 @@ mod tests { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: DuplicatesConfig::default(), @@ -776,6 +844,7 @@ mod tests { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: DuplicatesConfig::default(), @@ -831,6 +900,7 @@ mod tests { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: DuplicatesConfig::default(), diff --git a/crates/config/src/config/rules.rs b/crates/config/src/config/rules.rs index 01060167b..8e156f900 100644 --- a/crates/config/src/config/rules.rs +++ b/crates/config/src/config/rules.rs @@ -108,6 +108,13 @@ pub struct RulesConfig { pub unused_catalog_entries: Severity, #[serde(default, alias = "unresolved-catalog-reference")] pub unresolved_catalog_references: Severity, + #[serde( + default = "Severity::default_warn", + alias = "unused-dependency-override" + )] + pub unused_dependency_overrides: Severity, + #[serde(default, alias = "misconfigured-dependency-override")] + pub misconfigured_dependency_overrides: Severity, } impl Default for RulesConfig { @@ -134,6 +141,8 @@ impl Default for RulesConfig { stale_suppressions: Severity::Warn, unused_catalog_entries: Severity::Warn, unresolved_catalog_references: Severity::Error, + unused_dependency_overrides: Severity::Warn, + misconfigured_dependency_overrides: Severity::Error, } } } @@ -204,6 +213,12 @@ impl RulesConfig { if let Some(s) = partial.unresolved_catalog_references { self.unresolved_catalog_references = s; } + if let Some(s) = partial.unused_dependency_overrides { + self.unused_dependency_overrides = s; + } + if let Some(s) = partial.misconfigured_dependency_overrides { + self.misconfigured_dependency_overrides = s; + } } } @@ -337,6 +352,18 @@ pub struct PartialRulesConfig { skip_serializing_if = "Option::is_none" )] pub unresolved_catalog_references: Option, + #[serde( + default, + alias = "unused-dependency-override", + skip_serializing_if = "Option::is_none" + )] + pub unused_dependency_overrides: Option, + #[serde( + default, + alias = "misconfigured-dependency-override", + skip_serializing_if = "Option::is_none" + )] + pub misconfigured_dependency_overrides: Option, } #[cfg(test)] @@ -547,6 +574,8 @@ mod tests { stale_suppressions: Some(Severity::Off), unused_catalog_entries: Some(Severity::Off), unresolved_catalog_references: Some(Severity::Off), + unused_dependency_overrides: Some(Severity::Off), + misconfigured_dependency_overrides: Some(Severity::Off), }; rules.apply_partial(&partial); assert_eq!(rules.unused_files, Severity::Off); diff --git a/crates/config/src/workspace/mod.rs b/crates/config/src/workspace/mod.rs index bbc888f86..61beaf720 100644 --- a/crates/config/src/workspace/mod.rs +++ b/crates/config/src/workspace/mod.rs @@ -1,6 +1,7 @@ mod package_json; mod parsers; mod pnpm_catalog; +mod pnpm_overrides; use std::path::{Path, PathBuf}; @@ -11,6 +12,11 @@ pub use package_json::PackageJson; pub use parsers::parse_tsconfig_root_dir; use parsers::{expand_workspace_glob, parse_pnpm_workspace_yaml, parse_tsconfig_references}; pub use pnpm_catalog::{PnpmCatalog, PnpmCatalogData, PnpmCatalogEntry, parse_pnpm_catalog_data}; +pub use pnpm_overrides::{ + MisconfigReason, OverrideSource, ParsedOverrideKey, PnpmOverrideData, PnpmOverrideEntry, + is_valid_override_value, override_misconfig_reason, override_source_label, parse_override_key, + parse_pnpm_package_json_overrides, parse_pnpm_workspace_overrides, +}; /// Workspace configuration for monorepo support. #[derive(Debug, Clone, Deserialize, Serialize, JsonSchema)] diff --git a/crates/config/src/workspace/pnpm_catalog.rs b/crates/config/src/workspace/pnpm_catalog.rs index 972b6059a..5c6d10e2d 100644 --- a/crates/config/src/workspace/pnpm_catalog.rs +++ b/crates/config/src/workspace/pnpm_catalog.rs @@ -225,7 +225,7 @@ enum Section { /// Strip an unquoted trailing `# ...` comment from a single line. Preserves /// `#` characters inside quoted strings so `"# in quotes": "value"` is left /// alone. -fn strip_inline_comment(line: &str) -> &str { +pub(super) fn strip_inline_comment(line: &str) -> &str { let bytes = line.as_bytes(); let mut in_single = false; let mut in_double = false; @@ -246,7 +246,7 @@ fn strip_inline_comment(line: &str) -> &str { /// Parse a key declaration of the form `key:` or `key: value`, returning just /// the (unquoted) key. Returns `None` when the line is not a key declaration /// (e.g., a list item `- foo`, a block scalar marker, or malformed). -fn parse_key(line: &str) -> Option { +pub(super) fn parse_key(line: &str) -> Option { let bytes = line.as_bytes(); if bytes.is_empty() { return None; diff --git a/crates/config/src/workspace/pnpm_overrides.rs b/crates/config/src/workspace/pnpm_overrides.rs new file mode 100644 index 000000000..aa8bcdba7 --- /dev/null +++ b/crates/config/src/workspace/pnpm_overrides.rs @@ -0,0 +1,622 @@ +//! Parser for the `overrides:` section of `pnpm-workspace.yaml` and the +//! `pnpm.overrides` section of a root `package.json`. +//! +//! pnpm supports forcing transitive dependency versions through two equivalent +//! locations: +//! +//! ```yaml +//! # pnpm-workspace.yaml (pnpm 9+, canonical) +//! overrides: +//! axios: ^1.6.0 +//! "@types/react@<18": "18.0.0" +//! "react>react-dom": ^17 +//! ``` +//! +//! ```json +//! // package.json (legacy form, still supported) +//! { "pnpm": { "overrides": { "axios": "^1.6.0" } } } +//! ``` +//! +//! For the unused-dependency-override and misconfigured-dependency-override +//! detectors we need both the structured map of entries and the 1-based line +//! number of each entry in the source so findings can point users to the exact +//! line. `serde_yaml_ng` and `serde_json` give us the structural parse; a second +//! targeted scan over the raw source recovers the line numbers. +//! +//! The detector treats the following key shapes as valid pnpm syntax: +//! - `axios` (bare package) +//! - `@scope/pkg` (scoped package) +//! - `axios@>=1.0.0` (version selector on the overridden package) +//! - `react>react-dom` (parent matcher; override `react-dom` only inside `react`'s subtree) +//! - `react@1>zoo` (parent matcher with version selector on the parent) +//! - `@scope/parent>@scope/child` (scoped packages on both sides) +//! +//! Special values that are valid pnpm syntax and must NOT be flagged as +//! misconfigured: `-` (removal), `$ref` (self-reference to a workspace dep), +//! `npm:alias@^1` (npm-protocol alias). + +use std::path::Path; + +use super::pnpm_catalog::{parse_key, strip_inline_comment}; + +/// Where an override entry was declared. +#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum OverrideSource { + /// Top-level `overrides:` in `pnpm-workspace.yaml`. + PnpmWorkspaceYaml, + /// `pnpm.overrides` in a root `package.json`. + PnpmPackageJson, +} + +/// Structured override data extracted from one source. +#[derive(Debug, Clone, Default)] +pub struct PnpmOverrideData { + /// Entries declared in source order. + pub entries: Vec, +} + +/// A single override entry. +#[derive(Debug, Clone)] +pub struct PnpmOverrideEntry { + /// The full original key as written in the source (e.g. + /// `"react>react-dom"`, `"@types/react@<18"`). Preserved for round-trip + /// reporting so agents see the unmodified spelling. + pub raw_key: String, + /// Parsed structure of the key. `None` when the key cannot be parsed into + /// a pnpm-recognised shape; in that case the entry is reported as + /// misconfigured rather than checked for usage. + pub parsed_key: Option, + /// The right-hand side of the entry (the version pnpm should force). + /// `None` when the value is missing or unparsable. + pub raw_value: Option, + /// 1-based line number of the entry within the source file. + pub line: u32, +} + +/// Parsed structure of an override key. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct ParsedOverrideKey { + /// Optional parent package (left side of `>`). `None` for bare-target keys. + pub parent_package: Option, + /// Optional version selector on the parent (e.g. `react@1>zoo` has + /// `parent_version_selector = Some("1")`). + pub parent_version_selector: Option, + /// The target package name (the entry pnpm rewrites). + pub target_package: String, + /// Optional version selector on the target (e.g. `@types/react@<18` has + /// `target_version_selector = Some("<18")`). + pub target_version_selector: Option, +} + +/// Parse the `overrides:` section of `pnpm-workspace.yaml`. Returns an empty +/// `PnpmOverrideData` when the file has no overrides, when the YAML is +/// malformed, or when the section is present but empty. +#[must_use] +pub fn parse_pnpm_workspace_overrides(source: &str) -> PnpmOverrideData { + let value: serde_yaml_ng::Value = match serde_yaml_ng::from_str(source) { + Ok(v) => v, + Err(_) => return PnpmOverrideData::default(), + }; + let Some(mapping) = value.as_mapping() else { + return PnpmOverrideData::default(); + }; + let Some(overrides_value) = mapping.get("overrides") else { + return PnpmOverrideData::default(); + }; + let Some(overrides_map) = overrides_value.as_mapping() else { + return PnpmOverrideData::default(); + }; + + let line_index = build_yaml_line_index(source); + let entries = overrides_map + .iter() + .filter_map(|(k, v)| { + let raw_key = k.as_str()?.to_string(); + let raw_value = match v { + serde_yaml_ng::Value::String(s) => Some(s.clone()), + serde_yaml_ng::Value::Null => None, + other => Some(yaml_value_to_string(other)), + }; + let line = line_index.line_for(&raw_key)?; + let parsed_key = parse_override_key(&raw_key); + Some(PnpmOverrideEntry { + raw_key, + parsed_key, + raw_value, + line, + }) + }) + .collect(); + + PnpmOverrideData { entries } +} + +/// Parse the `pnpm.overrides` section of a root `package.json`. Returns an +/// empty `PnpmOverrideData` when the file has no overrides, when the JSON is +/// malformed, or when the section is present but empty. +#[must_use] +pub fn parse_pnpm_package_json_overrides(source: &str) -> PnpmOverrideData { + let value: serde_json::Value = match serde_json::from_str(source) { + Ok(v) => v, + Err(_) => return PnpmOverrideData::default(), + }; + let Some(overrides) = value.get("pnpm").and_then(|p| p.get("overrides")) else { + return PnpmOverrideData::default(); + }; + let Some(overrides_obj) = overrides.as_object() else { + return PnpmOverrideData::default(); + }; + + let line_index = build_package_json_line_index(source); + let entries = overrides_obj + .iter() + .filter_map(|(raw_key, v)| { + let raw_value = match v { + serde_json::Value::String(s) => Some(s.clone()), + serde_json::Value::Null => None, + other => Some(other.to_string()), + }; + let line = line_index.line_for(raw_key)?; + let parsed_key = parse_override_key(raw_key); + Some(PnpmOverrideEntry { + raw_key: raw_key.clone(), + parsed_key, + raw_value, + line, + }) + }) + .collect(); + + PnpmOverrideData { entries } +} + +/// Parse an override key into `parent`, `target`, and optional version +/// selectors. Returns `None` when the key cannot be split into a recognised +/// shape (empty key, parent or target missing). +#[must_use] +pub fn parse_override_key(key: &str) -> Option { + let trimmed = key.trim(); + if trimmed.is_empty() { + return None; + } + + // Split on the last `>`. pnpm parses single-depth parent matchers; multi-hop + // `a>b>c` is not officially documented but the resolver treats the rightmost + // segment as the target and everything left as the parent chain. We split + // on the LAST `>` so the parent side keeps any earlier `>` for future + // multi-hop support. + let (parent_part, target_part) = if let Some(idx) = trimmed.rfind('>') { + (Some(trimmed[..idx].trim()), trimmed[idx + 1..].trim()) + } else { + (None, trimmed) + }; + + let (target_package, target_version_selector) = split_pkg_and_selector(target_part)?; + + let (parent_package, parent_version_selector) = match parent_part { + Some(parent) if !parent.is_empty() => { + let (pkg, selector) = split_pkg_and_selector(parent)?; + (Some(pkg), selector) + } + // `>target` (leading separator with empty parent) is malformed: the + // user clearly intended a parent chain but left the parent slot blank. + Some(_) => return None, + None => (None, None), + }; + + Some(ParsedOverrideKey { + parent_package, + parent_version_selector, + target_package, + target_version_selector, + }) +} + +/// Split a `pkg@selector` segment into `(package_name, Option)`. +/// Handles scoped packages (`@scope/name@<2`) by skipping the leading `@`. +/// Returns `None` when the package name is empty. +fn split_pkg_and_selector(segment: &str) -> Option<(String, Option)> { + let trimmed = segment.trim(); + if trimmed.is_empty() { + return None; + } + + let bytes = trimmed.as_bytes(); + let scoped = bytes.first().copied() == Some(b'@'); + let start = usize::from(scoped); + let at_pos = trimmed[start..].find('@').map(|i| i + start); + + let (pkg, selector) = match at_pos { + Some(pos) => ( + trimmed[..pos].to_string(), + Some(trimmed[pos + 1..].to_string()), + ), + None => (trimmed.to_string(), None), + }; + + if pkg.is_empty() { + return None; + } + Some((pkg, selector)) +} + +/// Check whether `value` is a valid pnpm override right-hand side, even if it +/// is not a semver range. Returns `false` when the value is empty, contains a +/// raw newline, or is otherwise garbage. +#[must_use] +pub fn is_valid_override_value(value: &str) -> bool { + let trimmed = value.trim(); + if trimmed.is_empty() { + return false; + } + if trimmed.contains('\n') { + return false; + } + // pnpm accepts: semver ranges, `-` (removal), `$ref` (self-ref), + // `npm:alias@^1` (alias), `workspace:*`. We do not validate semver ranges + // here, only screen for obviously broken inputs. + true +} + +/// Convenience: is this entry effectively a misconfiguration the user should +/// see as an error? +#[must_use] +pub fn override_misconfig_reason(entry: &PnpmOverrideEntry) -> Option { + if entry.parsed_key.is_none() { + return Some(MisconfigReason::UnparsableKey); + } + match &entry.raw_value { + None => Some(MisconfigReason::EmptyValue), + Some(v) if !is_valid_override_value(v) => Some(MisconfigReason::EmptyValue), + _ => None, + } +} + +/// Why an override entry is misconfigured. +#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "kebab-case")] +pub enum MisconfigReason { + /// The override key cannot be parsed into a recognised pnpm shape. + UnparsableKey, + /// The override value is missing or empty. + EmptyValue, +} + +impl MisconfigReason { + /// Human-readable description. + #[must_use] + pub const fn describe(self) -> &'static str { + match self { + Self::UnparsableKey => "override key cannot be parsed", + Self::EmptyValue => "override value is missing or empty", + } + } +} + +struct YamlLineIndex { + entries: Vec<(String, u32)>, +} + +impl YamlLineIndex { + fn line_for(&self, key: &str) -> Option { + self.entries + .iter() + .find(|(k, _)| k == key) + .map(|(_, line)| *line) + } +} + +/// Walk the raw YAML source to map each `overrides:` entry key to its 1-based +/// line number. Mirrors the catalog parser's section-aware scanner. +fn build_yaml_line_index(source: &str) -> YamlLineIndex { + let mut entries = Vec::new(); + let mut in_overrides = false; + + for (idx, raw_line) in source.lines().enumerate() { + let line_no = u32::try_from(idx).unwrap_or(u32::MAX).saturating_add(1); + let trimmed = strip_inline_comment(raw_line); + let trimmed_left = trimmed.trim_start(); + let indent = trimmed.len() - trimmed_left.len(); + + if trimmed_left.is_empty() { + continue; + } + + if indent == 0 { + in_overrides = trimmed_left.starts_with("overrides:"); + continue; + } + + if in_overrides && let Some(key) = parse_key(trimmed_left) { + entries.push((key, line_no)); + } + } + + YamlLineIndex { entries } +} + +/// Walk a raw `package.json` source string to map each `pnpm.overrides` entry +/// key to its 1-based line number. The scan tracks brace depth so nested +/// objects under unrelated keys (e.g., `dependenciesMeta`) cannot be misread +/// as override entries. +fn build_package_json_line_index(source: &str) -> YamlLineIndex { + let mut entries = Vec::new(); + let mut depth: i32 = 0; + let mut pnpm_depth: Option = None; + let mut in_overrides_depth: Option = None; + let mut in_string = false; + let mut escape = false; + let mut current_line = 1u32; + let mut last_key: Option = None; + let mut key_buf = String::new(); + let mut collecting_key = false; + + for ch in source.chars() { + if ch == '\n' { + current_line += 1; + } + + if in_string { + if escape { + if collecting_key { + key_buf.push(ch); + } + escape = false; + continue; + } + if ch == '\\' { + escape = true; + if collecting_key { + key_buf.push(ch); + } + continue; + } + if ch == '"' { + in_string = false; + if collecting_key { + last_key = Some(std::mem::take(&mut key_buf)); + collecting_key = false; + } + continue; + } + if collecting_key { + key_buf.push(ch); + } + continue; + } + + match ch { + '"' => { + in_string = true; + // Start collecting a new key candidate. We commit it only when + // followed by `:` at the appropriate depth. + collecting_key = true; + key_buf.clear(); + } + '{' => depth += 1, + '}' => { + if Some(depth) == in_overrides_depth { + in_overrides_depth = None; + } + if Some(depth) == pnpm_depth { + pnpm_depth = None; + } + depth -= 1; + } + ':' => { + if let Some(key) = last_key.take() { + // Promote into a section if the key opens an object + // immediately. We track section transitions by matching + // the key name + current depth. + if pnpm_depth.is_none() && depth == 1 && key == "pnpm" { + pnpm_depth = Some(depth); + } else if in_overrides_depth.is_none() + && pnpm_depth.is_some() + && depth == pnpm_depth.unwrap_or(0) + 1 + && key == "overrides" + { + in_overrides_depth = Some(depth); + } else if let Some(d) = in_overrides_depth + && depth == d + 1 + { + // This is an override entry key at the right depth. + entries.push((key, current_line)); + } + } + } + ',' => { + last_key = None; + } + _ => {} + } + } + + YamlLineIndex { entries } +} + +fn yaml_value_to_string(value: &serde_yaml_ng::Value) -> String { + match value { + serde_yaml_ng::Value::String(s) => s.clone(), + serde_yaml_ng::Value::Number(n) => n.to_string(), + serde_yaml_ng::Value::Bool(b) => b.to_string(), + serde_yaml_ng::Value::Null => String::new(), + _ => serde_yaml_ng::to_string(value).unwrap_or_default(), + } +} + +/// Source-name string for diagnostics. +#[must_use] +pub fn override_source_label(source: OverrideSource, path: &Path) -> String { + match source { + OverrideSource::PnpmWorkspaceYaml => "pnpm-workspace.yaml".to_string(), + OverrideSource::PnpmPackageJson => path.display().to_string(), + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn parse_bare_target() { + let parsed = parse_override_key("axios").unwrap(); + assert_eq!(parsed.target_package, "axios"); + assert!(parsed.parent_package.is_none()); + assert!(parsed.target_version_selector.is_none()); + } + + #[test] + fn parse_scoped_target() { + let parsed = parse_override_key("@types/react").unwrap(); + assert_eq!(parsed.target_package, "@types/react"); + assert!(parsed.target_version_selector.is_none()); + } + + #[test] + fn parse_target_with_version_selector() { + let parsed = parse_override_key("@types/react@<18").unwrap(); + assert_eq!(parsed.target_package, "@types/react"); + assert_eq!(parsed.target_version_selector.as_deref(), Some("<18")); + } + + #[test] + fn parse_parent_chain() { + let parsed = parse_override_key("react>react-dom").unwrap(); + assert_eq!(parsed.parent_package.as_deref(), Some("react")); + assert_eq!(parsed.target_package, "react-dom"); + } + + #[test] + fn parse_parent_chain_with_selectors() { + let parsed = parse_override_key("react@1>zoo").unwrap(); + assert_eq!(parsed.parent_package.as_deref(), Some("react")); + assert_eq!(parsed.parent_version_selector.as_deref(), Some("1")); + assert_eq!(parsed.target_package, "zoo"); + } + + #[test] + fn parse_scoped_parent_and_target() { + let parsed = parse_override_key("@react-spring/web>@react-spring/core").unwrap(); + assert_eq!(parsed.parent_package.as_deref(), Some("@react-spring/web")); + assert_eq!(parsed.target_package, "@react-spring/core"); + } + + #[test] + fn parse_empty_returns_none() { + assert!(parse_override_key("").is_none()); + assert!(parse_override_key(" ").is_none()); + } + + #[test] + fn parse_dangling_separator_returns_none() { + assert!(parse_override_key("react>").is_none()); + assert!(parse_override_key(">react-dom").is_none()); + } + + #[test] + fn is_valid_override_value_accepts_pnpm_idioms() { + assert!(is_valid_override_value("^1.6.0")); + assert!(is_valid_override_value("-")); + assert!(is_valid_override_value("$foo")); + assert!(is_valid_override_value("npm:@scope/alias@^1.0.0")); + assert!(is_valid_override_value("workspace:*")); + } + + #[test] + fn is_valid_override_value_rejects_empty_and_newline() { + assert!(!is_valid_override_value("")); + assert!(!is_valid_override_value(" ")); + assert!(!is_valid_override_value("^1\n^2")); + } + + #[test] + fn parses_workspace_yaml_overrides() { + let yaml = "packages:\n - 'packages/*'\n\noverrides:\n axios: ^1.6.0\n \"@types/react@<18\": '18.0.0'\n \"react>react-dom\": ^17\n"; + let data = parse_pnpm_workspace_overrides(yaml); + assert_eq!(data.entries.len(), 3); + assert_eq!(data.entries[0].raw_key, "axios"); + assert_eq!(data.entries[0].line, 5); + assert_eq!(data.entries[0].raw_value.as_deref(), Some("^1.6.0")); + + assert_eq!(data.entries[1].raw_key, "@types/react@<18"); + assert_eq!(data.entries[1].line, 6); + assert_eq!(data.entries[1].raw_value.as_deref(), Some("18.0.0")); + assert_eq!( + data.entries[1] + .parsed_key + .as_ref() + .and_then(|p| p.target_version_selector.as_deref()), + Some("<18") + ); + + assert_eq!(data.entries[2].raw_key, "react>react-dom"); + assert_eq!(data.entries[2].line, 7); + assert_eq!( + data.entries[2] + .parsed_key + .as_ref() + .map(|p| p.target_package.as_str()), + Some("react-dom") + ); + } + + #[test] + fn parses_package_json_overrides() { + let json = r#"{ + "name": "root", + "pnpm": { + "overrides": { + "axios": "^1.6.0", + "react>react-dom": "^17" + } + }, + "dependenciesMeta": { + "shouldNotMatch": { "injected": true } + } +}"#; + let data = parse_pnpm_package_json_overrides(json); + assert_eq!(data.entries.len(), 2); + assert_eq!(data.entries[0].raw_key, "axios"); + assert_eq!(data.entries[0].raw_value.as_deref(), Some("^1.6.0")); + assert_eq!(data.entries[0].line, 5); + assert_eq!(data.entries[1].raw_key, "react>react-dom"); + assert_eq!(data.entries[1].line, 6); + } + + #[test] + fn empty_workspace_overrides_returns_no_entries() { + let data = parse_pnpm_workspace_overrides("overrides: {}\n"); + assert!(data.entries.is_empty()); + } + + #[test] + fn malformed_yaml_returns_no_entries() { + let data = parse_pnpm_workspace_overrides("{this is\nnot: valid: yaml"); + assert!(data.entries.is_empty()); + } + + #[test] + fn package_json_without_pnpm_overrides_returns_no_entries() { + let data = parse_pnpm_package_json_overrides(r#"{"dependencies": {"axios": "^1"}}"#); + assert!(data.entries.is_empty()); + } + + #[test] + fn malformed_json_returns_no_entries() { + let data = parse_pnpm_package_json_overrides("{not valid json"); + assert!(data.entries.is_empty()); + } + + #[test] + fn unparsable_key_carries_misconfig_signal() { + let yaml = "overrides:\n \">@bad-key>\": ^1.0.0\n"; + let data = parse_pnpm_workspace_overrides(yaml); + assert_eq!(data.entries.len(), 1); + assert!(data.entries[0].parsed_key.is_none()); + assert_eq!( + override_misconfig_reason(&data.entries[0]), + Some(MisconfigReason::UnparsableKey) + ); + } +} diff --git a/crates/core/benches/helpers.rs b/crates/core/benches/helpers.rs index 67468ddab..0061eaf18 100644 --- a/crates/core/benches/helpers.rs +++ b/crates/core/benches/helpers.rs @@ -20,6 +20,7 @@ pub fn make_config(root: PathBuf, no_cache: bool) -> fallow_config::ResolvedConf ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: fallow_config::DuplicatesConfig::default(), diff --git a/crates/core/src/analyze/mod.rs b/crates/core/src/analyze/mod.rs index 36c61b1d0..a448d20bd 100644 --- a/crates/core/src/analyze/mod.rs +++ b/crates/core/src/analyze/mod.rs @@ -7,6 +7,7 @@ mod unused_deps; mod unused_exports; mod unused_files; mod unused_members; +mod unused_overrides; use rustc_hash::FxHashMap; @@ -32,6 +33,10 @@ use unused_exports::{ }; use unused_files::find_unused_files; use unused_members::find_unused_members; +use unused_overrides::{ + find_misconfigured_dependency_overrides, find_unused_dependency_overrides, + gather_pnpm_override_state, +}; /// Pre-computed line offset tables indexed by `FileId`, built during parse and /// carried through the cache. Eliminates redundant file reads during analysis. @@ -548,6 +553,26 @@ pub fn find_dead_code_full( } } + // Detect pnpm dependency-override issues (off pnpm-workspace.yaml + + // root package.json's pnpm.overrides). Mirrors the catalog detector: one + // parse + workspace walk feeds both unused-dependency-overrides and + // misconfigured-dependency-overrides; each detector gated on its own + // rule severity. + let need_unused_overrides = config.rules.unused_dependency_overrides != Severity::Off; + let need_misconfigured_overrides = + config.rules.misconfigured_dependency_overrides != Severity::Off; + if (need_unused_overrides || need_misconfigured_overrides) + && let Some(state) = gather_pnpm_override_state(config, workspaces) + { + if need_unused_overrides { + results.unused_dependency_overrides = find_unused_dependency_overrides(&state, config); + } + if need_misconfigured_overrides { + results.misconfigured_dependency_overrides = + find_misconfigured_dependency_overrides(&state, config); + } + } + // Sort all result arrays for deterministic output ordering. // Parallel collection and FxHashMap iteration don't guarantee order, // so without sorting the same project can produce different orderings. @@ -744,6 +769,8 @@ mod tests { stale_suppressions: Severity::Off, unused_catalog_entries: Severity::Off, unresolved_catalog_references: Severity::Off, + unused_dependency_overrides: Severity::Off, + misconfigured_dependency_overrides: Severity::Off, }; let config = make_config_with_rules(rules); let results = find_dead_code(&graph, &config); diff --git a/crates/core/src/analyze/unused_overrides.rs b/crates/core/src/analyze/unused_overrides.rs new file mode 100644 index 000000000..f185c7362 --- /dev/null +++ b/crates/core/src/analyze/unused_overrides.rs @@ -0,0 +1,309 @@ +//! Detection of unused and misconfigured pnpm dependency-override entries. +//! +//! pnpm supports forcing transitive dependency versions through two +//! equivalent locations: +//! +//! - `overrides:` top-level in `pnpm-workspace.yaml` (pnpm 9+, canonical) +//! - `pnpm.overrides` in the root `package.json` (legacy form, still supported) +//! +//! Two findings are emitted: +//! +//! 1. **`unused-dependency-overrides`**: an override whose target package is +//! not declared in any workspace `package.json` dep section. Conservative +//! static algorithm: the v1 detector does not read `pnpm-lock.yaml`, so +//! overrides targeting purely-transitive packages (a common CVE-fix +//! pattern) can produce false positives. The finding's `hint` field +//! flags the parent-chain shape so consumers can de-prioritize. +//! +//! 2. **`misconfigured-dependency-overrides`**: an override whose key cannot +//! be parsed or whose value is empty. `pnpm install` refuses to honor +//! these entries; fallow surfaces the issue statically. +//! +//! Suppression is config-only via `ignoreDependencyOverrides: [{ package, +//! source? }]`. Inline suppression is structurally impossible because +//! `pnpm-workspace.yaml` uses YAML comments and `package.json` has no +//! comment syntax. +//! +//! Parent-chain semantics: `react>react-dom` is reported as unused only when +//! BOTH `react` AND `react-dom` are absent from every workspace `package.json`. +//! This matches the common CVE-fix pattern where the parent is declared and +//! the override forces a transitive version inside that parent's subtree. + +use std::path::PathBuf; + +use fallow_config::{ + CompiledIgnoreDependencyOverrideRule, PackageJson, PnpmOverrideData, ResolvedConfig, + WorkspaceInfo, override_misconfig_reason as parser_misconfig_reason, + parse_pnpm_package_json_overrides, parse_pnpm_workspace_overrides, +}; +use fallow_types::results::{ + DependencyOverrideMisconfigReason, DependencyOverrideSource, MisconfiguredDependencyOverride, + UnusedDependencyOverride, +}; +use rustc_hash::FxHashSet; + +const PNPM_WORKSPACE_FILE: &str = "pnpm-workspace.yaml"; +const ROOT_PACKAGE_JSON: &str = "package.json"; +const SOURCE_LABEL_YAML: &str = "pnpm-workspace.yaml"; +const SOURCE_LABEL_JSON: &str = "package.json"; +const HINT_PARENT_CHAIN_TRANSITIVE: &str = + "may target a transitive dependency; pnpm install --frozen-lockfile is the ground truth"; + +/// Combined override state across both sources, plus the set of packages +/// declared in any workspace `package.json` dep section. +pub struct PnpmOverrideState { + /// Entries from `pnpm-workspace.yaml`'s `overrides:` map. Empty when the + /// file is missing, has no overrides section, or fails to parse. + workspace_yaml_data: PnpmOverrideData, + /// Entries from `/package.json`'s `pnpm.overrides` map. Empty when + /// the file is missing, has no pnpm.overrides section, or fails to parse. + package_json_data: PnpmOverrideData, + /// Every package name that appears in `dependencies` / `devDependencies` / + /// `peerDependencies` / `optionalDependencies` of any workspace + /// `package.json` (root + members). + declared_packages: FxHashSet, +} + +/// Read both override sources and walk workspace `package.json` files to build +/// shared analysis state. Returns `None` when neither source carries any +/// entries; callers should skip both override detectors in that case. +#[must_use] +pub fn gather_pnpm_override_state( + config: &ResolvedConfig, + workspaces: &[WorkspaceInfo], +) -> Option { + let yaml_path = config.root.join(PNPM_WORKSPACE_FILE); + let workspace_yaml_data = std::fs::read_to_string(&yaml_path) + .ok() + .as_deref() + .map(parse_pnpm_workspace_overrides) + .unwrap_or_default(); + + let root_pkg_path = config.root.join(ROOT_PACKAGE_JSON); + let package_json_data = std::fs::read_to_string(&root_pkg_path) + .ok() + .as_deref() + .map(parse_pnpm_package_json_overrides) + .unwrap_or_default(); + + if workspace_yaml_data.entries.is_empty() && package_json_data.entries.is_empty() { + return None; + } + + let declared_packages = collect_declared_packages(config, workspaces); + + Some(PnpmOverrideState { + workspace_yaml_data, + package_json_data, + declared_packages, + }) +} + +/// Walk every workspace `package.json` (root + members) and collect every +/// package name appearing in any dep section. +fn collect_declared_packages( + config: &ResolvedConfig, + workspaces: &[WorkspaceInfo], +) -> FxHashSet { + let mut paths = Vec::with_capacity(workspaces.len() + 1); + paths.push(config.root.join(ROOT_PACKAGE_JSON)); + for ws in workspaces { + paths.push(ws.root.join(ROOT_PACKAGE_JSON)); + } + + let mut set: FxHashSet = FxHashSet::default(); + for pkg_path in &paths { + let Ok(raw_source) = std::fs::read_to_string(pkg_path) else { + continue; + }; + let Ok(pkg) = serde_json::from_str::(&raw_source) else { + continue; + }; + for deps in [ + pkg.dependencies.as_ref(), + pkg.dev_dependencies.as_ref(), + pkg.peer_dependencies.as_ref(), + pkg.optional_dependencies.as_ref(), + ] + .into_iter() + .flatten() + { + for name in deps.keys() { + set.insert(name.clone()); + } + } + } + + set +} + +/// Emit one `UnusedDependencyOverride` for every parseable override whose +/// target package (and parent, when present) is not declared in any workspace +/// `package.json`. +#[must_use] +pub fn find_unused_dependency_overrides( + state: &PnpmOverrideState, + config: &ResolvedConfig, +) -> Vec { + let mut findings = Vec::new(); + let yaml_path = PathBuf::from(PNPM_WORKSPACE_FILE); + let json_path = PathBuf::from(ROOT_PACKAGE_JSON); + collect_unused_from_source( + &state.workspace_yaml_data, + DependencyOverrideSource::PnpmWorkspaceYaml, + &yaml_path, + &state.declared_packages, + &config.compiled_ignore_dependency_overrides, + &mut findings, + ); + collect_unused_from_source( + &state.package_json_data, + DependencyOverrideSource::PnpmPackageJson, + &json_path, + &state.declared_packages, + &config.compiled_ignore_dependency_overrides, + &mut findings, + ); + findings +} + +fn collect_unused_from_source( + data: &PnpmOverrideData, + source: DependencyOverrideSource, + source_path: &std::path::Path, + declared: &FxHashSet, + ignore_rules: &[CompiledIgnoreDependencyOverrideRule], + findings: &mut Vec, +) { + for entry in &data.entries { + // Skip misconfigured entries; they are reported by the sibling detector. + let Some(parsed) = entry.parsed_key.as_ref() else { + continue; + }; + let Some(value) = entry.raw_value.as_ref() else { + continue; + }; + if !fallow_config::is_valid_override_value(value) { + continue; + } + + // Parent-chain semantics: if EITHER parent OR target is declared, + // consider the override used. This covers the common CVE-fix pattern + // (parent declared, target transitive). + let target_declared = declared.contains(&parsed.target_package); + let parent_declared = parsed + .parent_package + .as_ref() + .is_some_and(|p| declared.contains(p)); + if target_declared || parent_declared { + continue; + } + + let source_label = source_label_for(source); + if ignore_rules + .iter() + .any(|rule| rule.matches(&parsed.target_package, source_label)) + { + continue; + } + + let hint = if parsed.parent_package.is_some() { + Some(HINT_PARENT_CHAIN_TRANSITIVE.to_string()) + } else { + None + }; + + findings.push(UnusedDependencyOverride { + raw_key: entry.raw_key.clone(), + target_package: parsed.target_package.clone(), + parent_package: parsed.parent_package.clone(), + version_constraint: parsed.target_version_selector.clone(), + version_range: value.clone(), + source, + path: source_path.to_path_buf(), + line: entry.line, + hint, + }); + } +} + +/// Emit one `MisconfiguredDependencyOverride` for every entry whose key cannot +/// be parsed or whose value is missing. +#[must_use] +pub fn find_misconfigured_dependency_overrides( + state: &PnpmOverrideState, + config: &ResolvedConfig, +) -> Vec { + let mut findings = Vec::new(); + let yaml_path = PathBuf::from(PNPM_WORKSPACE_FILE); + let json_path = PathBuf::from(ROOT_PACKAGE_JSON); + collect_misconfigured_from_source( + &state.workspace_yaml_data, + DependencyOverrideSource::PnpmWorkspaceYaml, + &yaml_path, + &config.compiled_ignore_dependency_overrides, + &mut findings, + ); + collect_misconfigured_from_source( + &state.package_json_data, + DependencyOverrideSource::PnpmPackageJson, + &json_path, + &config.compiled_ignore_dependency_overrides, + &mut findings, + ); + findings +} + +fn collect_misconfigured_from_source( + data: &PnpmOverrideData, + source: DependencyOverrideSource, + source_path: &std::path::Path, + ignore_rules: &[CompiledIgnoreDependencyOverrideRule], + findings: &mut Vec, +) { + for entry in &data.entries { + let Some(reason) = parser_misconfig_reason(entry) else { + continue; + }; + + let target_for_ignore = entry + .parsed_key + .as_ref() + .map_or(entry.raw_key.as_str(), |p| p.target_package.as_str()); + + let source_label = source_label_for(source); + if ignore_rules + .iter() + .any(|rule| rule.matches(target_for_ignore, source_label)) + { + continue; + } + + findings.push(MisconfiguredDependencyOverride { + raw_key: entry.raw_key.clone(), + raw_value: entry.raw_value.clone().unwrap_or_default(), + reason: map_misconfig_reason(reason), + source, + path: source_path.to_path_buf(), + line: entry.line, + }); + } +} + +const fn map_misconfig_reason( + reason: fallow_config::MisconfigReason, +) -> DependencyOverrideMisconfigReason { + match reason { + fallow_config::MisconfigReason::UnparsableKey => { + DependencyOverrideMisconfigReason::UnparsableKey + } + fallow_config::MisconfigReason::EmptyValue => DependencyOverrideMisconfigReason::EmptyValue, + } +} + +const fn source_label_for(source: DependencyOverrideSource) -> &'static str { + match source { + DependencyOverrideSource::PnpmWorkspaceYaml => SOURCE_LABEL_YAML, + DependencyOverrideSource::PnpmPackageJson => SOURCE_LABEL_JSON, + } +} diff --git a/crates/core/src/discover/entry_points.rs b/crates/core/src/discover/entry_points.rs index eb0221d93..d095563f6 100644 --- a/crates/core/src/discover/entry_points.rs +++ b/crates/core/src/discover/entry_points.rs @@ -1100,6 +1100,7 @@ mod tests { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: fallow_config::DuplicatesConfig::default(), @@ -1227,6 +1228,7 @@ mod tests { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: fallow_config::DuplicatesConfig::default(), diff --git a/crates/core/src/discover/walk.rs b/crates/core/src/discover/walk.rs index c1410bd63..437627b63 100644 --- a/crates/core/src/discover/walk.rs +++ b/crates/core/src/discover/walk.rs @@ -825,6 +825,7 @@ mod tests { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default( ), used_class_members: vec![], diff --git a/crates/core/src/suppress.rs b/crates/core/src/suppress.rs index 93d01fd3c..215d71313 100644 --- a/crates/core/src/suppress.rs +++ b/crates/core/src/suppress.rs @@ -209,6 +209,10 @@ impl<'a> SuppressionContext<'a> { IssueKind::StaleSuppression => "stale-suppression", IssueKind::PnpmCatalogEntry => "unused-catalog-entry", IssueKind::UnresolvedCatalogReference => "unresolved-catalog-reference", + IssueKind::UnusedDependencyOverride => "unused-dependency-override", + IssueKind::MisconfiguredDependencyOverride => { + "misconfigured-dependency-override" + } } .to_string() }); @@ -327,6 +331,8 @@ mod tests { IssueKind::StaleSuppression, IssueKind::PnpmCatalogEntry, IssueKind::UnresolvedCatalogReference, + IssueKind::UnusedDependencyOverride, + IssueKind::MisconfiguredDependencyOverride, ] { assert_eq!( IssueKind::from_discriminant(kind.to_discriminant()), @@ -334,7 +340,7 @@ mod tests { ); } assert_eq!(IssueKind::from_discriminant(0), None); - assert_eq!(IssueKind::from_discriminant(23), None); + assert_eq!(IssueKind::from_discriminant(25), None); } #[test] diff --git a/crates/core/tests/integration_test.rs b/crates/core/tests/integration_test.rs index d955e0df5..d486c7784 100644 --- a/crates/core/tests/integration_test.rs +++ b/crates/core/tests/integration_test.rs @@ -116,6 +116,8 @@ mod issue_317_namespace_barrel_ignore_exports; mod issue_329_pnpm_catalog; #[path = "integration_test/issue_334_unresolved_catalog_ref.rs"] mod issue_334_unresolved_catalog_ref; +#[path = "integration_test/issue_336_unused_overrides.rs"] +mod issue_336_unused_overrides; #[path = "integration_test/script_multiplexers.rs"] mod script_multiplexers; #[path = "integration_test/visibility_tags.rs"] diff --git a/crates/core/tests/integration_test/boundary_violations.rs b/crates/core/tests/integration_test/boundary_violations.rs index 6a6de852d..633954970 100644 --- a/crates/core/tests/integration_test/boundary_violations.rs +++ b/crates/core/tests/integration_test/boundary_violations.rs @@ -19,6 +19,7 @@ fn create_boundary_config( ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: DuplicatesConfig::default(), @@ -158,6 +159,7 @@ fn no_violations_when_rule_is_off() { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: DuplicatesConfig::default(), @@ -209,6 +211,7 @@ fn preset_detects_boundary_violation() { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: DuplicatesConfig::default(), @@ -296,6 +299,7 @@ fn root_field_classifies_per_subtree() { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: DuplicatesConfig::default(), @@ -394,6 +398,7 @@ fn root_field_genuinely_disambiguates_flat_patterns() { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: DuplicatesConfig::default(), @@ -453,6 +458,7 @@ fn root_field_genuinely_disambiguates_flat_patterns() { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: DuplicatesConfig::default(), @@ -505,6 +511,7 @@ fn bulletproof_preset_detects_violation() { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: DuplicatesConfig::default(), diff --git a/crates/core/tests/integration_test/common.rs b/crates/core/tests/integration_test/common.rs index 36aa1d280..a8aa82988 100644 --- a/crates/core/tests/integration_test/common.rs +++ b/crates/core/tests/integration_test/common.rs @@ -24,6 +24,7 @@ pub fn create_config(root: PathBuf) -> fallow_config::ResolvedConfig { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: fallow_config::DuplicatesConfig::default(), @@ -60,6 +61,7 @@ pub fn create_config_with_cache( ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: fallow_config::DuplicatesConfig::default(), diff --git a/crates/core/tests/integration_test/dependencies.rs b/crates/core/tests/integration_test/dependencies.rs index 434c30c7a..26a3f03da 100644 --- a/crates/core/tests/integration_test/dependencies.rs +++ b/crates/core/tests/integration_test/dependencies.rs @@ -344,6 +344,7 @@ fn ignore_patterns_applied_to_workspace_package_json_for_unused_deps() { ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: fallow_config::DuplicatesConfig::default(), diff --git a/crates/core/tests/integration_test/external_plugins.rs b/crates/core/tests/integration_test/external_plugins.rs index e73941dfc..f37c1373a 100644 --- a/crates/core/tests/integration_test/external_plugins.rs +++ b/crates/core/tests/integration_test/external_plugins.rs @@ -14,6 +14,7 @@ fn external_plugin_config(root: &std::path::Path) -> fallow_config::ResolvedConf ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: fallow_config::DuplicatesConfig::default(), diff --git a/crates/core/tests/integration_test/issue_317_namespace_barrel_ignore_exports.rs b/crates/core/tests/integration_test/issue_317_namespace_barrel_ignore_exports.rs index d5778dde4..5c73e0377 100644 --- a/crates/core/tests/integration_test/issue_317_namespace_barrel_ignore_exports.rs +++ b/crates/core/tests/integration_test/issue_317_namespace_barrel_ignore_exports.rs @@ -22,6 +22,7 @@ fn make_config( ignore_dependencies: vec![], ignore_exports, ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: fallow_config::DuplicatesConfig::default(), diff --git a/crates/core/tests/integration_test/issue_334_unresolved_catalog_ref.rs b/crates/core/tests/integration_test/issue_334_unresolved_catalog_ref.rs index 0863a702b..fb5f6e5be 100644 --- a/crates/core/tests/integration_test/issue_334_unresolved_catalog_ref.rs +++ b/crates/core/tests/integration_test/issue_334_unresolved_catalog_ref.rs @@ -28,6 +28,7 @@ fn config_for_fixture( ) -> fallow_config::ResolvedConfig { FallowConfig { ignore_catalog_references: ignore, + ignore_dependency_overrides: vec![], ..Default::default() } .resolve(root, OutputFormat::Human, 4, true, true) diff --git a/crates/core/tests/integration_test/issue_336_unused_overrides.rs b/crates/core/tests/integration_test/issue_336_unused_overrides.rs new file mode 100644 index 000000000..baba45c9f --- /dev/null +++ b/crates/core/tests/integration_test/issue_336_unused_overrides.rs @@ -0,0 +1,227 @@ +//! Integration tests for unused / misconfigured pnpm dependency-override +//! detection (issue #336). +//! +//! Fixture under `tests/fixtures/issue-336-unused-overrides/` declares +//! overrides in BOTH sources: +//! +//! - `pnpm-workspace.yaml` `overrides:`: `axios` (declared, USED), +//! `@types/react@<18` (declared, USED), `react>react-dom` (parent declared, +//! USED via parent-chain rule), `lodash` (NOT declared, UNUSED). +//! - root `package.json` `pnpm.overrides`: `@scope/legacy-pkg` (NOT declared, +//! UNUSED), `react>react-dom` (parent declared, USED), empty key +//! (MISCONFIGURED: unparsable), `react@<18: ""` (MISCONFIGURED: empty +//! value). +//! +//! Workspace member dep sets: `app` declares `react` + `axios`; +//! `lib` declares `@types/react`. + +use std::path::PathBuf; + +use fallow_config::{ + FallowConfig, IgnoreDependencyOverrideRule, OutputFormat, RulesConfig, Severity, +}; +use fallow_types::results::{DependencyOverrideMisconfigReason, DependencyOverrideSource}; +use rustc_hash::FxHashSet; + +use super::common::fixture_path; + +fn config_for_fixture( + root: PathBuf, + ignore: Vec, +) -> fallow_config::ResolvedConfig { + FallowConfig { + ignore_dependency_overrides: ignore, + ..Default::default() + } + .resolve(root, OutputFormat::Human, 4, true, true) +} + +#[test] +fn detects_unused_overrides_across_both_sources() { + let root = fixture_path("issue-336-unused-overrides"); + let config = config_for_fixture(root, vec![]); + let results = fallow_core::analyze(&config).expect("analysis should succeed"); + + let actual: FxHashSet<(&str, DependencyOverrideSource)> = results + .unused_dependency_overrides + .iter() + .map(|f| (f.target_package.as_str(), f.source)) + .collect(); + + let mut expected: FxHashSet<(&str, DependencyOverrideSource)> = FxHashSet::default(); + expected.insert(("lodash", DependencyOverrideSource::PnpmWorkspaceYaml)); + expected.insert(( + "@scope/legacy-pkg", + DependencyOverrideSource::PnpmPackageJson, + )); + + assert_eq!( + actual, expected, + "expected only lodash + @scope/legacy-pkg flagged as unused; got {actual:?}" + ); +} + +#[test] +fn parent_chain_with_declared_parent_is_used() { + let root = fixture_path("issue-336-unused-overrides"); + let config = config_for_fixture(root, vec![]); + let results = fallow_core::analyze(&config).expect("analysis should succeed"); + + let any_react_dom = results + .unused_dependency_overrides + .iter() + .any(|f| f.target_package == "react-dom"); + assert!( + !any_react_dom, + "react>react-dom should be USED (parent `react` is declared); flagged: {:?}", + results.unused_dependency_overrides + ); +} + +#[test] +fn target_with_version_selector_is_resolved() { + let root = fixture_path("issue-336-unused-overrides"); + let config = config_for_fixture(root, vec![]); + let results = fallow_core::analyze(&config).expect("analysis should succeed"); + + let any_types_react = results + .unused_dependency_overrides + .iter() + .any(|f| f.target_package == "@types/react"); + assert!( + !any_types_react, + "@types/react@<18 should resolve target=@types/react which IS declared; flagged: {:?}", + results.unused_dependency_overrides + ); +} + +#[test] +fn detects_misconfigured_overrides() { + let root = fixture_path("issue-336-unused-overrides"); + let config = config_for_fixture(root, vec![]); + let results = fallow_core::analyze(&config).expect("analysis should succeed"); + + let actual: FxHashSet<(String, DependencyOverrideMisconfigReason)> = results + .misconfigured_dependency_overrides + .iter() + .map(|f| (f.raw_key.clone(), f.reason)) + .collect(); + + let mut expected: FxHashSet<(String, DependencyOverrideMisconfigReason)> = FxHashSet::default(); + expected.insert(( + String::new(), + DependencyOverrideMisconfigReason::UnparsableKey, + )); + expected.insert(( + "react@<18".to_string(), + DependencyOverrideMisconfigReason::EmptyValue, + )); + + assert_eq!( + actual, expected, + "expected unparsable empty-key + empty-value entries; got {actual:?}" + ); +} + +#[test] +fn ignore_rule_suppresses_unused_override() { + let root = fixture_path("issue-336-unused-overrides"); + let ignore = vec![IgnoreDependencyOverrideRule { + package: "lodash".to_string(), + source: None, + }]; + let config = config_for_fixture(root, ignore); + let results = fallow_core::analyze(&config).expect("analysis should succeed"); + + let any_lodash = results + .unused_dependency_overrides + .iter() + .any(|f| f.target_package == "lodash"); + assert!( + !any_lodash, + "lodash should be suppressed by the ignoreDependencyOverrides rule; flagged: {:?}", + results.unused_dependency_overrides + ); +} + +#[test] +fn ignore_rule_scoped_by_source_only_affects_matching_source() { + let root = fixture_path("issue-336-unused-overrides"); + // Ignore lodash only when declared in package.json (it lives in YAML, so + // the suppression should NOT apply). + let ignore = vec![IgnoreDependencyOverrideRule { + package: "lodash".to_string(), + source: Some("package.json".to_string()), + }]; + let config = config_for_fixture(root, ignore); + let results = fallow_core::analyze(&config).expect("analysis should succeed"); + + let any_lodash = results + .unused_dependency_overrides + .iter() + .any(|f| f.target_package == "lodash"); + assert!( + any_lodash, + "lodash override is in YAML; suppression scoped to package.json must not match; got {:?}", + results.unused_dependency_overrides + ); +} + +#[test] +fn severity_off_short_circuits() { + let root = fixture_path("issue-336-unused-overrides"); + let rules = RulesConfig { + unused_dependency_overrides: Severity::Off, + misconfigured_dependency_overrides: Severity::Off, + ..RulesConfig::default() + }; + let config = FallowConfig { + rules, + ..Default::default() + } + .resolve(root, OutputFormat::Human, 4, true, true); + let results = fallow_core::analyze(&config).expect("analysis should succeed"); + + assert!( + results.unused_dependency_overrides.is_empty(), + "Severity::Off must suppress unused overrides; got {:?}", + results.unused_dependency_overrides + ); + assert!( + results.misconfigured_dependency_overrides.is_empty(), + "Severity::Off must suppress misconfigured overrides; got {:?}", + results.misconfigured_dependency_overrides + ); +} + +#[test] +fn parent_chain_override_carries_transitive_hint() { + // Use a fresh fixture-shaped construction here so the parent-chain finding + // does fire (`react` NOT declared anywhere). We synthesize via a tempdir. + use std::fs; + let tmp = tempfile::tempdir().expect("tempdir"); + let root = tmp.path(); + fs::write( + root.join("package.json"), + r#"{"name": "tmp", "private": true, "version": "0.0.0"}"#, + ) + .expect("write root pkg"); + fs::write( + root.join("pnpm-workspace.yaml"), + "packages:\n - 'packages/*'\n\noverrides:\n \"unrelated-parent>orphaned-target\": \"^1.0.0\"\n", + ) + .expect("write yaml"); + + let config = + FallowConfig::default().resolve(root.to_path_buf(), OutputFormat::Human, 4, true, true); + let results = fallow_core::analyze(&config).expect("analysis should succeed"); + + assert_eq!(results.unused_dependency_overrides.len(), 1); + let finding = &results.unused_dependency_overrides[0]; + assert_eq!(finding.target_package, "orphaned-target"); + assert_eq!(finding.parent_package.as_deref(), Some("unrelated-parent")); + assert!( + finding.hint.is_some(), + "parent-chain override should carry the transitive-CVE hint" + ); +} diff --git a/crates/core/tests/integration_test/production_mode.rs b/crates/core/tests/integration_test/production_mode.rs index f9bee5c3d..85d9ff5e6 100644 --- a/crates/core/tests/integration_test/production_mode.rs +++ b/crates/core/tests/integration_test/production_mode.rs @@ -12,6 +12,7 @@ fn create_production_config(root: std::path::PathBuf) -> fallow_config::Resolved ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: fallow_config::DuplicatesConfig::default(), diff --git a/crates/core/tests/integration_test/rules_config.rs b/crates/core/tests/integration_test/rules_config.rs index 06bdcd6ef..52927379b 100644 --- a/crates/core/tests/integration_test/rules_config.rs +++ b/crates/core/tests/integration_test/rules_config.rs @@ -75,6 +75,7 @@ fn ignore_exports_wildcard() { let root = fixture_path("ignore-exports"); let config = FallowConfig { ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], schema: None, extends: vec![], entry: vec![], @@ -130,6 +131,7 @@ fn ignore_exports_specific() { let root = fixture_path("ignore-exports"); let config = FallowConfig { ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], schema: None, extends: vec![], entry: vec![], @@ -309,6 +311,7 @@ fn ignore_dependencies_config() { let root = fixture_path("basic-project"); let config = FallowConfig { ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], schema: None, extends: vec![], entry: vec![], diff --git a/crates/core/tests/integration_test/type_only_deps.rs b/crates/core/tests/integration_test/type_only_deps.rs index e1a46e808..44bfac8c1 100644 --- a/crates/core/tests/integration_test/type_only_deps.rs +++ b/crates/core/tests/integration_test/type_only_deps.rs @@ -12,6 +12,7 @@ fn create_production_config(root: std::path::PathBuf) -> fallow_config::Resolved ignore_dependencies: vec![], ignore_exports: vec![], ignore_catalog_references: vec![], + ignore_dependency_overrides: vec![], ignore_exports_used_in_file: fallow_config::IgnoreExportsUsedInFileConfig::default(), used_class_members: vec![], duplicates: fallow_config::DuplicatesConfig::default(), diff --git a/crates/types/src/results.rs b/crates/types/src/results.rs index be42b0f9c..c6f7f376e 100644 --- a/crates/types/src/results.rs +++ b/crates/types/src/results.rs @@ -85,6 +85,12 @@ pub struct AnalysisResults { /// Workspace package.json references to pnpm catalogs that don't declare the package. #[serde(default)] pub unresolved_catalog_references: Vec, + /// Entries in pnpm `overrides:` / `pnpm.overrides` that no workspace package depends on. + #[serde(default)] + pub unused_dependency_overrides: Vec, + /// Entries in pnpm `overrides:` / `pnpm.overrides` whose key or value cannot be parsed. + #[serde(default)] + pub misconfigured_dependency_overrides: Vec, /// Number of suppression entries that matched an issue during analysis. /// Human output uses this for the suppression footer; it is skipped in /// machine output to avoid changing the public JSON issue contract. @@ -151,6 +157,8 @@ impl AnalysisResults { + self.stale_suppressions.len() + self.unused_catalog_entries.len() + self.unresolved_catalog_references.len() + + self.unused_dependency_overrides.len() + + self.misconfigured_dependency_overrides.len() } /// Whether any issues were found. @@ -165,6 +173,10 @@ impl AnalysisResults { /// insertion order, so the same project can produce different orderings /// across runs. This method canonicalises every result list by sorting on /// (path, line, col, name) so that JSON/SARIF/human output is stable. + #[expect( + clippy::too_many_lines, + reason = "one short sort_by per result array; splitting would add indirection without clarity" + )] pub fn sort(&mut self) { self.unused_files.sort_by(|a, b| a.path.cmp(&b.path)); @@ -310,6 +322,20 @@ impl AnalysisResults { finding.available_in_catalogs.dedup(); } + self.unused_dependency_overrides.sort_by(|a, b| { + a.path + .cmp(&b.path) + .then(a.line.cmp(&b.line)) + .then(a.raw_key.cmp(&b.raw_key)) + }); + + self.misconfigured_dependency_overrides.sort_by(|a, b| { + a.path + .cmp(&b.path) + .then(a.line.cmp(&b.line)) + .then(a.raw_key.cmp(&b.raw_key)) + }); + self.feature_flags.sort_by(|a, b| { a.path .cmp(&b.path) @@ -592,6 +618,99 @@ pub struct UnresolvedCatalogReference { pub available_in_catalogs: Vec, } +/// Where an override entry was declared. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum DependencyOverrideSource { + /// Top-level `overrides:` key in `pnpm-workspace.yaml`. + PnpmWorkspaceYaml, + /// `pnpm.overrides` in a root `package.json`. + PnpmPackageJson, +} + +/// An entry in pnpm's `overrides:` map (or the legacy `pnpm.overrides` in +/// `package.json`) whose target package is not declared in any workspace +/// `package.json`. Conservative static algorithm: no lockfile read, so this +/// can produce false negatives for overrides targeting purely-transitive +/// packages (e.g. CVE-fix overrides). The `hint` field flags that case. +#[derive(Debug, Clone, Serialize)] +pub struct UnusedDependencyOverride { + /// The full original override key as written in the source (e.g. + /// `"react>react-dom"`, `"@types/react@<18"`). Preserved for round-trip + /// reporting so agents see the unmodified spelling. + pub raw_key: String, + /// The target package the override rewrites (e.g. `"react-dom"` for + /// `"react>react-dom"`, `"@types/react"` for `"@types/react@<18"`). + pub target_package: String, + /// Optional parent package (left side of `>`). `None` for bare-target keys. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent_package: Option, + /// Optional version selector on the target (e.g. `Some("<18")` for + /// `"@types/react@<18"`). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version_constraint: Option, + /// The right-hand side of the entry: the version pnpm should force. + pub version_range: String, + /// Where the override entry was declared. + pub source: DependencyOverrideSource, + /// Path to the source file. `pnpm-workspace.yaml` or a `package.json`, + /// stored as project-root-relative for consistency with `UnusedCatalogEntry`. + #[serde(serialize_with = "serde_path::serialize")] + pub path: PathBuf, + /// 1-based line number of the entry within the source file. + pub line: u32, + /// Soft hint for cases the conservative algorithm cannot disambiguate. + /// Currently emitted only when the parent-chain shape might target a + /// transitive dependency (CVE-fix pattern). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hint: Option, +} + +/// Why a dependency-override entry is misconfigured. `pnpm install` would +/// either fail at install time or silently no-op on these entries; surfacing +/// them statically catches the issue before pnpm does. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[serde(rename_all = "kebab-case")] +pub enum DependencyOverrideMisconfigReason { + /// The override key could not be parsed into a recognised pnpm shape + /// (e.g. dangling `>`, missing target, garbage characters). + UnparsableKey, + /// The override value is missing, empty, or contains line breaks. + EmptyValue, +} + +impl DependencyOverrideMisconfigReason { + /// Human-readable summary of the reason. + #[must_use] + pub const fn describe(self) -> &'static str { + match self { + Self::UnparsableKey => "override key cannot be parsed", + Self::EmptyValue => "override value is missing or empty", + } + } +} + +/// An override entry whose key or value is malformed. Default severity is +/// `error` because pnpm refuses to install (or silently produces a no-op +/// override) when it encounters these shapes. +#[derive(Debug, Clone, Serialize)] +pub struct MisconfiguredDependencyOverride { + /// The full original override key as written in the source. + pub raw_key: String, + /// The right-hand side of the entry, exactly as written. Empty when the + /// value was missing. + pub raw_value: String, + /// Classifier for the misconfiguration. + pub reason: DependencyOverrideMisconfigReason, + /// Where the override entry was declared. + pub source: DependencyOverrideSource, + /// Path to the source file (project-root-relative). + #[serde(serialize_with = "serde_path::serialize")] + pub path: PathBuf, + /// 1-based line number of the entry within the source file. + pub line: u32, +} + /// A production dependency that is only imported by test files. /// Since it is never used in production code, it could be moved to devDependencies. #[derive(Debug, Clone, Serialize)] diff --git a/crates/types/src/suppress.rs b/crates/types/src/suppress.rs index 867af7694..34a9d058e 100644 --- a/crates/types/src/suppress.rs +++ b/crates/types/src/suppress.rs @@ -64,6 +64,12 @@ pub enum IssueKind { /// A workspace package.json reference (`catalog:` / `catalog:`) pointing at /// a catalog that does not declare the consumed package. UnresolvedCatalogReference, + /// An entry in pnpm's `overrides:` / `pnpm.overrides` whose target package + /// is not declared in any workspace `package.json`. + UnusedDependencyOverride, + /// An entry in pnpm's `overrides:` / `pnpm.overrides` whose key or value + /// cannot be parsed into a valid pnpm shape. + MisconfiguredDependencyOverride, } impl IssueKind { @@ -95,6 +101,12 @@ impl IssueKind { "unresolved-catalog-reference" | "unresolved-catalog-references" => { Some(Self::UnresolvedCatalogReference) } + "unused-dependency-override" | "unused-dependency-overrides" => { + Some(Self::UnusedDependencyOverride) + } + "misconfigured-dependency-override" | "misconfigured-dependency-overrides" => { + Some(Self::MisconfiguredDependencyOverride) + } _ => None, } } @@ -125,6 +137,8 @@ impl IssueKind { Self::StaleSuppression => 20, Self::PnpmCatalogEntry => 21, Self::UnresolvedCatalogReference => 22, + Self::UnusedDependencyOverride => 23, + Self::MisconfiguredDependencyOverride => 24, } } @@ -154,6 +168,8 @@ impl IssueKind { 20 => Some(Self::StaleSuppression), 21 => Some(Self::PnpmCatalogEntry), 22 => Some(Self::UnresolvedCatalogReference), + 23 => Some(Self::UnusedDependencyOverride), + 24 => Some(Self::MisconfiguredDependencyOverride), _ => None, } } @@ -292,6 +308,22 @@ mod tests { IssueKind::parse("unresolved-catalog-references"), Some(IssueKind::UnresolvedCatalogReference) ); + assert_eq!( + IssueKind::parse("unused-dependency-override"), + Some(IssueKind::UnusedDependencyOverride) + ); + assert_eq!( + IssueKind::parse("unused-dependency-overrides"), + Some(IssueKind::UnusedDependencyOverride) + ); + assert_eq!( + IssueKind::parse("misconfigured-dependency-override"), + Some(IssueKind::MisconfiguredDependencyOverride) + ); + assert_eq!( + IssueKind::parse("misconfigured-dependency-overrides"), + Some(IssueKind::MisconfiguredDependencyOverride) + ); } #[test] @@ -313,7 +345,7 @@ mod tests { #[test] fn discriminant_out_of_range() { assert_eq!(IssueKind::from_discriminant(0), None); - assert_eq!(IssueKind::from_discriminant(23), None); + assert_eq!(IssueKind::from_discriminant(25), None); assert_eq!(IssueKind::from_discriminant(u8::MAX), None); } @@ -342,6 +374,8 @@ mod tests { IssueKind::StaleSuppression, IssueKind::PnpmCatalogEntry, IssueKind::UnresolvedCatalogReference, + IssueKind::UnusedDependencyOverride, + IssueKind::MisconfiguredDependencyOverride, ] { assert_eq!( IssueKind::from_discriminant(kind.to_discriminant()), @@ -349,7 +383,7 @@ mod tests { ); } assert_eq!(IssueKind::from_discriminant(0), None); - assert_eq!(IssueKind::from_discriminant(23), None); + assert_eq!(IssueKind::from_discriminant(25), None); } // ── Discriminant uniqueness ───────────────────────────────── @@ -379,6 +413,8 @@ mod tests { IssueKind::StaleSuppression, IssueKind::PnpmCatalogEntry, IssueKind::UnresolvedCatalogReference, + IssueKind::UnusedDependencyOverride, + IssueKind::MisconfiguredDependencyOverride, ]; let discriminants: Vec = all_kinds.iter().map(|k| k.to_discriminant()).collect(); let mut sorted = discriminants.clone(); diff --git a/tests/fixtures/issue-336-unused-overrides/package.json b/tests/fixtures/issue-336-unused-overrides/package.json new file mode 100644 index 000000000..0eb08ad2f --- /dev/null +++ b/tests/fixtures/issue-336-unused-overrides/package.json @@ -0,0 +1,13 @@ +{ + "name": "issue-336-unused-overrides", + "private": true, + "version": "0.0.0", + "pnpm": { + "overrides": { + "@scope/legacy-pkg": "^1.0.0", + "react>react-dom": "^17.0.2", + "": "^1.0.0", + "react@<18": "" + } + } +} diff --git a/tests/fixtures/issue-336-unused-overrides/packages/app/package.json b/tests/fixtures/issue-336-unused-overrides/packages/app/package.json new file mode 100644 index 000000000..3467c46a6 --- /dev/null +++ b/tests/fixtures/issue-336-unused-overrides/packages/app/package.json @@ -0,0 +1,9 @@ +{ + "name": "app", + "version": "0.0.0", + "private": true, + "dependencies": { + "react": "^18.0.0", + "axios": "^1.6.0" + } +} diff --git a/tests/fixtures/issue-336-unused-overrides/packages/lib/package.json b/tests/fixtures/issue-336-unused-overrides/packages/lib/package.json new file mode 100644 index 000000000..87ec3733d --- /dev/null +++ b/tests/fixtures/issue-336-unused-overrides/packages/lib/package.json @@ -0,0 +1,8 @@ +{ + "name": "lib", + "version": "0.0.0", + "private": true, + "dependencies": { + "@types/react": "^18.2.0" + } +} diff --git a/tests/fixtures/issue-336-unused-overrides/pnpm-workspace.yaml b/tests/fixtures/issue-336-unused-overrides/pnpm-workspace.yaml new file mode 100644 index 000000000..5c6228023 --- /dev/null +++ b/tests/fixtures/issue-336-unused-overrides/pnpm-workspace.yaml @@ -0,0 +1,8 @@ +packages: + - 'packages/*' + +overrides: + axios: ^1.6.0 + "@types/react@<18": "18.0.0" + "react>react-dom": ^17.0.2 + "lodash": "^4.17.21" From bfea1c0e7a353ead7618fecbe4838867ddec7705 Mon Sep 17 00:00:00 2001 From: Bart Waardenburg Date: Tue, 12 May 2026 21:20:07 +0200 Subject: [PATCH 2/6] fix(overrides): address review concerns from /fallow-review Two CONCERN-class fixes flagged by the pre-ship review of #362. 1. Hint inversion: the unused-override `hint` field was emitted only for parent-chain shapes (`react>react-dom`), the inverse of the panel's intent. The panel's verdict #3 was "bare-target unused override stays at warn, ship a hint field" precisely to cover the bare-target transitive-CVE pattern (`debug: 'npm:obug@^1.0.2'`, react-is canary aliases, etc.). Phase 6 smoke on benchmark fixtures surfaced four real-world examples on vite + next.js, all flagged without the hint. Fix: emit the hint on every unused-override finding (both bare-target and parent-chain). The constant renames from HINT_PARENT_CHAIN_TRANSITIVE to HINT_MAY_BE_TRANSITIVE, the integration test renames from parent_chain_override_carries_transitive_hint to unused_overrides_carry_transitive_hint_on_every_shape and now exercises BOTH shapes in the same tempdir. 2. Cross-surface source naming inconsistency: JSON output emitted `source: "pnpm_workspace_yaml" / "pnpm_package_json"` (snake_case enum names) while `ignoreDependencyOverrides[].source` expected `"pnpm-workspace.yaml" / "package.json"` (filename labels). An agent reading a finding's source and copying it into a suppression rule would silently not match. Fix: serialize DependencyOverrideSource as filename labels via explicit `#[serde(rename = "...")]` per variant. Both surfaces now agree. Refs #336 --- crates/core/src/analyze/unused_overrides.rs | 13 +++++----- .../issue_336_unused_overrides.rs | 25 ++++++++++--------- crates/types/src/results.rs | 7 ++++-- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/crates/core/src/analyze/unused_overrides.rs b/crates/core/src/analyze/unused_overrides.rs index f185c7362..e4b18962d 100644 --- a/crates/core/src/analyze/unused_overrides.rs +++ b/crates/core/src/analyze/unused_overrides.rs @@ -46,7 +46,7 @@ const PNPM_WORKSPACE_FILE: &str = "pnpm-workspace.yaml"; const ROOT_PACKAGE_JSON: &str = "package.json"; const SOURCE_LABEL_YAML: &str = "pnpm-workspace.yaml"; const SOURCE_LABEL_JSON: &str = "package.json"; -const HINT_PARENT_CHAIN_TRANSITIVE: &str = +const HINT_MAY_BE_TRANSITIVE: &str = "may target a transitive dependency; pnpm install --frozen-lockfile is the ground truth"; /// Combined override state across both sources, plus the set of packages @@ -207,11 +207,12 @@ fn collect_unused_from_source( continue; } - let hint = if parsed.parent_package.is_some() { - Some(HINT_PARENT_CHAIN_TRANSITIVE.to_string()) - } else { - None - }; + // Every unused override (bare-target AND parent-chain) is a potential + // transitive-dependency override, the CVE-fix / canary-aliasing pattern + // the conservative static algorithm cannot disambiguate without a + // lockfile. Emit the hint on every finding so agents can de-prioritize + // and human readers know to verify against `pnpm install`. + let hint = Some(HINT_MAY_BE_TRANSITIVE.to_string()); findings.push(UnusedDependencyOverride { raw_key: entry.raw_key.clone(), diff --git a/crates/core/tests/integration_test/issue_336_unused_overrides.rs b/crates/core/tests/integration_test/issue_336_unused_overrides.rs index baba45c9f..6bac8e030 100644 --- a/crates/core/tests/integration_test/issue_336_unused_overrides.rs +++ b/crates/core/tests/integration_test/issue_336_unused_overrides.rs @@ -195,9 +195,10 @@ fn severity_off_short_circuits() { } #[test] -fn parent_chain_override_carries_transitive_hint() { - // Use a fresh fixture-shaped construction here so the parent-chain finding - // does fire (`react` NOT declared anywhere). We synthesize via a tempdir. +fn unused_overrides_carry_transitive_hint_on_every_shape() { + // Both bare-target AND parent-chain unused findings must carry the + // transitive-CVE hint so agents can de-prioritize. Synthesize a tempdir + // with one of each shape and confirm the hint fires on both. use std::fs; let tmp = tempfile::tempdir().expect("tempdir"); let root = tmp.path(); @@ -208,7 +209,7 @@ fn parent_chain_override_carries_transitive_hint() { .expect("write root pkg"); fs::write( root.join("pnpm-workspace.yaml"), - "packages:\n - 'packages/*'\n\noverrides:\n \"unrelated-parent>orphaned-target\": \"^1.0.0\"\n", + "packages:\n - 'packages/*'\n\noverrides:\n bare-orphan: \"^1.0.0\"\n \"unrelated-parent>orphaned-target\": \"^1.0.0\"\n", ) .expect("write yaml"); @@ -216,12 +217,12 @@ fn parent_chain_override_carries_transitive_hint() { FallowConfig::default().resolve(root.to_path_buf(), OutputFormat::Human, 4, true, true); let results = fallow_core::analyze(&config).expect("analysis should succeed"); - assert_eq!(results.unused_dependency_overrides.len(), 1); - let finding = &results.unused_dependency_overrides[0]; - assert_eq!(finding.target_package, "orphaned-target"); - assert_eq!(finding.parent_package.as_deref(), Some("unrelated-parent")); - assert!( - finding.hint.is_some(), - "parent-chain override should carry the transitive-CVE hint" - ); + assert_eq!(results.unused_dependency_overrides.len(), 2); + for finding in &results.unused_dependency_overrides { + assert!( + finding.hint.is_some(), + "every unused override (bare-target or parent-chain) should carry the transitive hint; missing on {:?}", + finding.raw_key + ); + } } diff --git a/crates/types/src/results.rs b/crates/types/src/results.rs index c6f7f376e..91274b1b4 100644 --- a/crates/types/src/results.rs +++ b/crates/types/src/results.rs @@ -618,13 +618,16 @@ pub struct UnresolvedCatalogReference { pub available_in_catalogs: Vec, } -/// Where an override entry was declared. +/// Where an override entry was declared. Serialized as the filename label +/// (`"pnpm-workspace.yaml"` or `"package.json"`) so the value in JSON output +/// matches the value users write in `ignoreDependencyOverrides[].source`. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] pub enum DependencyOverrideSource { /// Top-level `overrides:` key in `pnpm-workspace.yaml`. + #[serde(rename = "pnpm-workspace.yaml")] PnpmWorkspaceYaml, /// `pnpm.overrides` in a root `package.json`. + #[serde(rename = "package.json")] PnpmPackageJson, } From 3f2015f5e06d21c06c3c031c8ef1d8b0469ade1c Mon Sep 17 00:00:00 2001 From: Bart Waardenburg Date: Tue, 12 May 2026 21:40:35 +0200 Subject: [PATCH 3/6] fix(overrides): address codex review BLOCKs + CONCERN Three load-bearing wiring gaps caught by codex's parallel /fallow-review of #362 plus one stale-doc concern. BLOCK 1: misconfigured-dependency-overrides did not fail CI despite the default error severity. has_error_severity_issues and promote_warns_to_errors in crates/cli/src/check/rules.rs both skipped the two new arrays, so a malformed pnpm override produced exit 0 even when the rule's default severity was error. Both functions now check the new arrays alongside unused_catalog_entries. BLOCK 2: scoped analysis + audit did not handle the new path-anchored issue types. crates/core/src/changed_files.rs::filter_results_by_changed_files filtered through unresolved_catalog_references but not the two override arrays, so dead-code --changed-since would still return unrelated override findings. Audit (crates/cli/src/audit.rs) was missing the new arrays in dead_code_keys, retain_introduced_dead_code, and annotate_dead_code_json, so audit --gate new-only would mis-attribute every override finding as 'not introduced' and the introduced flag would never land in the JSON. All five sites now mirror the unresolved_catalog_references pattern. BLOCK 3: JSON machine output was internally inconsistent. The summary block in crates/cli/src/report/json.rs omitted both new arrays, so total_issues counted findings the summary block did not surface; the action_spec_for_kind switch had no entry for either array, so finding JSON had no actions array. Added summary keys + two new ActionSpecs (remove-dependency-override fix-type for unused entries, fix-dependency-override for misconfigured entries) plus an AddToConfigIgnoreDependencyOverrides SuppressKind that emits a paste- ready { package, source } pair for ignoreDependencyOverrides. CONCERN 4: stale hint docs in unused_overrides.rs and results.rs still claimed the hint was emitted only on parent-chain shapes. Updated both doc comments to match the post-fix behavior (hint emitted on every unused finding). Snapshot tests regenerated to absorb the two new summary keys. Refs #336 --- crates/cli/src/audit.rs | 65 +++++++++++++++++++ crates/cli/src/check/rules.rs | 10 +++ crates/cli/src/report/json.rs | 47 ++++++++++++++ ...apshot_tests__json_circular_deps_only.snap | 4 +- ...ot_tests__json_duplicate_exports_only.snap | 4 +- .../snapshots/snapshot_tests__json_empty.snap | 4 +- .../snapshot_tests__json_mixed_severity.snap | 4 +- ...ests__json_multiple_exports_same_file.snap | 4 +- .../snapshot_tests__json_output.snap | 4 +- ...napshot_tests__json_re_export_variant.snap | 4 +- .../snapshot_tests__json_type_only_deps.snap | 4 +- ...apshot_tests__json_unlisted_deps_only.snap | 4 +- ...t_tests__json_unresolved_imports_only.snap | 4 +- ...tests__json_unused_class_members_only.snap | 4 +- ...snapshot_tests__json_unused_deps_only.snap | 4 +- ...shot_tests__json_unused_dev_deps_only.snap | 4 +- ..._tests__json_unused_enum_members_only.snap | 4 +- ...pshot_tests__json_unused_exports_only.snap | 4 +- ...napshot_tests__json_unused_files_only.snap | 4 +- ...tests__json_unused_optional_deps_only.snap | 4 +- ...napshot_tests__json_unused_types_only.snap | 4 +- .../snapshot_tests__json_workspace_deps.snap | 4 +- crates/core/src/analyze/unused_overrides.rs | 7 +- crates/core/src/changed_files.rs | 10 +++ crates/types/src/results.rs | 6 +- 25 files changed, 197 insertions(+), 24 deletions(-) diff --git a/crates/cli/src/audit.rs b/crates/cli/src/audit.rs index 90bac3079..9647dd9bf 100644 --- a/crates/cli/src/audit.rs +++ b/crates/cli/src/audit.rs @@ -1422,6 +1422,22 @@ fn dead_code_keys( item.entry_name )); } + for item in &results.unused_dependency_overrides { + keys.insert(format!( + "unused-dependency-override:{}:{}:{}", + relative_key_path(&item.path, root), + item.line, + item.raw_key + )); + } + for item in &results.misconfigured_dependency_overrides { + keys.insert(format!( + "misconfigured-dependency-override:{}:{}:{}", + relative_key_path(&item.path, root), + item.line, + item.raw_key + )); + } keys } @@ -1554,6 +1570,22 @@ fn retain_introduced_dead_code( item.entry_name )) }); + results.unused_dependency_overrides.retain(|item| { + keep(format!( + "unused-dependency-override:{}:{}:{}", + relative_key_path(&item.path, root), + item.line, + item.raw_key + )) + }); + results.misconfigured_dependency_overrides.retain(|item| { + keep(format!( + "misconfigured-dependency-override:{}:{}:{}", + relative_key_path(&item.path, root), + item.line, + item.raw_key + )) + }); } fn issue_was_introduced(key: &str, base: &FxHashSet) -> bool { @@ -1804,6 +1836,39 @@ fn annotate_dead_code_json( ) }), ); + annotate_issue_array( + json, + "unused_dependency_overrides", + results.unused_dependency_overrides.iter().map(|item| { + issue_was_introduced( + &format!( + "unused-dependency-override:{}:{}:{}", + relative_key_path(&item.path, root), + item.line, + item.raw_key + ), + base, + ) + }), + ); + annotate_issue_array( + json, + "misconfigured_dependency_overrides", + results + .misconfigured_dependency_overrides + .iter() + .map(|item| { + issue_was_introduced( + &format!( + "misconfigured-dependency-override:{}:{}:{}", + relative_key_path(&item.path, root), + item.line, + item.raw_key + ), + base, + ) + }), + ); } fn annotate_health_json( diff --git a/crates/cli/src/check/rules.rs b/crates/cli/src/check/rules.rs index a0e015a19..8a654bdf9 100644 --- a/crates/cli/src/check/rules.rs +++ b/crates/cli/src/check/rules.rs @@ -203,6 +203,10 @@ pub fn has_error_severity_issues( || (rules.boundary_violation == Severity::Error && !results.boundary_violations.is_empty()) || (rules.unused_catalog_entries == Severity::Error && !results.unused_catalog_entries.is_empty()) + || (rules.unused_dependency_overrides == Severity::Error + && !results.unused_dependency_overrides.is_empty()) + || (rules.misconfigured_dependency_overrides == Severity::Error + && !results.misconfigured_dependency_overrides.is_empty()) } /// Promote all `Warn` severities to `Error` for a single run. @@ -267,6 +271,12 @@ pub fn promote_warns_to_errors(rules: &mut RulesConfig) { if rules.unresolved_catalog_references == Severity::Warn { rules.unresolved_catalog_references = Severity::Error; } + if rules.unused_dependency_overrides == Severity::Warn { + rules.unused_dependency_overrides = Severity::Error; + } + if rules.misconfigured_dependency_overrides == Severity::Warn { + rules.misconfigured_dependency_overrides = Severity::Error; + } } #[cfg(test)] diff --git a/crates/cli/src/report/json.rs b/crates/cli/src/report/json.rs index 8ea4b712a..a42f0021b 100644 --- a/crates/cli/src/report/json.rs +++ b/crates/cli/src/report/json.rs @@ -276,6 +276,8 @@ pub fn build_json( "stale_suppressions": results.stale_suppressions.len(), "unused_catalog_entries": results.unused_catalog_entries.len(), "unresolved_catalog_references": results.unresolved_catalog_references.len(), + "unused_dependency_overrides": results.unused_dependency_overrides.len(), + "misconfigured_dependency_overrides": results.misconfigured_dependency_overrides.len(), }); map.insert("summary".to_string(), summary); @@ -342,6 +344,9 @@ enum SuppressKind { /// Add to `ignoreCatalogReferences` in fallow config (with optional /// catalog + consumer scope). AddToConfigIgnoreCatalogReferences, + /// Add to `ignoreDependencyOverrides` in fallow config (with optional + /// source scope). + AddToConfigIgnoreDependencyOverrides, } /// Specification for actions to inject per issue type. @@ -523,6 +528,26 @@ fn actions_for_issue_type(key: &str) -> Option { suppress: SuppressKind::AddToConfigIgnoreCatalogReferences, issue_kind: "unresolved-catalog-reference", }), + "unused_dependency_overrides" => Some(ActionSpec { + fix_type: "remove-dependency-override", + auto_fixable: false, + description: "Remove the override entry from pnpm-workspace.yaml or pnpm.overrides", + note: Some( + "Conservative static check; verify against `pnpm install --frozen-lockfile` before removing in case the override targets a transitive dependency (CVE-fix pattern)", + ), + suppress: SuppressKind::AddToConfigIgnoreDependencyOverrides, + issue_kind: "unused-dependency-override", + }), + "misconfigured_dependency_overrides" => Some(ActionSpec { + fix_type: "fix-dependency-override", + auto_fixable: false, + description: "Fix the override key or value: pnpm refuses to honor entries with an unparsable key or empty value", + note: Some( + "Common shapes: bare `pkg`, scoped `@scope/pkg`, version-selector `pkg@<2`, parent-chain `parent>child`. Valid values include semver ranges, `-` (removal), `$ref` (self-ref), and `npm:alias@^1`.", + ), + suppress: SuppressKind::AddToConfigIgnoreDependencyOverrides, + issue_kind: "misconfigured-dependency-override", + }), _ => None, } } @@ -740,6 +765,28 @@ fn build_actions( "value_schema": IGNORE_CATALOG_REFERENCES_VALUE_SCHEMA, })); } + SuppressKind::AddToConfigIgnoreDependencyOverrides => { + let package_name = item + .get("target_package") + .and_then(serde_json::Value::as_str) + .or_else(|| item.get("raw_key").and_then(serde_json::Value::as_str)) + .unwrap_or("package"); + let source = item + .get("source") + .and_then(serde_json::Value::as_str) + .unwrap_or("pnpm-workspace.yaml"); + let value = serde_json::json!({ + "package": package_name, + "source": source, + }); + actions.push(serde_json::json!({ + "type": "add-to-config", + "auto_fixable": false, + "description": "Suppress this override finding via ignoreDependencyOverrides in fallow config (use for CVE-fix overrides that target a purely-transitive package).", + "config_key": "ignoreDependencyOverrides", + "value": value, + })); + } } serde_json::Value::Array(actions) diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_circular_deps_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_circular_deps_only.snap index f214bcc88..9bc1b6909 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_circular_deps_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_circular_deps_only.snap @@ -25,7 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [], diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_duplicate_exports_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_duplicate_exports_only.snap index 4f14290df..1a4802566 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_duplicate_exports_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_duplicate_exports_only.snap @@ -25,7 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [], diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_empty.snap b/crates/cli/tests/snapshots/snapshot_tests__json_empty.snap index a9d522e71..f12d9cb3c 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_empty.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_empty.snap @@ -25,7 +25,9 @@ expression: "json_str.replace(&format!(\"\\\"version\\\": \\\"{}\\\"\", env!(\"C "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [], diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap b/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap index 54984b671..e9b23e6a8 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap @@ -25,7 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 2, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [ { diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_multiple_exports_same_file.snap b/crates/cli/tests/snapshots/snapshot_tests__json_multiple_exports_same_file.snap index 8357cc82d..06c570b39 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_multiple_exports_same_file.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_multiple_exports_same_file.snap @@ -25,7 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [ diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_output.snap b/crates/cli/tests/snapshots/snapshot_tests__json_output.snap index 596ca56bb..ece3793d2 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_output.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_output.snap @@ -25,7 +25,9 @@ expression: "json_str.replace(&format!(\"\\\"version\\\": \\\"{}\\\"\", env!(\"C "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 2, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [ { diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_re_export_variant.snap b/crates/cli/tests/snapshots/snapshot_tests__json_re_export_variant.snap index 7227e1d9c..fe3287490 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_re_export_variant.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_re_export_variant.snap @@ -25,7 +25,9 @@ expression: "json_str.replace(&format!(\"\\\"version\\\": \\\"{}\\\"\", env!(\"C "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [ diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_type_only_deps.snap b/crates/cli/tests/snapshots/snapshot_tests__json_type_only_deps.snap index fb7d5b53e..5f10e14c4 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_type_only_deps.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_type_only_deps.snap @@ -25,7 +25,9 @@ expression: "json_str.replace(&format!(\"\\\"version\\\": \\\"{}\\\"\", env!(\"C "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [], diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unlisted_deps_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unlisted_deps_only.snap index eaa049672..5b08354d8 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unlisted_deps_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unlisted_deps_only.snap @@ -25,7 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [], diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unresolved_imports_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unresolved_imports_only.snap index 8db7220bb..d5f03f73f 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unresolved_imports_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unresolved_imports_only.snap @@ -25,7 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [], diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_class_members_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_class_members_only.snap index 86456fd52..d2f82f8a4 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_class_members_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_class_members_only.snap @@ -25,7 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [], diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_deps_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_deps_only.snap index 1b98318a5..5f0b1301e 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_deps_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_deps_only.snap @@ -25,7 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [], diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_dev_deps_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_dev_deps_only.snap index 88489c361..cf01a0af0 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_dev_deps_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_dev_deps_only.snap @@ -25,7 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [], diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_enum_members_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_enum_members_only.snap index 7c6ae3ee7..9e7a3f910 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_enum_members_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_enum_members_only.snap @@ -25,7 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [], diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_exports_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_exports_only.snap index 7c1ce3bb6..ab742fac2 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_exports_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_exports_only.snap @@ -25,7 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [ diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_files_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_files_only.snap index 7a725b1fc..96f991f81 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_files_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_files_only.snap @@ -25,7 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [ { diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_optional_deps_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_optional_deps_only.snap index a6740ce10..a66d61c73 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_optional_deps_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_optional_deps_only.snap @@ -25,7 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [], diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_unused_types_only.snap b/crates/cli/tests/snapshots/snapshot_tests__json_unused_types_only.snap index 893fe4932..ef107f50a 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_unused_types_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_unused_types_only.snap @@ -25,7 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [], diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_workspace_deps.snap b/crates/cli/tests/snapshots/snapshot_tests__json_workspace_deps.snap index e0076a88b..712e9e0a7 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_workspace_deps.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_workspace_deps.snap @@ -25,7 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 0, - "unresolved_catalog_references": 0 + "unresolved_catalog_references": 0, + "unused_dependency_overrides": 0, + "misconfigured_dependency_overrides": 0 }, "unused_files": [], "unused_exports": [], diff --git a/crates/core/src/analyze/unused_overrides.rs b/crates/core/src/analyze/unused_overrides.rs index e4b18962d..ab99017c8 100644 --- a/crates/core/src/analyze/unused_overrides.rs +++ b/crates/core/src/analyze/unused_overrides.rs @@ -11,9 +11,10 @@ //! 1. **`unused-dependency-overrides`**: an override whose target package is //! not declared in any workspace `package.json` dep section. Conservative //! static algorithm: the v1 detector does not read `pnpm-lock.yaml`, so -//! overrides targeting purely-transitive packages (a common CVE-fix -//! pattern) can produce false positives. The finding's `hint` field -//! flags the parent-chain shape so consumers can de-prioritize. +//! overrides targeting purely-transitive packages (a common CVE-fix / +//! canary-aliasing pattern) can produce false positives. Every unused +//! finding (bare-target AND parent-chain) carries a `hint` flagging the +//! transitive-dependency possibility so consumers can de-prioritize. //! //! 2. **`misconfigured-dependency-overrides`**: an override whose key cannot //! be parsed or whose value is empty. `pnpm install` refuses to honor diff --git a/crates/core/src/changed_files.rs b/crates/core/src/changed_files.rs index 1906f2a76..6d4901902 100644 --- a/crates/core/src/changed_files.rs +++ b/crates/core/src/changed_files.rs @@ -350,6 +350,16 @@ pub fn filter_results_by_changed_files( results .unresolved_catalog_references .retain(|r| changed_files.contains(&r.path)); + + // Unused / misconfigured dependency overrides: anchored at the declaring + // source file (pnpm-workspace.yaml or root package.json). Keep only + // findings whose source file is in the changed set. + results + .unused_dependency_overrides + .retain(|o| changed_files.contains(&o.path)); + results + .misconfigured_dependency_overrides + .retain(|o| changed_files.contains(&o.path)); } /// Recompute duplication statistics after filtering. diff --git a/crates/types/src/results.rs b/crates/types/src/results.rs index 91274b1b4..9206c648d 100644 --- a/crates/types/src/results.rs +++ b/crates/types/src/results.rs @@ -663,8 +663,10 @@ pub struct UnusedDependencyOverride { /// 1-based line number of the entry within the source file. pub line: u32, /// Soft hint for cases the conservative algorithm cannot disambiguate. - /// Currently emitted only when the parent-chain shape might target a - /// transitive dependency (CVE-fix pattern). + /// Emitted on every unused-override finding (both bare-target and + /// parent-chain shapes) so consumers know the result may be a false + /// positive against a transitive dependency (CVE-fix / canary-aliasing + /// pattern). #[serde(default, skip_serializing_if = "Option::is_none")] pub hint: Option, } From eca21e2aa830115e3795455c0a31e44e6a467436 Mon Sep 17 00:00:00 2001 From: Bart Waardenburg Date: Tue, 12 May 2026 23:05:02 +0200 Subject: [PATCH 4/6] feat(overrides): wire dependency overrides through CLI, LSP, MCP, VS Code, Action, CI (Phase B) CLI plumbing for the two new detectors: --unused-dependency-overrides / --misconfigured-dependency-overrides flags, IssueFilters / apply_rules / filter-to-workspaces / programmatic / baseline / explain registry with cross-references between the override pair. All six report formats render the findings (human two-tier with raw_key headline + forces-line / reason-line, JSON with discriminated remove-dependency-override / fix-dependency-override primary actions + ignoreDependencyOverrides add-to-config suppress, SARIF rules fallow/unused-dependency-override / fallow/misconfigured-dependency-override, compact, markdown, codeclimate). LSP emits WARNING for unused-dependency-override and ERROR for misconfigured-dependency-override, anchored at the source file (root-relative path joined with the analyzer root, mirroring the unused-catalog-entry fix). DIAGNOSTIC_ISSUE_TYPES + AnalysisCompleteParams + merge_results + dedup_results gain matching entries. Two new LSP regression tests cover the path-anchor behavior + the severity mapping. MCP accepts issue_types: ["unused-dependency-overrides", "misconfigured-dependency-overrides"] and ISSUE_TYPE_FLAGS gains the two CLI flags. NAPI bindings expose both. The analyze tool description is updated to reference both new detectors. VS Code: types, treeView icons + category branch, config default, analysis-utils total count, diagnosticFilter entries, statusBar count + label, commands filter mapping, package.json configuration default + property entries. output-contract.d.ts (vscode + npm) regenerated. dist bundle rebuilt. GitHub Action + GitLab CI: filter-changed.jq total_issues + retain-by-path rule, summary-check.jq table row + section block, summary-combined.jq count row, annotations-check.jq emits ::warning for unused with hint and ::error for misconfigured with reason, summary-audit.jq audit rows. Fixtures + run.sh inline JSON updated; both action (196) and ci (203) test suites green. CLI snapshot tests cover both new types via sample_results additions. schema.json regenerated. docs/output-schema.json gains UnusedDependencyOverride and MisconfiguredDependencyOverride definitions, FixAction enum entries (remove-dependency-override, fix-dependency-override), and broadened AddToConfigAction.value to accept the { package, source } object shape. Refs #336 --- action/jq/annotations-check.jq | 6 +- action/jq/filter-changed.jq | 10 +- action/jq/summary-audit.jq | 4 +- action/jq/summary-check.jq | 10 +- action/jq/summary-combined.jq | 4 +- action/tests/fixtures/check-clean.json | 4 +- action/tests/fixtures/check.json | 23 ++- action/tests/fixtures/combined-clean.json | 4 +- action/tests/fixtures/combined.json | 4 +- action/tests/run.sh | 4 +- ci/jq/summary-audit.jq | 4 +- ci/jq/summary-check.jq | 10 +- ci/jq/summary-combined.jq | 4 +- ci/tests/fixtures/check-clean.json | 4 +- ci/tests/fixtures/check.json | 23 ++- ci/tests/fixtures/combined-clean.json | 4 +- ci/tests/fixtures/combined.json | 4 +- ci/tests/run.sh | 4 +- crates/cli/src/baseline.rs | 44 +++++ crates/cli/src/check/filtering.rs | 5 + crates/cli/src/check/mod.rs | 14 ++ crates/cli/src/check/rules.rs | 6 + crates/cli/src/explain.rs | 36 +++- crates/cli/src/main.rs | 12 ++ crates/cli/src/programmatic.rs | 4 + crates/cli/src/report/codeclimate.rs | 90 ++++++++++ crates/cli/src/report/compact.rs | 22 +++ crates/cli/src/report/human/check.rs | 117 ++++++++++++- crates/cli/src/report/human/mod.rs | 26 ++- crates/cli/src/report/markdown.rs | 36 ++++ crates/cli/src/report/sarif.rs | 84 ++++++++- crates/cli/tests/snapshot_tests.rs | 38 +++++ ...hot_tests__codeclimate_mixed_severity.snap | 48 ++++++ .../snapshot_tests__codeclimate_output.snap | 48 ++++++ .../snapshot_tests__compact_output.snap | 3 + .../snapshot_tests__json_mixed_severity.snap | 110 +++++++++++- .../snapshot_tests__json_output.snap | 110 +++++++++++- .../snapshot_tests__markdown_output.snap | 14 +- .../snapshot_tests__pr_comment_github.snap | 7 +- .../snapshot_tests__pr_comment_gitlab.snap | 7 +- ...napshot_tests__review_github_envelope.snap | 23 ++- ...napshot_tests__review_gitlab_envelope.snap | 32 +++- ...pshot_tests__sarif_circular_deps_only.snap | 28 ++- ...t_tests__sarif_duplicate_exports_only.snap | 28 ++- .../snapshot_tests__sarif_empty.snap | 28 ++- .../snapshot_tests__sarif_mixed_severity.snap | 100 ++++++++++- ...sts__sarif_multiple_exports_same_file.snap | 28 ++- .../snapshot_tests__sarif_output.snap | 100 ++++++++++- ...apshot_tests__sarif_re_export_variant.snap | 28 ++- .../snapshot_tests__sarif_type_only_deps.snap | 28 ++- ...pshot_tests__sarif_unlisted_deps_only.snap | 28 ++- ..._tests__sarif_unresolved_imports_only.snap | 28 ++- ...ests__sarif_unused_class_members_only.snap | 28 ++- ...napshot_tests__sarif_unused_deps_only.snap | 28 ++- ...hot_tests__sarif_unused_dev_deps_only.snap | 28 ++- ...tests__sarif_unused_enum_members_only.snap | 28 ++- ...shot_tests__sarif_unused_exports_only.snap | 28 ++- ...apshot_tests__sarif_unused_files_only.snap | 28 ++- ...ests__sarif_unused_optional_deps_only.snap | 28 ++- ...apshot_tests__sarif_unused_types_only.snap | 28 ++- .../snapshot_tests__sarif_workspace_deps.snap | 28 ++- crates/core/src/results.rs | 12 +- crates/lsp/src/diagnostics/unused.rs | 160 ++++++++++++++++++ crates/lsp/src/main.rs | 28 +++ crates/mcp/src/params.rs | 5 +- crates/mcp/src/server/mod.rs | 2 +- crates/mcp/src/server/tests/params.rs | 2 +- crates/mcp/src/tools/mod.rs | 8 + crates/napi/src/lib.rs | 6 + crates/types/src/results.rs | 18 ++ docs/output-schema.json | 115 ++++++++++++- editors/vscode/dist/extension.js | 6 +- editors/vscode/dist/extension.js.map | 2 +- editors/vscode/package.json | 10 +- editors/vscode/src/analysis-utils.ts | 4 +- editors/vscode/src/commands.ts | 8 + editors/vscode/src/config.ts | 2 + editors/vscode/src/diagnosticFilter.ts | 8 + .../vscode/src/generated/output-contract.d.ts | 92 +++++++++- editors/vscode/src/labels.ts | 6 +- editors/vscode/src/settings.ts | 2 + editors/vscode/src/statusBar-utils.ts | 16 ++ editors/vscode/src/treeView.ts | 36 ++++ editors/vscode/src/types.ts | 2 + editors/vscode/test/statusBar-utils.test.ts | 2 + npm/fallow/types/output-contract.d.ts | 92 +++++++++- schema.json | 60 ++++++- 87 files changed, 2352 insertions(+), 94 deletions(-) diff --git a/action/jq/annotations-check.jq b/action/jq/annotations-check.jq index 4dd5f2a10..521767113 100644 --- a/action/jq/annotations-check.jq +++ b/action/jq/annotations-check.jq @@ -55,5 +55,9 @@ def dependency_action(pkg): (.unused_catalog_entries[]? | "::warning file=\(.path | san),line=\(.line),title=Unused catalog entry::Catalog entry '\(.entry_name | san)' (catalog '\(.catalog_name | san)') is not referenced by any workspace package via the catalog: protocol.\(nl)\(nl)\(if ((.hardcoded_consumers // []) | length) > 0 then "Hardcoded consumers: " + (.hardcoded_consumers | map(san) | join(", ")) + ".\(nl)Switch them to catalog: before removing." else "Remove the entry from pnpm-workspace.yaml." end)"), (.unresolved_catalog_references[]? | - "::error file=\(.path | san),line=\(.line),title=Unresolved catalog reference::Package '\(.entry_name | san)' is referenced via `catalog:\(if .catalog_name == "default" then "" else (.catalog_name | san) end)` but \(if .catalog_name == "default" then "the default catalog" else "catalog '" + (.catalog_name | san) + "'" end) does not declare it. `pnpm install` will fail.\(nl)\(nl)\(if ((.available_in_catalogs // []) | length) > 0 then "Available in: " + (.available_in_catalogs | map(san) | join(", ")) + ".\(nl)Switch the reference to a catalog that declares this package, or add it to the named catalog." else "Add this package to the named catalog in pnpm-workspace.yaml, or remove the reference and pin a hardcoded version." end)") + "::error file=\(.path | san),line=\(.line),title=Unresolved catalog reference::Package '\(.entry_name | san)' is referenced via `catalog:\(if .catalog_name == "default" then "" else (.catalog_name | san) end)` but \(if .catalog_name == "default" then "the default catalog" else "catalog '" + (.catalog_name | san) + "'" end) does not declare it. `pnpm install` will fail.\(nl)\(nl)\(if ((.available_in_catalogs // []) | length) > 0 then "Available in: " + (.available_in_catalogs | map(san) | join(", ")) + ".\(nl)Switch the reference to a catalog that declares this package, or add it to the named catalog." else "Add this package to the named catalog in pnpm-workspace.yaml, or remove the reference and pin a hardcoded version." end)"), + (.unused_dependency_overrides[]? | + "::warning file=\(.path | san),line=\(.line),title=Unused dependency override::Override `\(.raw_key | san)` forces `\(.target_package | san)` to `\(.version_range | san)` but no workspace package depends on `\(.target_package | san)`.\(nl)\(nl)\(if .hint then (.hint | san) + ".\(nl)" else "" end)Delete the entry, or scope it under a real parent (`pkg>\(.target_package | san)`) if it pins a transitive."), + (.misconfigured_dependency_overrides[]? | + "::error file=\(.path | san),line=\(.line),title=Misconfigured dependency override::Override `\(.raw_key | san)` -> `\(.raw_value | san)` is malformed (\(.reason | san)). `pnpm install` will reject this entry.\(nl)\(nl)Fix the key/value to match pnpm's override grammar, or remove the entry.") ] | .[] diff --git a/action/jq/filter-changed.jq b/action/jq/filter-changed.jq index e3f596b50..dd420e299 100644 --- a/action/jq/filter-changed.jq +++ b/action/jq/filter-changed.jq @@ -36,6 +36,12 @@ def filter_check: (if .unresolved_catalog_references then .unresolved_catalog_references |= map(select(.path | in_changed)) else . end) | + (if .unused_dependency_overrides then + .unused_dependency_overrides |= map(select(.path | in_changed)) + else . end) | + (if .misconfigured_dependency_overrides then + .misconfigured_dependency_overrides |= map(select(.path | in_changed)) + else . end) | # Recalculate total_issues from filtered arrays (if .total_issues != null then .total_issues = ( @@ -56,7 +62,9 @@ def filter_check: (.type_only_dependencies // [] | length) + (.stale_suppressions // [] | length) + (.unused_catalog_entries // [] | length) + - (.unresolved_catalog_references // [] | length) + (.unresolved_catalog_references // [] | length) + + (.unused_dependency_overrides // [] | length) + + (.misconfigured_dependency_overrides // [] | length) ) else . end); diff --git a/action/jq/summary-audit.jq b/action/jq/summary-audit.jq index 2fd6b6906..af5793603 100644 --- a/action/jq/summary-audit.jq +++ b/action/jq/summary-audit.jq @@ -30,7 +30,9 @@ def dead_code_rows: [ (.dead_code.test_only_dependencies // [])[] | {kind:"Test-only dependency", location:path_line, item:("`\(.package_name)`"), introduced:.introduced} ] + [ (.dead_code.stale_suppressions // [])[] | {kind:"Stale suppression", location:path_line, item:(.description // "suppression"), introduced:.introduced} ] + [ (.dead_code.unused_catalog_entries // [])[] | {kind:"Unused catalog entry", location:path_line, item:("`\(.entry_name)` (`\(.catalog_name)`)"), introduced:.introduced} ] + - [ (.dead_code.unresolved_catalog_references // [])[] | {kind:"Unresolved catalog reference", location:path_line, item:("`\(.entry_name)` -> `\(.catalog_name)`"), introduced:.introduced} ]); + [ (.dead_code.unresolved_catalog_references // [])[] | {kind:"Unresolved catalog reference", location:path_line, item:("`\(.entry_name)` -> `\(.catalog_name)`"), introduced:.introduced} ] + + [ (.dead_code.unused_dependency_overrides // [])[] | {kind:"Unused dependency override", location:path_line, item:("`\(.raw_key)` (`\(.source)`)"), introduced:.introduced} ] + + [ (.dead_code.misconfigured_dependency_overrides // [])[] | {kind:"Misconfigured dependency override", location:path_line, item:("`\(.raw_key)` (`\(.source)`)"), introduced:.introduced} ]); def duplication_rows: [(.duplication.clone_groups // [])[] | (.instances // []) as $instances | diff --git a/action/jq/summary-check.jq b/action/jq/summary-check.jq index ab356e8c7..ff0b7e408 100644 --- a/action/jq/summary-check.jq +++ b/action/jq/summary-check.jq @@ -47,7 +47,9 @@ else table_row("Test-only dependencies"; "test_only_dependencies"; "test-only-dependencies"), table_row("Stale suppressions"; "stale_suppressions"; "stale-suppressions"), table_row("Unused catalog entries"; "unused_catalog_entries"; "unused-catalog-entries"), - table_row("Unresolved catalog references"; "unresolved_catalog_references"; "unresolved-catalog-references") + table_row("Unresolved catalog references"; "unresolved_catalog_references"; "unresolved-catalog-references"), + table_row("Unused dependency overrides"; "unused_dependency_overrides"; "unused-dependency-overrides"), + table_row("Misconfigured dependency overrides"; "misconfigured_dependency_overrides"; "misconfigured-dependency-overrides") ] | join("\n")) + "\n\n---\n" + section("Unused files"; "unused_files"; @@ -107,6 +109,12 @@ else section("Unresolved catalog references"; "unresolved_catalog_references"; "Workspace `package.json` references to catalogs that do not declare the package. `pnpm install` will fail until each entry is added to its named catalog or the reference is switched.\n\n| Entry | Catalog | Location | Available in |\n|-------|---------|----------|--------------|\n"; "| `\(.entry_name)` | `\(.catalog_name)` | `\(.path):\(.line)` | \(if ((.available_in_catalogs // []) | length) > 0 then (.available_in_catalogs | map("`\(.)`") | join(", ")) else "" end) |") + + section("Unused dependency overrides"; "unused_dependency_overrides"; + "`pnpm.overrides` entries forcing a version no workspace package depends on. Some entries may be intentional pins for transitive CVEs; the hint column flags those.\n\n| Override | Forces | Source | Location | Hint |\n|----------|--------|--------|----------|------|\n"; + "| `\(.raw_key)` | `\(.target_package)` -> `\(.version_range)` | `\(.source)` | `\(.path):\(.line)` | \(.hint // "") |") + + section("Misconfigured dependency overrides"; "misconfigured_dependency_overrides"; + "`pnpm.overrides` entries with an unparsable key or empty value. `pnpm install` will reject these.\n\n| Override | Value | Source | Location | Reason |\n|----------|-------|--------|----------|--------|\n"; + "| `\(.raw_key)` | `\(.raw_value)` | `\(.source)` | `\(.path):\(.line)` | \(.reason) |") + "\n\n> [!TIP]\n" + (if ((.unused_exports // []) + (.unused_dependencies // []) + (.unused_enum_members // [])) | length > 0 then "> Run `fallow fix --dry-run` to preview safe auto-fixes.\n" diff --git a/action/jq/summary-combined.jq b/action/jq/summary-combined.jq index 2ca8b3645..05b2a26d8 100644 --- a/action/jq/summary-combined.jq +++ b/action/jq/summary-combined.jq @@ -137,7 +137,9 @@ else (if (.check.test_only_dependencies | length) > 0 then "| [Test-only dependencies](\(docs("test-only-dependencies"))) | \(.check.test_only_dependencies | length) |" else null end), (if (.check.stale_suppressions | length) > 0 then "| [Stale suppressions](\(docs("stale-suppressions"))) | \(.check.stale_suppressions | length) |" else null end), (if ((.check.unused_catalog_entries // []) | length) > 0 then "| [Unused catalog entries](\(docs("unused-catalog-entries"))) | \(.check.unused_catalog_entries | length) |" else null end), - (if ((.check.unresolved_catalog_references // []) | length) > 0 then "| [Unresolved catalog references](\(docs("unresolved-catalog-references"))) | \(.check.unresolved_catalog_references | length) |" else null end) + (if ((.check.unresolved_catalog_references // []) | length) > 0 then "| [Unresolved catalog references](\(docs("unresolved-catalog-references"))) | \(.check.unresolved_catalog_references | length) |" else null end), + (if ((.check.unused_dependency_overrides // []) | length) > 0 then "| [Unused dependency overrides](\(docs("unused-dependency-overrides"))) | \(.check.unused_dependency_overrides | length) |" else null end), + (if ((.check.misconfigured_dependency_overrides // []) | length) > 0 then "| [Misconfigured dependency overrides](\(docs("misconfigured-dependency-overrides"))) | \(.check.misconfigured_dependency_overrides | length) |" else null end) ] | map(select(. != null)) | join("\n")) + "\n\n\n\n" else "" end) + diff --git a/action/tests/fixtures/check-clean.json b/action/tests/fixtures/check-clean.json index 5b56e43f9..8ee68ab7a 100644 --- a/action/tests/fixtures/check-clean.json +++ b/action/tests/fixtures/check-clean.json @@ -20,5 +20,7 @@ "type_only_dependencies": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/action/tests/fixtures/check.json b/action/tests/fixtures/check.json index f8df3d787..a2401d104 100644 --- a/action/tests/fixtures/check.json +++ b/action/tests/fixtures/check.json @@ -2,7 +2,7 @@ "schema_version": 3, "version": "2.2.2", "elapsed_ms": 4, - "total_issues": 11, + "total_issues": 14, "unused_files": [], "unused_exports": [ { @@ -120,5 +120,26 @@ "line": 14, "available_in_catalogs": ["react18"] } + ], + "unused_dependency_overrides": [ + { + "raw_key": "axios", + "target_package": "axios", + "version_range": "^1.6.0", + "source": "pnpm-workspace.yaml", + "path": "pnpm-workspace.yaml", + "line": 9, + "hint": "May be an intentional pin for a transitive CVE that no workspace package depends on directly" + } + ], + "misconfigured_dependency_overrides": [ + { + "raw_key": "@types/react@<<18", + "raw_value": "18.0.0", + "reason": "unparsable-key", + "source": "package.json", + "path": "package.json", + "line": 3 + } ] } diff --git a/action/tests/fixtures/combined-clean.json b/action/tests/fixtures/combined-clean.json index 7d3250955..23837fa4d 100644 --- a/action/tests/fixtures/combined-clean.json +++ b/action/tests/fixtures/combined-clean.json @@ -21,7 +21,9 @@ "type_only_dependencies": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] }, "dupes": { "clone_groups": [], diff --git a/action/tests/fixtures/combined.json b/action/tests/fixtures/combined.json index 53425af44..593c8b8ef 100644 --- a/action/tests/fixtures/combined.json +++ b/action/tests/fixtures/combined.json @@ -107,7 +107,9 @@ "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] }, "dupes": { "clone_groups": [ diff --git a/action/tests/run.sh b/action/tests/run.sh index a3534daa2..6b11b5d1c 100755 --- a/action/tests/run.sh +++ b/action/tests/run.sh @@ -380,7 +380,7 @@ assert_contains "$OUT_ONE" "(1 group ·" "dupes: singular group header" assert_not_contains "$OUT_ONE" "(1 groups ·" "dupes: no '1 groups' grammar" # Status-bar pluralization: 1 of each renders singular -OUT_SINGULAR=$(jq '.check.unused_files = [.check.unused_files[0]] | .check.unused_exports = [] | .check.unused_dependencies = [] | .check.unused_dev_dependencies = [] | .check.unused_optional_dependencies = [] | .check.unused_types = [] | .check.unused_enum_members = [] | .check.unused_class_members = [] | .check.unresolved_imports = [] | .check.unlisted_dependencies = [] | .check.duplicate_exports = [] | .check.circular_dependencies = [] | .check.boundary_violations = [] | .check.type_only_dependencies = [] | .check.test_only_dependencies = [] | .check.stale_suppressions = [] | .check.unused_catalog_entries = [] | .check.unresolved_catalog_references = [] | .check.private_type_leaks = [] | .check.total_issues = 1 | .dupes.stats.clone_groups = 1 | .dupes.clone_groups = [.dupes.clone_groups[0]] | .health.summary.functions_above_threshold = 1 | .health.findings = [.health.findings[0]]' "$FIXTURES/combined.json" | jq -r -f "$JQ_DIR/summary-combined.jq" 2>&1) +OUT_SINGULAR=$(jq '.check.unused_files = [.check.unused_files[0]] | .check.unused_exports = [] | .check.unused_dependencies = [] | .check.unused_dev_dependencies = [] | .check.unused_optional_dependencies = [] | .check.unused_types = [] | .check.unused_enum_members = [] | .check.unused_class_members = [] | .check.unresolved_imports = [] | .check.unlisted_dependencies = [] | .check.duplicate_exports = [] | .check.circular_dependencies = [] | .check.boundary_violations = [] | .check.type_only_dependencies = [] | .check.test_only_dependencies = [] | .check.stale_suppressions = [] | .check.unused_catalog_entries = [] | .check.unresolved_catalog_references = [] | .check.unused_dependency_overrides = [] | .check.misconfigured_dependency_overrides = [] | .check.private_type_leaks = [] | .check.total_issues = 1 | .dupes.stats.clone_groups = 1 | .dupes.clone_groups = [.dupes.clone_groups[0]] | .health.summary.functions_above_threshold = 1 | .health.findings = [.health.findings[0]]' "$FIXTURES/combined.json" | jq -r -f "$JQ_DIR/summary-combined.jq" 2>&1) assert_contains "$OUT_SINGULAR" "**1** code issue " "status-bar: singular code issue" assert_not_contains "$OUT_SINGULAR" "**1** code issues" "status-bar: no '1 code issues' grammar" assert_contains "$OUT_SINGULAR" "**1** clone group " "status-bar: singular clone group" @@ -399,7 +399,7 @@ assert_not_contains "$OUT_SINGULAR" "(1 functions above threshold)" "complexity OUT_LARGE=$(jq -n ' { schema_version: 3, - check: {total_issues: 0, unused_files: [], unused_exports: [], unused_types: [], unused_dependencies: [], unused_dev_dependencies: [], unused_optional_dependencies: [], unused_enum_members: [], unused_class_members: [], unresolved_imports: [], unlisted_dependencies: [], duplicate_exports: [], circular_dependencies: [], boundary_violations: [], type_only_dependencies: [], test_only_dependencies: [], stale_suppressions: [], unused_catalog_entries: [], unresolved_catalog_references: [], private_type_leaks: []}, + check: {total_issues: 0, unused_files: [], unused_exports: [], unused_types: [], unused_dependencies: [], unused_dev_dependencies: [], unused_optional_dependencies: [], unused_enum_members: [], unused_class_members: [], unresolved_imports: [], unlisted_dependencies: [], duplicate_exports: [], circular_dependencies: [], boundary_violations: [], type_only_dependencies: [], test_only_dependencies: [], stale_suppressions: [], unused_catalog_entries: [], unresolved_catalog_references: [], unused_dependency_overrides: [], misconfigured_dependency_overrides: [], private_type_leaks: []}, dupes: { stats: {clone_groups: 50, clone_instances: 200, files_with_clones: 50, duplicated_lines: 5000, total_lines: 100000, duplication_percentage: 5.0}, clone_groups: ([range(0;50)] | map(. as $g | {line_count: ($g + 1), token_count: ($g * 5 + 50), instances: ([range(0;4)] | map(. as $i | {file: ("src/group_\($g)/file_\($i).ts"), start_line: ($i * 10 + 1), end_line: ($i * 10 + 9)}))})) diff --git a/ci/jq/summary-audit.jq b/ci/jq/summary-audit.jq index f8f0e1aee..3d018a244 100644 --- a/ci/jq/summary-audit.jq +++ b/ci/jq/summary-audit.jq @@ -30,7 +30,9 @@ def dead_code_rows: [ (.dead_code.test_only_dependencies // [])[] | {kind:"Test-only dependency", location:path_line, item:("`\(.package_name)`"), introduced:.introduced} ] + [ (.dead_code.stale_suppressions // [])[] | {kind:"Stale suppression", location:path_line, item:(.description // "suppression"), introduced:.introduced} ] + [ (.dead_code.unused_catalog_entries // [])[] | {kind:"Unused catalog entry", location:path_line, item:("`\(.entry_name)` (`\(.catalog_name)`)"), introduced:.introduced} ] + - [ (.dead_code.unresolved_catalog_references // [])[] | {kind:"Unresolved catalog reference", location:path_line, item:("`\(.entry_name)` -> `\(.catalog_name)`"), introduced:.introduced} ]); + [ (.dead_code.unresolved_catalog_references // [])[] | {kind:"Unresolved catalog reference", location:path_line, item:("`\(.entry_name)` -> `\(.catalog_name)`"), introduced:.introduced} ] + + [ (.dead_code.unused_dependency_overrides // [])[] | {kind:"Unused dependency override", location:path_line, item:("`\(.raw_key)` (`\(.source)`)"), introduced:.introduced} ] + + [ (.dead_code.misconfigured_dependency_overrides // [])[] | {kind:"Misconfigured dependency override", location:path_line, item:("`\(.raw_key)` (`\(.source)`)"), introduced:.introduced} ]); def duplication_rows: [(.duplication.clone_groups // [])[] | (.instances // []) as $instances | diff --git a/ci/jq/summary-check.jq b/ci/jq/summary-check.jq index 51920d8d4..de3f4b62a 100644 --- a/ci/jq/summary-check.jq +++ b/ci/jq/summary-check.jq @@ -50,7 +50,9 @@ else table_row("Test-only dependencies"; "test_only_dependencies"; "test-only-dependencies"), table_row("Stale suppressions"; "stale_suppressions"; "stale-suppressions"), table_row("Unused catalog entries"; "unused_catalog_entries"; "unused-catalog-entries"), - table_row("Unresolved catalog references"; "unresolved_catalog_references"; "unresolved-catalog-references") + table_row("Unresolved catalog references"; "unresolved_catalog_references"; "unresolved-catalog-references"), + table_row("Unused dependency overrides"; "unused_dependency_overrides"; "unused-dependency-overrides"), + table_row("Misconfigured dependency overrides"; "misconfigured_dependency_overrides"; "misconfigured-dependency-overrides") ] | join("\n")) + "\n\n---\n" + section("Unused files"; "unused_files"; @@ -110,6 +112,12 @@ else section("Unresolved catalog references"; "unresolved_catalog_references"; "Workspace `package.json` references to catalogs that do not declare the package. `pnpm install` will fail until each entry is added to its named catalog or the reference is switched.\n\n| Entry | Catalog | Location | Available in |\n|-------|---------|----------|--------------|\n"; "| `\(.entry_name)` | `\(.catalog_name)` | `\(.path):\(.line)` | \(if ((.available_in_catalogs // []) | length) > 0 then (.available_in_catalogs | map("`\(.)`") | join(", ")) else "" end) |") + + section("Unused dependency overrides"; "unused_dependency_overrides"; + "`pnpm.overrides` entries forcing a version no workspace package depends on. Some entries may be intentional pins for transitive CVEs; the hint column flags those.\n\n| Override | Forces | Source | Location | Hint |\n|----------|--------|--------|----------|------|\n"; + "| `\(.raw_key)` | `\(.target_package)` -> `\(.version_range)` | `\(.source)` | `\(.path):\(.line)` | \(.hint // "") |") + + section("Misconfigured dependency overrides"; "misconfigured_dependency_overrides"; + "`pnpm.overrides` entries with an unparsable key or empty value. `pnpm install` will reject these.\n\n| Override | Value | Source | Location | Reason |\n|----------|-------|--------|----------|--------|\n"; + "| `\(.raw_key)` | `\(.raw_value)` | `\(.source)` | `\(.path):\(.line)` | \(.reason) |") + "\n\n" + (if ((.unused_exports // []) + (.unused_dependencies // []) + (.unused_enum_members // [])) | length > 0 then "> :bulb: Run `fallow fix --dry-run` to preview safe auto-fixes.\n" diff --git a/ci/jq/summary-combined.jq b/ci/jq/summary-combined.jq index fd258b61b..a3d5dd305 100644 --- a/ci/jq/summary-combined.jq +++ b/ci/jq/summary-combined.jq @@ -140,7 +140,9 @@ else (if (.check.test_only_dependencies | length) > 0 then "| [Test-only dependencies](\(docs("test-only-dependencies"))) | \(.check.test_only_dependencies | length) |" else null end), (if (.check.stale_suppressions | length) > 0 then "| [Stale suppressions](\(docs("stale-suppressions"))) | \(.check.stale_suppressions | length) |" else null end), (if ((.check.unused_catalog_entries // []) | length) > 0 then "| [Unused catalog entries](\(docs("unused-catalog-entries"))) | \(.check.unused_catalog_entries | length) |" else null end), - (if ((.check.unresolved_catalog_references // []) | length) > 0 then "| [Unresolved catalog references](\(docs("unresolved-catalog-references"))) | \(.check.unresolved_catalog_references | length) |" else null end) + (if ((.check.unresolved_catalog_references // []) | length) > 0 then "| [Unresolved catalog references](\(docs("unresolved-catalog-references"))) | \(.check.unresolved_catalog_references | length) |" else null end), + (if ((.check.unused_dependency_overrides // []) | length) > 0 then "| [Unused dependency overrides](\(docs("unused-dependency-overrides"))) | \(.check.unused_dependency_overrides | length) |" else null end), + (if ((.check.misconfigured_dependency_overrides // []) | length) > 0 then "| [Misconfigured dependency overrides](\(docs("misconfigured-dependency-overrides"))) | \(.check.misconfigured_dependency_overrides | length) |" else null end) ] | map(select(. != null)) | join("\n")) + "\n\n\n\n" else "" end) + diff --git a/ci/tests/fixtures/check-clean.json b/ci/tests/fixtures/check-clean.json index 5b56e43f9..8ee68ab7a 100644 --- a/ci/tests/fixtures/check-clean.json +++ b/ci/tests/fixtures/check-clean.json @@ -20,5 +20,7 @@ "type_only_dependencies": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] } diff --git a/ci/tests/fixtures/check.json b/ci/tests/fixtures/check.json index f8df3d787..a2401d104 100644 --- a/ci/tests/fixtures/check.json +++ b/ci/tests/fixtures/check.json @@ -2,7 +2,7 @@ "schema_version": 3, "version": "2.2.2", "elapsed_ms": 4, - "total_issues": 11, + "total_issues": 14, "unused_files": [], "unused_exports": [ { @@ -120,5 +120,26 @@ "line": 14, "available_in_catalogs": ["react18"] } + ], + "unused_dependency_overrides": [ + { + "raw_key": "axios", + "target_package": "axios", + "version_range": "^1.6.0", + "source": "pnpm-workspace.yaml", + "path": "pnpm-workspace.yaml", + "line": 9, + "hint": "May be an intentional pin for a transitive CVE that no workspace package depends on directly" + } + ], + "misconfigured_dependency_overrides": [ + { + "raw_key": "@types/react@<<18", + "raw_value": "18.0.0", + "reason": "unparsable-key", + "source": "package.json", + "path": "package.json", + "line": 3 + } ] } diff --git a/ci/tests/fixtures/combined-clean.json b/ci/tests/fixtures/combined-clean.json index 7d3250955..23837fa4d 100644 --- a/ci/tests/fixtures/combined-clean.json +++ b/ci/tests/fixtures/combined-clean.json @@ -21,7 +21,9 @@ "type_only_dependencies": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] }, "dupes": { "clone_groups": [], diff --git a/ci/tests/fixtures/combined.json b/ci/tests/fixtures/combined.json index 53425af44..593c8b8ef 100644 --- a/ci/tests/fixtures/combined.json +++ b/ci/tests/fixtures/combined.json @@ -107,7 +107,9 @@ "boundary_violations": [], "stale_suppressions": [], "unused_catalog_entries": [], - "unresolved_catalog_references": [] + "unresolved_catalog_references": [], + "unused_dependency_overrides": [], + "misconfigured_dependency_overrides": [] }, "dupes": { "clone_groups": [ diff --git a/ci/tests/run.sh b/ci/tests/run.sh index 55c4a3a63..8d682c65d 100755 --- a/ci/tests/run.sh +++ b/ci/tests/run.sh @@ -448,7 +448,7 @@ assert_contains "$OUT_ONE_GL" "(1 group ·" "dupes: singular group header" assert_not_contains "$OUT_ONE_GL" "(1 groups ·" "dupes: no '1 groups' grammar" # Status-bar pluralization: 1 of each renders singular -OUT_SINGULAR_GL=$(jq '.check.unused_files = [.check.unused_files[0]] | .check.unused_exports = [] | .check.unused_dependencies = [] | .check.unused_dev_dependencies = [] | .check.unused_optional_dependencies = [] | .check.unused_types = [] | .check.unused_enum_members = [] | .check.unused_class_members = [] | .check.unresolved_imports = [] | .check.unlisted_dependencies = [] | .check.duplicate_exports = [] | .check.circular_dependencies = [] | .check.boundary_violations = [] | .check.type_only_dependencies = [] | .check.test_only_dependencies = [] | .check.stale_suppressions = [] | .check.unused_catalog_entries = [] | .check.unresolved_catalog_references = [] | .check.private_type_leaks = [] | .check.total_issues = 1 | .dupes.stats.clone_groups = 1 | .dupes.clone_groups = [.dupes.clone_groups[0]] | .health.summary.functions_above_threshold = 1 | .health.findings = [.health.findings[0]]' "$FIXTURES/combined.json" | jq -r -f "$CI_JQ_DIR/summary-combined.jq" 2>&1) +OUT_SINGULAR_GL=$(jq '.check.unused_files = [.check.unused_files[0]] | .check.unused_exports = [] | .check.unused_dependencies = [] | .check.unused_dev_dependencies = [] | .check.unused_optional_dependencies = [] | .check.unused_types = [] | .check.unused_enum_members = [] | .check.unused_class_members = [] | .check.unresolved_imports = [] | .check.unlisted_dependencies = [] | .check.duplicate_exports = [] | .check.circular_dependencies = [] | .check.boundary_violations = [] | .check.type_only_dependencies = [] | .check.test_only_dependencies = [] | .check.stale_suppressions = [] | .check.unused_catalog_entries = [] | .check.unresolved_catalog_references = [] | .check.unused_dependency_overrides = [] | .check.misconfigured_dependency_overrides = [] | .check.private_type_leaks = [] | .check.total_issues = 1 | .dupes.stats.clone_groups = 1 | .dupes.clone_groups = [.dupes.clone_groups[0]] | .health.summary.functions_above_threshold = 1 | .health.findings = [.health.findings[0]]' "$FIXTURES/combined.json" | jq -r -f "$CI_JQ_DIR/summary-combined.jq" 2>&1) assert_contains "$OUT_SINGULAR_GL" "**1** code issue " "status-bar: singular code issue" assert_not_contains "$OUT_SINGULAR_GL" "**1** code issues" "status-bar: no '1 code issues' grammar" assert_contains "$OUT_SINGULAR_GL" "**1** clone group " "status-bar: singular clone group" @@ -465,7 +465,7 @@ assert_not_contains "$OUT_SINGULAR_GL" "(1 functions above threshold)" "complexi OUT_LARGE_GL=$(jq -n ' { schema_version: 3, - check: {total_issues: 0, unused_files: [], unused_exports: [], unused_types: [], unused_dependencies: [], unused_dev_dependencies: [], unused_optional_dependencies: [], unused_enum_members: [], unused_class_members: [], unresolved_imports: [], unlisted_dependencies: [], duplicate_exports: [], circular_dependencies: [], boundary_violations: [], type_only_dependencies: [], test_only_dependencies: [], stale_suppressions: [], unused_catalog_entries: [], unresolved_catalog_references: [], private_type_leaks: []}, + check: {total_issues: 0, unused_files: [], unused_exports: [], unused_types: [], unused_dependencies: [], unused_dev_dependencies: [], unused_optional_dependencies: [], unused_enum_members: [], unused_class_members: [], unresolved_imports: [], unlisted_dependencies: [], duplicate_exports: [], circular_dependencies: [], boundary_violations: [], type_only_dependencies: [], test_only_dependencies: [], stale_suppressions: [], unused_catalog_entries: [], unresolved_catalog_references: [], unused_dependency_overrides: [], misconfigured_dependency_overrides: [], private_type_leaks: []}, dupes: { stats: {clone_groups: 50, clone_instances: 200, files_with_clones: 50, duplicated_lines: 5000, total_lines: 100000, duplication_percentage: 5.0}, clone_groups: ([range(0;50)] | map(. as $g | {line_count: ($g + 1), token_count: ($g * 5 + 50), instances: ([range(0;4)] | map(. as $i | {file: ("src/group_\($g)/file_\($i).ts"), start_line: ($i * 10 + 1), end_line: ($i * 10 + 9)}))})) diff --git a/crates/cli/src/baseline.rs b/crates/cli/src/baseline.rs index 4b58c68b6..376c76341 100644 --- a/crates/cli/src/baseline.rs +++ b/crates/cli/src/baseline.rs @@ -96,6 +96,12 @@ pub struct BaselineData { /// Unresolved catalog references, keyed by `path:line:catalog_name:entry_name`. #[serde(default)] pub unresolved_catalog_references: Vec, + /// Unused pnpm dependency overrides, keyed by `source:raw_key`. + #[serde(default)] + pub unused_dependency_overrides: Vec, + /// Misconfigured pnpm dependency overrides, keyed by `source:raw_key`. + #[serde(default)] + pub misconfigured_dependency_overrides: Vec, } impl BaselineData { @@ -225,6 +231,16 @@ impl BaselineData { ) }) .collect(), + unused_dependency_overrides: results + .unused_dependency_overrides + .iter() + .map(|o| format!("{}:{}", o.source, o.raw_key)) + .collect(), + misconfigured_dependency_overrides: results + .misconfigured_dependency_overrides + .iter() + .map(|o| format!("{}:{}", o.source, o.raw_key)) + .collect(), } } @@ -249,6 +265,8 @@ impl BaselineData { + self.stale_suppressions.len() + self.unused_catalog_entries.len() + self.unresolved_catalog_references.len() + + self.unused_dependency_overrides.len() + + self.misconfigured_dependency_overrides.len() } } @@ -498,6 +516,26 @@ pub fn filter_new_issues( !baseline_unresolved.contains(key.as_str()) }); + let baseline_unused_overrides: FxHashSet<&str> = baseline + .unused_dependency_overrides + .iter() + .map(String::as_str) + .collect(); + results.unused_dependency_overrides.retain(|o| { + let key = format!("{}:{}", o.source, o.raw_key); + !baseline_unused_overrides.contains(key.as_str()) + }); + + let baseline_misconfigured_overrides: FxHashSet<&str> = baseline + .misconfigured_dependency_overrides + .iter() + .map(String::as_str) + .collect(); + results.misconfigured_dependency_overrides.retain(|o| { + let key = format!("{}:{}", o.source, o.raw_key); + !baseline_misconfigured_overrides.contains(key.as_str()) + }); + results } @@ -1241,6 +1279,8 @@ mod tests { stale_suppressions: vec![], unused_catalog_entries: vec![], unresolved_catalog_references: vec![], + unused_dependency_overrides: vec![], + misconfigured_dependency_overrides: vec![], }; let results = AnalysisResults { unused_files: vec![ @@ -1283,6 +1323,8 @@ mod tests { stale_suppressions: vec![], unused_catalog_entries: vec![], unresolved_catalog_references: vec![], + unused_dependency_overrides: vec![], + misconfigured_dependency_overrides: vec![], }; let results = make_results(); let filtered = filter_new_issues(results, &baseline, Path::new("")); @@ -1312,6 +1354,8 @@ mod tests { stale_suppressions: vec![], unused_catalog_entries: vec![], unresolved_catalog_references: vec![], + unused_dependency_overrides: vec![], + misconfigured_dependency_overrides: vec![], }; let results = AnalysisResults { unused_exports: vec![ diff --git a/crates/cli/src/check/filtering.rs b/crates/cli/src/check/filtering.rs index 2916ff863..f3aed4c1a 100644 --- a/crates/cli/src/check/filtering.rs +++ b/crates/cli/src/check/filtering.rs @@ -83,6 +83,11 @@ pub fn filter_to_workspaces( results .unresolved_catalog_references .retain(|r| any_under(&r.path)); + // Dependency overrides live in the project-root pnpm-workspace.yaml or + // root package.json's pnpm.overrides, not per-workspace. Same reasoning as + // unused-catalog-entries: drop when --workspace narrows. + results.unused_dependency_overrides.clear(); + results.misconfigured_dependency_overrides.clear(); } /// Resolve `--workspace ` to a set of workspace roots, or exit with diff --git a/crates/cli/src/check/mod.rs b/crates/cli/src/check/mod.rs index be0234464..f5ae92d29 100644 --- a/crates/cli/src/check/mod.rs +++ b/crates/cli/src/check/mod.rs @@ -37,6 +37,8 @@ pub struct IssueFilters { pub stale_suppressions: bool, pub unused_catalog_entries: bool, pub unresolved_catalog_references: bool, + pub unused_dependency_overrides: bool, + pub misconfigured_dependency_overrides: bool, } impl IssueFilters { @@ -56,6 +58,8 @@ impl IssueFilters { || self.stale_suppressions || self.unused_catalog_entries || self.unresolved_catalog_references + || self.unused_dependency_overrides + || self.misconfigured_dependency_overrides } /// Enable off-by-default issue types when explicitly requested as filters. @@ -118,6 +122,12 @@ impl IssueFilters { if !self.unresolved_catalog_references { results.unresolved_catalog_references.clear(); } + if !self.unused_dependency_overrides { + results.unused_dependency_overrides.clear(); + } + if !self.misconfigured_dependency_overrides { + results.misconfigured_dependency_overrides.clear(); + } } } @@ -681,6 +691,8 @@ mod tests { stale_suppressions: false, unused_catalog_entries: false, unresolved_catalog_references: false, + unused_dependency_overrides: false, + misconfigured_dependency_overrides: false, } } @@ -1031,6 +1043,8 @@ mod tests { stale_suppressions: true, unused_catalog_entries: true, unresolved_catalog_references: true, + unused_dependency_overrides: true, + misconfigured_dependency_overrides: true, }; let total_before = results.total_issues(); f.apply(&mut results); diff --git a/crates/cli/src/check/rules.rs b/crates/cli/src/check/rules.rs index 8a654bdf9..723380b87 100644 --- a/crates/cli/src/check/rules.rs +++ b/crates/cli/src/check/rules.rs @@ -110,6 +110,12 @@ pub fn apply_rules(results: &mut fallow_core::results::AnalysisResults, config: if rules.unresolved_catalog_references == Severity::Off { results.unresolved_catalog_references.clear(); } + if rules.unused_dependency_overrides == Severity::Off { + results.unused_dependency_overrides.clear(); + } + if rules.misconfigured_dependency_overrides == Severity::Off { + results.misconfigured_dependency_overrides.clear(); + } } /// Check whether any issue type with `Severity::Error` has remaining issues. diff --git a/crates/cli/src/explain.rs b/crates/cli/src/explain.rs index 80ce9e72b..cefe162bf 100644 --- a/crates/cli/src/explain.rs +++ b/crates/cli/src/explain.rs @@ -197,9 +197,25 @@ pub const CHECK_RULES: &[RuleDef] = &[ category: "Dependencies", name: "Unresolved pnpm catalog reference", short: "package.json references a catalog that does not declare the package", - full: "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references).", + full: "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references).", docs_path: "explanations/dead-code#unresolved-catalog-references", }, + RuleDef { + id: "fallow/unused-dependency-override", + category: "Dependencies", + name: "Unused pnpm dependency override", + short: "pnpm.overrides entry forces a version no workspace package depends on", + full: "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override.", + docs_path: "explanations/dead-code#unused-dependency-overrides", + }, + RuleDef { + id: "fallow/misconfigured-dependency-override", + category: "Dependencies", + name: "Misconfigured pnpm dependency override", + short: "pnpm.overrides entry has an unparsable key or value", + full: "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override.", + docs_path: "explanations/dead-code#misconfigured-dependency-overrides", + }, ]; /// Look up a rule definition by its SARIF rule ID across all rule sets. @@ -271,6 +287,14 @@ pub fn rule_by_token(token: &str) -> Option<&'static RuleDef> { "unresolved-catalog-references" | "unresolved-catalog-reference" | "unresolved-catalog" => { Some("fallow/unresolved-catalog-reference") } + "unused-dependency-overrides" + | "unused-dependency-override" + | "unused-override" + | "unused-overrides" => Some("fallow/unused-dependency-override"), + "misconfigured-dependency-overrides" + | "misconfigured-dependency-override" + | "misconfigured-override" + | "misconfigured-overrides" => Some("fallow/misconfigured-dependency-override"), "complexity" | "high-complexity" => Some("fallow/high-complexity"), "cyclomatic" | "high-cyclomatic" | "high-cyclomatic-complexity" => { Some("fallow/high-cyclomatic-complexity") @@ -379,6 +403,14 @@ pub fn rule_guide(rule: &RuleDef) -> RuleGuide { example: "packages/app/package.json declares `\"old-react\": \"catalog:react17\"`, but `catalogs.react17` in pnpm-workspace.yaml does not declare `old-react`. `pnpm install` will fail.", how_to_fix: "If `available_in_catalogs` is non-empty, change the reference to one of those catalogs (e.g. `catalog:react18`). Otherwise add the package to the named catalog in pnpm-workspace.yaml, or remove the catalog reference and pin a hardcoded version. For staged migrations where the catalog edit lands separately, add the (package, catalog, consumer) triple to `ignoreCatalogReferences` in your fallow config.", }, + "fallow/unused-dependency-override" => RuleGuide { + example: "pnpm-workspace.yaml declares `overrides: { axios: ^1.6.0 }`, but no workspace package.json depends on `axios` (directly or transitively as a declared parent in `react>axios: ...`).", + how_to_fix: "Delete the entry from `pnpm-workspace.yaml` or `package.json#pnpm.overrides`. If the entry exists to pin a transitive dependency for a CVE fix, scope it under a real parent (`real-pkg>axios: ^1.6.0`) so the parent-chain rule recognises it, or add the entry to `ignoreDependencyOverrides` in your fallow config to silence the finding while keeping the override.", + }, + "fallow/misconfigured-dependency-override" => RuleGuide { + example: "pnpm-workspace.yaml declares `overrides: { \"@types/react@<<18\": \"18.0.0\" }`. The doubled `<<` is not a valid pnpm version selector and pnpm will reject the workspace at install time.", + how_to_fix: "Fix the key/value to match pnpm's override grammar: bare names (`axios`), scoped names (`@types/react`), targets with version selectors (`@types/react@<18`), parent matchers (`react>react-dom`), and parent chains with selectors on either side. Allowed value idioms: bare version range, `-` (delete), `$ref`, and `npm:alias`. If the entry was experimental, remove it.", + }, "fallow/high-cyclomatic-complexity" | "fallow/high-cognitive-complexity" | "fallow/high-complexity" => RuleGuide { @@ -1455,7 +1487,7 @@ mod tests { #[test] fn check_rules_count() { - assert_eq!(CHECK_RULES.len(), 19); + assert_eq!(CHECK_RULES.len(), 21); } #[test] diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 7fef4bb2f..100bf4664 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -327,6 +327,14 @@ enum Command { #[arg(long)] unresolved_catalog_references: bool, + /// Only report unused pnpm dependency overrides + #[arg(long)] + unused_dependency_overrides: bool, + + /// Only report misconfigured pnpm dependency overrides + #[arg(long)] + misconfigured_dependency_overrides: bool, + /// Also run duplication analysis and cross-reference with dead code #[arg(long)] include_dupes: bool, @@ -2005,6 +2013,8 @@ fn dispatch_subcommand(command: Command, dispatch: &DispatchContext<'_>) -> Exit stale_suppressions, unused_catalog_entries, unresolved_catalog_references, + unused_dependency_overrides, + misconfigured_dependency_overrides, include_dupes, trace, trace_file, @@ -2030,6 +2040,8 @@ fn dispatch_subcommand(command: Command, dispatch: &DispatchContext<'_>) -> Exit stale_suppressions, unused_catalog_entries, unresolved_catalog_references, + unused_dependency_overrides, + misconfigured_dependency_overrides, }, trace_opts: TraceOptions { trace_export: trace, diff --git a/crates/cli/src/programmatic.rs b/crates/cli/src/programmatic.rs index 2e647008b..30068b665 100644 --- a/crates/cli/src/programmatic.rs +++ b/crates/cli/src/programmatic.rs @@ -98,6 +98,8 @@ pub struct DeadCodeFilters { pub stale_suppressions: bool, pub unused_catalog_entries: bool, pub unresolved_catalog_references: bool, + pub unused_dependency_overrides: bool, + pub misconfigured_dependency_overrides: bool, } /// Options for dead-code-oriented analyses. @@ -386,6 +388,8 @@ fn to_issue_filters(filters: &DeadCodeFilters) -> IssueFilters { stale_suppressions: filters.stale_suppressions, unused_catalog_entries: filters.unused_catalog_entries, unresolved_catalog_references: filters.unresolved_catalog_references, + unused_dependency_overrides: filters.unused_dependency_overrides, + misconfigured_dependency_overrides: filters.misconfigured_dependency_overrides, } } diff --git a/crates/cli/src/report/codeclimate.rs b/crates/cli/src/report/codeclimate.rs index e22ad6653..c25b12f61 100644 --- a/crates/cli/src/report/codeclimate.rs +++ b/crates/cli/src/report/codeclimate.rs @@ -601,6 +601,84 @@ fn push_unresolved_catalog_reference_issues( } } +fn push_unused_dependency_override_issues( + issues: &mut Vec, + findings: &[fallow_core::results::UnusedDependencyOverride], + root: &Path, + severity: Severity, +) { + if findings.is_empty() { + return; + } + let level = severity_to_codeclimate(severity); + for finding in findings { + let path = cc_path(&finding.path, root); + let line_str = finding.line.to_string(); + let fp = fingerprint_hash(&[ + "fallow/unused-dependency-override", + &path, + &line_str, + finding.source.as_label(), + &finding.raw_key, + ]); + let mut description = format!( + "Override `{}` forces version `{}` but no workspace package depends on `{}`", + finding.raw_key, finding.version_range, finding.target_package, + ); + if let Some(hint) = &finding.hint { + use std::fmt::Write as _; + let _ = write!(description, " ({hint})"); + } + issues.push(cc_issue( + "fallow/unused-dependency-override", + &description, + level, + "Bug Risk", + &path, + Some(finding.line), + &fp, + )); + } +} + +fn push_misconfigured_dependency_override_issues( + issues: &mut Vec, + findings: &[fallow_core::results::MisconfiguredDependencyOverride], + root: &Path, + severity: Severity, +) { + if findings.is_empty() { + return; + } + let level = severity_to_codeclimate(severity); + for finding in findings { + let path = cc_path(&finding.path, root); + let line_str = finding.line.to_string(); + let fp = fingerprint_hash(&[ + "fallow/misconfigured-dependency-override", + &path, + &line_str, + finding.source.as_label(), + &finding.raw_key, + ]); + let description = format!( + "Override `{}` -> `{}` is malformed: {}", + finding.raw_key, + finding.raw_value, + finding.reason.describe(), + ); + issues.push(cc_issue( + "fallow/misconfigured-dependency-override", + &description, + level, + "Bug Risk", + &path, + Some(finding.line), + &fp, + )); + } +} + /// Build CodeClimate JSON array from dead-code analysis results. #[must_use] pub fn build_codeclimate( @@ -735,6 +813,18 @@ pub fn build_codeclimate( root, rules.unresolved_catalog_references, ); + push_unused_dependency_override_issues( + &mut issues, + &results.unused_dependency_overrides, + root, + rules.unused_dependency_overrides, + ); + push_misconfigured_dependency_override_issues( + &mut issues, + &results.misconfigured_dependency_overrides, + root, + rules.misconfigured_dependency_overrides, + ); serde_json::Value::Array(issues) } diff --git a/crates/cli/src/report/compact.rs b/crates/cli/src/report/compact.rs index 360fb3cbc..8761f6ac9 100644 --- a/crates/cli/src/report/compact.rs +++ b/crates/cli/src/report/compact.rs @@ -14,6 +14,10 @@ pub(super) fn print_compact(results: &AnalysisResults, root: &Path) { /// Build compact output lines for analysis results. /// Each issue is represented as a single `prefix:details` line. +#[expect( + clippy::too_many_lines, + reason = "One uniform loop per issue type; the line count grows linearly with new issue types and the structure is clearer than extracting per-loop helpers." +)] pub fn build_compact_lines(results: &AnalysisResults, root: &Path) -> Vec { let rel = |p: &Path| normalize_uri(&relative_path(p, root).display().to_string()); @@ -155,6 +159,24 @@ pub fn build_compact_lines(results: &AnalysisResults, root: &Path) -> Vec, + findings: &[fallow_core::results::UnusedDependencyOverride], + severity: fallow_config::Severity, + max_items: usize, + total_issues: usize, + root: &Path, +) { + if findings.is_empty() { + return; + } + let level = severity_to_level(severity); + build_human_section_ex( + lines, + findings, + "Unused dependency overrides", + level, + max_items, + total_issues, + |finding| { + let path_display = root.join(&finding.path); + let row = format!( + " {key} {source} {loc}", + key = finding.raw_key.bold(), + source = finding.source.as_label().dimmed(), + loc = format!( + "{}:{}", + path_display + .strip_prefix(root) + .unwrap_or(&path_display) + .display(), + finding.line + ) + .dimmed(), + ); + let mut out = vec![row]; + let detail = format!( + "forces {} to {}", + finding.target_package, finding.version_range + ); + out.push(format!(" {}", detail.dimmed())); + if let Some(hint) = &finding.hint { + out.push(format!(" {}", hint.as_str().dimmed())); + } + out + }, + ); +} + +/// Render misconfigured pnpm dependency overrides as a two-tier block: a +/// headline row shows `raw_key source path:line`, then an indented detail +/// row shows the parsed reason. pnpm refuses to install on these shapes so the +/// rule defaults to error. +fn push_misconfigured_dependency_overrides_section( + lines: &mut Vec, + findings: &[fallow_core::results::MisconfiguredDependencyOverride], + severity: fallow_config::Severity, + max_items: usize, + total_issues: usize, + root: &Path, +) { + if findings.is_empty() { + return; + } + let level = severity_to_level(severity); + build_human_section_ex( + lines, + findings, + "Misconfigured dependency overrides", + level, + max_items, + total_issues, + |finding| { + let path_display = root.join(&finding.path); + let row = format!( + " {key} {source} {loc}", + key = finding.raw_key.bold(), + source = finding.source.as_label().dimmed(), + loc = format!( + "{}:{}", + path_display + .strip_prefix(root) + .unwrap_or(&path_display) + .display(), + finding.line + ) + .dimmed(), + ); + vec![row, format!(" {}", finding.reason.describe().dimmed())] + }, + ); +} + fn build_structure_section( lines: &mut Vec, results: &AnalysisResults, diff --git a/crates/cli/src/report/human/mod.rs b/crates/cli/src/report/human/mod.rs index 09222ff80..0274eb4bb 100644 --- a/crates/cli/src/report/human/mod.rs +++ b/crates/cli/src/report/human/mod.rs @@ -132,6 +132,14 @@ fn section_footer_text(title: &str) -> Option<(&'static str, &'static str)> { "package.json `catalog:` / `catalog:` references whose catalog does not declare the package (pnpm install will error)", "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", )), + "Unused dependency overrides" => Some(( + "pnpm `overrides:` entries forcing a version no workspace package depends on (may be intentional pin for a transitive CVE)", + "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + )), + "Misconfigured dependency overrides" => Some(( + "pnpm `overrides:` entries with an unparsable key or empty value (pnpm install will error)", + "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + )), t if t.starts_with("Type-only") => Some(( "Dependencies only used for type imports \u{2014} consider moving to devDependencies", "https://docs.fallow.tools/explanations/dead-code#type-only-dependencies", @@ -159,6 +167,8 @@ fn section_suppress_rule(title: &str) -> Option<&'static str> { "Boundary violations" => Some("boundary-violation"), "Unused catalog entries" => Some("unused-catalog-entry"), "Unresolved catalog references" => Some("unresolved-catalog-reference"), + "Unused dependency overrides" => Some("unused-dependency-override"), + "Misconfigured dependency overrides" => Some("misconfigured-dependency-override"), _ => None, } } @@ -175,10 +185,17 @@ fn is_yaml_comment_only(rule: &str) -> bool { } /// Rules whose findings live in a file format that does not support comments -/// at all (e.g., `unresolved-catalog-reference` lives in `package.json`). -/// Suppression for these MUST go through a fallow config entry. +/// at all (e.g., `unresolved-catalog-reference` lives in `package.json`), or +/// whose findings can live in either YAML or JSON (`*-dependency-override`), +/// so an inline suppression mechanism would be format-dependent. Suppression +/// for these MUST go through a fallow config entry. fn is_config_only_suppression(rule: &str) -> bool { - matches!(rule, "unresolved-catalog-reference") + matches!( + rule, + "unresolved-catalog-reference" + | "unused-dependency-override" + | "misconfigured-dependency-override" + ) } /// Render the config-only suppression hint for a rule that has no inline @@ -188,6 +205,9 @@ fn config_only_suppression_hint(rule: &str) -> &'static str { "unresolved-catalog-reference" => { "To suppress: add an entry to ignoreCatalogReferences in your fallow config" } + "unused-dependency-override" | "misconfigured-dependency-override" => { + "To suppress: add an entry to ignoreDependencyOverrides in your fallow config" + } _ => "To suppress: add an override in your fallow config", } } diff --git a/crates/cli/src/report/markdown.rs b/crates/cli/src/report/markdown.rs index a040084f3..4d92c40e9 100644 --- a/crates/cli/src/report/markdown.rs +++ b/crates/cli/src/report/markdown.rs @@ -279,6 +279,42 @@ pub fn build_markdown(results: &AnalysisResults, root: &Path) -> String { vec![row] }, ); + markdown_section( + &mut out, + &results.unused_dependency_overrides, + "Unused dependency overrides", + |finding| { + use std::fmt::Write as _; + let mut row = format!( + "- `{}` -> `{}` (`{}`) `{}`:{}", + escape_backticks(&finding.raw_key), + escape_backticks(&finding.version_range), + finding.source.as_label(), + rel(&finding.path), + finding.line, + ); + if let Some(hint) = &finding.hint { + let _ = write!(row, " (hint: {})", escape_backticks(hint)); + } + vec![row] + }, + ); + markdown_section( + &mut out, + &results.misconfigured_dependency_overrides, + "Misconfigured dependency overrides", + |finding| { + vec![format!( + "- `{}` -> `{}` (`{}`) `{}`:{} ({})", + escape_backticks(&finding.raw_key), + escape_backticks(&finding.raw_value), + finding.source.as_label(), + rel(&finding.path), + finding.line, + finding.reason.describe(), + )] + }, + ); out } diff --git a/crates/cli/src/report/sarif.rs b/crates/cli/src/report/sarif.rs index 8e7e39f8d..d8df8bd99 100644 --- a/crates/cli/src/report/sarif.rs +++ b/crates/cli/src/report/sarif.rs @@ -449,6 +449,52 @@ fn sarif_unused_catalog_entry_fields( } } +fn sarif_unused_dependency_override_fields( + finding: &fallow_core::results::UnusedDependencyOverride, + root: &Path, + level: &'static str, +) -> SarifFields { + let mut message = format!( + "Override `{}` forces version `{}` but no workspace package depends on `{}`", + finding.raw_key, finding.version_range, finding.target_package, + ); + if let Some(hint) = &finding.hint { + use std::fmt::Write as _; + let _ = write!(message, " ({hint})"); + } + SarifFields { + rule_id: "fallow/unused-dependency-override", + level, + message, + uri: relative_uri(&finding.path, root), + region: Some((finding.line, 1)), + source_path: Some(finding.path.clone()), + properties: None, + } +} + +fn sarif_misconfigured_dependency_override_fields( + finding: &fallow_core::results::MisconfiguredDependencyOverride, + root: &Path, + level: &'static str, +) -> SarifFields { + let message = format!( + "Override `{}` -> `{}` is malformed: {}", + finding.raw_key, + finding.raw_value, + finding.reason.describe(), + ); + SarifFields { + rule_id: "fallow/misconfigured-dependency-override", + level, + message, + uri: relative_uri(&finding.path, root), + region: Some((finding.line, 1)), + source_path: Some(finding.path.clone()), + properties: None, + } +} + fn sarif_unresolved_catalog_reference_fields( finding: &fallow_core::results::UnresolvedCatalogReference, root: &Path, @@ -639,6 +685,16 @@ fn build_sarif_rules(rules: &RulesConfig) -> Vec { "package.json catalog reference points at a catalog that does not declare the package", rules.unresolved_catalog_references, ), + ( + "fallow/unused-dependency-override", + "pnpm dependency override forces a version no workspace package depends on", + rules.unused_dependency_overrides, + ), + ( + "fallow/misconfigured-dependency-override", + "pnpm dependency override key or value is malformed", + rules.misconfigured_dependency_overrides, + ), ] .into_iter() .map(|(id, description, rule_severity)| { @@ -892,6 +948,30 @@ pub fn build_sarif( ) }, ); + push_sarif_results( + &mut sarif_results, + &results.unused_dependency_overrides, + &mut snippets, + |f| { + sarif_unused_dependency_override_fields( + f, + root, + severity_to_sarif_level(rules.unused_dependency_overrides), + ) + }, + ); + push_sarif_results( + &mut sarif_results, + &results.misconfigured_dependency_overrides, + &mut snippets, + |f| { + sarif_misconfigured_dependency_override_fields( + f, + root, + severity_to_sarif_level(rules.misconfigured_dependency_overrides), + ) + }, + ); serde_json::json!({ "$schema": "https://json.schemastore.org/sarif-2.1.0.json", @@ -1473,7 +1553,7 @@ mod tests { let rules = sarif["runs"][0]["tool"]["driver"]["rules"] .as_array() .expect("rules should be an array"); - assert_eq!(rules.len(), 19); + assert_eq!(rules.len(), 21); let rule_ids: Vec<&str> = rules.iter().map(|r| r["id"].as_str().unwrap()).collect(); assert!(rule_ids.contains(&"fallow/unused-file")); @@ -1494,6 +1574,8 @@ mod tests { assert!(rule_ids.contains(&"fallow/boundary-violation")); assert!(rule_ids.contains(&"fallow/unused-catalog-entry")); assert!(rule_ids.contains(&"fallow/unresolved-catalog-reference")); + assert!(rule_ids.contains(&"fallow/unused-dependency-override")); + assert!(rule_ids.contains(&"fallow/misconfigured-dependency-override")); } #[test] diff --git a/crates/cli/tests/snapshot_tests.rs b/crates/cli/tests/snapshot_tests.rs index 1ddb2603b..e12fa4c4a 100644 --- a/crates/cli/tests/snapshot_tests.rs +++ b/crates/cli/tests/snapshot_tests.rs @@ -18,6 +18,10 @@ use fallow_core::extract::MemberKind; use fallow_core::results::*; /// Build sample `AnalysisResults` with one issue of each type for consistent snapshots. +#[expect( + clippy::too_many_lines, + reason = "One block per issue type used across the snapshot suite; the line count grows with new issue types and the structure is intentional." +)] fn sample_results(root: &Path) -> AnalysisResults { let mut r = AnalysisResults::default(); @@ -142,6 +146,40 @@ fn sample_results(root: &Path) -> AnalysisResults { line: 12, hardcoded_consumers: vec![PathBuf::from("apps/web/package.json")], }); + r.unresolved_catalog_references + .push(fallow_core::results::UnresolvedCatalogReference { + entry_name: "old-react".to_string(), + catalog_name: "react17".to_string(), + path: root.join("packages/app/package.json"), + line: 14, + available_in_catalogs: vec!["react18".to_string()], + }); + r.unused_dependency_overrides.push( + fallow_core::results::UnusedDependencyOverride { + raw_key: "axios".to_string(), + target_package: "axios".to_string(), + parent_package: None, + version_constraint: None, + version_range: "^1.6.0".to_string(), + source: fallow_core::results::DependencyOverrideSource::PnpmWorkspaceYaml, + path: PathBuf::from("pnpm-workspace.yaml"), + line: 9, + hint: Some( + "May be an intentional pin for a transitive CVE that no workspace package depends on directly" + .to_string(), + ), + }, + ); + r.misconfigured_dependency_overrides.push( + fallow_core::results::MisconfiguredDependencyOverride { + raw_key: "@types/react@<<18".to_string(), + raw_value: "18.0.0".to_string(), + reason: fallow_core::results::DependencyOverrideMisconfigReason::UnparsableKey, + source: fallow_core::results::DependencyOverrideSource::PnpmPackageJson, + path: PathBuf::from("package.json"), + line: 3, + }, + ); r } diff --git a/crates/cli/tests/snapshots/snapshot_tests__codeclimate_mixed_severity.snap b/crates/cli/tests/snapshots/snapshot_tests__codeclimate_mixed_severity.snap index 5b6a2c46b..86f8e4830 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__codeclimate_mixed_severity.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__codeclimate_mixed_severity.snap @@ -274,5 +274,53 @@ expression: json_str "begin": 12 } } + }, + { + "type": "issue", + "check_name": "fallow/unresolved-catalog-reference", + "description": "Package 'old-react' is referenced via `catalog:react17` but catalog 'react17' does not declare it; `pnpm install` will fail (available in: react18)", + "categories": [ + "Bug Risk" + ], + "severity": "major", + "fingerprint": "3b583c29be84724a", + "location": { + "path": "packages/app/package.json", + "lines": { + "begin": 14 + } + } + }, + { + "type": "issue", + "check_name": "fallow/unused-dependency-override", + "description": "Override `axios` forces version `^1.6.0` but no workspace package depends on `axios` (May be an intentional pin for a transitive CVE that no workspace package depends on directly)", + "categories": [ + "Bug Risk" + ], + "severity": "minor", + "fingerprint": "9e455c649fd184fe", + "location": { + "path": "pnpm-workspace.yaml", + "lines": { + "begin": 9 + } + } + }, + { + "type": "issue", + "check_name": "fallow/misconfigured-dependency-override", + "description": "Override `@types/react@<<18` -> `18.0.0` is malformed: override key cannot be parsed", + "categories": [ + "Bug Risk" + ], + "severity": "major", + "fingerprint": "21be520b86ce0207", + "location": { + "path": "package.json", + "lines": { + "begin": 3 + } + } } ] diff --git a/crates/cli/tests/snapshots/snapshot_tests__codeclimate_output.snap b/crates/cli/tests/snapshots/snapshot_tests__codeclimate_output.snap index 56db968d7..305ccf3e1 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__codeclimate_output.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__codeclimate_output.snap @@ -274,5 +274,53 @@ expression: json_str "begin": 12 } } + }, + { + "type": "issue", + "check_name": "fallow/unresolved-catalog-reference", + "description": "Package 'old-react' is referenced via `catalog:react17` but catalog 'react17' does not declare it; `pnpm install` will fail (available in: react18)", + "categories": [ + "Bug Risk" + ], + "severity": "major", + "fingerprint": "3b583c29be84724a", + "location": { + "path": "packages/app/package.json", + "lines": { + "begin": 14 + } + } + }, + { + "type": "issue", + "check_name": "fallow/unused-dependency-override", + "description": "Override `axios` forces version `^1.6.0` but no workspace package depends on `axios` (May be an intentional pin for a transitive CVE that no workspace package depends on directly)", + "categories": [ + "Bug Risk" + ], + "severity": "minor", + "fingerprint": "9e455c649fd184fe", + "location": { + "path": "pnpm-workspace.yaml", + "lines": { + "begin": 9 + } + } + }, + { + "type": "issue", + "check_name": "fallow/misconfigured-dependency-override", + "description": "Override `@types/react@<<18` -> `18.0.0` is malformed: override key cannot be parsed", + "categories": [ + "Bug Risk" + ], + "severity": "major", + "fingerprint": "21be520b86ce0207", + "location": { + "path": "package.json", + "lines": { + "begin": 3 + } + } } ] diff --git a/crates/cli/tests/snapshots/snapshot_tests__compact_output.snap b/crates/cli/tests/snapshots/snapshot_tests__compact_output.snap index e236d6f4f..7dc989398 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__compact_output.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__compact_output.snap @@ -18,3 +18,6 @@ test-only-dep:msw circular-dependency:src/a.ts:3:src/a.ts → src/b.ts → src/a.ts unused-catalog-entry:pnpm-workspace.yaml:6:default:is-even unused-catalog-entry:pnpm-workspace.yaml:12:legacy:old-thing +unresolved-catalog-reference:packages/app/package.json:14:react17:old-react +unused-dependency-override:pnpm-workspace.yaml:9:pnpm-workspace.yaml:axios +misconfigured-dependency-override:package.json:3:package.json:@types/react@<<18 diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap b/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap index e9b23e6a8..a1fdbcc31 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap @@ -6,9 +6,9 @@ expression: redact_version(&json_str) "schema_version": 6, "version": "[VERSION]", "elapsed_ms": 42, - "total_issues": 16, + "total_issues": 19, "summary": { - "total_issues": 16, + "total_issues": 19, "unused_files": 1, "unused_exports": 1, "unused_types": 1, @@ -25,9 +25,9 @@ expression: redact_version(&json_str) "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 2, - "unresolved_catalog_references": 0, - "unused_dependency_overrides": 0, - "misconfigured_dependency_overrides": 0 + "unresolved_catalog_references": 1, + "unused_dependency_overrides": 1, + "misconfigured_dependency_overrides": 1 }, "unused_files": [ { @@ -435,7 +435,101 @@ expression: redact_version(&json_str) ] } ], - "unresolved_catalog_references": [], - "unused_dependency_overrides": [], - "misconfigured_dependency_overrides": [] + "unresolved_catalog_references": [ + { + "entry_name": "old-react", + "catalog_name": "react17", + "path": "packages/app/package.json", + "line": 14, + "available_in_catalogs": [ + "react18" + ], + "actions": [ + { + "type": "update-catalog-reference", + "auto_fixable": false, + "description": "Switch the reference from `catalog:react17` to a catalog that declares `old-react`", + "available_in_catalogs": [ + "react18" + ], + "suggested_target": "react18" + }, + { + "type": "remove-catalog-reference", + "auto_fixable": false, + "description": "Remove the catalog reference and pin a hardcoded version in package.json", + "note": "Use only when neither another catalog declares the package nor the named catalog should grow to include it" + }, + { + "type": "add-to-config", + "auto_fixable": false, + "description": "Suppress this reference via ignoreCatalogReferences in fallow config (use when the catalog edit is intentionally landing in a separate PR or the package is a placeholder).", + "config_key": "ignoreCatalogReferences", + "value": { + "package": "old-react", + "catalog": "react17", + "consumer": "packages/app/package.json" + }, + "value_schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json#/properties/ignoreCatalogReferences/items" + } + ] + } + ], + "unused_dependency_overrides": [ + { + "raw_key": "axios", + "target_package": "axios", + "version_range": "^1.6.0", + "source": "pnpm-workspace.yaml", + "path": "pnpm-workspace.yaml", + "line": 9, + "hint": "May be an intentional pin for a transitive CVE that no workspace package depends on directly", + "actions": [ + { + "type": "remove-dependency-override", + "auto_fixable": false, + "description": "Remove the override entry from pnpm-workspace.yaml or pnpm.overrides", + "note": "Conservative static check; verify against `pnpm install --frozen-lockfile` before removing in case the override targets a transitive dependency (CVE-fix pattern)" + }, + { + "type": "add-to-config", + "auto_fixable": false, + "description": "Suppress this override finding via ignoreDependencyOverrides in fallow config (use for CVE-fix overrides that target a purely-transitive package).", + "config_key": "ignoreDependencyOverrides", + "value": { + "package": "axios", + "source": "pnpm-workspace.yaml" + } + } + ] + } + ], + "misconfigured_dependency_overrides": [ + { + "raw_key": "@types/react@<<18", + "raw_value": "18.0.0", + "reason": "unparsable-key", + "source": "package.json", + "path": "package.json", + "line": 3, + "actions": [ + { + "type": "fix-dependency-override", + "auto_fixable": false, + "description": "Fix the override key or value: pnpm refuses to honor entries with an unparsable key or empty value", + "note": "Common shapes: bare `pkg`, scoped `@scope/pkg`, version-selector `pkg@<2`, parent-chain `parent>child`. Valid values include semver ranges, `-` (removal), `$ref` (self-ref), and `npm:alias@^1`." + }, + { + "type": "add-to-config", + "auto_fixable": false, + "description": "Suppress this override finding via ignoreDependencyOverrides in fallow config (use for CVE-fix overrides that target a purely-transitive package).", + "config_key": "ignoreDependencyOverrides", + "value": { + "package": "@types/react@<<18", + "source": "package.json" + } + } + ] + } + ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_output.snap b/crates/cli/tests/snapshots/snapshot_tests__json_output.snap index ece3793d2..9cd460076 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_output.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_output.snap @@ -6,9 +6,9 @@ expression: "json_str.replace(&format!(\"\\\"version\\\": \\\"{}\\\"\", env!(\"C "schema_version": 6, "version": "[VERSION]", "elapsed_ms": 42, - "total_issues": 16, + "total_issues": 19, "summary": { - "total_issues": 16, + "total_issues": 19, "unused_files": 1, "unused_exports": 1, "unused_types": 1, @@ -25,9 +25,9 @@ expression: "json_str.replace(&format!(\"\\\"version\\\": \\\"{}\\\"\", env!(\"C "boundary_violations": 0, "stale_suppressions": 0, "unused_catalog_entries": 2, - "unresolved_catalog_references": 0, - "unused_dependency_overrides": 0, - "misconfigured_dependency_overrides": 0 + "unresolved_catalog_references": 1, + "unused_dependency_overrides": 1, + "misconfigured_dependency_overrides": 1 }, "unused_files": [ { @@ -435,7 +435,101 @@ expression: "json_str.replace(&format!(\"\\\"version\\\": \\\"{}\\\"\", env!(\"C ] } ], - "unresolved_catalog_references": [], - "unused_dependency_overrides": [], - "misconfigured_dependency_overrides": [] + "unresolved_catalog_references": [ + { + "entry_name": "old-react", + "catalog_name": "react17", + "path": "packages/app/package.json", + "line": 14, + "available_in_catalogs": [ + "react18" + ], + "actions": [ + { + "type": "update-catalog-reference", + "auto_fixable": false, + "description": "Switch the reference from `catalog:react17` to a catalog that declares `old-react`", + "available_in_catalogs": [ + "react18" + ], + "suggested_target": "react18" + }, + { + "type": "remove-catalog-reference", + "auto_fixable": false, + "description": "Remove the catalog reference and pin a hardcoded version in package.json", + "note": "Use only when neither another catalog declares the package nor the named catalog should grow to include it" + }, + { + "type": "add-to-config", + "auto_fixable": false, + "description": "Suppress this reference via ignoreCatalogReferences in fallow config (use when the catalog edit is intentionally landing in a separate PR or the package is a placeholder).", + "config_key": "ignoreCatalogReferences", + "value": { + "package": "old-react", + "catalog": "react17", + "consumer": "packages/app/package.json" + }, + "value_schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json#/properties/ignoreCatalogReferences/items" + } + ] + } + ], + "unused_dependency_overrides": [ + { + "raw_key": "axios", + "target_package": "axios", + "version_range": "^1.6.0", + "source": "pnpm-workspace.yaml", + "path": "pnpm-workspace.yaml", + "line": 9, + "hint": "May be an intentional pin for a transitive CVE that no workspace package depends on directly", + "actions": [ + { + "type": "remove-dependency-override", + "auto_fixable": false, + "description": "Remove the override entry from pnpm-workspace.yaml or pnpm.overrides", + "note": "Conservative static check; verify against `pnpm install --frozen-lockfile` before removing in case the override targets a transitive dependency (CVE-fix pattern)" + }, + { + "type": "add-to-config", + "auto_fixable": false, + "description": "Suppress this override finding via ignoreDependencyOverrides in fallow config (use for CVE-fix overrides that target a purely-transitive package).", + "config_key": "ignoreDependencyOverrides", + "value": { + "package": "axios", + "source": "pnpm-workspace.yaml" + } + } + ] + } + ], + "misconfigured_dependency_overrides": [ + { + "raw_key": "@types/react@<<18", + "raw_value": "18.0.0", + "reason": "unparsable-key", + "source": "package.json", + "path": "package.json", + "line": 3, + "actions": [ + { + "type": "fix-dependency-override", + "auto_fixable": false, + "description": "Fix the override key or value: pnpm refuses to honor entries with an unparsable key or empty value", + "note": "Common shapes: bare `pkg`, scoped `@scope/pkg`, version-selector `pkg@<2`, parent-chain `parent>child`. Valid values include semver ranges, `-` (removal), `$ref` (self-ref), and `npm:alias@^1`." + }, + { + "type": "add-to-config", + "auto_fixable": false, + "description": "Suppress this override finding via ignoreDependencyOverrides in fallow config (use for CVE-fix overrides that target a purely-transitive package).", + "config_key": "ignoreDependencyOverrides", + "value": { + "package": "@types/react@<<18", + "source": "package.json" + } + } + ] + } + ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__markdown_output.snap b/crates/cli/tests/snapshots/snapshot_tests__markdown_output.snap index 9b2c56237..683fdefa9 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__markdown_output.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__markdown_output.snap @@ -2,7 +2,7 @@ source: crates/cli/tests/snapshot_tests.rs expression: output --- -## Fallow: 16 issues found +## Fallow: 19 issues found ### Unused files (1) @@ -69,3 +69,15 @@ expression: output - `is-even` (`default`) `pnpm-workspace.yaml`:6 - `old-thing` (`legacy`) `pnpm-workspace.yaml`:12 (hardcoded in `apps/web/package.json`) + +### Unresolved catalog references (1) + +- `old-react` (`react17`) `packages/app/package.json`:14 (available in: `react18`) + +### Unused dependency overrides (1) + +- `axios` -> `^1.6.0` (`pnpm-workspace.yaml`) `pnpm-workspace.yaml`:9 (hint: May be an intentional pin for a transitive CVE that no workspace package depends on directly) + +### Misconfigured dependency overrides (1) + +- `@types/react@<<18` -> `18.0.0` (`package.json`) `package.json`:3 (override key cannot be parsed) diff --git a/crates/cli/tests/snapshots/snapshot_tests__pr_comment_github.snap b/crates/cli/tests/snapshots/snapshot_tests__pr_comment_github.snap index 0a1998ddb..29c9fafc1 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__pr_comment_github.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__pr_comment_github.snap @@ -5,7 +5,7 @@ expression: output ### Fallow dead-code report -Found **17** findings. +Found **20** findings.
Dead code (8) @@ -24,16 +24,19 @@ Found **17** findings.
-Dependencies (8) +Dependencies (11) | Severity | Rule | Location | Description | | --- | --- | --- | --- | +| major | `fallow/misconfigured-dependency-override` | `package.json`:3 | Override \`@types/react@\<\<18\` -\> \`18.0.0\` is malformed: override key cannot be parsed | | major | `fallow/unused-dependency` | `package.json`:5 | Package 'lodash' is in dependencies but never imported | | minor | `fallow/unused-dev-dependency` | `package.json`:5 | Package 'jest' is in devDependencies but never imported | | minor | `fallow/unused-optional-dependency` | `package.json`:5 | Package 'fsevents' is in optionalDependencies but never imported | | minor | `fallow/type-only-dependency` | `package.json`:8 | Package 'zod' is only imported via type-only imports \(consider moving to devDependencies\) | | minor | `fallow/test-only-dependency` | `package.json`:12 | Package 'msw' is only imported by test files \(consider moving to devDependencies\) | +| major | `fallow/unresolved-catalog-reference` | `packages/app/package.json`:14 | Package 'old-react' is referenced via \`catalog:react17\` but catalog 'react17' does not declare it; \`pnpm install\` will fail \(available in: react18\) | | minor | `fallow/unused-catalog-entry` | `pnpm-workspace.yaml`:6 | Catalog entry 'is-even' is not referenced by any workspace package | +| minor | `fallow/unused-dependency-override` | `pnpm-workspace.yaml`:9 | Override \`axios\` forces version \`^1.6.0\` but no workspace package depends on \`axios\` \(May be an intentional pin for a transitive CVE that no workspace package depends on directly\) | | minor | `fallow/unused-catalog-entry` | `pnpm-workspace.yaml`:12 | Catalog entry 'old-thing' \(catalog 'legacy'\) is not referenced by any workspace package | | major | `fallow/unlisted-dependency` | `src/cli.ts`:2 | Package 'chalk' is imported but not listed in package.json | diff --git a/crates/cli/tests/snapshots/snapshot_tests__pr_comment_gitlab.snap b/crates/cli/tests/snapshots/snapshot_tests__pr_comment_gitlab.snap index 0a1998ddb..29c9fafc1 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__pr_comment_gitlab.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__pr_comment_gitlab.snap @@ -5,7 +5,7 @@ expression: output ### Fallow dead-code report -Found **17** findings. +Found **20** findings.
Dead code (8) @@ -24,16 +24,19 @@ Found **17** findings.
-Dependencies (8) +Dependencies (11) | Severity | Rule | Location | Description | | --- | --- | --- | --- | +| major | `fallow/misconfigured-dependency-override` | `package.json`:3 | Override \`@types/react@\<\<18\` -\> \`18.0.0\` is malformed: override key cannot be parsed | | major | `fallow/unused-dependency` | `package.json`:5 | Package 'lodash' is in dependencies but never imported | | minor | `fallow/unused-dev-dependency` | `package.json`:5 | Package 'jest' is in devDependencies but never imported | | minor | `fallow/unused-optional-dependency` | `package.json`:5 | Package 'fsevents' is in optionalDependencies but never imported | | minor | `fallow/type-only-dependency` | `package.json`:8 | Package 'zod' is only imported via type-only imports \(consider moving to devDependencies\) | | minor | `fallow/test-only-dependency` | `package.json`:12 | Package 'msw' is only imported by test files \(consider moving to devDependencies\) | +| major | `fallow/unresolved-catalog-reference` | `packages/app/package.json`:14 | Package 'old-react' is referenced via \`catalog:react17\` but catalog 'react17' does not declare it; \`pnpm install\` will fail \(available in: react18\) | | minor | `fallow/unused-catalog-entry` | `pnpm-workspace.yaml`:6 | Catalog entry 'is-even' is not referenced by any workspace package | +| minor | `fallow/unused-dependency-override` | `pnpm-workspace.yaml`:9 | Override \`axios\` forces version \`^1.6.0\` but no workspace package depends on \`axios\` \(May be an intentional pin for a transitive CVE that no workspace package depends on directly\) | | minor | `fallow/unused-catalog-entry` | `pnpm-workspace.yaml`:12 | Catalog entry 'old-thing' \(catalog 'legacy'\) is not referenced by any workspace package | | major | `fallow/unlisted-dependency` | `src/cli.ts`:2 | Package 'chalk' is imported but not listed in package.json | diff --git a/crates/cli/tests/snapshots/snapshot_tests__review_github_envelope.snap b/crates/cli/tests/snapshots/snapshot_tests__review_github_envelope.snap index 27e688f18..1ae977414 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__review_github_envelope.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__review_github_envelope.snap @@ -4,8 +4,15 @@ expression: json_str --- { "event": "COMMENT", - "body": "### Fallow dead-code report\n\n17 inline findings selected for GitHub review.\n\n", + "body": "### Fallow dead-code report\n\n20 inline findings selected for GitHub review.\n\n", "comments": [ + { + "path": "package.json", + "line": 3, + "side": "RIGHT", + "body": "**error** `fallow/misconfigured-dependency-override`: Override \\`@types/react@\\<\\<18\\` -\\> \\`18.0.0\\` is malformed: override key cannot be parsed\n\n", + "fingerprint": "21be520b86ce0207" + }, { "path": "package.json", "line": 5, @@ -41,6 +48,13 @@ expression: json_str "body": "**warn** `fallow/test-only-dependency`: Package 'msw' is only imported by test files \\(consider moving to devDependencies\\)\n\n", "fingerprint": "ebc538b211ef05f5" }, + { + "path": "packages/app/package.json", + "line": 14, + "side": "RIGHT", + "body": "**error** `fallow/unresolved-catalog-reference`: Package 'old-react' is referenced via \\`catalog:react17\\` but catalog 'react17' does not declare it; \\`pnpm install\\` will fail \\(available in: react18\\)\n\n", + "fingerprint": "3b583c29be84724a" + }, { "path": "pnpm-workspace.yaml", "line": 6, @@ -48,6 +62,13 @@ expression: json_str "body": "**warn** `fallow/unused-catalog-entry`: Catalog entry 'is-even' is not referenced by any workspace package\n\n", "fingerprint": "01c68b8e65ee42b9" }, + { + "path": "pnpm-workspace.yaml", + "line": 9, + "side": "RIGHT", + "body": "**warn** `fallow/unused-dependency-override`: Override \\`axios\\` forces version \\`^1.6.0\\` but no workspace package depends on \\`axios\\` \\(May be an intentional pin for a transitive CVE that no workspace package depends on directly\\)\n\n", + "fingerprint": "9e455c649fd184fe" + }, { "path": "pnpm-workspace.yaml", "line": 12, diff --git a/crates/cli/tests/snapshots/snapshot_tests__review_gitlab_envelope.snap b/crates/cli/tests/snapshots/snapshot_tests__review_gitlab_envelope.snap index 7d83ca801..bca5232eb 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__review_gitlab_envelope.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__review_gitlab_envelope.snap @@ -3,8 +3,18 @@ source: crates/cli/tests/snapshot_tests.rs expression: json_str --- { - "body": "### Fallow dead-code report\n\n17 inline findings selected for GitLab review.\n\n", + "body": "### Fallow dead-code report\n\n20 inline findings selected for GitLab review.\n\n", "comments": [ + { + "body": "**error** `fallow/misconfigured-dependency-override`: Override \\`@types/react@\\<\\<18\\` -\\> \\`18.0.0\\` is malformed: override key cannot be parsed\n\n", + "position": { + "position_type": "text", + "old_path": "package.json", + "new_path": "package.json", + "new_line": 3 + }, + "fingerprint": "21be520b86ce0207" + }, { "body": "**error** `fallow/unused-dependency`: Package 'lodash' is in dependencies but never imported\n\n", "position": { @@ -55,6 +65,16 @@ expression: json_str }, "fingerprint": "ebc538b211ef05f5" }, + { + "body": "**error** `fallow/unresolved-catalog-reference`: Package 'old-react' is referenced via \\`catalog:react17\\` but catalog 'react17' does not declare it; \\`pnpm install\\` will fail \\(available in: react18\\)\n\n", + "position": { + "position_type": "text", + "old_path": "packages/app/package.json", + "new_path": "packages/app/package.json", + "new_line": 14 + }, + "fingerprint": "3b583c29be84724a" + }, { "body": "**warn** `fallow/unused-catalog-entry`: Catalog entry 'is-even' is not referenced by any workspace package\n\n", "position": { @@ -65,6 +85,16 @@ expression: json_str }, "fingerprint": "01c68b8e65ee42b9" }, + { + "body": "**warn** `fallow/unused-dependency-override`: Override \\`axios\\` forces version \\`^1.6.0\\` but no workspace package depends on \\`axios\\` \\(May be an intentional pin for a transitive CVE that no workspace package depends on directly\\)\n\n", + "position": { + "position_type": "text", + "old_path": "pnpm-workspace.yaml", + "new_path": "pnpm-workspace.yaml", + "new_line": 9 + }, + "fingerprint": "9e455c649fd184fe" + }, { "body": "**warn** `fallow/unused-catalog-entry`: Catalog entry 'old-thing' \\(catalog 'legacy'\\) is not referenced by any workspace package\n\n", "position": { diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_circular_deps_only.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_circular_deps_only.snap index ae77a8741..483a62178 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_circular_deps_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_circular_deps_only.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_duplicate_exports_only.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_duplicate_exports_only.snap index 6f3414f52..b3f89e031 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_duplicate_exports_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_duplicate_exports_only.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_empty.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_empty.snap index c5aa7cc55..9b18ca042 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_empty.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_empty.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_mixed_severity.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_mixed_severity.snap index 51784c78f..23af7b795 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_mixed_severity.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_mixed_severity.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } @@ -667,6 +693,78 @@ expression: redact_sarif_version(&json_str) "tools.fallow.fingerprint/v1": "998648e8e4881340", "primaryLocationLineHash/v1": "998648e8e4881340" } + }, + { + "ruleId": "fallow/unresolved-catalog-reference", + "level": "error", + "message": { + "text": "Package 'old-react' is referenced via `catalog:react17` but catalog 'react17' does not declare it (available in: react18)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "packages/app/package.json" + }, + "region": { + "startLine": 14, + "startColumn": 1 + } + } + } + ], + "partialFingerprints": { + "tools.fallow.fingerprint/v1": "87b6a746e59701fa", + "primaryLocationLineHash/v1": "87b6a746e59701fa" + } + }, + { + "ruleId": "fallow/unused-dependency-override", + "level": "warning", + "message": { + "text": "Override `axios` forces version `^1.6.0` but no workspace package depends on `axios` (May be an intentional pin for a transitive CVE that no workspace package depends on directly)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "pnpm-workspace.yaml" + }, + "region": { + "startLine": 9, + "startColumn": 1 + } + } + } + ], + "partialFingerprints": { + "tools.fallow.fingerprint/v1": "1e6d78b17f8db08a", + "primaryLocationLineHash/v1": "1e6d78b17f8db08a" + } + }, + { + "ruleId": "fallow/misconfigured-dependency-override", + "level": "error", + "message": { + "text": "Override `@types/react@<<18` -> `18.0.0` is malformed: override key cannot be parsed" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "package.json" + }, + "region": { + "startLine": 3, + "startColumn": 1 + } + } + } + ], + "partialFingerprints": { + "tools.fallow.fingerprint/v1": "a244cd2ee608018b", + "primaryLocationLineHash/v1": "a244cd2ee608018b" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_multiple_exports_same_file.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_multiple_exports_same_file.snap index 9afedcbf2..93a9bffda 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_multiple_exports_same_file.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_multiple_exports_same_file.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_output.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_output.snap index 4b4ea8459..06652dbb1 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_output.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_output.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } @@ -667,6 +693,78 @@ expression: redact_sarif_version(&json_str) "tools.fallow.fingerprint/v1": "998648e8e4881340", "primaryLocationLineHash/v1": "998648e8e4881340" } + }, + { + "ruleId": "fallow/unresolved-catalog-reference", + "level": "error", + "message": { + "text": "Package 'old-react' is referenced via `catalog:react17` but catalog 'react17' does not declare it (available in: react18)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "packages/app/package.json" + }, + "region": { + "startLine": 14, + "startColumn": 1 + } + } + } + ], + "partialFingerprints": { + "tools.fallow.fingerprint/v1": "87b6a746e59701fa", + "primaryLocationLineHash/v1": "87b6a746e59701fa" + } + }, + { + "ruleId": "fallow/unused-dependency-override", + "level": "warning", + "message": { + "text": "Override `axios` forces version `^1.6.0` but no workspace package depends on `axios` (May be an intentional pin for a transitive CVE that no workspace package depends on directly)" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "pnpm-workspace.yaml" + }, + "region": { + "startLine": 9, + "startColumn": 1 + } + } + } + ], + "partialFingerprints": { + "tools.fallow.fingerprint/v1": "1e6d78b17f8db08a", + "primaryLocationLineHash/v1": "1e6d78b17f8db08a" + } + }, + { + "ruleId": "fallow/misconfigured-dependency-override", + "level": "error", + "message": { + "text": "Override `@types/react@<<18` -> `18.0.0` is malformed: override key cannot be parsed" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "package.json" + }, + "region": { + "startLine": 3, + "startColumn": 1 + } + } + } + ], + "partialFingerprints": { + "tools.fallow.fingerprint/v1": "a244cd2ee608018b", + "primaryLocationLineHash/v1": "a244cd2ee608018b" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_re_export_variant.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_re_export_variant.snap index 3cb902844..42483f5c2 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_re_export_variant.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_re_export_variant.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_type_only_deps.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_type_only_deps.snap index 3f65188f0..0443f154e 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_type_only_deps.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_type_only_deps.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_unlisted_deps_only.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_unlisted_deps_only.snap index bb91f26ed..a2a45ed74 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_unlisted_deps_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_unlisted_deps_only.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_unresolved_imports_only.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_unresolved_imports_only.snap index 1b0551930..e36446aee 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_unresolved_imports_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_unresolved_imports_only.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_class_members_only.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_class_members_only.snap index 1d80aaa05..2303dd51a 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_class_members_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_class_members_only.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_deps_only.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_deps_only.snap index d5495ba02..9c12990aa 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_deps_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_deps_only.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_dev_deps_only.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_dev_deps_only.snap index 848aff621..3aca31f6e 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_dev_deps_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_dev_deps_only.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_enum_members_only.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_enum_members_only.snap index 2bed6637f..39c5fad9f 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_enum_members_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_enum_members_only.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_exports_only.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_exports_only.snap index 2925515c1..0e556067a 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_exports_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_exports_only.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_files_only.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_files_only.snap index bedc545cf..7e0f63f17 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_files_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_files_only.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_optional_deps_only.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_optional_deps_only.snap index c0656d690..419798a15 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_optional_deps_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_optional_deps_only.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_types_only.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_types_only.snap index 0e339355e..38be696d9 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_types_only.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_unused_types_only.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__sarif_workspace_deps.snap b/crates/cli/tests/snapshots/snapshot_tests__sarif_workspace_deps.snap index 2bb7978dc..4d503f331 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__sarif_workspace_deps.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__sarif_workspace_deps.snap @@ -253,12 +253,38 @@ expression: redact_sarif_version(&json_str) "text": "package.json references a catalog that does not declare the package" }, "fullDescription": { - "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. `pnpm.overrides` is currently out of scope. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." + "text": "A workspace package.json declares a dependency with the `catalog:` or `catalog:` protocol, but the catalog has no entry for that package. `pnpm install` will fail with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL. To fix: add the package to the named catalog, switch the reference to a different catalog that does declare it, or remove the reference and pin a hardcoded version. Scope: the detector scans `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies` in every workspace `package.json`. See also: fallow/unused-catalog-entry (the inverse: catalog entries no consumer references)." }, "helpUri": "https://docs.fallow.tools/explanations/dead-code#unresolved-catalog-references", "defaultConfiguration": { "level": "error" } + }, + { + "id": "fallow/unused-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry forces a version no workspace package depends on" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` section, or the root `package.json`'s `pnpm.overrides` block, that no workspace package depends on (either directly or as the parent in a parent>child override). Override entries linger after their target package is removed from the dependency tree. Bare-target overrides (`axios: ^1.6.0` without a parent matcher) may still be intentional pins for transitive CVEs not visible to static analysis; the `cve_hint` field flags those for review. To fix: delete the entry, or scope it under a real parent if it pins a transitive. See also: fallow/misconfigured-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#unused-dependency-overrides", + "defaultConfiguration": { + "level": "warning" + } + }, + { + "id": "fallow/misconfigured-dependency-override", + "shortDescription": { + "text": "pnpm.overrides entry has an unparsable key or value" + }, + "fullDescription": { + "text": "An entry in `pnpm-workspace.yaml`'s `overrides:` or `package.json`'s `pnpm.overrides` whose key or value does not parse as a valid pnpm override spec. Common shapes: empty key, empty value, malformed version selector on the target (`@types/react@<<18`), unbalanced parent matcher (`react>`), or unsupported `npm:alias@` syntax in the version (only the `-`, `$ref`, and `npm:alias` pnpm idioms are allowed). pnpm rejects the workspace at install time with a parser error. To fix: correct the key/value shape, or remove the entry. See also: fallow/unused-dependency-override." + }, + "helpUri": "https://docs.fallow.tools/explanations/dead-code#misconfigured-dependency-overrides", + "defaultConfiguration": { + "level": "error" + } } ] } diff --git a/crates/core/src/results.rs b/crates/core/src/results.rs index 2101b2079..621cbb079 100644 --- a/crates/core/src/results.rs +++ b/crates/core/src/results.rs @@ -1,10 +1,12 @@ // Re-export all result types from fallow-types pub use fallow_types::results::{ - AnalysisResults, BoundaryViolation, CircularDependency, DependencyLocation, DuplicateExport, - DuplicateLocation, EntryPointSummary, ExportUsage, ImportSite, PrivateTypeLeak, - ReferenceLocation, StaleSuppression, SuppressionOrigin, TestOnlyDependency, TypeOnlyDependency, - UnlistedDependency, UnresolvedCatalogReference, UnresolvedImport, UnusedCatalogEntry, - UnusedDependency, UnusedExport, UnusedFile, UnusedMember, + AnalysisResults, BoundaryViolation, CircularDependency, DependencyLocation, + DependencyOverrideMisconfigReason, DependencyOverrideSource, DuplicateExport, + DuplicateLocation, EntryPointSummary, ExportUsage, ImportSite, MisconfiguredDependencyOverride, + PrivateTypeLeak, ReferenceLocation, StaleSuppression, SuppressionOrigin, TestOnlyDependency, + TypeOnlyDependency, UnlistedDependency, UnresolvedCatalogReference, UnresolvedImport, + UnusedCatalogEntry, UnusedDependency, UnusedDependencyOverride, UnusedExport, UnusedFile, + UnusedMember, }; #[cfg(test)] diff --git a/crates/lsp/src/diagnostics/unused.rs b/crates/lsp/src/diagnostics/unused.rs index 20b95aa99..a9ce1b68c 100644 --- a/crates/lsp/src/diagnostics/unused.rs +++ b/crates/lsp/src/diagnostics/unused.rs @@ -288,6 +288,7 @@ pub fn push_dep_diagnostics( } push_unresolved_catalog_reference_diagnostics(map, results); + push_dependency_override_diagnostics(map, results, root); } /// Emit one `ERROR`-severity diagnostic per unresolved-catalog-reference @@ -340,6 +341,78 @@ fn push_unresolved_catalog_reference_diagnostics( } } +/// Emit diagnostics for unused and misconfigured pnpm dependency-override +/// findings. Both finding types carry a project-root-relative `path` (same +/// convention as `UnusedCatalogEntry`), so the URI must be built from +/// `root.join(&finding.path)`. Severity matches the default rule severity: +/// unused = `WARNING`, misconfigured = `ERROR` (pnpm refuses to install). +fn push_dependency_override_diagnostics( + map: &mut FxHashMap>, + results: &AnalysisResults, + root: &std::path::Path, +) { + use std::fmt::Write as _; + for finding in &results.unused_dependency_overrides { + let Ok(uri) = Url::from_file_path(root.join(&finding.path)) else { + continue; + }; + let line = finding.line.saturating_sub(1); + let mut message = format!( + "Unused dependency override: `{}` forces `{}` to `{}` but no workspace package depends on it", + finding.raw_key, finding.target_package, finding.version_range, + ); + if let Some(hint) = &finding.hint { + let _ = write!(message, " ({hint})"); + } + map.entry(uri).or_default().push(Diagnostic { + range: Range { + start: Position { line, character: 0 }, + end: Position { + line, + character: u32::MAX, + }, + }, + severity: Some(DiagnosticSeverity::WARNING), + source: Some("fallow".to_string()), + code: Some(NumberOrString::String( + "unused-dependency-override".to_string(), + )), + code_description: doc_link("unused-dependency-overrides"), + message, + ..Default::default() + }); + } + for finding in &results.misconfigured_dependency_overrides { + let Ok(uri) = Url::from_file_path(root.join(&finding.path)) else { + continue; + }; + let line = finding.line.saturating_sub(1); + let message = format!( + "Misconfigured dependency override: `{}` -> `{}` ({})", + finding.raw_key, + finding.raw_value, + finding.reason.describe(), + ); + map.entry(uri).or_default().push(Diagnostic { + range: Range { + start: Position { line, character: 0 }, + end: Position { + line, + character: u32::MAX, + }, + }, + severity: Some(DiagnosticSeverity::ERROR), + source: Some("fallow".to_string()), + code: Some(NumberOrString::String( + "misconfigured-dependency-override".to_string(), + )), + code_description: doc_link("misconfigured-dependency-overrides"), + message, + ..Default::default() + }); + } +} + #[expect( clippy::cast_possible_truncation, reason = "member name lengths are bounded by source size" @@ -960,4 +1033,91 @@ mod tests { "empty available_in_catalogs should not produce an 'available in' suffix", ); } + + #[test] + fn unused_dependency_override_produces_warning_diagnostic_with_absolute_uri() { + // Override findings store project-root-relative paths (same convention + // as UnusedCatalogEntry), so the diagnostic emitter must root.join + // before calling Url::from_file_path. Asserting the key exists in the + // map under the absolute URI proves the join happened. + use fallow_core::results::{DependencyOverrideSource, UnusedDependencyOverride}; + + let root = test_root(); + let mut results = AnalysisResults::default(); + results + .unused_dependency_overrides + .push(UnusedDependencyOverride { + raw_key: "axios".to_string(), + target_package: "axios".to_string(), + parent_package: None, + version_constraint: None, + version_range: "^1.6.0".to_string(), + source: DependencyOverrideSource::PnpmWorkspaceYaml, + path: PathBuf::from("pnpm-workspace.yaml"), + line: 9, + hint: Some("may be intentional transitive pin".to_string()), + }); + + let duplication = empty_duplication(); + let diags = build_diagnostics(&results, &duplication, &root); + + let uri = Url::from_file_path(root.join("pnpm-workspace.yaml")).unwrap(); + let file_diags = diags + .get(&uri) + .expect("unused-dependency-override diagnostic must key by absolute URI"); + assert_eq!(file_diags.len(), 1); + let d = &file_diags[0]; + assert_eq!(d.severity, Some(DiagnosticSeverity::WARNING)); + assert_eq!( + d.code, + Some(NumberOrString::String( + "unused-dependency-override".to_string() + )) + ); + assert!(d.message.contains("axios")); + assert!(d.message.contains("^1.6.0")); + assert!( + d.message.contains("transitive pin"), + "hint must surface in the diagnostic message, got: {}", + d.message + ); + assert_eq!(d.range.start.line, 8); + } + + #[test] + fn misconfigured_dependency_override_produces_error_diagnostic() { + use fallow_core::results::{ + DependencyOverrideMisconfigReason, DependencyOverrideSource, + MisconfiguredDependencyOverride, + }; + + let root = test_root(); + let mut results = AnalysisResults::default(); + results + .misconfigured_dependency_overrides + .push(MisconfiguredDependencyOverride { + raw_key: "@types/react@<<18".to_string(), + raw_value: "18.0.0".to_string(), + reason: DependencyOverrideMisconfigReason::UnparsableKey, + source: DependencyOverrideSource::PnpmPackageJson, + path: PathBuf::from("package.json"), + line: 3, + }); + + let duplication = empty_duplication(); + let diags = build_diagnostics(&results, &duplication, &root); + + let uri = Url::from_file_path(root.join("package.json")).unwrap(); + let d = &diags[&uri][0]; + assert_eq!(d.severity, Some(DiagnosticSeverity::ERROR)); + assert_eq!( + d.code, + Some(NumberOrString::String( + "misconfigured-dependency-override".to_string() + )) + ); + assert!(d.message.contains("@types/react@<<18")); + assert!(d.message.contains("override key cannot be parsed")); + assert_eq!(d.range.start.line, 2); + } } diff --git a/crates/lsp/src/main.rs b/crates/lsp/src/main.rs index cd7bee9ad..bebdb421f 100644 --- a/crates/lsp/src/main.rs +++ b/crates/lsp/src/main.rs @@ -58,6 +58,8 @@ struct AnalysisCompleteParams { stale_suppressions: usize, unused_catalog_entries: usize, unresolved_catalog_references: usize, + unused_dependency_overrides: usize, + misconfigured_dependency_overrides: usize, duplication_percentage: f64, clone_groups: usize, } @@ -180,6 +182,16 @@ const DIAGNOSTIC_ISSUE_TYPES: &[DiagnosticIssueType] = &[ code: "unresolved-catalog-reference", label: "Unresolved Catalog References", }, + DiagnosticIssueType { + config_key: Some("unused-dependency-overrides"), + code: "unused-dependency-override", + label: "Unused Dependency Overrides", + }, + DiagnosticIssueType { + config_key: Some("misconfigured-dependency-overrides"), + code: "misconfigured-dependency-override", + label: "Misconfigured Dependency Overrides", + }, ]; fn diagnostic_issue_types() -> Vec { @@ -862,6 +874,10 @@ impl FallowLspServer { stale_suppressions: results.stale_suppressions.len(), unused_catalog_entries: results.unused_catalog_entries.len(), unresolved_catalog_references: results.unresolved_catalog_references.len(), + unused_dependency_overrides: results.unused_dependency_overrides.len(), + misconfigured_dependency_overrides: results + .misconfigured_dependency_overrides + .len(), duplication_percentage: duplication.stats.duplication_percentage, clone_groups: duplication.stats.clone_groups, }) @@ -1164,6 +1180,12 @@ fn dedup_results(target: &mut AnalysisResults) { f.entry_name.clone(), ) }); + dedup_by_key_preserving_order(&mut target.unused_dependency_overrides, |o| { + (o.path.clone(), o.source, o.raw_key.clone()) + }); + dedup_by_key_preserving_order(&mut target.misconfigured_dependency_overrides, |o| { + (o.path.clone(), o.source, o.raw_key.clone()) + }); // UnlistedDependency: real merge, not plain dedup. The same package can // be reported by two roots with different `imported_from` site lists @@ -1241,6 +1263,12 @@ fn merge_results(target: &mut AnalysisResults, source: AnalysisResults) { target .unresolved_catalog_references .extend(source.unresolved_catalog_references); + target + .unused_dependency_overrides + .extend(source.unused_dependency_overrides); + target + .misconfigured_dependency_overrides + .extend(source.misconfigured_dependency_overrides); } /// Merge duplication reports from a sub-project into the accumulated report. diff --git a/crates/mcp/src/params.rs b/crates/mcp/src/params.rs index 769c3c2c7..ed376c4bd 100644 --- a/crates/mcp/src/params.rs +++ b/crates/mcp/src/params.rs @@ -53,7 +53,10 @@ pub struct AnalyzeParams { /// stale-suppressions, unused-catalog-entries (catalog declares packages no /// consumer references; dead config), unresolved-catalog-references /// (consumer references catalogs that do not declare the package; broken - /// config that pnpm install will reject). + /// config that pnpm install will reject), unused-dependency-overrides + /// (pnpm.overrides forces a version no workspace package depends on; may be + /// an intentional transitive CVE pin), misconfigured-dependency-overrides + /// (pnpm.overrides key/value is unparsable; pnpm install will reject). pub issue_types: Option>, #[schemars( diff --git a/crates/mcp/src/server/mod.rs b/crates/mcp/src/server/mod.rs index b4b8260c4..e7ecefb49 100644 --- a/crates/mcp/src/server/mod.rs +++ b/crates/mcp/src/server/mod.rs @@ -71,7 +71,7 @@ fn resolve_binary() -> String { #[tool_router] impl FallowMcp { #[tool( - description = "Analyze a TypeScript/JavaScript project for unused code and circular dependencies. Detects unused files, exports, types, dependencies, enum/class members, unresolved imports, unlisted dependencies, duplicate exports, circular dependencies, boundary violations, stale suppression comments, and unused pnpm catalog entries (entries in pnpm-workspace.yaml `catalog:` / `catalogs:` not referenced by any workspace package). Private type leaks are an opt-in API hygiene check via issue_types: [\"private-type-leaks\"]. Returns structured JSON with all issues found, grouped by issue type. For code duplication use find_dupes, for complexity hotspots use check_health. Supports baseline comparisons (baseline/save_baseline), regression detection (fail_on_regression, tolerance, regression_baseline, save_regression_baseline), and performance tuning (no_cache, threads). Set boundary_violations=true to check only architecture boundary violations (convenience alias for issue_types: [\"boundary-violations\"]). Set group_by to \"owner\" (CODEOWNERS), \"directory\", \"package\" (workspace), or \"section\" to group results. The `section` mode reads GitLab CODEOWNERS `[Section]` headers and emits `owners` metadata per group.", + description = "Analyze a TypeScript/JavaScript project for unused code and circular dependencies. Detects unused files, exports, types, dependencies, enum/class members, unresolved imports, unlisted dependencies, duplicate exports, circular dependencies, boundary violations, stale suppression comments, unused pnpm catalog entries (entries in pnpm-workspace.yaml `catalog:` / `catalogs:` not referenced by any workspace package), unresolved catalog references (workspace package.json declares `catalog:` but the catalog has no entry), unused pnpm dependency overrides (`pnpm-workspace.yaml#overrides` or `package.json#pnpm.overrides` forces a version no workspace package depends on; may be an intentional transitive CVE pin, flagged via a hint), and misconfigured pnpm dependency overrides (unparsable key or empty value; pnpm install will reject). Private type leaks are an opt-in API hygiene check via issue_types: [\"private-type-leaks\"]. Returns structured JSON with all issues found, grouped by issue type. For code duplication use find_dupes, for complexity hotspots use check_health. Supports baseline comparisons (baseline/save_baseline), regression detection (fail_on_regression, tolerance, regression_baseline, save_regression_baseline), and performance tuning (no_cache, threads). Set boundary_violations=true to check only architecture boundary violations (convenience alias for issue_types: [\"boundary-violations\"]). Set group_by to \"owner\" (CODEOWNERS), \"directory\", \"package\" (workspace), or \"section\" to group results. The `section` mode reads GitLab CODEOWNERS `[Section]` headers and emits `owners` metadata per group.", annotations(read_only_hint = true, open_world_hint = true) )] async fn analyze(&self, params: Parameters) -> Result { diff --git a/crates/mcp/src/server/tests/params.rs b/crates/mcp/src/server/tests/params.rs index 06022c8bf..1e04027fc 100644 --- a/crates/mcp/src/server/tests/params.rs +++ b/crates/mcp/src/server/tests/params.rs @@ -3,7 +3,7 @@ use crate::tools::ISSUE_TYPE_FLAGS; #[test] fn issue_type_flags_are_complete() { - assert_eq!(ISSUE_TYPE_FLAGS.len(), 15); + assert_eq!(ISSUE_TYPE_FLAGS.len(), 17); for &(name, flag) in ISSUE_TYPE_FLAGS { assert!( flag.starts_with("--"), diff --git a/crates/mcp/src/tools/mod.rs b/crates/mcp/src/tools/mod.rs index 793f7369b..a9f12eae7 100644 --- a/crates/mcp/src/tools/mod.rs +++ b/crates/mcp/src/tools/mod.rs @@ -122,6 +122,14 @@ pub const ISSUE_TYPE_FLAGS: &[(&str, &str)] = &[ "unresolved-catalog-references", "--unresolved-catalog-references", ), + ( + "unused-dependency-overrides", + "--unused-dependency-overrides", + ), + ( + "misconfigured-dependency-overrides", + "--misconfigured-dependency-overrides", + ), ]; /// Valid detection modes for the `find_dupes` tool. diff --git a/crates/napi/src/lib.rs b/crates/napi/src/lib.rs index d5379ed00..fef32e1b2 100644 --- a/crates/napi/src/lib.rs +++ b/crates/napi/src/lib.rs @@ -30,6 +30,8 @@ pub struct DeadCodeOptions { pub stale_suppressions: Option, pub unused_catalog_entries: Option, pub unresolved_catalog_references: Option, + pub unused_dependency_overrides: Option, + pub misconfigured_dependency_overrides: Option, pub files: Option>, pub include_entry_exports: Option, } @@ -250,6 +252,10 @@ impl TryFrom for programmatic::DeadCodeOptions { stale_suppressions: value.stale_suppressions.unwrap_or(false), unused_catalog_entries: value.unused_catalog_entries.unwrap_or(false), unresolved_catalog_references: value.unresolved_catalog_references.unwrap_or(false), + unused_dependency_overrides: value.unused_dependency_overrides.unwrap_or(false), + misconfigured_dependency_overrides: value + .misconfigured_dependency_overrides + .unwrap_or(false), }, files: value .files diff --git a/crates/types/src/results.rs b/crates/types/src/results.rs index 9206c648d..ecb915600 100644 --- a/crates/types/src/results.rs +++ b/crates/types/src/results.rs @@ -631,6 +631,24 @@ pub enum DependencyOverrideSource { PnpmPackageJson, } +impl DependencyOverrideSource { + /// Stable string label matching the serde rename. Used in baseline keys, + /// audit keys, jq comparisons, and `ignoreDependencyOverrides[].source`. + #[must_use] + pub const fn as_label(&self) -> &'static str { + match self { + Self::PnpmWorkspaceYaml => "pnpm-workspace.yaml", + Self::PnpmPackageJson => "package.json", + } + } +} + +impl std::fmt::Display for DependencyOverrideSource { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str(self.as_label()) + } +} + /// An entry in pnpm's `overrides:` map (or the legacy `pnpm.overrides` in /// `package.json`) whose target package is not declared in any workspace /// `package.json`. Conservative static algorithm: no lockfile read, so this diff --git a/docs/output-schema.json b/docs/output-schema.json index 14e5d44b9..b7719fdb6 100644 --- a/docs/output-schema.json +++ b/docs/output-schema.json @@ -350,6 +350,16 @@ "items": { "$ref": "#/definitions/UnresolvedCatalogReference" }, "description": "Workspace package.json references to catalogs (catalog: or catalog:) that do not declare the consumed package. pnpm install will error until the named catalog grows to include the package or the reference is switched / removed." }, + "unused_dependency_overrides": { + "type": "array", + "items": { "$ref": "#/definitions/UnusedDependencyOverride" }, + "description": "Entries in pnpm-workspace.yaml's overrides: section, or package.json's pnpm.overrides block, whose target package no workspace package depends on. Default severity is warn because some entries are intentional pins for transitive CVEs; the hint field flags the cases the conservative algorithm cannot disambiguate." + }, + "misconfigured_dependency_overrides": { + "type": "array", + "items": { "$ref": "#/definitions/MisconfiguredDependencyOverride" }, + "description": "pnpm.overrides entries whose key or value does not parse as a valid override spec (empty key, empty value, malformed selector, unbalanced parent matcher). pnpm install will reject these. Default severity is error." + }, "entry_points": { "$ref": "#/definitions/EntryPoints", "description": "Entry point detection summary. Always present in check output." @@ -1844,7 +1854,7 @@ "properties": { "type": { "type": "string", - "enum": ["remove-export", "delete-file", "remove-dependency", "move-dependency", "remove-enum-member", "remove-class-member", "resolve-import", "install-dependency", "remove-duplicate", "move-to-dev", "refactor-cycle", "refactor-boundary", "export-type", "remove-catalog-entry", "update-catalog-reference", "add-catalog-entry", "remove-catalog-reference"], + "enum": ["remove-export", "delete-file", "remove-dependency", "move-dependency", "remove-enum-member", "remove-class-member", "resolve-import", "install-dependency", "remove-duplicate", "move-to-dev", "refactor-cycle", "refactor-boundary", "export-type", "remove-catalog-entry", "update-catalog-reference", "add-catalog-entry", "remove-catalog-reference", "remove-dependency-override", "fix-dependency-override"], "description": "Kebab-case identifier for the fix action." }, "auto_fixable": { @@ -1954,9 +1964,13 @@ "exports": { "type": "array", "items": { "type": "string" } } } } + }, + { + "type": "object", + "description": "Object value used by `ignoreCatalogReferences` and `ignoreDependencyOverrides` add-to-config actions. For `ignoreDependencyOverrides`: `{ package: string, source: \"pnpm-workspace.yaml\" | \"package.json\" }`. For `ignoreCatalogReferences`: `{ package: string, catalog?: string, consumer?: string }`." } ], - "description": "Value to add to the config key. Shape depends on `config_key`. For scalar config keys (`ignoreDependencies`, others) this is a string such as `\"lodash\"`. For `ignoreExports` this is an array of `{ file, exports }` rule objects so the snippet can be merged into the user's config verbatim." + "description": "Value to add to the config key. Shape depends on `config_key`. For scalar config keys (`ignoreDependencies`, others) this is a string such as `\"lodash\"`. For `ignoreExports` this is an array of `{ file, exports }` rule objects so the snippet can be merged into the user's config verbatim. For `ignoreCatalogReferences` and `ignoreDependencyOverrides` this is an object whose shape matches the rule entry users add to their fallow config." }, "value_schema": { "type": "string", @@ -2648,6 +2662,99 @@ } }, + "UnusedDependencyOverride": { + "type": "object", + "required": ["raw_key", "target_package", "version_range", "source", "path", "line"], + "description": "A pnpm.overrides entry whose target package is not declared in any workspace package.json (directly or as a declared parent in a parent>child override). May still be intentional for a transitive CVE pin; see `hint`.", + "properties": { + "raw_key": { + "type": "string", + "description": "Full original override key as written (e.g. 'react>react-dom', '@types/react@<18')." + }, + "target_package": { + "type": "string", + "description": "Target package the override rewrites (rightmost segment for parent>child keys)." + }, + "parent_package": { + "type": "string", + "description": "Optional parent package (left side of `>`). Omitted for bare-target keys." + }, + "version_constraint": { + "type": "string", + "description": "Optional version selector on the target (e.g. '<18' for '@types/react@<18'). Omitted when absent." + }, + "version_range": { + "type": "string", + "description": "Right-hand side of the entry: the version pnpm should force." + }, + "source": { + "type": "string", + "enum": ["pnpm-workspace.yaml", "package.json"], + "description": "File the override was declared in. Matches the value users write in `ignoreDependencyOverrides[].source`." + }, + "path": { + "type": "string", + "description": "Relative path to the source file." + }, + "line": { + "type": "integer", + "description": "1-based line number of the entry." + }, + "hint": { + "type": "string", + "description": "Soft hint for cases the conservative algorithm cannot disambiguate (e.g. a transitive CVE pin not visible to static analysis). Omitted when absent." + }, + "actions": { + "type": "array", + "items": { "$ref": "#/definitions/IssueAction" } + }, + "introduced": { + "$ref": "#/definitions/AuditIntroduced" + } + } + }, + + "MisconfiguredDependencyOverride": { + "type": "object", + "required": ["raw_key", "raw_value", "reason", "source", "path", "line"], + "description": "A pnpm.overrides entry whose key or value does not parse as a valid pnpm override spec. `pnpm install` will reject these.", + "properties": { + "raw_key": { + "type": "string", + "description": "Full original override key as written." + }, + "raw_value": { + "type": "string", + "description": "Right-hand side of the entry, exactly as written. Empty when the value was missing." + }, + "reason": { + "type": "string", + "enum": ["unparsable-key", "empty-value"], + "description": "Classifier for the misconfiguration. 'unparsable-key' = the key is not a valid pnpm shape; 'empty-value' = the value is missing, empty, or contains line breaks." + }, + "source": { + "type": "string", + "enum": ["pnpm-workspace.yaml", "package.json"], + "description": "File the override was declared in." + }, + "path": { + "type": "string", + "description": "Relative path to the source file." + }, + "line": { + "type": "integer", + "description": "1-based line number of the entry." + }, + "actions": { + "type": "array", + "items": { "$ref": "#/definitions/IssueAction" } + }, + "introduced": { + "$ref": "#/definitions/AuditIntroduced" + } + } + }, + "CloneGroup": { "type": "object", "required": ["instances", "token_count", "line_count"], @@ -2860,7 +2967,9 @@ "boundary_violations": { "type": "integer" }, "stale_suppressions": { "type": "integer" }, "unused_catalog_entries": { "type": "integer" }, - "unresolved_catalog_references": { "type": "integer" } + "unresolved_catalog_references": { "type": "integer" }, + "unused_dependency_overrides": { "type": "integer" }, + "misconfigured_dependency_overrides": { "type": "integer" } } }, diff --git a/editors/vscode/dist/extension.js b/editors/vscode/dist/extension.js index 21cbc0e9b..1dc3ae66e 100644 --- a/editors/vscode/dist/extension.js +++ b/editors/vscode/dist/extension.js @@ -1,4 +1,4 @@ -Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`vscode`);l=c(l);let u=require(`node:fs`);u=c(u);let d=require(`node:path`);d=c(d);let f=require(`node:os`);f=c(f);let p=require(`node:child_process`);p=c(p);let m=require(`node:crypto`),h=require(`node:https`);h=c(h);const g=e=>e?e.unused_files.length+e.unused_exports.length+e.unused_types.length+(e.private_type_leaks?.length??0)+e.unused_dependencies.length+e.unused_dev_dependencies.length+(e.unused_optional_dependencies?.length??0)+e.unused_enum_members.length+e.unused_class_members.length+e.unresolved_imports.length+e.unlisted_dependencies.length+e.duplicate_exports.length+(e.type_only_dependencies?.length??0)+(e.test_only_dependencies?.length??0)+(e.circular_dependencies?.length??0)+(e.boundary_violations?.length??0)+(e.stale_suppressions?.length??0)+(e.unused_catalog_entries?.length??0)+(e.unresolved_catalog_references?.length??0):0;var _=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.asPromise=e.thenable=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(e){return e===!0||e===!1}e.boolean=t;function n(e){return typeof e==`string`||e instanceof String}e.string=n;function r(e){return typeof e==`number`||e instanceof Number}e.number=r;function i(e){return e instanceof Error}e.error=i;function a(e){return typeof e==`function`}e.func=a;function o(e){return Array.isArray(e)}e.array=o;function s(e){return o(e)&&e.every(e=>n(e))}e.stringArray=s;function c(e,t){return Array.isArray(e)&&e.every(t)}e.typedArray=c;function l(e){return e&&a(e.then)}e.thenable=l;function u(e){return e instanceof Promise?e:l(e)?new Promise((t,n)=>{e.then(e=>t(e),e=>n(e))}):Promise.resolve(e)}e.asPromise=u})),v=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(e){return e===!0||e===!1}e.boolean=t;function n(e){return typeof e==`string`||e instanceof String}e.string=n;function r(e){return typeof e==`number`||e instanceof Number}e.number=r;function i(e){return e instanceof Error}e.error=i;function a(e){return typeof e==`function`}e.func=a;function o(e){return Array.isArray(e)}e.array=o;function s(e){return o(e)&&e.every(e=>n(e))}e.stringArray=s})),y=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;let t=v();var n;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(n||(e.ErrorCodes=n={})),e.ResponseError=class e extends Error{constructor(r,i,a){super(i),this.code=t.number(r)?r:n.UnknownErrorCode,this.data=a,Object.setPrototypeOf(this,e.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};var r=class e{constructor(e){this.kind=e}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};e.ParameterStructures=r,r.auto=new r(`auto`),r.byPosition=new r(`byPosition`),r.byName=new r(`byName`);var i=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return r.auto}};e.AbstractMessageSignature=i,e.RequestType0=class extends i{constructor(e){super(e,0)}},e.RequestType=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends i{constructor(e){super(e,2)}},e.RequestType3=class extends i{constructor(e){super(e,3)}},e.RequestType4=class extends i{constructor(e){super(e,4)}},e.RequestType5=class extends i{constructor(e){super(e,5)}},e.RequestType6=class extends i{constructor(e){super(e,6)}},e.RequestType7=class extends i{constructor(e){super(e,7)}},e.RequestType8=class extends i{constructor(e){super(e,8)}},e.RequestType9=class extends i{constructor(e){super(e,9)}},e.NotificationType=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends i{constructor(e){super(e,0)}},e.NotificationType1=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends i{constructor(e){super(e,2)}},e.NotificationType3=class extends i{constructor(e){super(e,3)}},e.NotificationType4=class extends i{constructor(e){super(e,4)}},e.NotificationType5=class extends i{constructor(e){super(e,5)}},e.NotificationType6=class extends i{constructor(e){super(e,6)}},e.NotificationType7=class extends i{constructor(e){super(e,7)}},e.NotificationType8=class extends i{constructor(e){super(e,8)}},e.NotificationType9=class extends i{constructor(e){super(e,9)}};var a;(function(e){function n(e){let n=e;return n&&t.string(n.method)&&(t.string(n.id)||t.number(n.id))}e.isRequest=n;function r(e){let n=e;return n&&t.string(n.method)&&e.id===void 0}e.isNotification=r;function i(e){let n=e;return n&&(n.result!==void 0||!!n.error)&&(t.string(n.id)||t.number(n.id)||n.id===null)}e.isResponse=i})(a||(e.Message=a={}))})),b=o((e=>{var t;Object.defineProperty(e,`__esModule`,{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var n;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(n||(e.Touch=n={}));var r=class{constructor(){this[t]=`LinkedMap`,this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=n.None){let r=this._map.get(e);if(r)return t!==n.None&&this.touch(r,t),r.value}set(e,t,r=n.None){let i=this._map.get(e);if(i)i.value=t,r!==n.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case n.None:this.addItemLast(i);break;case n.First:this.addItemFirst(i);break;case n.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error(`Invalid list`);let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw Error(`LinkedMap got modified during iteration.`);r=r.next}}keys(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.key,done:!1};return t=t.next,e}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.value,done:!1};return t=t.next,e}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:[t.key,t.value],done:!1};return t=t.next,e}else return{value:void 0,done:!0}}};return n}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw Error(`Invalid list`);this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw Error(`Invalid list`);this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw Error(`Invalid list`);e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw Error(`Invalid list`);e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,n=e.previous;if(!t||!n)throw Error(`Invalid list`);t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw Error(`Invalid list`);if(!(t!==n.First&&t!==n.Last)){if(t===n.First){if(e===this._head)return;let t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===n.Last){if(e===this._tail)return;let t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}};e.LinkedMap=r,e.LRUCache=class extends r{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=n.AsNew){return super.get(e,t)}peek(e){return super.get(e,n.None)}set(e,t){return super.set(e,t,n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),x=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Disposable=void 0;var t;(function(e){function t(e){return{dispose:e}}e.create=t})(t||(e.Disposable=t={}))})),S=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t;function n(){if(t===void 0)throw Error(`No runtime abstraction layer installed`);return t}(function(e){function n(e){if(e===void 0)throw Error(`No runtime abstraction layer provided`);t=e}e.install=n})(n||={}),e.default=n})),C=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Emitter=e.Event=void 0;let t=S();var n;(function(e){let t={dispose(){}};e.None=function(){return t}})(n||(e.Event=n={}));var r=class{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r{this._callbacks||=new r,this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let a={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),a.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(a),a},this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&=(this._callbacks.dispose(),void 0)}};e.Emitter=i,i._noop=function(){}})),w=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;let t=S(),n=v(),r=C();var i;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None});function t(t){let r=t;return r&&(r===e.None||r===e.Cancelled||n.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}e.is=t})(i||(e.CancellationToken=i={}));let a=Object.freeze(function(e,n){let r=(0,t.default)().timer.setTimeout(e.bind(n),0);return{dispose(){r.dispose()}}});var o=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||=new r.Emitter,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),void 0)}};e.CancellationTokenSource=class{get token(){return this._token||=new o,this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=i.None}}})),T=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;let t=w();var n;(function(e){e.Continue=0,e.Cancelled=1})(n||={}),e.SharedArraySenderStrategy=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=n.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,n.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};var r=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===n.Cancelled}get onCancellationRequested(){throw Error(`Cancellation over SharedArrayBuffer doesn't support cancellation events`)}},i=class{constructor(e){this.token=new r(e)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{constructor(){this.kind=`request`}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new t.CancellationTokenSource:new i(n)}}})),E=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Semaphore=void 0;let t=S();e.Semaphore=class{constructor(e=1){if(e<=0)throw Error(`Capacity must be greater than 0`);this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error(`To many thunks active`);try{let t=e.thunk();t instanceof Promise?t.then(t=>{this._active--,e.resolve(t),this.runNext()},t=>{this._active--,e.reject(t),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}})),D=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;let t=S(),n=v(),r=C(),i=E();var a;(function(e){function t(e){let t=e;return t&&n.func(t.listen)&&n.func(t.dispose)&&n.func(t.onError)&&n.func(t.onClose)&&n.func(t.onPartialMessage)}e.is=t})(a||(e.MessageReader=a={}));var o=class{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter,this.partialMessageEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:Error(`Reader received error. Reason: ${n.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageReader=o;var s;(function(e){function n(e){let n,r,i=new Map,a,o=new Map;if(e===void 0||typeof e==`string`)n=e??`utf-8`;else{if(n=e.charset??`utf-8`,e.contentDecoder!==void 0&&(r=e.contentDecoder,i.set(r.name,r)),e.contentDecoders!==void 0)for(let t of e.contentDecoders)i.set(t.name,t);if(e.contentTypeDecoder!==void 0&&(a=e.contentTypeDecoder,o.set(a.name,a)),e.contentTypeDecoders!==void 0)for(let t of e.contentTypeDecoders)o.set(t.name,t)}return a===void 0&&(a=(0,t.default)().applicationJson.decoder,o.set(a.name,a)),{charset:n,contentDecoder:r,contentDecoders:i,contentTypeDecoder:a,contentTypeDecoders:o}}e.fromOptions=n})(s||={}),e.ReadableStreamMessageReader=class extends o{constructor(e,n){super(),this.readable=e,this.options=s.fromOptions(n),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(e=>{this.onData(e)});return this.readable.onError(e=>this.fireError(e)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let e=this.buffer.tryReadHeaders(!0);if(!e)return;let t=e.get(`content-length`);if(!t){this.fireError(Error(`Header must provide a Content-Length property.\n${JSON.stringify(Object.fromEntries(e))}`));return}let n=parseInt(t);if(isNaN(n)){this.fireError(Error(`Content-Length value must be a number. Got ${t}`));return}this.nextMessageLength=n}let e=this.buffer.tryReadBody(this.nextMessageLength);if(e===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let t=this.options.contentDecoder===void 0?e:await this.options.contentDecoder.decode(e),n=await this.options.contentTypeDecoder.decode(t,this.options);this.callback(n)}).catch(e=>{this.fireError(e)})}}catch(e){this.fireError(e)}}clearPartialMessageTimer(){this.partialMessageTimer&&=(this.partialMessageTimer.dispose(),void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}})),O=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;let t=S(),n=v(),r=E(),i=C();var a;(function(e){function t(e){let t=e;return t&&n.func(t.dispose)&&n.func(t.onClose)&&n.func(t.onError)&&n.func(t.write)}e.is=t})(a||(e.MessageWriter=a={}));var o=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:Error(`Writer received error. Reason: ${n.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageWriter=o;var s;(function(e){function n(e){return e===void 0||typeof e==`string`?{charset:e??`utf-8`,contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:e.charset??`utf-8`,contentEncoder:e.contentEncoder,contentTypeEncoder:e.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}e.fromOptions=n})(s||={}),e.WriteableStreamMessageWriter=class extends o{constructor(e,t){super(),this.writable=e,this.options=s.fromOptions(t),this.errorCount=0,this.writeSemaphore=new r.Semaphore(1),this.writable.onError(e=>this.fireError(e)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(e=>this.options.contentEncoder===void 0?e:this.options.contentEncoder.encode(e)).then(t=>{let n=[];return n.push(`Content-Length: `,t.byteLength.toString(),`\r +Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`vscode`);l=c(l);let u=require(`node:fs`);u=c(u);let d=require(`node:path`);d=c(d);let f=require(`node:os`);f=c(f);let p=require(`node:child_process`);p=c(p);let m=require(`node:crypto`),h=require(`node:https`);h=c(h);const g=e=>e?e.unused_files.length+e.unused_exports.length+e.unused_types.length+(e.private_type_leaks?.length??0)+e.unused_dependencies.length+e.unused_dev_dependencies.length+(e.unused_optional_dependencies?.length??0)+e.unused_enum_members.length+e.unused_class_members.length+e.unresolved_imports.length+e.unlisted_dependencies.length+e.duplicate_exports.length+(e.type_only_dependencies?.length??0)+(e.test_only_dependencies?.length??0)+(e.circular_dependencies?.length??0)+(e.boundary_violations?.length??0)+(e.stale_suppressions?.length??0)+(e.unused_catalog_entries?.length??0)+(e.unresolved_catalog_references?.length??0)+(e.unused_dependency_overrides?.length??0)+(e.misconfigured_dependency_overrides?.length??0):0;var _=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.asPromise=e.thenable=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(e){return e===!0||e===!1}e.boolean=t;function n(e){return typeof e==`string`||e instanceof String}e.string=n;function r(e){return typeof e==`number`||e instanceof Number}e.number=r;function i(e){return e instanceof Error}e.error=i;function a(e){return typeof e==`function`}e.func=a;function o(e){return Array.isArray(e)}e.array=o;function s(e){return o(e)&&e.every(e=>n(e))}e.stringArray=s;function c(e,t){return Array.isArray(e)&&e.every(t)}e.typedArray=c;function l(e){return e&&a(e.then)}e.thenable=l;function u(e){return e instanceof Promise?e:l(e)?new Promise((t,n)=>{e.then(e=>t(e),e=>n(e))}):Promise.resolve(e)}e.asPromise=u})),v=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(e){return e===!0||e===!1}e.boolean=t;function n(e){return typeof e==`string`||e instanceof String}e.string=n;function r(e){return typeof e==`number`||e instanceof Number}e.number=r;function i(e){return e instanceof Error}e.error=i;function a(e){return typeof e==`function`}e.func=a;function o(e){return Array.isArray(e)}e.array=o;function s(e){return o(e)&&e.every(e=>n(e))}e.stringArray=s})),y=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;let t=v();var n;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(n||(e.ErrorCodes=n={})),e.ResponseError=class e extends Error{constructor(r,i,a){super(i),this.code=t.number(r)?r:n.UnknownErrorCode,this.data=a,Object.setPrototypeOf(this,e.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};var r=class e{constructor(e){this.kind=e}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};e.ParameterStructures=r,r.auto=new r(`auto`),r.byPosition=new r(`byPosition`),r.byName=new r(`byName`);var i=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return r.auto}};e.AbstractMessageSignature=i,e.RequestType0=class extends i{constructor(e){super(e,0)}},e.RequestType=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends i{constructor(e){super(e,2)}},e.RequestType3=class extends i{constructor(e){super(e,3)}},e.RequestType4=class extends i{constructor(e){super(e,4)}},e.RequestType5=class extends i{constructor(e){super(e,5)}},e.RequestType6=class extends i{constructor(e){super(e,6)}},e.RequestType7=class extends i{constructor(e){super(e,7)}},e.RequestType8=class extends i{constructor(e){super(e,8)}},e.RequestType9=class extends i{constructor(e){super(e,9)}},e.NotificationType=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends i{constructor(e){super(e,0)}},e.NotificationType1=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends i{constructor(e){super(e,2)}},e.NotificationType3=class extends i{constructor(e){super(e,3)}},e.NotificationType4=class extends i{constructor(e){super(e,4)}},e.NotificationType5=class extends i{constructor(e){super(e,5)}},e.NotificationType6=class extends i{constructor(e){super(e,6)}},e.NotificationType7=class extends i{constructor(e){super(e,7)}},e.NotificationType8=class extends i{constructor(e){super(e,8)}},e.NotificationType9=class extends i{constructor(e){super(e,9)}};var a;(function(e){function n(e){let n=e;return n&&t.string(n.method)&&(t.string(n.id)||t.number(n.id))}e.isRequest=n;function r(e){let n=e;return n&&t.string(n.method)&&e.id===void 0}e.isNotification=r;function i(e){let n=e;return n&&(n.result!==void 0||!!n.error)&&(t.string(n.id)||t.number(n.id)||n.id===null)}e.isResponse=i})(a||(e.Message=a={}))})),b=o((e=>{var t;Object.defineProperty(e,`__esModule`,{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var n;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(n||(e.Touch=n={}));var r=class{constructor(){this[t]=`LinkedMap`,this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=n.None){let r=this._map.get(e);if(r)return t!==n.None&&this.touch(r,t),r.value}set(e,t,r=n.None){let i=this._map.get(e);if(i)i.value=t,r!==n.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case n.None:this.addItemLast(i);break;case n.First:this.addItemFirst(i);break;case n.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error(`Invalid list`);let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw Error(`LinkedMap got modified during iteration.`);r=r.next}}keys(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.key,done:!1};return t=t.next,e}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.value,done:!1};return t=t.next,e}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:[t.key,t.value],done:!1};return t=t.next,e}else return{value:void 0,done:!0}}};return n}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw Error(`Invalid list`);this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw Error(`Invalid list`);this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw Error(`Invalid list`);e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw Error(`Invalid list`);e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,n=e.previous;if(!t||!n)throw Error(`Invalid list`);t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw Error(`Invalid list`);if(!(t!==n.First&&t!==n.Last)){if(t===n.First){if(e===this._head)return;let t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===n.Last){if(e===this._tail)return;let t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}};e.LinkedMap=r,e.LRUCache=class extends r{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=n.AsNew){return super.get(e,t)}peek(e){return super.get(e,n.None)}set(e,t){return super.set(e,t,n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),x=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Disposable=void 0;var t;(function(e){function t(e){return{dispose:e}}e.create=t})(t||(e.Disposable=t={}))})),S=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t;function n(){if(t===void 0)throw Error(`No runtime abstraction layer installed`);return t}(function(e){function n(e){if(e===void 0)throw Error(`No runtime abstraction layer provided`);t=e}e.install=n})(n||={}),e.default=n})),C=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Emitter=e.Event=void 0;let t=S();var n;(function(e){let t={dispose(){}};e.None=function(){return t}})(n||(e.Event=n={}));var r=class{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r{this._callbacks||=new r,this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let a={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),a.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(a),a},this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&=(this._callbacks.dispose(),void 0)}};e.Emitter=i,i._noop=function(){}})),w=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;let t=S(),n=v(),r=C();var i;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None});function t(t){let r=t;return r&&(r===e.None||r===e.Cancelled||n.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}e.is=t})(i||(e.CancellationToken=i={}));let a=Object.freeze(function(e,n){let r=(0,t.default)().timer.setTimeout(e.bind(n),0);return{dispose(){r.dispose()}}});var o=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||=new r.Emitter,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),void 0)}};e.CancellationTokenSource=class{get token(){return this._token||=new o,this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=i.None}}})),T=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;let t=w();var n;(function(e){e.Continue=0,e.Cancelled=1})(n||={}),e.SharedArraySenderStrategy=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=n.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,n.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};var r=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===n.Cancelled}get onCancellationRequested(){throw Error(`Cancellation over SharedArrayBuffer doesn't support cancellation events`)}},i=class{constructor(e){this.token=new r(e)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{constructor(){this.kind=`request`}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new t.CancellationTokenSource:new i(n)}}})),E=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Semaphore=void 0;let t=S();e.Semaphore=class{constructor(e=1){if(e<=0)throw Error(`Capacity must be greater than 0`);this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error(`To many thunks active`);try{let t=e.thunk();t instanceof Promise?t.then(t=>{this._active--,e.resolve(t),this.runNext()},t=>{this._active--,e.reject(t),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}})),D=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;let t=S(),n=v(),r=C(),i=E();var a;(function(e){function t(e){let t=e;return t&&n.func(t.listen)&&n.func(t.dispose)&&n.func(t.onError)&&n.func(t.onClose)&&n.func(t.onPartialMessage)}e.is=t})(a||(e.MessageReader=a={}));var o=class{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter,this.partialMessageEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:Error(`Reader received error. Reason: ${n.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageReader=o;var s;(function(e){function n(e){let n,r,i=new Map,a,o=new Map;if(e===void 0||typeof e==`string`)n=e??`utf-8`;else{if(n=e.charset??`utf-8`,e.contentDecoder!==void 0&&(r=e.contentDecoder,i.set(r.name,r)),e.contentDecoders!==void 0)for(let t of e.contentDecoders)i.set(t.name,t);if(e.contentTypeDecoder!==void 0&&(a=e.contentTypeDecoder,o.set(a.name,a)),e.contentTypeDecoders!==void 0)for(let t of e.contentTypeDecoders)o.set(t.name,t)}return a===void 0&&(a=(0,t.default)().applicationJson.decoder,o.set(a.name,a)),{charset:n,contentDecoder:r,contentDecoders:i,contentTypeDecoder:a,contentTypeDecoders:o}}e.fromOptions=n})(s||={}),e.ReadableStreamMessageReader=class extends o{constructor(e,n){super(),this.readable=e,this.options=s.fromOptions(n),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(e=>{this.onData(e)});return this.readable.onError(e=>this.fireError(e)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let e=this.buffer.tryReadHeaders(!0);if(!e)return;let t=e.get(`content-length`);if(!t){this.fireError(Error(`Header must provide a Content-Length property.\n${JSON.stringify(Object.fromEntries(e))}`));return}let n=parseInt(t);if(isNaN(n)){this.fireError(Error(`Content-Length value must be a number. Got ${t}`));return}this.nextMessageLength=n}let e=this.buffer.tryReadBody(this.nextMessageLength);if(e===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let t=this.options.contentDecoder===void 0?e:await this.options.contentDecoder.decode(e),n=await this.options.contentTypeDecoder.decode(t,this.options);this.callback(n)}).catch(e=>{this.fireError(e)})}}catch(e){this.fireError(e)}}clearPartialMessageTimer(){this.partialMessageTimer&&=(this.partialMessageTimer.dispose(),void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}})),O=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;let t=S(),n=v(),r=E(),i=C();var a;(function(e){function t(e){let t=e;return t&&n.func(t.dispose)&&n.func(t.onClose)&&n.func(t.onError)&&n.func(t.write)}e.is=t})(a||(e.MessageWriter=a={}));var o=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:Error(`Writer received error. Reason: ${n.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageWriter=o;var s;(function(e){function n(e){return e===void 0||typeof e==`string`?{charset:e??`utf-8`,contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:e.charset??`utf-8`,contentEncoder:e.contentEncoder,contentTypeEncoder:e.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}e.fromOptions=n})(s||={}),e.WriteableStreamMessageWriter=class extends o{constructor(e,t){super(),this.writable=e,this.options=s.fromOptions(t),this.errorCount=0,this.writeSemaphore=new r.Semaphore(1),this.writable.onError(e=>this.fireError(e)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(e=>this.options.contentEncoder===void 0?e:this.options.contentEncoder.encode(e)).then(t=>{let n=[];return n.push(`Content-Length: `,t.byteLength.toString(),`\r `),n.push(`\r `),this.doWrite(e,n,t)},e=>{throw this.fireError(e),e}))}async doWrite(e,t,n){try{return await this.writable.write(t.join(``),`ascii`),this.writable.write(n)}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}})),k=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AbstractMessageBuffer=void 0,e.AbstractMessageBuffer=class{constructor(e=`utf-8`){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e==`string`?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,n=0,r=0,i=0;row:for(;nthis._totalLength)throw Error(`Cannot read so many bytes!`);if(this._chunks[0].byteLength===e){let t=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(t)}if(this._chunks[0].byteLength>e){let t=this._chunks[0],n=this.asNative(t,e);return this._chunks[0]=t.slice(e),this._totalLength-=e,n}let t=this.allocNative(e),n=0;for(;e>0;){let r=this._chunks[0];if(r.byteLength>e){let i=r.slice(0,e);t.set(i,n),n+=e,this._chunks[0]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}}})),A=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;let t=S(),n=v(),r=y(),i=b(),a=C(),o=w();var s;(function(e){e.type=new r.NotificationType(`$/cancelRequest`)})(s||={});var c;(function(e){function t(e){return typeof e==`string`||typeof e==`number`}e.is=t})(c||(e.ProgressToken=c={}));var l;(function(e){e.type=new r.NotificationType(`$/progress`)})(l||={}),e.ProgressType=class{constructor(){}};var u;(function(e){function t(e){return n.func(e)}e.is=t})(u||={}),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var d;(function(e){e[e.Off=0]=`Off`,e[e.Messages=1]=`Messages`,e[e.Compact=2]=`Compact`,e[e.Verbose=3]=`Verbose`})(d||(e.Trace=d={}));var f;(function(e){e.Off=`off`,e.Messages=`messages`,e.Compact=`compact`,e.Verbose=`verbose`})(f||(e.TraceValues=f={})),(function(e){function t(t){if(!n.string(t))return e.Off;switch(t=t.toLowerCase(),t){case`off`:return e.Off;case`messages`:return e.Messages;case`compact`:return e.Compact;case`verbose`:return e.Verbose;default:return e.Off}}e.fromString=t;function r(t){switch(t){case e.Off:return`off`;case e.Messages:return`messages`;case e.Compact:return`compact`;case e.Verbose:return`verbose`;default:return`off`}}e.toString=r})(d||(e.Trace=d={}));var p;(function(e){e.Text=`text`,e.JSON=`json`})(p||(e.TraceFormat=p={})),(function(e){function t(t){return n.string(t)?(t=t.toLowerCase(),t===`json`?e.JSON:e.Text):e.Text}e.fromString=t})(p||(e.TraceFormat=p={}));var m;(function(e){e.type=new r.NotificationType(`$/setTrace`)})(m||(e.SetTraceNotification=m={}));var h;(function(e){e.type=new r.NotificationType(`$/logTrace`)})(h||(e.LogTraceNotification=h={}));var g;(function(e){e[e.Closed=1]=`Closed`,e[e.Disposed=2]=`Disposed`,e[e.AlreadyListening=3]=`AlreadyListening`})(g||(e.ConnectionErrors=g={}));var _=class e extends Error{constructor(t,n){super(n),this.code=t,Object.setPrototypeOf(this,e.prototype)}};e.ConnectionError=_;var x;(function(e){function t(e){let t=e;return t&&n.func(t.cancelUndispatched)}e.is=t})(x||(e.ConnectionStrategy=x={}));var T;(function(e){function t(e){let t=e;return t&&(t.kind===void 0||t.kind===`id`)&&n.func(t.createCancellationTokenSource)&&(t.dispose===void 0||n.func(t.dispose))}e.is=t})(T||(e.IdCancellationReceiverStrategy=T={}));var E;(function(e){function t(e){let t=e;return t&&t.kind===`request`&&n.func(t.createCancellationTokenSource)&&(t.dispose===void 0||n.func(t.dispose))}e.is=t})(E||(e.RequestCancellationReceiverStrategy=E={}));var D;(function(e){e.Message=Object.freeze({createCancellationTokenSource(e){return new o.CancellationTokenSource}});function t(e){return T.is(e)||E.is(e)}e.is=t})(D||(e.CancellationReceiverStrategy=D={}));var O;(function(e){e.Message=Object.freeze({sendCancellation(e,t){return e.sendNotification(s.type,{id:t})},cleanup(e){}});function t(e){let t=e;return t&&n.func(t.sendCancellation)&&n.func(t.cleanup)}e.is=t})(O||(e.CancellationSenderStrategy=O={}));var k;(function(e){e.Message=Object.freeze({receiver:D.Message,sender:O.Message});function t(e){let t=e;return t&&D.is(t.receiver)&&O.is(t.sender)}e.is=t})(k||(e.CancellationStrategy=k={}));var A;(function(e){function t(e){let t=e;return t&&n.func(t.handleMessage)}e.is=t})(A||(e.MessageStrategy=A={}));var j;(function(e){function t(e){let t=e;return t&&(k.is(t.cancellationStrategy)||x.is(t.connectionStrategy)||A.is(t.messageStrategy))}e.is=t})(j||(e.ConnectionOptions=j={}));var M;(function(e){e[e.New=1]=`New`,e[e.Listening=2]=`Listening`,e[e.Closed=3]=`Closed`,e[e.Disposed=4]=`Disposed`})(M||={});function N(f,v,y,b){let x=y===void 0?e.NullLogger:y,S=0,C=0,w=0,E,D=new Map,O,j=new Map,N=new Map,P,ee=new i.LinkedMap,F=new Map,te=new Set,ne=new Map,I=d.Off,L=p.Text,R,re=M.New,ie=new a.Emitter,z=new a.Emitter,B=new a.Emitter,V=new a.Emitter,ae=new a.Emitter,H=b&&b.cancellationStrategy?b.cancellationStrategy:k.Message;function oe(e){if(e===null)throw Error(`Can't send requests with id null since the response can't be correlated.`);return`req-`+e.toString()}function se(e){return e===null?`res-unknown-`+(++w).toString():`res-`+e.toString()}function ce(){return`not-`+(++C).toString()}function le(e,t){r.Message.isRequest(t)?e.set(oe(t.id),t):r.Message.isResponse(t)?e.set(se(t.id),t):e.set(ce(),t)}function U(e){}function ue(){return re===M.Listening}function de(){return re===M.Closed}function fe(){return re===M.Disposed}function pe(){(re===M.New||re===M.Listening)&&(re=M.Closed,z.fire(void 0))}function me(e){ie.fire([e,void 0,void 0])}function he(e){ie.fire(e)}f.onClose(pe),f.onError(me),v.onClose(pe),v.onError(he);function ge(){P||ee.size===0||(P=(0,t.default)().timer.setImmediate(()=>{P=void 0,W()}))}function _e(e){r.Message.isRequest(e)?ye(e):r.Message.isNotification(e)?xe(e):r.Message.isResponse(e)?be(e):Se(e)}function W(){if(ee.size===0)return;let e=ee.shift();try{let t=b?.messageStrategy;A.is(t)?t.handleMessage(e,_e):_e(e)}finally{ge()}}let ve=e=>{try{if(r.Message.isNotification(e)&&e.method===s.type.method){let t=e.params.id,n=oe(t),i=ee.get(n);if(r.Message.isRequest(i)){let r=b?.connectionStrategy,a=r&&r.cancelUndispatched?r.cancelUndispatched(i,U):void 0;if(a&&(a.error!==void 0||a.result!==void 0)){ee.delete(n),ne.delete(t),a.id=i.id,q(a,e.method,Date.now()),v.write(a).catch(()=>x.error(`Sending response for canceled message failed.`));return}}let a=ne.get(t);if(a!==void 0){a.cancel(),Te(e);return}else te.add(t)}le(ee,e)}finally{ge()}};function ye(e){if(fe())return;function t(t,n,i){let a={jsonrpc:`2.0`,id:e.id};t instanceof r.ResponseError?a.error=t.toJson():a.result=t===void 0?null:t,q(a,n,i),v.write(a).catch(()=>x.error(`Sending response failed.`))}function i(t,n,r){let i={jsonrpc:`2.0`,id:e.id,error:t.toJson()};q(i,n,r),v.write(i).catch(()=>x.error(`Sending response failed.`))}function a(t,n,r){t===void 0&&(t=null);let i={jsonrpc:`2.0`,id:e.id,result:t};q(i,n,r),v.write(i).catch(()=>x.error(`Sending response failed.`))}we(e);let o=D.get(e.method),s,c;o&&(s=o.type,c=o.handler);let l=Date.now();if(c||E){let o=e.id??String(Date.now()),u=T.is(H.receiver)?H.receiver.createCancellationTokenSource(o):H.receiver.createCancellationTokenSource(e);e.id!==null&&te.has(e.id)&&u.cancel(),e.id!==null&&ne.set(o,u);try{let d;if(c)if(e.params===void 0){if(s!==void 0&&s.numberOfParams!==0){i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines ${s.numberOfParams} params but received none.`),e.method,l);return}d=c(u.token)}else if(Array.isArray(e.params)){if(s!==void 0&&s.parameterStructures===r.ParameterStructures.byName){i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,l);return}d=c(...e.params,u.token)}else{if(s!==void 0&&s.parameterStructures===r.ParameterStructures.byPosition){i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,l);return}d=c(e.params,u.token)}else E&&(d=E(e.method,e.params,u.token));let f=d;d?f.then?f.then(n=>{ne.delete(o),t(n,e.method,l)},t=>{ne.delete(o),t instanceof r.ResponseError?i(t,e.method,l):t&&n.string(t.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,l):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,l)}):(ne.delete(o),t(d,e.method,l)):(ne.delete(o),a(d,e.method,l))}catch(a){ne.delete(o),a instanceof r.ResponseError?t(a,e.method,l):a&&n.string(a.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${a.message}`),e.method,l):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,l)}}else i(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,l)}function be(e){if(!fe())if(e.id===null)e.error?x.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):x.error(`Received response message without id. No further error information provided.`);else{let t=e.id,n=F.get(t);if(Ee(e,n),n!==void 0){F.delete(t);try{if(e.error){let t=e.error;n.reject(new r.ResponseError(t.code,t.message,t.data))}else if(e.result!==void 0)n.resolve(e.result);else throw Error(`Should never happen.`)}catch(e){e.message?x.error(`Response handler '${n.method}' failed with message: ${e.message}`):x.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}function xe(e){if(fe())return;let t,n;if(e.method===s.type.method){let t=e.params.id;te.delete(t),Te(e);return}else{let r=j.get(e.method);r&&(n=r.handler,t=r.type)}if(n||O)try{if(Te(e),n)if(e.params===void 0)t!==void 0&&t.numberOfParams!==0&&t.parameterStructures!==r.ParameterStructures.byName&&x.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),n();else if(Array.isArray(e.params)){let i=e.params;e.method===l.type.method&&i.length===2&&c.is(i[0])?n({token:i[0],value:i[1]}):(t!==void 0&&(t.parameterStructures===r.ParameterStructures.byName&&x.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&x.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${i.length} arguments`)),n(...i))}else t!==void 0&&t.parameterStructures===r.ParameterStructures.byPosition&&x.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params);else O&&O(e.method,e.params)}catch(t){t.message?x.error(`Notification handler '${e.method}' failed with message: ${t.message}`):x.error(`Notification handler '${e.method}' failed unexpectedly.`)}else B.fire(e)}function Se(e){if(!e){x.error(`Received empty message.`);return}x.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(e,null,4)}`);let t=e;if(n.string(t.id)||n.number(t.id)){let e=t.id,n=F.get(e);n&&n.reject(Error(`The received response has neither a result nor an error property.`))}}function G(e){if(e!=null)switch(I){case d.Verbose:return JSON.stringify(e,null,4);case d.Compact:return JSON.stringify(e);default:return}}function K(e){if(!(I===d.Off||!R))if(L===p.Text){let t;(I===d.Verbose||I===d.Compact)&&e.params&&(t=`Params: ${G(e.params)}\n\n`),R.log(`Sending request '${e.method} - (${e.id})'.`,t)}else J(`send-request`,e)}function Ce(e){if(!(I===d.Off||!R))if(L===p.Text){let t;(I===d.Verbose||I===d.Compact)&&(t=e.params?`Params: ${G(e.params)}\n\n`:`No parameters provided. @@ -15,10 +15,10 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object. `,i===`\r`&&r+10&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return o.create(0,e);for(;ne?r=i:n=i+1}var a=n-1;return o.create(a,e-t[a])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1{Object.defineProperty(e,`__esModule`,{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;let t=N();var n;(function(e){e.clientToServer=`clientToServer`,e.serverToClient=`serverToClient`,e.both=`both`})(n||(e.MessageDirection=n={})),e.RegistrationType=class{constructor(e){this.method=e}},e.ProtocolRequestType0=class extends t.RequestType0{constructor(e){super(e)}},e.ProtocolRequestType=class extends t.RequestType{constructor(e){super(e,t.ParameterStructures.byName)}},e.ProtocolNotificationType0=class extends t.NotificationType0{constructor(e){super(e)}},e.ProtocolNotificationType=class extends t.NotificationType{constructor(e){super(e,t.ParameterStructures.byName)}}})),te=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(e){return e===!0||e===!1}e.boolean=t;function n(e){return typeof e==`string`||e instanceof String}e.string=n;function r(e){return typeof e==`number`||e instanceof Number}e.number=r;function i(e){return e instanceof Error}e.error=i;function a(e){return typeof e==`function`}e.func=a;function o(e){return Array.isArray(e)}e.array=o;function s(e){return o(e)&&e.every(e=>n(e))}e.stringArray=s;function c(e,t){return Array.isArray(e)&&e.every(t)}e.typedArray=c;function l(e){return typeof e==`object`&&!!e}e.objectLiteral=l})),ne=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ImplementationRequest=void 0;let t=F();var n;(function(e){e.method=`textDocument/implementation`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.ImplementationRequest=n={}))})),I=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.TypeDefinitionRequest=void 0;let t=F();var n;(function(e){e.method=`textDocument/typeDefinition`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.TypeDefinitionRequest=n={}))})),L=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;let t=F();var n;(function(e){e.method=`workspace/workspaceFolders`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(n||(e.WorkspaceFoldersRequest=n={}));var r;(function(e){e.method=`workspace/didChangeWorkspaceFolders`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(r||(e.DidChangeWorkspaceFoldersNotification=r={}))})),R=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ConfigurationRequest=void 0;let t=F();var n;(function(e){e.method=`workspace/configuration`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(n||(e.ConfigurationRequest=n={}))})),re=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;let t=F();var n;(function(e){e.method=`textDocument/documentColor`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.DocumentColorRequest=n={}));var r;(function(e){e.method=`textDocument/colorPresentation`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.ColorPresentationRequest=r={}))})),ie=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;let t=F();var n;(function(e){e.method=`textDocument/foldingRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.FoldingRangeRequest=n={}));var r;(function(e){e.method=`workspace/foldingRange/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(r||(e.FoldingRangeRefreshRequest=r={}))})),z=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DeclarationRequest=void 0;let t=F();var n;(function(e){e.method=`textDocument/declaration`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.DeclarationRequest=n={}))})),B=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SelectionRangeRequest=void 0;let t=F();var n;(function(e){e.method=`textDocument/selectionRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.SelectionRangeRequest=n={}))})),V=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;let t=N(),n=F();var r;(function(e){e.type=new t.ProgressType;function n(t){return t===e.type}e.is=n})(r||(e.WorkDoneProgress=r={}));var i;(function(e){e.method=`window/workDoneProgress/create`,e.messageDirection=n.MessageDirection.serverToClient,e.type=new n.ProtocolRequestType(e.method)})(i||(e.WorkDoneProgressCreateRequest=i={}));var a;(function(e){e.method=`window/workDoneProgress/cancel`,e.messageDirection=n.MessageDirection.clientToServer,e.type=new n.ProtocolNotificationType(e.method)})(a||(e.WorkDoneProgressCancelNotification=a={}))})),ae=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;let t=F();var n;(function(e){e.method=`textDocument/prepareCallHierarchy`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.CallHierarchyPrepareRequest=n={}));var r;(function(e){e.method=`callHierarchy/incomingCalls`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.CallHierarchyIncomingCallsRequest=r={}));var i;(function(e){e.method=`callHierarchy/outgoingCalls`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.CallHierarchyOutgoingCallsRequest=i={}))})),H=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;let t=F();var n;(function(e){e.Relative=`relative`})(n||(e.TokenFormat=n={}));var r;(function(e){e.method=`textDocument/semanticTokens`,e.type=new t.RegistrationType(e.method)})(r||(e.SemanticTokensRegistrationType=r={}));var i;(function(e){e.method=`textDocument/semanticTokens/full`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method})(i||(e.SemanticTokensRequest=i={}));var a;(function(e){e.method=`textDocument/semanticTokens/full/delta`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method})(a||(e.SemanticTokensDeltaRequest=a={}));var o;(function(e){e.method=`textDocument/semanticTokens/range`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method})(o||(e.SemanticTokensRangeRequest=o={}));var s;(function(e){e.method=`workspace/semanticTokens/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(s||(e.SemanticTokensRefreshRequest=s={}))})),oe=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ShowDocumentRequest=void 0;let t=F();var n;(function(e){e.method=`window/showDocument`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(n||(e.ShowDocumentRequest=n={}))})),se=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LinkedEditingRangeRequest=void 0;let t=F();var n;(function(e){e.method=`textDocument/linkedEditingRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.LinkedEditingRangeRequest=n={}))})),ce=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;let t=F();var n;(function(e){e.file=`file`,e.folder=`folder`})(n||(e.FileOperationPatternKind=n={}));var r;(function(e){e.method=`workspace/willCreateFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.WillCreateFilesRequest=r={}));var i;(function(e){e.method=`workspace/didCreateFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(i||(e.DidCreateFilesNotification=i={}));var a;(function(e){e.method=`workspace/willRenameFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(a||(e.WillRenameFilesRequest=a={}));var o;(function(e){e.method=`workspace/didRenameFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(o||(e.DidRenameFilesNotification=o={}));var s;(function(e){e.method=`workspace/didDeleteFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(s||(e.DidDeleteFilesNotification=s={}));var c;(function(e){e.method=`workspace/willDeleteFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(c||(e.WillDeleteFilesRequest=c={}))})),le=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;let t=F();var n;(function(e){e.document=`document`,e.project=`project`,e.group=`group`,e.scheme=`scheme`,e.global=`global`})(n||(e.UniquenessLevel=n={}));var r;(function(e){e.$import=`import`,e.$export=`export`,e.local=`local`})(r||(e.MonikerKind=r={}));var i;(function(e){e.method=`textDocument/moniker`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.MonikerRequest=i={}))})),U=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;let t=F();var n;(function(e){e.method=`textDocument/prepareTypeHierarchy`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.TypeHierarchyPrepareRequest=n={}));var r;(function(e){e.method=`typeHierarchy/supertypes`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.TypeHierarchySupertypesRequest=r={}));var i;(function(e){e.method=`typeHierarchy/subtypes`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.TypeHierarchySubtypesRequest=i={}))})),ue=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;let t=F();var n;(function(e){e.method=`textDocument/inlineValue`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.InlineValueRequest=n={}));var r;(function(e){e.method=`workspace/inlineValue/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(r||(e.InlineValueRefreshRequest=r={}))})),de=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;let t=F();var n;(function(e){e.method=`textDocument/inlayHint`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.InlayHintRequest=n={}));var r;(function(e){e.method=`inlayHint/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.InlayHintResolveRequest=r={}));var i;(function(e){e.method=`workspace/inlayHint/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(i||(e.InlayHintRefreshRequest=i={}))})),fe=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;let t=N(),n=te(),r=F();var i;(function(e){function t(e){let t=e;return t&&n.boolean(t.retriggerRequest)}e.is=t})(i||(e.DiagnosticServerCancellationData=i={}));var a;(function(e){e.Full=`full`,e.Unchanged=`unchanged`})(a||(e.DocumentDiagnosticReportKind=a={}));var o;(function(e){e.method=`textDocument/diagnostic`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolRequestType(e.method),e.partialResult=new t.ProgressType})(o||(e.DocumentDiagnosticRequest=o={}));var s;(function(e){e.method=`workspace/diagnostic`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolRequestType(e.method),e.partialResult=new t.ProgressType})(s||(e.WorkspaceDiagnosticRequest=s={}));var c;(function(e){e.method=`workspace/diagnostic/refresh`,e.messageDirection=r.MessageDirection.serverToClient,e.type=new r.ProtocolRequestType0(e.method)})(c||(e.DiagnosticRefreshRequest=c={}))})),pe=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;let t=ee(),n=te(),r=F();var i;(function(e){e.Markup=1,e.Code=2;function t(e){return e===1||e===2}e.is=t})(i||(e.NotebookCellKind=i={}));var a;(function(e){function r(e,t){let n={executionOrder:e};return(t===!0||t===!1)&&(n.success=t),n}e.create=r;function i(e){let r=e;return n.objectLiteral(r)&&t.uinteger.is(r.executionOrder)&&(r.success===void 0||n.boolean(r.success))}e.is=i;function a(e,t){return e===t?!0:e==null||t==null?!1:e.executionOrder===t.executionOrder&&e.success===t.success}e.equals=a})(a||(e.ExecutionSummary=a={}));var o;(function(e){function r(e,t){return{kind:e,document:t}}e.create=r;function o(e){let r=e;return n.objectLiteral(r)&&i.is(r.kind)&&t.DocumentUri.is(r.document)&&(r.metadata===void 0||n.objectLiteral(r.metadata))}e.is=o;function s(e,t){let n=new Set;return e.document!==t.document&&n.add(`document`),e.kind!==t.kind&&n.add(`kind`),e.executionSummary!==t.executionSummary&&n.add(`executionSummary`),(e.metadata!==void 0||t.metadata!==void 0)&&!c(e.metadata,t.metadata)&&n.add(`metadata`),(e.executionSummary!==void 0||t.executionSummary!==void 0)&&!a.equals(e.executionSummary,t.executionSummary)&&n.add(`executionSummary`),n}e.diff=s;function c(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`)return!1;let r=Array.isArray(e),i=Array.isArray(t);if(r!==i)return!1;if(r&&i){if(e.length!==t.length)return!1;for(let n=0;n{Object.defineProperty(e,`__esModule`,{value:!0}),e.InlineCompletionRequest=void 0;let t=F();var n;(function(e){e.method=`textDocument/inlineCompletion`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.InlineCompletionRequest=n={}))})),he=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangesFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.InlineCompletionRequest=e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=void 0;let t=F(),n=ee(),r=te(),i=ne();Object.defineProperty(e,`ImplementationRequest`,{enumerable:!0,get:function(){return i.ImplementationRequest}});let a=I();Object.defineProperty(e,`TypeDefinitionRequest`,{enumerable:!0,get:function(){return a.TypeDefinitionRequest}});let o=L();Object.defineProperty(e,`WorkspaceFoldersRequest`,{enumerable:!0,get:function(){return o.WorkspaceFoldersRequest}}),Object.defineProperty(e,`DidChangeWorkspaceFoldersNotification`,{enumerable:!0,get:function(){return o.DidChangeWorkspaceFoldersNotification}});let s=R();Object.defineProperty(e,`ConfigurationRequest`,{enumerable:!0,get:function(){return s.ConfigurationRequest}});let c=re();Object.defineProperty(e,`DocumentColorRequest`,{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(e,`ColorPresentationRequest`,{enumerable:!0,get:function(){return c.ColorPresentationRequest}});let l=ie();Object.defineProperty(e,`FoldingRangeRequest`,{enumerable:!0,get:function(){return l.FoldingRangeRequest}}),Object.defineProperty(e,`FoldingRangeRefreshRequest`,{enumerable:!0,get:function(){return l.FoldingRangeRefreshRequest}});let u=z();Object.defineProperty(e,`DeclarationRequest`,{enumerable:!0,get:function(){return u.DeclarationRequest}});let d=B();Object.defineProperty(e,`SelectionRangeRequest`,{enumerable:!0,get:function(){return d.SelectionRangeRequest}});let f=V();Object.defineProperty(e,`WorkDoneProgress`,{enumerable:!0,get:function(){return f.WorkDoneProgress}}),Object.defineProperty(e,`WorkDoneProgressCreateRequest`,{enumerable:!0,get:function(){return f.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,`WorkDoneProgressCancelNotification`,{enumerable:!0,get:function(){return f.WorkDoneProgressCancelNotification}});let p=ae();Object.defineProperty(e,`CallHierarchyIncomingCallsRequest`,{enumerable:!0,get:function(){return p.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,`CallHierarchyOutgoingCallsRequest`,{enumerable:!0,get:function(){return p.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,`CallHierarchyPrepareRequest`,{enumerable:!0,get:function(){return p.CallHierarchyPrepareRequest}});let m=H();Object.defineProperty(e,`TokenFormat`,{enumerable:!0,get:function(){return m.TokenFormat}}),Object.defineProperty(e,`SemanticTokensRequest`,{enumerable:!0,get:function(){return m.SemanticTokensRequest}}),Object.defineProperty(e,`SemanticTokensDeltaRequest`,{enumerable:!0,get:function(){return m.SemanticTokensDeltaRequest}}),Object.defineProperty(e,`SemanticTokensRangeRequest`,{enumerable:!0,get:function(){return m.SemanticTokensRangeRequest}}),Object.defineProperty(e,`SemanticTokensRefreshRequest`,{enumerable:!0,get:function(){return m.SemanticTokensRefreshRequest}}),Object.defineProperty(e,`SemanticTokensRegistrationType`,{enumerable:!0,get:function(){return m.SemanticTokensRegistrationType}});let h=oe();Object.defineProperty(e,`ShowDocumentRequest`,{enumerable:!0,get:function(){return h.ShowDocumentRequest}});let g=se();Object.defineProperty(e,`LinkedEditingRangeRequest`,{enumerable:!0,get:function(){return g.LinkedEditingRangeRequest}});let _=ce();Object.defineProperty(e,`FileOperationPatternKind`,{enumerable:!0,get:function(){return _.FileOperationPatternKind}}),Object.defineProperty(e,`DidCreateFilesNotification`,{enumerable:!0,get:function(){return _.DidCreateFilesNotification}}),Object.defineProperty(e,`WillCreateFilesRequest`,{enumerable:!0,get:function(){return _.WillCreateFilesRequest}}),Object.defineProperty(e,`DidRenameFilesNotification`,{enumerable:!0,get:function(){return _.DidRenameFilesNotification}}),Object.defineProperty(e,`WillRenameFilesRequest`,{enumerable:!0,get:function(){return _.WillRenameFilesRequest}}),Object.defineProperty(e,`DidDeleteFilesNotification`,{enumerable:!0,get:function(){return _.DidDeleteFilesNotification}}),Object.defineProperty(e,`WillDeleteFilesRequest`,{enumerable:!0,get:function(){return _.WillDeleteFilesRequest}});let v=le();Object.defineProperty(e,`UniquenessLevel`,{enumerable:!0,get:function(){return v.UniquenessLevel}}),Object.defineProperty(e,`MonikerKind`,{enumerable:!0,get:function(){return v.MonikerKind}}),Object.defineProperty(e,`MonikerRequest`,{enumerable:!0,get:function(){return v.MonikerRequest}});let y=U();Object.defineProperty(e,`TypeHierarchyPrepareRequest`,{enumerable:!0,get:function(){return y.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,`TypeHierarchySubtypesRequest`,{enumerable:!0,get:function(){return y.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,`TypeHierarchySupertypesRequest`,{enumerable:!0,get:function(){return y.TypeHierarchySupertypesRequest}});let b=ue();Object.defineProperty(e,`InlineValueRequest`,{enumerable:!0,get:function(){return b.InlineValueRequest}}),Object.defineProperty(e,`InlineValueRefreshRequest`,{enumerable:!0,get:function(){return b.InlineValueRefreshRequest}});let x=de();Object.defineProperty(e,`InlayHintRequest`,{enumerable:!0,get:function(){return x.InlayHintRequest}}),Object.defineProperty(e,`InlayHintResolveRequest`,{enumerable:!0,get:function(){return x.InlayHintResolveRequest}}),Object.defineProperty(e,`InlayHintRefreshRequest`,{enumerable:!0,get:function(){return x.InlayHintRefreshRequest}});let S=fe();Object.defineProperty(e,`DiagnosticServerCancellationData`,{enumerable:!0,get:function(){return S.DiagnosticServerCancellationData}}),Object.defineProperty(e,`DocumentDiagnosticReportKind`,{enumerable:!0,get:function(){return S.DocumentDiagnosticReportKind}}),Object.defineProperty(e,`DocumentDiagnosticRequest`,{enumerable:!0,get:function(){return S.DocumentDiagnosticRequest}}),Object.defineProperty(e,`WorkspaceDiagnosticRequest`,{enumerable:!0,get:function(){return S.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,`DiagnosticRefreshRequest`,{enumerable:!0,get:function(){return S.DiagnosticRefreshRequest}});let C=pe();Object.defineProperty(e,`NotebookCellKind`,{enumerable:!0,get:function(){return C.NotebookCellKind}}),Object.defineProperty(e,`ExecutionSummary`,{enumerable:!0,get:function(){return C.ExecutionSummary}}),Object.defineProperty(e,`NotebookCell`,{enumerable:!0,get:function(){return C.NotebookCell}}),Object.defineProperty(e,`NotebookDocument`,{enumerable:!0,get:function(){return C.NotebookDocument}}),Object.defineProperty(e,`NotebookDocumentSyncRegistrationType`,{enumerable:!0,get:function(){return C.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,`DidOpenNotebookDocumentNotification`,{enumerable:!0,get:function(){return C.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,`NotebookCellArrayChange`,{enumerable:!0,get:function(){return C.NotebookCellArrayChange}}),Object.defineProperty(e,`DidChangeNotebookDocumentNotification`,{enumerable:!0,get:function(){return C.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,`DidSaveNotebookDocumentNotification`,{enumerable:!0,get:function(){return C.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,`DidCloseNotebookDocumentNotification`,{enumerable:!0,get:function(){return C.DidCloseNotebookDocumentNotification}});let w=me();Object.defineProperty(e,`InlineCompletionRequest`,{enumerable:!0,get:function(){return w.InlineCompletionRequest}});var T;(function(e){function t(e){let t=e;return r.string(t)||r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)}e.is=t})(T||(e.TextDocumentFilter=T={}));var E;(function(e){function t(e){let t=e;return r.objectLiteral(t)&&(r.string(t.notebookType)||r.string(t.scheme)||r.string(t.pattern))}e.is=t})(E||(e.NotebookDocumentFilter=E={}));var D;(function(e){function t(e){let t=e;return r.objectLiteral(t)&&(r.string(t.notebook)||E.is(t.notebook))&&(t.language===void 0||r.string(t.language))}e.is=t})(D||(e.NotebookCellTextDocumentFilter=D={}));var O;(function(e){function t(e){if(!Array.isArray(e))return!1;for(let t of e)if(!r.string(t)&&!T.is(t)&&!D.is(t))return!1;return!0}e.is=t})(O||(e.DocumentSelector=O={}));var k;(function(e){e.method=`client/registerCapability`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(k||(e.RegistrationRequest=k={}));var A;(function(e){e.method=`client/unregisterCapability`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(A||(e.UnregistrationRequest=A={}));var j;(function(e){e.Create=`create`,e.Rename=`rename`,e.Delete=`delete`})(j||(e.ResourceOperationKind=j={}));var M;(function(e){e.Abort=`abort`,e.Transactional=`transactional`,e.TextOnlyTransactional=`textOnlyTransactional`,e.Undo=`undo`})(M||(e.FailureHandlingKind=M={}));var N;(function(e){e.UTF8=`utf-8`,e.UTF16=`utf-16`,e.UTF32=`utf-32`})(N||(e.PositionEncodingKind=N={}));var P;(function(e){function t(e){let t=e;return t&&r.string(t.id)&&t.id.length>0}e.hasId=t})(P||(e.StaticRegistrationOptions=P={}));var he;(function(e){function t(e){let t=e;return t&&(t.documentSelector===null||O.is(t.documentSelector))}e.is=t})(he||(e.TextDocumentRegistrationOptions=he={}));var ge;(function(e){function t(e){let t=e;return r.objectLiteral(t)&&(t.workDoneProgress===void 0||r.boolean(t.workDoneProgress))}e.is=t;function n(e){let t=e;return t&&r.boolean(t.workDoneProgress)}e.hasWorkDoneProgress=n})(ge||(e.WorkDoneProgressOptions=ge={}));var _e;(function(e){e.method=`initialize`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(_e||(e.InitializeRequest=_e={}));var W;(function(e){e.unknownProtocolVersion=1})(W||(e.InitializeErrorCodes=W={}));var ve;(function(e){e.method=`initialized`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(ve||(e.InitializedNotification=ve={}));var ye;(function(e){e.method=`shutdown`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType0(e.method)})(ye||(e.ShutdownRequest=ye={}));var be;(function(e){e.method=`exit`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType0(e.method)})(be||(e.ExitNotification=be={}));var xe;(function(e){e.method=`workspace/didChangeConfiguration`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(xe||(e.DidChangeConfigurationNotification=xe={}));var Se;(function(e){e.Error=1,e.Warning=2,e.Info=3,e.Log=4,e.Debug=5})(Se||(e.MessageType=Se={}));var G;(function(e){e.method=`window/showMessage`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(G||(e.ShowMessageNotification=G={}));var K;(function(e){e.method=`window/showMessageRequest`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(K||(e.ShowMessageRequest=K={}));var Ce;(function(e){e.method=`window/logMessage`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(Ce||(e.LogMessageNotification=Ce={}));var q;(function(e){e.method=`telemetry/event`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(q||(e.TelemetryEventNotification=q={}));var we;(function(e){e.None=0,e.Full=1,e.Incremental=2})(we||(e.TextDocumentSyncKind=we={}));var Te;(function(e){e.method=`textDocument/didOpen`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(Te||(e.DidOpenTextDocumentNotification=Te={}));var Ee;(function(e){function t(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength==`number`)}e.isIncremental=t;function n(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range===void 0&&t.rangeLength===void 0}e.isFull=n})(Ee||(e.TextDocumentContentChangeEvent=Ee={}));var J;(function(e){e.method=`textDocument/didChange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(J||(e.DidChangeTextDocumentNotification=J={}));var De;(function(e){e.method=`textDocument/didClose`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(De||(e.DidCloseTextDocumentNotification=De={}));var Y;(function(e){e.method=`textDocument/didSave`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(Y||(e.DidSaveTextDocumentNotification=Y={}));var Oe;(function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3})(Oe||(e.TextDocumentSaveReason=Oe={}));var ke;(function(e){e.method=`textDocument/willSave`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(ke||(e.WillSaveTextDocumentNotification=ke={}));var Ae;(function(e){e.method=`textDocument/willSaveWaitUntil`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ae||(e.WillSaveTextDocumentWaitUntilRequest=Ae={}));var X;(function(e){e.method=`workspace/didChangeWatchedFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(X||(e.DidChangeWatchedFilesNotification=X={}));var je;(function(e){e.Created=1,e.Changed=2,e.Deleted=3})(je||(e.FileChangeType=je={}));var Me;(function(e){function t(e){let t=e;return r.objectLiteral(t)&&(n.URI.is(t.baseUri)||n.WorkspaceFolder.is(t.baseUri))&&r.string(t.pattern)}e.is=t})(Me||(e.RelativePattern=Me={}));var Z;(function(e){e.Create=1,e.Change=2,e.Delete=4})(Z||(e.WatchKind=Z={}));var Ne;(function(e){e.method=`textDocument/publishDiagnostics`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(Ne||(e.PublishDiagnosticsNotification=Ne={}));var Pe;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.TriggerForIncompleteCompletions=3})(Pe||(e.CompletionTriggerKind=Pe={}));var Fe;(function(e){e.method=`textDocument/completion`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Fe||(e.CompletionRequest=Fe={}));var Ie;(function(e){e.method=`completionItem/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ie||(e.CompletionResolveRequest=Ie={}));var Le;(function(e){e.method=`textDocument/hover`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Le||(e.HoverRequest=Le={}));var Re;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.ContentChange=3})(Re||(e.SignatureHelpTriggerKind=Re={}));var ze;(function(e){e.method=`textDocument/signatureHelp`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(ze||(e.SignatureHelpRequest=ze={}));var Be;(function(e){e.method=`textDocument/definition`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Be||(e.DefinitionRequest=Be={}));var Ve;(function(e){e.method=`textDocument/references`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ve||(e.ReferencesRequest=Ve={}));var He;(function(e){e.method=`textDocument/documentHighlight`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(He||(e.DocumentHighlightRequest=He={}));var Ue;(function(e){e.method=`textDocument/documentSymbol`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ue||(e.DocumentSymbolRequest=Ue={}));var We;(function(e){e.method=`textDocument/codeAction`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(We||(e.CodeActionRequest=We={}));var Ge;(function(e){e.method=`codeAction/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ge||(e.CodeActionResolveRequest=Ge={}));var Ke;(function(e){e.method=`workspace/symbol`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ke||(e.WorkspaceSymbolRequest=Ke={}));var qe;(function(e){e.method=`workspaceSymbol/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(qe||(e.WorkspaceSymbolResolveRequest=qe={}));var Je;(function(e){e.method=`textDocument/codeLens`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Je||(e.CodeLensRequest=Je={}));var Ye;(function(e){e.method=`codeLens/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ye||(e.CodeLensResolveRequest=Ye={}));var Xe;(function(e){e.method=`workspace/codeLens/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(Xe||(e.CodeLensRefreshRequest=Xe={}));var Ze;(function(e){e.method=`textDocument/documentLink`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ze||(e.DocumentLinkRequest=Ze={}));var Qe;(function(e){e.method=`documentLink/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Qe||(e.DocumentLinkResolveRequest=Qe={}));var $e;(function(e){e.method=`textDocument/formatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})($e||(e.DocumentFormattingRequest=$e={}));var et;(function(e){e.method=`textDocument/rangeFormatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(et||(e.DocumentRangeFormattingRequest=et={}));var tt;(function(e){e.method=`textDocument/rangesFormatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(tt||(e.DocumentRangesFormattingRequest=tt={}));var nt;(function(e){e.method=`textDocument/onTypeFormatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(nt||(e.DocumentOnTypeFormattingRequest=nt={}));var rt;(function(e){e.Identifier=1})(rt||(e.PrepareSupportDefaultBehavior=rt={}));var it;(function(e){e.method=`textDocument/rename`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(it||(e.RenameRequest=it={}));var at;(function(e){e.method=`textDocument/prepareRename`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(at||(e.PrepareRenameRequest=at={}));var ot;(function(e){e.method=`workspace/executeCommand`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(ot||(e.ExecuteCommandRequest=ot={}));var st;(function(e){e.method=`workspace/applyEdit`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(`workspace/applyEdit`)})(st||(e.ApplyWorkspaceEditRequest=st={}))})),ge=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createProtocolConnection=void 0;let t=N();function n(e,n,r,i){return t.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,t.createMessageConnection)(e,n,r,i)}e.createProtocolConnection=n})),_e=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,n(N(),e),n(ee(),e),n(F(),e),n(he(),e);var r=ge();Object.defineProperty(e,`createProtocolConnection`,{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(e){e.lspReservedErrorRangeStart=-32899,e.RequestFailed=-32803,e.ServerCancelled=-32802,e.ContentModified=-32801,e.RequestCancelled=-32800,e.lspReservedErrorRangeEnd=-32800})(i||(e.LSPErrorCodes=i={}))})),W=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.createProtocolConnection=void 0;let r=P();n(P(),e),n(_e(),e);function i(e,t,n,i){return(0,r.createMessageConnection)(e,t,n,i)}e.createProtocolConnection=i})),ve=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.forEach=e.mapAsync=e.map=e.clearTestMode=e.setTestMode=e.Semaphore=e.Delayer=void 0;let t=W();e.Delayer=class{constructor(e){this.defaultDelay=e,this.timeout=void 0,this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0}trigger(e,n=this.defaultDelay){return this.task=e,n>=0&&this.cancelTimeout(),this.completionPromise||=new Promise(e=>{this.onSuccess=e}).then(()=>{this.completionPromise=void 0,this.onSuccess=void 0;var e=this.task();return this.task=void 0,e}),(n>=0||this.timeout===void 0)&&(this.timeout=(0,t.RAL)().timer.setTimeout(()=>{this.timeout=void 0,this.onSuccess(void 0)},n>=0?n:this.defaultDelay)),this.completionPromise}forceDelivery(){if(!this.completionPromise)return;this.cancelTimeout();let e=this.task();return this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0,e}isTriggered(){return this.timeout!==void 0}cancel(){this.cancelTimeout(),this.completionPromise=void 0}cancelTimeout(){this.timeout!==void 0&&(this.timeout.dispose(),this.timeout=void 0)}},e.Semaphore=class{constructor(e=1){if(e<=0)throw Error(`Capacity must be greater than 0`);this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.RAL)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error(`To many thunks active`);try{let t=e.thunk();t instanceof Promise?t.then(t=>{this._active--,e.resolve(t),this.runNext()},t=>{this._active--,e.reject(t),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};let n=!1;function r(){n=!0}e.setTestMode=r;function i(){n=!1}e.clearTestMode=i;var a=class{constructor(e=15){this.yieldAfter=n===!0?Math.max(e,2):Math.max(e,15),this.startTime=Date.now(),this.counter=0,this.total=0,this.counterInterval=1}start(){this.counter=0,this.total=0,this.counterInterval=1,this.startTime=Date.now()}shouldYield(){if(++this.counter>=this.counterInterval){let e=Date.now()-this.startTime,t=Math.max(0,this.yieldAfter-e);if(this.total+=this.counter,this.counter=0,e>=this.yieldAfter||t<=1)return this.counterInterval=1,this.total=0,!0;switch(e){case 0:case 1:this.counterInterval=this.total*2;break}}return!1}};async function o(e,n,r,i){if(e.length===0)return[];let o=Array(e.length),s=new a(i?.yieldAfter);function c(t){s.start();for(let r=t;r{(0,t.RAL)().timer.setImmediate(()=>{e(c(l))})});return o}e.map=o;async function s(e,n,r,i){if(e.length===0)return[];let o=Array(e.length),s=new a(i?.yieldAfter);async function c(t){s.start();for(let a=t;a{(0,t.RAL)().timer.setImmediate(()=>{e(c(l))})});return o}e.mapAsync=s;async function c(e,n,r,i){if(e.length===0)return;let o=new a(i?.yieldAfter);function s(t){o.start();for(let r=t;r{(0,t.RAL)().timer.setImmediate(()=>{e(s(c))})})}e.forEach=c})),ye=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`vscode`);e.default=class extends t.CompletionItem{constructor(e){super(e)}}})),be=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`vscode`);e.default=class extends t.CodeLens{constructor(e){super(e)}}})),xe=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`vscode`);e.default=class extends t.DocumentLink{constructor(e,t){super(e,t)}}})),Se=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`vscode`);e.default=class extends t.CodeAction{constructor(e,t){super(e),this.data=t}}})),G=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ProtocolDiagnostic=e.DiagnosticCode=void 0;let t=require(`vscode`),n=_();var r;(function(e){function t(e){let t=e;return t!=null&&(n.number(t.value)||n.string(t.value))&&n.string(t.target)}e.is=t})(r||(e.DiagnosticCode=r={})),e.ProtocolDiagnostic=class extends t.Diagnostic{constructor(e,t,n,r){super(e,t,n),this.data=r,this.hasDiagnosticCode=!1}}})),K=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`vscode`);e.default=class extends t.CallHierarchyItem{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,a),o!==void 0&&(this.data=o)}}})),Ce=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`vscode`);e.default=class extends t.TypeHierarchyItem{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,a),o!==void 0&&(this.data=o)}}})),q=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`vscode`);e.default=class extends t.SymbolInformation{constructor(e,n,r,i,a){let o=!(i instanceof t.Uri);super(e,n,r,o?i:new t.Location(i,new t.Range(0,0,0,0))),this.hasRange=o,a!==void 0&&(this.data=a)}}})),we=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=require(`vscode`);e.default=class extends t.InlayHint{constructor(e,t,n){super(e,t,n)}}})),Te=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createConverter=void 0;let t=require(`vscode`),n=W(),r=_(),i=ve(),a=ye(),o=be(),s=xe(),c=Se(),l=G(),u=K(),d=Ce(),f=q(),p=we();var m;(function(e){function t(e){let t=e;return t&&!!t.inserting&&!!t.replacing}e.is=t})(m||={});function h(e){let h=e||(e=>e.toString());function g(e){return h(e)}function _(e){return{uri:h(e.uri)}}function v(e){return{uri:h(e.uri),languageId:e.languageId,version:e.version,text:e.getText()}}function y(e){return{uri:h(e.uri),version:e.version}}function b(e){return{textDocument:v(e)}}function x(e){let t=e;return!!t.document&&!!t.contentChanges}function S(e){let t=e;return!!t.uri&&!!t.version}function C(e,t,n){if(S(e))return{textDocument:{uri:h(e.uri),version:e.version},contentChanges:[{text:e.getText()}]};if(x(e)){let r=t,i=n;return{textDocument:{uri:h(r),version:i},contentChanges:e.contentChanges.map(e=>{let t=e.range;return{range:{start:{line:t.start.line,character:t.start.character},end:{line:t.end.line,character:t.end.character}},rangeLength:e.rangeLength,text:e.text}})}}else throw Error(`Unsupported text document change parameter`)}function w(e){return{textDocument:_(e)}}function T(e,t=!1){let n={textDocument:_(e)};return t&&(n.text=e.getText()),n}function E(e){switch(e){case t.TextDocumentSaveReason.Manual:return n.TextDocumentSaveReason.Manual;case t.TextDocumentSaveReason.AfterDelay:return n.TextDocumentSaveReason.AfterDelay;case t.TextDocumentSaveReason.FocusOut:return n.TextDocumentSaveReason.FocusOut}return n.TextDocumentSaveReason.Manual}function D(e){return{textDocument:_(e.document),reason:E(e.reason)}}function O(e){return{files:e.files.map(e=>({uri:h(e)}))}}function k(e){return{files:e.files.map(e=>({oldUri:h(e.oldUri),newUri:h(e.newUri)}))}}function A(e){return{files:e.files.map(e=>({uri:h(e)}))}}function j(e){return{files:e.files.map(e=>({uri:h(e)}))}}function M(e){return{files:e.files.map(e=>({oldUri:h(e.oldUri),newUri:h(e.newUri)}))}}function N(e){return{files:e.files.map(e=>({uri:h(e)}))}}function P(e,t){return{textDocument:_(e),position:z(t)}}function ee(e){switch(e){case t.CompletionTriggerKind.TriggerCharacter:return n.CompletionTriggerKind.TriggerCharacter;case t.CompletionTriggerKind.TriggerForIncompleteCompletions:return n.CompletionTriggerKind.TriggerForIncompleteCompletions;default:return n.CompletionTriggerKind.Invoked}}function F(e,t,n){return{textDocument:_(e),position:z(t),context:{triggerKind:ee(n.triggerKind),triggerCharacter:n.triggerCharacter}}}function te(e){switch(e){case t.SignatureHelpTriggerKind.Invoke:return n.SignatureHelpTriggerKind.Invoked;case t.SignatureHelpTriggerKind.TriggerCharacter:return n.SignatureHelpTriggerKind.TriggerCharacter;case t.SignatureHelpTriggerKind.ContentChange:return n.SignatureHelpTriggerKind.ContentChange}}function ne(e){return{label:e.label}}function I(e){return e.map(ne)}function L(e){return{label:e.label,parameters:I(e.parameters)}}function R(e){return e.map(L)}function re(e){return e===void 0?e:{signatures:R(e.signatures),activeSignature:e.activeSignature,activeParameter:e.activeParameter}}function ie(e,t,n){return{textDocument:_(e),position:z(t),context:{isRetrigger:n.isRetrigger,triggerCharacter:n.triggerCharacter,triggerKind:te(n.triggerKind),activeSignatureHelp:re(n.activeSignatureHelp)}}}function z(e){return{line:e.line,character:e.character}}function B(e){return e==null?e:{line:e.line>n.uinteger.MAX_VALUE?n.uinteger.MAX_VALUE:e.line,character:e.character>n.uinteger.MAX_VALUE?n.uinteger.MAX_VALUE:e.character}}function V(e,t){return i.map(e,B,t)}function ae(e){return e.map(B)}function H(e){return e==null?e:{start:B(e.start),end:B(e.end)}}function oe(e){return e.map(H)}function se(e){return e==null?e:n.Location.create(g(e.uri),H(e.range))}function ce(e){switch(e){case t.DiagnosticSeverity.Error:return n.DiagnosticSeverity.Error;case t.DiagnosticSeverity.Warning:return n.DiagnosticSeverity.Warning;case t.DiagnosticSeverity.Information:return n.DiagnosticSeverity.Information;case t.DiagnosticSeverity.Hint:return n.DiagnosticSeverity.Hint}}function le(e){if(!e)return;let t=[];for(let n of e){let e=U(n);e!==void 0&&t.push(e)}return t.length>0?t:void 0}function U(e){switch(e){case t.DiagnosticTag.Unnecessary:return n.DiagnosticTag.Unnecessary;case t.DiagnosticTag.Deprecated:return n.DiagnosticTag.Deprecated;default:return}}function ue(e){return{message:e.message,location:se(e.location)}}function de(e){return e.map(ue)}function fe(e){if(e!=null)return r.number(e)||r.string(e)?e:{value:e.value,target:g(e.target)}}function pe(e){let t=n.Diagnostic.create(H(e.range),e.message),i=e instanceof l.ProtocolDiagnostic?e:void 0;i!==void 0&&i.data!==void 0&&(t.data=i.data);let a=fe(e.code);return l.DiagnosticCode.is(a)?i!==void 0&&i.hasDiagnosticCode?t.code=a:(t.code=a.value,t.codeDescription={href:a.target}):t.code=a,r.number(e.severity)&&(t.severity=ce(e.severity)),Array.isArray(e.tags)&&(t.tags=le(e.tags)),e.relatedInformation&&(t.relatedInformation=de(e.relatedInformation)),e.source&&(t.source=e.source),t}function me(e,t){return e==null?e:i.map(e,pe,t)}function he(e){return e==null?e:e.map(pe)}function ge(e,t){switch(e){case`$string`:return t;case n.MarkupKind.PlainText:return{kind:e,value:t};case n.MarkupKind.Markdown:return{kind:e,value:t.value};default:return`Unsupported Markup content received. Kind is: ${e}`}}function _e(e){switch(e){case t.CompletionItemTag.Deprecated:return n.CompletionItemTag.Deprecated}}function W(e){if(e===void 0)return e;let t=[];for(let n of e){let e=_e(n);e!==void 0&&t.push(e)}return t}function ve(e,t){return t===void 0?e+1:t}function ye(e,i=!1){let o,s;r.string(e.label)?o=e.label:(o=e.label.label,i&&(e.label.detail!==void 0||e.label.description!==void 0)&&(s={detail:e.label.detail,description:e.label.description}));let c={label:o};s!==void 0&&(c.labelDetails=s);let l=e instanceof a.default?e:void 0;e.detail&&(c.detail=e.detail),e.documentation&&(!l||l.documentationFormat===`$string`?c.documentation=e.documentation:c.documentation=ge(l.documentationFormat,e.documentation)),e.filterText&&(c.filterText=e.filterText),be(c,e),r.number(e.kind)&&(c.kind=ve(e.kind,l&&l.originalItemKind)),e.sortText&&(c.sortText=e.sortText),e.additionalTextEdits&&(c.additionalTextEdits=G(e.additionalTextEdits)),e.commitCharacters&&(c.commitCharacters=e.commitCharacters.slice()),e.command&&(c.command=X(e.command)),(e.preselect===!0||e.preselect===!1)&&(c.preselect=e.preselect);let u=W(e.tags);if(l){if(l.data!==void 0&&(c.data=l.data),l.deprecated===!0||l.deprecated===!1){if(l.deprecated===!0&&u!==void 0&&u.length>0){let e=u.indexOf(t.CompletionItemTag.Deprecated);e!==-1&&u.splice(e,1)}c.deprecated=l.deprecated}l.insertTextMode!==void 0&&(c.insertTextMode=l.insertTextMode)}return u!==void 0&&u.length>0&&(c.tags=u),c.insertTextMode===void 0&&e.keepWhitespace===!0&&(c.insertTextMode=n.InsertTextMode.adjustIndentation),c}function be(e,r){let i=n.InsertTextFormat.PlainText,a,o;r.textEdit?(a=r.textEdit.newText,o=r.textEdit.range):r.insertText instanceof t.SnippetString?(i=n.InsertTextFormat.Snippet,a=r.insertText.value):a=r.insertText,r.range&&(o=r.range),e.insertTextFormat=i,r.fromEdit&&a!==void 0&&o!==void 0?e.textEdit=xe(a,o):e.insertText=a}function xe(e,t){return m.is(t)?n.InsertReplaceEdit.create(e,H(t.inserting),H(t.replacing)):{newText:e,range:H(t)}}function Se(e){return{range:H(e.range),newText:e.newText}}function G(e){return e==null?e:e.map(Se)}function K(e){return e<=t.SymbolKind.TypeParameter?e+1:n.SymbolKind.Property}function Ce(e){return e}function q(e){return e.map(Ce)}function we(e,t,n){return{textDocument:_(e),position:z(t),context:{includeDeclaration:n.includeDeclaration}}}async function Te(e,t){let r=n.CodeAction.create(e.title);if(e instanceof c.default&&e.data!==void 0&&(r.data=e.data),e.kind!==void 0&&(r.kind=Oe(e.kind)),e.diagnostics!==void 0&&(r.diagnostics=await me(e.diagnostics,t)),e.edit!==void 0)throw Error(`VS Code code actions can only be converted to a protocol code action without an edit.`);return e.command!==void 0&&(r.command=X(e.command)),e.isPreferred!==void 0&&(r.isPreferred=e.isPreferred),e.disabled!==void 0&&(r.disabled={reason:e.disabled.reason}),r}function Ee(e){let t=n.CodeAction.create(e.title);if(e instanceof c.default&&e.data!==void 0&&(t.data=e.data),e.kind!==void 0&&(t.kind=Oe(e.kind)),e.diagnostics!==void 0&&(t.diagnostics=he(e.diagnostics)),e.edit!==void 0)throw Error(`VS Code code actions can only be converted to a protocol code action without an edit.`);return e.command!==void 0&&(t.command=X(e.command)),e.isPreferred!==void 0&&(t.isPreferred=e.isPreferred),e.disabled!==void 0&&(t.disabled={reason:e.disabled.reason}),t}async function J(e,t){if(e==null)return e;let i;return e.only&&r.string(e.only.value)&&(i=[e.only.value]),n.CodeActionContext.create(await me(e.diagnostics,t),i,Y(e.triggerKind))}function De(e){if(e==null)return e;let t;return e.only&&r.string(e.only.value)&&(t=[e.only.value]),n.CodeActionContext.create(he(e.diagnostics),t,Y(e.triggerKind))}function Y(e){switch(e){case t.CodeActionTriggerKind.Invoke:return n.CodeActionTriggerKind.Invoked;case t.CodeActionTriggerKind.Automatic:return n.CodeActionTriggerKind.Automatic;default:return}}function Oe(e){if(e!=null)return e.value}function ke(e){return e==null?e:n.InlineValueContext.create(e.frameId,H(e.stoppedLocation))}function Ae(e,t,r){return{context:n.InlineCompletionContext.create(r.triggerKind,r.selectedCompletionInfo),textDocument:_(e),position:B(t)}}function X(e){let t=n.Command.create(e.title,e.command);return e.arguments&&(t.arguments=e.arguments),t}function je(e){let t=n.CodeLens.create(H(e.range));return e.command&&(t.command=X(e.command)),e instanceof o.default&&e.data&&(t.data=e.data),t}function Me(e,t){let n={tabSize:e.tabSize,insertSpaces:e.insertSpaces};return t.trimTrailingWhitespace&&(n.trimTrailingWhitespace=!0),t.trimFinalNewlines&&(n.trimFinalNewlines=!0),t.insertFinalNewline&&(n.insertFinalNewline=!0),n}function Z(e){return{textDocument:_(e)}}function Ne(e){return{textDocument:_(e)}}function Pe(e){let t=n.DocumentLink.create(H(e.range));e.target&&(t.target=g(e.target)),e.tooltip!==void 0&&(t.tooltip=e.tooltip);let r=e instanceof s.default?e:void 0;return r&&r.data&&(t.data=r.data),t}function Fe(e){return{textDocument:_(e)}}function Ie(e){let t={name:e.name,kind:K(e.kind),uri:g(e.uri),range:H(e.range),selectionRange:H(e.selectionRange)};return e.detail!==void 0&&e.detail.length>0&&(t.detail=e.detail),e.tags!==void 0&&(t.tags=q(e.tags)),e instanceof u.default&&e.data!==void 0&&(t.data=e.data),t}function Le(e){let t={name:e.name,kind:K(e.kind),uri:g(e.uri),range:H(e.range),selectionRange:H(e.selectionRange)};return e.detail!==void 0&&e.detail.length>0&&(t.detail=e.detail),e.tags!==void 0&&(t.tags=q(e.tags)),e instanceof d.default&&e.data!==void 0&&(t.data=e.data),t}function Re(e){let t=e instanceof f.default?{name:e.name,kind:K(e.kind),location:e.hasRange?se(e.location):{uri:h(e.location.uri)},data:e.data}:{name:e.name,kind:K(e.kind),location:se(e.location)};return e.tags!==void 0&&(t.tags=q(e.tags)),e.containerName!==``&&(t.containerName=e.containerName),t}function ze(e){let t=typeof e.label==`string`?e.label:e.label.map(Be),r=n.InlayHint.create(B(e.position),t);return e.kind!==void 0&&(r.kind=e.kind),e.textEdits!==void 0&&(r.textEdits=G(e.textEdits)),e.tooltip!==void 0&&(r.tooltip=Ve(e.tooltip)),e.paddingLeft!==void 0&&(r.paddingLeft=e.paddingLeft),e.paddingRight!==void 0&&(r.paddingRight=e.paddingRight),e instanceof p.default&&e.data!==void 0&&(r.data=e.data),r}function Be(e){let t=n.InlayHintLabelPart.create(e.value);return e.location!==void 0&&(t.location=se(e.location)),e.command!==void 0&&(t.command=X(e.command)),e.tooltip!==void 0&&(t.tooltip=Ve(e.tooltip)),t}function Ve(e){return typeof e==`string`?e:{kind:n.MarkupKind.Markdown,value:e.value}}return{asUri:g,asTextDocumentIdentifier:_,asTextDocumentItem:v,asVersionedTextDocumentIdentifier:y,asOpenTextDocumentParams:b,asChangeTextDocumentParams:C,asCloseTextDocumentParams:w,asSaveTextDocumentParams:T,asWillSaveTextDocumentParams:D,asDidCreateFilesParams:O,asDidRenameFilesParams:k,asDidDeleteFilesParams:A,asWillCreateFilesParams:j,asWillRenameFilesParams:M,asWillDeleteFilesParams:N,asTextDocumentPositionParams:P,asCompletionParams:F,asSignatureHelpParams:ie,asWorkerPosition:z,asRange:H,asRanges:oe,asPosition:B,asPositions:V,asPositionsSync:ae,asLocation:se,asDiagnosticSeverity:ce,asDiagnosticTag:U,asDiagnostic:pe,asDiagnostics:me,asDiagnosticsSync:he,asCompletionItem:ye,asTextEdit:Se,asSymbolKind:K,asSymbolTag:Ce,asSymbolTags:q,asReferenceParams:we,asCodeAction:Te,asCodeActionSync:Ee,asCodeActionContext:J,asCodeActionContextSync:De,asInlineValueContext:ke,asCommand:X,asCodeLens:je,asFormattingOptions:Me,asDocumentSymbolParams:Z,asCodeLensParams:Ne,asDocumentLink:Pe,asDocumentLinkParams:Fe,asCallHierarchyItem:Ie,asTypeHierarchyItem:Le,asInlayHint:ze,asWorkspaceSymbol:Re,asInlineCompletionParams:Ae}}e.createConverter=h})),Ee=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createConverter=void 0;let t=require(`vscode`),n=W(),r=_(),i=ve(),a=ye(),o=be(),s=xe(),c=Se(),l=G(),u=K(),d=Ce(),f=q(),p=we(),m=W();var h;(function(e){function t(e){let t=e;return t&&r.string(t.language)&&r.string(t.value)}e.is=t})(h||={});function g(e,g,_){let v=e||(e=>t.Uri.parse(e));function y(e){return v(e)}function b(e){let t=[];for(let n of e)if(typeof n==`string`)t.push(n);else if(m.NotebookCellTextDocumentFilter.is(n))if(typeof n.notebook==`string`)t.push({notebookType:n.notebook,language:n.language});else{let e=n.notebook.notebookType??`*`;t.push({notebookType:e,scheme:n.notebook.scheme,pattern:n.notebook.pattern,language:n.language})}else m.TextDocumentFilter.is(n)&&t.push({language:n.language,scheme:n.scheme,pattern:n.pattern});return t}async function x(e,t){return i.map(e,C,t)}function S(e){let t=Array(e.length);for(let n=0;n0?t:void 0}function E(e){switch(e){case n.DiagnosticTag.Unnecessary:return t.DiagnosticTag.Unnecessary;case n.DiagnosticTag.Deprecated:return t.DiagnosticTag.Deprecated;default:return}}function D(e){return e?new t.Position(e.line,e.character):void 0}function O(e){return e?new t.Range(e.start.line,e.start.character,e.end.line,e.end.character):void 0}async function k(e,n){return i.map(e,e=>new t.Range(e.start.line,e.start.character,e.end.line,e.end.character),n)}function A(e){if(e==null)return t.DiagnosticSeverity.Error;switch(e){case n.DiagnosticSeverity.Error:return t.DiagnosticSeverity.Error;case n.DiagnosticSeverity.Warning:return t.DiagnosticSeverity.Warning;case n.DiagnosticSeverity.Information:return t.DiagnosticSeverity.Information;case n.DiagnosticSeverity.Hint:return t.DiagnosticSeverity.Hint}return t.DiagnosticSeverity.Error}function j(e){if(r.string(e))return N(e);if(h.is(e))return N().appendCodeblock(e.value,e.language);if(Array.isArray(e)){let t=[];for(let n of e){let e=N();h.is(n)?e.appendCodeblock(n.value,n.language):e.appendMarkdown(n),t.push(e)}return t}else return N(e)}function M(e){if(r.string(e))return e;switch(e.kind){case n.MarkupKind.Markdown:return N(e.value);case n.MarkupKind.PlainText:return e.value;default:return`Unsupported Markup content received. Kind is: ${e.kind}`}}function N(e){let r;if(e===void 0||typeof e==`string`)r=new t.MarkdownString(e);else switch(e.kind){case n.MarkupKind.Markdown:r=new t.MarkdownString(e.value);break;case n.MarkupKind.PlainText:r=new t.MarkdownString,r.appendText(e.value);break;default:r=new t.MarkdownString,r.appendText(`Unsupported Markup content received. Kind is: ${e.kind}`);break}return r.isTrusted=g,r.supportHtml=_,r}function P(e){if(e)return new t.Hover(j(e.contents),O(e.range))}async function ee(e,n,r){if(!e)return;if(Array.isArray(e))return i.map(e,e=>L(e,n),r);let a=e,{defaultRange:o,commitCharacters:s}=F(a,n),c=await i.map(a.items,e=>L(e,s,o,a.itemDefaults?.insertTextMode,a.itemDefaults?.insertTextFormat,a.itemDefaults?.data),r);return new t.CompletionList(c,a.isIncomplete)}function F(e,t){let r=e.itemDefaults?.editRange,i=e.itemDefaults?.commitCharacters??t;return n.Range.is(r)?{defaultRange:O(r),commitCharacters:i}:r===void 0?{defaultRange:void 0,commitCharacters:i}:{defaultRange:{inserting:O(r.insert),replacing:O(r.replace)},commitCharacters:i}}function te(e){return n.CompletionItemKind.Text<=e&&e<=n.CompletionItemKind.TypeParameter?[e-1,void 0]:[t.CompletionItemKind.Text,e]}function ne(e){switch(e){case n.CompletionItemTag.Deprecated:return t.CompletionItemTag.Deprecated}}function I(e){if(e==null)return[];let t=[];for(let n of e){let e=ne(n);e!==void 0&&t.push(e)}return t}function L(e,i,o,s,c,l){let u=I(e.tags),d=R(e),f=new a.default(d);e.detail&&(f.detail=e.detail),e.documentation&&(f.documentation=M(e.documentation),f.documentationFormat=r.string(e.documentation)?`$string`:e.documentation.kind),e.filterText&&(f.filterText=e.filterText);let p=re(e,o,c);if(p&&(f.insertText=p.text,f.range=p.range,f.fromEdit=p.fromEdit),r.number(e.kind)){let[t,n]=te(e.kind);f.kind=t,n&&(f.originalItemKind=n)}e.sortText&&(f.sortText=e.sortText),e.additionalTextEdits&&(f.additionalTextEdits=V(e.additionalTextEdits));let m=e.commitCharacters===void 0?i:r.stringArray(e.commitCharacters)?e.commitCharacters:void 0;m&&(f.commitCharacters=m.slice()),e.command&&(f.command=K(e.command)),(e.deprecated===!0||e.deprecated===!1)&&(f.deprecated=e.deprecated,e.deprecated===!0&&u.push(t.CompletionItemTag.Deprecated)),(e.preselect===!0||e.preselect===!1)&&(f.preselect=e.preselect);let h=e.data??l;h!==void 0&&(f.data=h),u.length>0&&(f.tags=u);let g=e.insertTextMode??s;return g!==void 0&&(f.insertTextMode=g,g===n.InsertTextMode.asIs&&(f.keepWhitespace=!0)),f}function R(e){return n.CompletionItemLabelDetails.is(e.labelDetails)?{label:e.label,detail:e.labelDetails.detail,description:e.labelDetails.description}:e.label}function re(e,r,i){let a=e.insertTextFormat??i;if(e.textEdit!==void 0||r!==void 0){let[i,o]=e.textEdit===void 0?[r,e.textEditText??e.label]:ie(e.textEdit);return a===n.InsertTextFormat.Snippet?{text:new t.SnippetString(o),range:i,fromEdit:!0}:{text:o,range:i,fromEdit:!0}}else if(e.insertText)return a===n.InsertTextFormat.Snippet?{text:new t.SnippetString(e.insertText),fromEdit:!1}:{text:e.insertText,fromEdit:!1};else return}function ie(e){return n.InsertReplaceEdit.is(e)?[{inserting:O(e.insert),replacing:O(e.replace)},e.newText]:[O(e.range),e.newText]}function z(e){if(e)return new t.TextEdit(O(e.range),e.newText)}async function B(e,t){if(e)return i.map(e,z,t)}function V(e){if(!e)return;let t=Array(e.length);for(let n=0;n0){let t=[];for(let n of e.children)t.push(Se(n));n.children=t}return n}function G(e,n){e.tags=ye(n.tags),n.deprecated&&(e.tags?e.tags.includes(t.SymbolTag.Deprecated)||(e.tags=e.tags.concat(t.SymbolTag.Deprecated)):e.tags=[t.SymbolTag.Deprecated])}function K(e){let t={title:e.title,command:e.command};return e.arguments&&(t.arguments=e.arguments),t}async function Ce(e,t){if(e)return i.map(e,K,t)}let q=new Map;q.set(n.CodeActionKind.Empty,t.CodeActionKind.Empty),q.set(n.CodeActionKind.QuickFix,t.CodeActionKind.QuickFix),q.set(n.CodeActionKind.Refactor,t.CodeActionKind.Refactor),q.set(n.CodeActionKind.RefactorExtract,t.CodeActionKind.RefactorExtract),q.set(n.CodeActionKind.RefactorInline,t.CodeActionKind.RefactorInline),q.set(n.CodeActionKind.RefactorRewrite,t.CodeActionKind.RefactorRewrite),q.set(n.CodeActionKind.Source,t.CodeActionKind.Source),q.set(n.CodeActionKind.SourceOrganizeImports,t.CodeActionKind.SourceOrganizeImports);function we(e){if(e==null)return;let n=q.get(e);if(n)return n;let r=e.split(`.`);n=t.CodeActionKind.Empty;for(let e of r)n=n.append(e);return n}function Te(e){if(e!=null)return e.map(e=>we(e))}async function Ee(e,t){if(e==null)return;let n=new c.default(e.title,e.data);return e.kind!==void 0&&(n.kind=we(e.kind)),e.diagnostics!==void 0&&(n.diagnostics=S(e.diagnostics)),e.edit!==void 0&&(n.edit=await Oe(e.edit,t)),e.command!==void 0&&(n.command=K(e.command)),e.isPreferred!==void 0&&(n.isPreferred=e.isPreferred),e.disabled!==void 0&&(n.disabled={reason:e.disabled.reason}),n}function J(e,t){return i.mapAsync(e,async e=>n.Command.is(e)?K(e):Ee(e,t),t)}function De(e){if(!e)return;let t=new o.default(O(e.range));return e.command&&(t.command=K(e.command)),e.data!==void 0&&e.data!==null&&(t.data=e.data),t}async function Y(e,t){if(e)return i.map(e,De,t)}async function Oe(e,r){if(!e)return;let a=new Map;if(e.changeAnnotations!==void 0){let t=e.changeAnnotations;await i.forEach(Object.keys(t),e=>{let n=ke(t[e]);a.set(e,n)},r)}let o=e=>{if(e!==void 0)return a.get(e)},s=new t.WorkspaceEdit;if(e.documentChanges){let t=e.documentChanges;await i.forEach(t,e=>{if(n.CreateFile.is(e))s.createFile(v(e.uri),e.options,o(e.annotationId));else if(n.RenameFile.is(e))s.renameFile(v(e.oldUri),v(e.newUri),e.options,o(e.annotationId));else if(n.DeleteFile.is(e))s.deleteFile(v(e.uri),e.options,o(e.annotationId));else if(n.TextDocumentEdit.is(e)){let t=v(e.textDocument.uri);for(let r of e.edits)n.AnnotatedTextEdit.is(r)?s.replace(t,O(r.range),r.newText,o(r.annotationId)):s.replace(t,O(r.range),r.newText)}else throw Error(`Unknown workspace edit change received:\n${JSON.stringify(e,void 0,4)}`)},r)}else if(e.changes){let t=e.changes;await i.forEach(Object.keys(t),e=>{s.set(v(e),V(t[e]))},r)}return s}function ke(e){if(e!==void 0)return{label:e.label,needsConfirmation:!!e.needsConfirmation,description:e.description}}function Ae(e){let t=O(e.range),n=e.target?y(e.target):void 0,r=new s.default(t,n);return e.tooltip!==void 0&&(r.tooltip=e.tooltip),e.data!==void 0&&e.data!==null&&(r.data=e.data),r}async function X(e,t){if(e)return i.map(e,Ae,t)}function je(e){return new t.Color(e.red,e.green,e.blue,e.alpha)}function Me(e){return new t.ColorInformation(O(e.range),je(e.color))}async function Z(e,t){if(e)return i.map(e,Me,t)}function Ne(e){let n=new t.ColorPresentation(e.label);return n.additionalTextEdits=V(e.additionalTextEdits),e.textEdit&&(n.textEdit=z(e.textEdit)),n}async function Pe(e,t){if(e)return i.map(e,Ne,t)}function Fe(e){if(e)switch(e){case n.FoldingRangeKind.Comment:return t.FoldingRangeKind.Comment;case n.FoldingRangeKind.Imports:return t.FoldingRangeKind.Imports;case n.FoldingRangeKind.Region:return t.FoldingRangeKind.Region}}function Ie(e){return new t.FoldingRange(e.startLine,e.endLine,Fe(e.kind))}async function Le(e,t){if(e)return i.map(e,Ie,t)}function Re(e){return new t.SelectionRange(O(e.range),e.parent?Re(e.parent):void 0)}async function ze(e,t){return Array.isArray(e)?i.map(e,Re,t):[]}function Be(e){return n.InlineValueText.is(e)?new t.InlineValueText(O(e.range),e.text):n.InlineValueVariableLookup.is(e)?new t.InlineValueVariableLookup(O(e.range),e.variableName,e.caseSensitiveLookup):new t.InlineValueEvaluatableExpression(O(e.range),e.expression)}async function Ve(e,t){return Array.isArray(e)?i.map(e,Be,t):[]}async function He(e,t){let n=typeof e.label==`string`?e.label:await i.map(e.label,Ue,t),r=new p.default(D(e.position),n);return e.kind!==void 0&&(r.kind=e.kind),e.textEdits!==void 0&&(r.textEdits=await B(e.textEdits,t)),e.tooltip!==void 0&&(r.tooltip=We(e.tooltip)),e.paddingLeft!==void 0&&(r.paddingLeft=e.paddingLeft),e.paddingRight!==void 0&&(r.paddingRight=e.paddingRight),e.data!==void 0&&(r.data=e.data),r}function Ue(e){let n=new t.InlayHintLabelPart(e.value);return e.location!==void 0&&(n.location=le(e.location)),e.tooltip!==void 0&&(n.tooltip=We(e.tooltip)),e.command!==void 0&&(n.command=K(e.command)),n}function We(e){return typeof e==`string`?e:N(e)}async function Ge(e,t){if(Array.isArray(e))return i.mapAsync(e,He,t)}function Ke(e){if(e===null)return;let t=new u.default(W(e.kind),e.name,e.detail||``,y(e.uri),O(e.range),O(e.selectionRange),e.data);return e.tags!==void 0&&(t.tags=ye(e.tags)),t}async function qe(e,t){if(e!==null)return i.map(e,Ke,t)}async function Je(e,n){return new t.CallHierarchyIncomingCall(Ke(e.from),await k(e.fromRanges,n))}async function Ye(e,t){if(e!==null)return i.mapAsync(e,Je,t)}async function Xe(e,n){return new t.CallHierarchyOutgoingCall(Ke(e.to),await k(e.fromRanges,n))}async function Ze(e,t){if(e!==null)return i.mapAsync(e,Xe,t)}async function Qe(e,n){if(e!=null)return new t.SemanticTokens(new Uint32Array(e.data),e.resultId)}function $e(e){return new t.SemanticTokensEdit(e.start,e.deleteCount,e.data===void 0?void 0:new Uint32Array(e.data))}async function et(e,n){if(e!=null)return new t.SemanticTokensEdits(e.edits.map($e),e.resultId)}function tt(e){return e}async function nt(e,n){if(e!=null)return new t.LinkedEditingRanges(await k(e.ranges,n),rt(e.wordPattern))}function rt(e){if(e!=null)return new RegExp(e)}function it(e){if(e===null)return;let t=new d.default(W(e.kind),e.name,e.detail||``,y(e.uri),O(e.range),O(e.selectionRange),e.data);return e.tags!==void 0&&(t.tags=ye(e.tags)),t}async function at(e,t){if(e!==null)return i.map(e,it,t)}function ot(e){if(r.string(e))return e;if(n.RelativePattern.is(e)){if(n.URI.is(e.baseUri))return new t.RelativePattern(y(e.baseUri),e.pattern);if(n.WorkspaceFolder.is(e.baseUri)){let n=t.workspace.getWorkspaceFolder(y(e.baseUri.uri));return n===void 0?void 0:new t.RelativePattern(n,e.pattern)}}}async function st(e,n){if(!e)return;if(Array.isArray(e))return i.map(e,e=>ct(e),n);let r=e,a=await i.map(r.items,e=>ct(e),n);return new t.InlineCompletionList(a)}function ct(e){let n;n=typeof e.insertText==`string`?e.insertText:new t.SnippetString(e.insertText.value);let r;e.command&&(r=K(e.command));let i=new t.InlineCompletionItem(n,O(e.range),r);return e.filterText&&(i.filterText=e.filterText),i}return{asUri:y,asDocumentSelector:b,asDiagnostics:x,asDiagnostic:C,asRange:O,asRanges:k,asPosition:D,asDiagnosticSeverity:A,asDiagnosticTag:E,asHover:P,asCompletionResult:ee,asCompletionItem:L,asTextEdit:z,asTextEdits:B,asSignatureHelp:ae,asSignatureInformations:H,asSignatureInformation:oe,asParameterInformations:se,asParameterInformation:ce,asDeclarationResult:U,asDefinitionResult:ue,asLocation:le,asReferences:pe,asDocumentHighlights:me,asDocumentHighlight:he,asDocumentHighlightKind:ge,asSymbolKind:W,asSymbolTag:ve,asSymbolTags:ye,asSymbolInformations:_e,asSymbolInformation:be,asDocumentSymbols:xe,asDocumentSymbol:Se,asCommand:K,asCommands:Ce,asCodeAction:Ee,asCodeActionKind:we,asCodeActionKinds:Te,asCodeActionResult:J,asCodeLens:De,asCodeLenses:Y,asWorkspaceEdit:Oe,asDocumentLink:Ae,asDocumentLinks:X,asFoldingRangeKind:Fe,asFoldingRange:Ie,asFoldingRanges:Le,asColor:je,asColorInformation:Me,asColorInformations:Z,asColorPresentation:Ne,asColorPresentations:Pe,asSelectionRange:Re,asSelectionRanges:ze,asInlineValue:Be,asInlineValues:Ve,asInlayHint:He,asInlayHints:Ge,asSemanticTokensLegend:tt,asSemanticTokens:Qe,asSemanticTokensEdit:$e,asSemanticTokensEdits:et,asCallHierarchyItem:Ke,asCallHierarchyItems:qe,asCallHierarchyIncomingCall:Je,asCallHierarchyIncomingCalls:Ye,asCallHierarchyOutgoingCall:Xe,asCallHierarchyOutgoingCalls:Ze,asLinkedEditingRanges:nt,asTypeHierarchyItem:it,asTypeHierarchyItems:at,asGlobPattern:ot,asInlineCompletionResult:st,asInlineCompletionItem:ct}}e.createConverter=g})),J=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.generateUuid=e.parse=e.isUUID=e.v4=e.empty=void 0;var t=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},n=class e extends t{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return e._oneOf(e._chars)}constructor(){super([e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),`-`,e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),`-`,`4`,e._randomHex(),e._randomHex(),e._randomHex(),`-`,e._oneOf(e._timeHighBits),e._randomHex(),e._randomHex(),e._randomHex(),`-`,e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex()].join(``))}};n._chars=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`6`,`7`,`8`,`9`,`a`,`b`,`c`,`d`,`e`,`f`],n._timeHighBits=[`8`,`9`,`a`,`b`],e.empty=new t(`00000000-0000-0000-0000-000000000000`);function r(){return new n}e.v4=r;let i=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function a(e){return i.test(e)}e.isUUID=a;function o(e){if(!a(e))throw Error(`invalid uuid`);return new t(e)}e.parse=o;function s(){return r().asHex()}e.generateUuid=s})),De=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ProgressPart=void 0;let t=require(`vscode`),n=W(),r=_();e.ProgressPart=class{constructor(e,t,r){this._client=e,this._token=t,this._reported=0,this._infinite=!1,this._lspProgressDisposable=this._client.onProgress(n.WorkDoneProgress.type,this._token,e=>{switch(e.kind){case`begin`:this.begin(e);break;case`report`:this.report(e);break;case`end`:this.done(),r&&r(this);break}})}begin(e){this._infinite=e.percentage===void 0,this._lspProgressDisposable!==void 0&&t.window.withProgress({location:t.ProgressLocation.Window,cancellable:e.cancellable,title:e.title},async(t,r)=>{if(this._lspProgressDisposable!==void 0)return this._progress=t,this._cancellationToken=r,this._tokenDisposable=this._cancellationToken.onCancellationRequested(()=>{this._client.sendNotification(n.WorkDoneProgressCancelNotification.type,{token:this._token})}),this.report(e),new Promise((e,t)=>{this._resolve=e,this._reject=t})})}report(e){if(this._infinite&&r.string(e.message))this._progress!==void 0&&this._progress.report({message:e.message});else if(r.number(e.percentage)){let t=Math.max(0,Math.min(e.percentage,100)),n=Math.max(0,t-this._reported);this._reported+=n,this._progress!==void 0&&this._progress.report({message:e.message,increment:n})}}cancel(){this.cleanup(),this._reject!==void 0&&(this._reject(),this._resolve=void 0,this._reject=void 0)}done(){this.cleanup(),this._resolve!==void 0&&(this._resolve(),this._resolve=void 0,this._reject=void 0)}cleanup(){this._lspProgressDisposable!==void 0&&(this._lspProgressDisposable.dispose(),this._lspProgressDisposable=void 0),this._tokenDisposable!==void 0&&(this._tokenDisposable.dispose(),this._tokenDisposable=void 0),this._progress=void 0,this._cancellationToken=void 0}}})),Y=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WorkspaceFeature=e.TextDocumentLanguageFeature=e.TextDocumentEventFeature=e.DynamicDocumentFeature=e.DynamicFeature=e.StaticFeature=e.ensure=e.LSPCancellationError=void 0;let t=require(`vscode`),n=W(),r=_(),i=J();e.LSPCancellationError=class extends t.CancellationError{constructor(e){super(),this.data=e}};function a(e,t){return e[t]===void 0&&(e[t]={}),e[t]}e.ensure=a;var o;(function(e){function t(e){let t=e;return t!=null&&r.func(t.fillClientCapabilities)&&r.func(t.initialize)&&r.func(t.getState)&&r.func(t.clear)&&(t.fillInitializeParams===void 0||r.func(t.fillInitializeParams))}e.is=t})(o||(e.StaticFeature=o={}));var s;(function(e){function t(e){let t=e;return t!=null&&r.func(t.fillClientCapabilities)&&r.func(t.initialize)&&r.func(t.getState)&&r.func(t.clear)&&(t.fillInitializeParams===void 0||r.func(t.fillInitializeParams))&&r.func(t.register)&&r.func(t.unregister)&&t.registrationType!==void 0}e.is=t})(s||(e.DynamicFeature=s={}));var c=class{constructor(e){this._client=e}getState(){let e=this.getDocumentSelectors(),n=0;for(let r of e){n++;for(let e of t.workspace.textDocuments)if(t.languages.match(r,e)>0)return{kind:`document`,id:this.registrationType.method,registrations:!0,matches:!0}}let r=n>0;return{kind:`document`,id:this.registrationType.method,registrations:r,matches:!1}}};e.DynamicDocumentFeature=c,e.TextDocumentEventFeature=class extends c{static textDocumentFilter(e,n){for(let r of e)if(t.languages.match(r,n)>0)return!0;return!1}constructor(e,n,r,i,a,o,s){super(e),this._event=n,this._type=r,this._middleware=i,this._createParams=a,this._textDocument=o,this._selectorFilter=s,this._selectors=new Map,this._onNotificationSent=new t.EventEmitter}getStateInfo(){return[this._selectors.values(),!1]}getDocumentSelectors(){return this._selectors.values()}register(e){e.registerOptions.documentSelector&&(this._listener||=this._event(e=>{this.callback(e).catch(e=>{this._client.error(`Sending document notification ${this._type.method} failed.`,e)})}),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}async callback(e){let t=async e=>{let t=this._createParams(e);await this._client.sendNotification(this._type,t),this.notificationSent(this.getTextDocument(e),this._type,t)};if(this.matches(e)){let n=this._middleware();return n?n(e,e=>t(e)):t(e)}}matches(e){return this._client.hasDedicatedTextSynchronizationFeature(this._textDocument(e))?!1:!this._selectorFilter||this._selectorFilter(this._selectors.values(),e)}get onNotificationSent(){return this._onNotificationSent.event}notificationSent(e,t,n){this._onNotificationSent.fire({textDocument:e,type:t,params:n})}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._selectors.clear(),this._onNotificationSent.dispose(),this._listener&&=(this._listener.dispose(),void 0)}getProvider(e){for(let n of this._selectors.values())if(t.languages.match(n,e)>0)return{send:e=>this.callback(e)}}},e.TextDocumentLanguageFeature=class extends c{constructor(e,t){super(e),this._registrationType=t,this._registrations=new Map}*getDocumentSelectors(){for(let e of this._registrations.values()){let t=e.data.registerOptions.documentSelector;t!==null&&(yield this._client.protocol2CodeConverter.asDocumentSelector(t))}}get registrationType(){return this._registrationType}register(e){if(!e.registerOptions.documentSelector)return;let t=this.registerLanguageProvider(e.registerOptions,e.id);this._registrations.set(e.id,{disposable:t[0],data:e,provider:t[1]})}unregister(e){let t=this._registrations.get(e);t!==void 0&&t.disposable.dispose()}clear(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getRegistration(e,t){if(!t)return[void 0,void 0];if(n.TextDocumentRegistrationOptions.is(t)){let r=n.StaticRegistrationOptions.hasId(t)?t.id:i.generateUuid(),a=t.documentSelector??e;if(a)return[r,Object.assign({},t,{documentSelector:a})]}else if(r.boolean(t)&&t===!0||n.WorkDoneProgressOptions.is(t)){if(!e)return[void 0,void 0];let n=r.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e});return[i.generateUuid(),n]}return[void 0,void 0]}getRegistrationOptions(e,t){if(!(!e||!t))return r.boolean(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e})}getProvider(e){for(let n of this._registrations.values()){let r=n.data.registerOptions.documentSelector;if(r!==null&&t.languages.match(this._client.protocol2CodeConverter.asDocumentSelector(r),e)>0)return n.provider}}getAllProviders(){let e=[];for(let t of this._registrations.values())e.push(t.provider);return e}},e.WorkspaceFeature=class{constructor(e,t){this._client=e,this._registrationType=t,this._registrations=new Map}getState(){let e=this._registrations.size>0;return{kind:`workspace`,id:this._registrationType.method,registrations:e}}get registrationType(){return this._registrationType}register(e){let t=this.registerLanguageProvider(e.registerOptions);this._registrations.set(e.id,{disposable:t[0],provider:t[1]})}unregister(e){let t=this._registrations.get(e);t!==void 0&&t.disposable.dispose()}clear(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getProviders(){let e=[];for(let t of this._registrations.values())e.push(t.provider);return e}}})),Oe=o(((e,t)=>{t.exports=typeof process==`object`&&process&&process.platform===`win32`?{sep:`\\`}:{sep:`/`}})),ke=o(((e,t)=>{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i=0?c:l;r.length&&(s=[a,o])}return s}})),Ae=o(((e,t)=>{var n=ke();t.exports=f;var r=`\0SLASH`+Math.random()+`\0`,i=`\0OPEN`+Math.random()+`\0`,a=`\0CLOSE`+Math.random()+`\0`,o=`\0COMMA`+Math.random()+`\0`,s=`\0PERIOD`+Math.random()+`\0`;function c(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function l(e){return e.split(`\\\\`).join(r).split(`\\{`).join(i).split(`\\}`).join(a).split(`\\,`).join(o).split(`\\.`).join(s)}function u(e){return e.split(r).join(`\\`).split(i).join(`{`).split(a).join(`}`).split(o).join(`,`).split(s).join(`.`)}function d(e){if(!e)return[``];var t=[],r=n(`{`,`}`,e);if(!r)return e.split(`,`);var i=r.pre,a=r.body,o=r.post,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;var c=d(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function f(e,t){if(!e)return[];t||={};var n=t.max==null?1/0:t.max;return e.substr(0,2)===`{}`&&(e=`\\{\\}`+e.substr(2)),_(l(e),n,!0).map(u)}function p(e){return`{`+e+`}`}function m(e){return/^-?0\d/.test(e)}function h(e,t){return e<=t}function g(e,t){return e>=t}function _(e,t,r){var i=[],o=n(`{`,`}`,e);if(!o)return[e];var s=o.pre,l=o.post.length?_(o.post,t,!1):[``];if(/\$$/.test(o.pre))for(var u=0;u=0;if(!b&&!x)return o.post.match(/,(?!,).*\}/)?(e=o.pre+`{`+o.body+a+o.post,_(e,t,!0)):[e];var S;if(b)S=o.body.split(/\.\./);else if(S=d(o.body),S.length===1&&(S=_(S[0],t,!1).map(p),S.length===1))return l.map(function(e){return o.pre+S[0]+e});var C;if(b){var w=c(S[0]),T=c(S[1]),E=Math.max(S[0].length,S[1].length),D=S.length==3?Math.max(Math.abs(c(S[2])),1):1,O=h;T0){var N=Array(M+1).join(`0`);j=A<0?`-`+N+j.slice(1):N+j}}C.push(j)}}else{C=[];for(var P=0;P{let n=t.exports=(e,t,n={})=>(h(t),!n.nocomment&&t.charAt(0)===`#`?!1:new x(t,n).match(e));t.exports=n;let r=Oe();n.sep=r.sep;let i=Symbol(`globstar **`);n.GLOBSTAR=i;let a=Ae(),o={"!":{open:`(?:(?!(?:`,close:`))[^/]*?)`},"?":{open:`(?:`,close:`)?`},"+":{open:`(?:`,close:`)+`},"*":{open:`(?:`,close:`)*`},"@":{open:`(?:`,close:`)`}},s=`[^/]`,c=s+`*?`,l=e=>e.split(``).reduce((e,t)=>(e[t]=!0,e),{}),u=l(`().*{}+?[]^$\\!`),d=l(`[.(`),f=/\/+/;n.filter=(e,t={})=>(r,i,a)=>n(r,e,t);let p=(e,t={})=>{let n={};return Object.keys(e).forEach(t=>n[t]=e[t]),Object.keys(t).forEach(e=>n[e]=t[e]),n};n.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return n;let t=n,r=(n,r,i)=>t(n,r,p(e,i));return r.Minimatch=class extends t.Minimatch{constructor(t,n){super(t,p(e,n))}},r.Minimatch.defaults=n=>t.defaults(p(e,n)).Minimatch,r.filter=(n,r)=>t.filter(n,p(e,r)),r.defaults=n=>t.defaults(p(e,n)),r.makeRe=(n,r)=>t.makeRe(n,p(e,r)),r.braceExpand=(n,r)=>t.braceExpand(n,p(e,r)),r.match=(n,r,i)=>t.match(n,r,p(e,i)),r},n.braceExpand=(e,t)=>m(e,t);let m=(e,t={})=>(h(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:a(e)),h=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},g=Symbol(`subparse`);n.makeRe=(e,t)=>new x(e,t||{}).makeRe(),n.match=(e,t,n={})=>{let r=new x(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};let _=e=>e.replace(/\\(.)/g,`$1`),v=e=>e.replace(/\\([^-\]])/g,`$1`),y=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),b=e=>e.replace(/[[\]\\]/g,`\\$&`);var x=class{constructor(e,t){h(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion===void 0?200:t.maxGlobstarRecursion,this.set=[],this.pattern=e,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}debug(){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate();let n=this.globSet=this.braceExpand();t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,n),n=this.globParts=n.map(e=>e.split(f)),this.debug(this.pattern,n),n=n.map((e,t,n)=>e.map(this.parse,this)),this.debug(this.pattern,n),n=n.filter(e=>e.indexOf(!1)===-1),this.debug(this.pattern,n),this.set=n}parseNegate(){if(this.options.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r=0;e--)if(t[e]===i){s=e;break}let c=t.slice(a,o),l=n?t.slice(o+1):t.slice(o+1,s),u=n?[]:t.slice(s+1);if(c.length){let t=e.slice(r,r+c.length);if(!this._matchOne(t,c,n,0,0))return!1;r+=c.length}let d=0;if(u.length){if(u.length+r>e.length)return!1;let t=e.length-u.length;if(this._matchOne(e,u,n,t,0))d=u.length;else{if(e[e.length-1]!==``||r+u.length===e.length||!this._matchOne(e,u,n,t-1,0))return!1;d=u.length+1}}if(!l.length){let t=!!d;for(let n=r;nE?``:D?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`,k=e=>e.charAt(0)===`.`?``:n.dot?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`,A=()=>{if(m){switch(m){case`*`:r+=c,a=!0;break;case`?`:r+=s,a=!0;break;default:r+=`\\`+m;break}this.debug(`clearStateChar %j %j`,m,r),m=!1}};for(let t=0,i;t(n||=`\\`,t+t+n+`|`)),this.debug(`tail=%j %s`,e,e,w,r);let t=w.type===`*`?c:w.type===`?`?s:`\\`+w.type;a=!0,r=r.slice(0,w.reStart)+t+`\\(`+e}A(),l&&(r+=`\\\\`);let j=d[r.charAt(0)];for(let e=p.length-1;e>-1;e--){let n=p[e],i=r.slice(0,n.reStart),a=r.slice(n.reStart,n.reEnd-8),o=r.slice(n.reEnd),s=r.slice(n.reEnd-8,n.reEnd)+o,c=i.split(`)`).length,l=i.split(`(`).length-c,u=o;for(let e=0;e(e=e.map(e=>typeof e==`string`?y(e):e===i?i:e._src).reduce((e,t)=>(e[e.length-1]===i&&t===i||e.push(t),e),[]),e.forEach((t,r)=>{t!==i||e[r-1]===i||(r===0?e.length>1?e[r+1]=`(?:\\/|`+n+`\\/)?`+e[r+1]:e[r]=n:r===e.length-1?e[r-1]+=`(?:\\/|`+n+`)?`:(e[r-1]+=`(?:\\/|\\/`+n+`\\/)`+e[r+1],e[r+1]=i))}),e.filter(e=>e!==i).join(`/`))).join(`|`);a=`^(?:`+a+`)$`,this.negate&&(a=`^(?!`+a+`).*$`);try{this.regexp=new RegExp(a,r)}catch{this.regexp=!1}return this.regexp}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;r.sep!==`/`&&(e=e.split(r.sep).join(`/`)),e=e.split(f),this.debug(this.pattern,`split`,e);let i=this.set;this.debug(this.pattern,`set`,i);let a;for(let t=e.length-1;t>=0&&(a=e[t],!a);t--);for(let r=0;r{Object.defineProperty(e,`__esModule`,{value:!0}),e.DiagnosticFeature=e.DiagnosticPullMode=e.vsdiag=void 0;let t=X(),n=require(`vscode`),r=W(),i=J(),a=Y();function o(e,t){return e[t]===void 0&&(e[t]={}),e[t]}var s;(function(e){(function(e){e.full=`full`,e.unChanged=`unChanged`})(e.DocumentDiagnosticReportKind||={})})(s||(e.vsdiag=s={}));var c;(function(e){e.onType=`onType`,e.onSave=`onSave`})(c||(e.DiagnosticPullMode=c={}));var l;(function(e){e.active=`open`,e.reschedule=`reschedule`,e.outDated=`drop`})(l||={});var u=class e{constructor(){this.open=new Set,this._onOpen=new n.EventEmitter,this._onClose=new n.EventEmitter,e.fillTabResources(this.open);let t=t=>{if(t.closed.length===0&&t.opened.length===0)return;let r=this.open,i=new Set;e.fillTabResources(i);let a=new Set,o=new Set(i);for(let e of r.values())i.has(e)?o.delete(e):a.add(e);if(this.open=i,a.size>0){let e=new Set;for(let t of a)e.add(n.Uri.parse(t));this._onClose.fire(e)}if(o.size>0){let e=new Set;for(let t of o)e.add(n.Uri.parse(t));this._onOpen.fire(e)}};n.window.tabGroups.onDidChangeTabs===void 0?this.disposable={dispose:()=>{}}:this.disposable=n.window.tabGroups.onDidChangeTabs(t)}get onClose(){return this._onClose.event}get onOpen(){return this._onOpen.event}dispose(){this.disposable.dispose()}isActive(e){return e instanceof n.Uri?n.window.activeTextEditor?.document.uri===e:n.window.activeTextEditor?.document===e}isVisible(e){let t=e instanceof n.Uri?e:e.uri;return this.open.has(t.toString())}getTabResources(){let t=new Set;return e.fillTabResources(new Set,t),t}static fillTabResources(e,t){let r=e??new Set;for(let e of n.window.tabGroups.all)for(let i of e.tabs){let e=i.input,a;e instanceof n.TabInputText?a=e.uri:e instanceof n.TabInputTextDiff?a=e.modified:e instanceof n.TabInputCustom&&(a=e.uri),a!==void 0&&!r.has(a.toString())&&(r.add(a.toString()),t!==void 0&&t.add(a))}}},d;(function(e){e[e.document=1]=`document`,e[e.workspace=2]=`workspace`})(d||={});var f;(function(e){function t(e){return e instanceof n.Uri?e.toString():e.uri.toString()}e.asKey=t})(f||={});var p=class{constructor(){this.documentPullStates=new Map,this.workspacePullStates=new Map}track(e,t,r){let i=e===d.document?this.documentPullStates:this.workspacePullStates,[a,o,s]=t instanceof n.Uri?[t.toString(),t,r]:[t.uri.toString(),t.uri,t.version],c=i.get(a);return c===void 0&&(c={document:o,pulledVersion:s,resultId:void 0},i.set(a,c)),c}update(e,t,r,i){let a=e===d.document?this.documentPullStates:this.workspacePullStates,[o,s,c,l]=t instanceof n.Uri?[t.toString(),t,r,i]:[t.uri.toString(),t.uri,t.version,r],u=a.get(o);u===void 0?(u={document:s,pulledVersion:c,resultId:l},a.set(o,u)):(u.pulledVersion=c,u.resultId=l)}unTrack(e,t){let n=f.asKey(t);(e===d.document?this.documentPullStates:this.workspacePullStates).delete(n)}tracks(e,t){let n=f.asKey(t);return(e===d.document?this.documentPullStates:this.workspacePullStates).has(n)}getResultId(e,t){let n=f.asKey(t);return(e===d.document?this.documentPullStates:this.workspacePullStates).get(n)?.resultId}getAllResultIds(){let e=[];for(let[t,n]of this.workspacePullStates)this.documentPullStates.has(t)&&(n=this.documentPullStates.get(t)),n.resultId!==void 0&&e.push({uri:t,value:n.resultId});return e}},m=class{constructor(e,t,r){this.client=e,this.tabs=t,this.options=r,this.isDisposed=!1,this.onDidChangeDiagnosticsEmitter=new n.EventEmitter,this.provider=this.createProvider(),this.diagnostics=n.languages.createDiagnosticCollection(r.identifier),this.openRequests=new Map,this.documentStates=new p,this.workspaceErrorCounter=0}knows(e,t){let r=t instanceof n.Uri?t:t.uri;return this.documentStates.tracks(e,t)||this.openRequests.has(r.toString())}forget(e,t){this.documentStates.unTrack(e,t)}pull(e,t){if(this.isDisposed)return;let r=e instanceof n.Uri?e:e.uri;this.pullAsync(e).then(()=>{t&&t()},e=>{this.client.error(`Document pull failed for text document ${r.toString()}`,e,!1)})}async pullAsync(e,t){if(this.isDisposed)return;let i=e instanceof n.Uri,o=i?e:e.uri,c=o.toString();t=i?t:e.version;let u=this.openRequests.get(c),f=i?this.documentStates.track(d.document,e,t):this.documentStates.track(d.document,e);if(u===void 0){let i=new n.CancellationTokenSource;this.openRequests.set(c,{state:l.active,document:e,version:t,tokenSource:i});let u,p;try{u=await this.provider.provideDiagnostics(e,f.resultId,i.token)??{kind:s.DocumentDiagnosticReportKind.full,items:[]}}catch(t){if(t instanceof a.LSPCancellationError&&r.DiagnosticServerCancellationData.is(t.data)&&t.data.retriggerRequest===!1&&(p={state:l.outDated,document:e}),p===void 0&&t instanceof n.CancellationError)p={state:l.reschedule,document:e};else throw t}if(p??=this.openRequests.get(c),p===void 0){this.client.error(`Lost request state in diagnostic pull model. Clearing diagnostics for ${c}`),this.diagnostics.delete(o);return}if(this.openRequests.delete(c),!this.tabs.isVisible(e)){this.documentStates.unTrack(d.document,e);return}if(p.state===l.outDated)return;u!==void 0&&(u.kind===s.DocumentDiagnosticReportKind.full&&this.diagnostics.set(o,u.items),f.pulledVersion=t,f.resultId=u.resultId),p.state===l.reschedule&&this.pull(e)}else u.state===l.active?(u.tokenSource.cancel(),this.openRequests.set(c,{state:l.reschedule,document:u.document})):u.state===l.outDated&&this.openRequests.set(c,{state:l.reschedule,document:u.document})}forgetDocument(e){let t=e instanceof n.Uri?e:e.uri,r=t.toString(),i=this.openRequests.get(r);this.options.workspaceDiagnostics?i===void 0?this.pull(e,()=>{this.forget(d.document,e)}):this.openRequests.set(r,{state:l.reschedule,document:e}):(i!==void 0&&(i.state===l.active&&i.tokenSource.cancel(),this.openRequests.set(r,{state:l.outDated,document:e})),this.diagnostics.delete(t),this.forget(d.document,e))}pullWorkspace(){this.isDisposed||this.pullWorkspaceAsync().then(()=>{this.workspaceTimeout=(0,r.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3)},e=>{!(e instanceof a.LSPCancellationError)&&!r.DiagnosticServerCancellationData.is(e.data)&&(this.client.error(`Workspace diagnostic pull failed.`,e,!1),this.workspaceErrorCounter++),this.workspaceErrorCounter<=5&&(this.workspaceTimeout=(0,r.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3))})}async pullWorkspaceAsync(){if(!this.provider.provideWorkspaceDiagnostics||this.isDisposed)return;this.workspaceCancellation!==void 0&&(this.workspaceCancellation.cancel(),this.workspaceCancellation=void 0),this.workspaceCancellation=new n.CancellationTokenSource;let e=this.documentStates.getAllResultIds().map(e=>({uri:this.client.protocol2CodeConverter.asUri(e.uri),value:e.value}));await this.provider.provideWorkspaceDiagnostics(e,this.workspaceCancellation.token,e=>{if(!(!e||this.isDisposed))for(let t of e.items)t.kind===s.DocumentDiagnosticReportKind.full&&(this.documentStates.tracks(d.document,t.uri)||this.diagnostics.set(t.uri,t.items)),this.documentStates.update(d.workspace,t.uri,t.version??void 0,t.resultId)})}createProvider(){let e={onDidChangeDiagnostics:this.onDidChangeDiagnosticsEmitter.event,provideDiagnostics:(e,t,i)=>{let a=(e,t,i)=>{let a={identifier:this.options.identifier,textDocument:{uri:this.client.code2ProtocolConverter.asUri(e instanceof n.Uri?e:e.uri)},previousResultId:t};return this.isDisposed===!0||!this.client.isRunning()?{kind:s.DocumentDiagnosticReportKind.full,items:[]}:this.client.sendRequest(r.DocumentDiagnosticRequest.type,a,i).then(async e=>e==null||this.isDisposed||i.isCancellationRequested?{kind:s.DocumentDiagnosticReportKind.full,items:[]}:e.kind===r.DocumentDiagnosticReportKind.Full?{kind:s.DocumentDiagnosticReportKind.full,resultId:e.resultId,items:await this.client.protocol2CodeConverter.asDiagnostics(e.items,i)}:{kind:s.DocumentDiagnosticReportKind.unChanged,resultId:e.resultId},e=>this.client.handleFailedRequest(r.DocumentDiagnosticRequest.type,i,e,{kind:s.DocumentDiagnosticReportKind.full,items:[]}))},o=this.client.middleware;return o.provideDiagnostics?o.provideDiagnostics(e,t,i,a):a(e,t,i)}};return this.options.workspaceDiagnostics&&(e.provideWorkspaceDiagnostics=(e,t,n)=>{let a=async e=>e.kind===r.DocumentDiagnosticReportKind.Full?{kind:s.DocumentDiagnosticReportKind.full,uri:this.client.protocol2CodeConverter.asUri(e.uri),resultId:e.resultId,version:e.version,items:await this.client.protocol2CodeConverter.asDiagnostics(e.items,t)}:{kind:s.DocumentDiagnosticReportKind.unChanged,uri:this.client.protocol2CodeConverter.asUri(e.uri),resultId:e.resultId,version:e.version},o=e=>{let t=[];for(let n of e)t.push({uri:this.client.code2ProtocolConverter.asUri(n.uri),value:n.value});return t},c=(e,t)=>{let s=(0,i.generateUuid)(),c=this.client.onProgress(r.WorkspaceDiagnosticRequest.partialResult,s,async e=>{if(e==null){n(null);return}let t={items:[]};for(let n of e.items)try{t.items.push(await a(n))}catch(e){this.client.error(`Converting workspace diagnostics failed.`,e)}n(t)}),l={identifier:this.options.identifier,previousResultIds:o(e),partialResultToken:s};return this.isDisposed===!0||!this.client.isRunning()?{items:[]}:this.client.sendRequest(r.WorkspaceDiagnosticRequest.type,l,t).then(async e=>{if(t.isCancellationRequested)return{items:[]};let r={items:[]};for(let t of e.items)r.items.push(await a(t));return c.dispose(),n(r),{items:[]}},e=>(c.dispose(),this.client.handleFailedRequest(r.DocumentDiagnosticRequest.type,t,e,{items:[]})))},l=this.client.middleware;return l.provideWorkspaceDiagnostics?l.provideWorkspaceDiagnostics(e,t,n,c):c(e,t,n)}),e}dispose(){this.isDisposed=!0,this.workspaceCancellation?.cancel(),this.workspaceTimeout?.dispose();for(let[e,t]of this.openRequests)t.state===l.active&&t.tokenSource.cancel(),this.openRequests.set(e,{state:l.outDated,document:t.document});this.diagnostics.dispose()}},h=class{constructor(e){this.diagnosticRequestor=e,this.documents=new r.LinkedMap,this.isDisposed=!1}add(e){if(this.isDisposed===!0)return;let t=f.asKey(e);this.documents.has(t)||(this.documents.set(t,e,r.Touch.Last),this.trigger())}remove(e){let t=f.asKey(e);this.documents.delete(t),this.documents.size===0?this.stop():t===this.endDocumentKey()&&(this.endDocument=this.documents.last)}trigger(){if(this.isDisposed!==!0){if(this.intervalHandle!==void 0){this.endDocument=this.documents.last;return}this.endDocument=this.documents.last,this.intervalHandle=(0,r.RAL)().timer.setInterval(()=>{let e=this.documents.first;if(e!==void 0){let t=f.asKey(e);this.diagnosticRequestor.pull(e),this.documents.set(t,e,r.Touch.Last),t===this.endDocumentKey()&&this.stop()}},200)}}dispose(){this.isDisposed=!0,this.stop(),this.documents.clear()}stop(){this.intervalHandle?.dispose(),this.intervalHandle=void 0,this.endDocument=void 0}endDocumentKey(){return this.endDocument===void 0?void 0:f.asKey(this.endDocument)}},g=class{constructor(e,i,a){let o=e.clientOptions.diagnosticPullOptions??{onChange:!0,onSave:!1},s=e.protocol2CodeConverter.asDocumentSelector(a.documentSelector),l=[],u=e=>{let n=a.documentSelector;if(o.match!==void 0)return o.match(n,e);for(let i of n)if(r.TextDocumentFilter.is(i)){if(typeof i==`string`||i.language!==void 0&&i.language!==`*`||i.scheme!==void 0&&i.scheme!==`*`&&i.scheme!==e.scheme)return!1;if(i.pattern!==void 0){let n=new t.Minimatch(i.pattern,{noext:!0});if(!n.makeRe()||!n.match(e.fsPath))return!1}}return!0},f=e=>e instanceof n.Uri?u(e):n.languages.match(s,e)>0&&i.isVisible(e),p=e=>e instanceof n.Uri?this.activeTextDocument?.uri.toString()===e.toString():this.activeTextDocument===e;this.diagnosticRequestor=new m(e,i,a),this.backgroundScheduler=new h(this.diagnosticRequestor);let g=e=>{!f(e)||!a.interFileDependencies||p(e)||this.backgroundScheduler.add(e)};this.activeTextDocument=n.window.activeTextEditor?.document,n.window.onDidChangeActiveTextEditor(e=>{let t=this.activeTextDocument;this.activeTextDocument=e?.document,t!==void 0&&g(t),this.activeTextDocument!==void 0&&this.backgroundScheduler.remove(this.activeTextDocument)});let _=e.getFeature(r.DidOpenTextDocumentNotification.method);l.push(_.onNotificationSent(e=>{let t=e.textDocument;this.diagnosticRequestor.knows(d.document,t)||f(t)&&this.diagnosticRequestor.pull(t,()=>{g(t)})})),l.push(i.onOpen(e=>{for(let t of e){if(this.diagnosticRequestor.knows(d.document,t))continue;let e=t.toString(),r;for(let t of n.workspace.textDocuments)if(e===t.uri.toString()){r=t;break}r!==void 0&&f(r)&&this.diagnosticRequestor.pull(r,()=>{g(r)})}}));let v=new Set;for(let e of n.workspace.textDocuments)f(e)&&(this.diagnosticRequestor.pull(e,()=>{g(e)}),v.add(e.uri.toString()));if(o.onTabs===!0)for(let e of i.getTabResources())!v.has(e.toString())&&f(e)&&this.diagnosticRequestor.pull(e,()=>{g(e)});if(o.onChange===!0){let t=e.getFeature(r.DidChangeTextDocumentNotification.method);l.push(t.onNotificationSent(async e=>{let t=e.textDocument;(o.filter===void 0||!o.filter(t,c.onType))&&this.diagnosticRequestor.knows(d.document,t)&&this.diagnosticRequestor.pull(t,()=>{this.backgroundScheduler.trigger()})}))}if(o.onSave===!0){let t=e.getFeature(r.DidSaveTextDocumentNotification.method);l.push(t.onNotificationSent(e=>{let t=e.textDocument;(o.filter===void 0||!o.filter(t,c.onSave))&&this.diagnosticRequestor.knows(d.document,t)&&this.diagnosticRequestor.pull(e.textDocument,()=>{this.backgroundScheduler.trigger()})}))}let y=e.getFeature(r.DidCloseTextDocumentNotification.method);l.push(y.onNotificationSent(e=>{this.cleanUpDocument(e.textDocument)})),i.onClose(e=>{for(let t of e)this.cleanUpDocument(t)}),this.diagnosticRequestor.onDidChangeDiagnosticsEmitter.event(()=>{for(let e of n.workspace.textDocuments)f(e)&&this.diagnosticRequestor.pull(e)}),a.workspaceDiagnostics===!0&&a.identifier!==`da348dc5-c30a-4515-9d98-31ff3be38d14`&&this.diagnosticRequestor.pullWorkspace(),this.disposable=n.Disposable.from(...l,this.backgroundScheduler,this.diagnosticRequestor)}get onDidChangeDiagnosticsEmitter(){return this.diagnosticRequestor.onDidChangeDiagnosticsEmitter}get diagnostics(){return this.diagnosticRequestor.provider}cleanUpDocument(e){this.diagnosticRequestor.knows(d.document,e)&&(this.diagnosticRequestor.forgetDocument(e),this.backgroundScheduler.remove(e))}};e.DiagnosticFeature=class extends a.TextDocumentLanguageFeature{constructor(e){super(e,r.DocumentDiagnosticRequest.type)}fillClientCapabilities(e){let t=o(o(e,`textDocument`),`diagnostic`);t.dynamicRegistration=!0,t.relatedDocumentSupport=!1,o(o(e,`workspace`),`diagnostics`).refreshSupport=!0}initialize(e,t){this._client.onRequest(r.DiagnosticRefreshRequest.type,async()=>{for(let e of this.getAllProviders())e.onDidChangeDiagnosticsEmitter.fire()});let[n,i]=this.getRegistration(t,e.diagnosticProvider);!n||!i||this.register({id:n,registerOptions:i})}clear(){this.tabs!==void 0&&(this.tabs.dispose(),this.tabs=void 0),super.clear()}registerLanguageProvider(e){this.tabs===void 0&&(this.tabs=new u);let t=new g(this._client,this.tabs,e);return[t.disposable,t]}}})),Me=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NotebookDocumentSyncFeature=void 0;let t=require(`vscode`),n=X(),r=W(),i=J(),a=_();function o(e,t){return e[t]===void 0&&(e[t]={}),e[t]}var s;(function(e){(function(n){function i(e,t){return{version:e.version,uri:t.asUri(e.uri)}}n.asVersionedNotebookDocumentIdentifier=i;function o(e,t,n){let i=r.NotebookDocument.create(n.asUri(e.uri),e.notebookType,e.version,s(t,n));return Object.keys(e.metadata).length>0&&(i.metadata=c(e.metadata)),i}n.asNotebookDocument=o;function s(e,t){return e.map(e=>l(e,t))}n.asNotebookCells=s;function c(e){return d(new Set,e)}n.asMetadata=c;function l(e,t){let n=r.NotebookCell.create(u(e.kind),t.asUri(e.document.uri));return Object.keys(e.metadata).length>0&&(n.metadata=c(e.metadata)),e.executionSummary!==void 0&&a.number(e.executionSummary.executionOrder)&&a.boolean(e.executionSummary.success)&&(n.executionSummary={executionOrder:e.executionSummary.executionOrder,success:e.executionSummary.success}),n}n.asNotebookCell=l;function u(e){switch(e){case t.NotebookCellKind.Markup:return r.NotebookCellKind.Markup;case t.NotebookCellKind.Code:return r.NotebookCellKind.Code}}function d(e,t){if(e.has(t))throw Error(`Can't deep copy cyclic structures.`);if(Array.isArray(t)){let n=[];for(let r of t)if(typeof r==`object`&&r||Array.isArray(r))n.push(d(e,r));else{if(r instanceof RegExp)throw Error(`Can't transfer regular expressions to the server`);n.push(r)}return n}else{let n=Object.keys(t),r=Object.create(null);for(let i of n){let n=t[i];if(typeof n==`object`&&n||Array.isArray(n))r[i]=d(e,n);else{if(n instanceof RegExp)throw Error(`Can't transfer regular expressions to the server`);r[i]=n}}return r}}function f(e,t){let n=t.asChangeTextDocumentParams(e,e.document.uri,e.document.version);return{document:n.textDocument,changes:n.contentChanges}}n.asTextContentChange=f;function p(t,n){let r=Object.create(null);if(t.metadata&&(r.metadata=e.c2p.asMetadata(t.metadata)),t.cells!==void 0){let i=Object.create(null),a=t.cells;a.structure&&(i.structure={array:{start:a.structure.array.start,deleteCount:a.structure.array.deleteCount,cells:a.structure.array.cells===void 0?void 0:a.structure.array.cells.map(t=>e.c2p.asNotebookCell(t,n))},didOpen:a.structure.didOpen===void 0?void 0:a.structure.didOpen.map(e=>n.asOpenTextDocumentParams(e.document).textDocument),didClose:a.structure.didClose===void 0?void 0:a.structure.didClose.map(e=>n.asCloseTextDocumentParams(e.document).textDocument)}),a.data!==void 0&&(i.data=a.data.map(t=>e.c2p.asNotebookCell(t,n))),a.textContent!==void 0&&(i.textContent=a.textContent.map(t=>e.c2p.asTextContentChange(t,n))),Object.keys(i).length>0&&(r.cells=i)}return r}n.asNotebookDocumentChangeEvent=p})(e.c2p||={})})(s||={});var c;(function(e){function t(e,t,r){let i=e.length,a=t.length,o=0;for(;o=0&&c>=0&&n(e[s],t[c],r);)s--,c--;let l=s+1-o,u=o===c+1?void 0:t.slice(o,c+1);return u===void 0?{start:o,deleteCount:l}:{start:o,deleteCount:l,cells:u}}else if(oe.document.uri.toString()))}}e.create=t})(d||={});var f=class{constructor(e,n){this.client=e,this.options=n,this.notebookSyncInfo=new Map,this.notebookDidOpen=new Set,this.disposables=[],this.selector=e.protocol2CodeConverter.asDocumentSelector(u.asDocumentSelector(n)),t.workspace.onDidOpenNotebookDocument(e=>{this.notebookDidOpen.add(e.uri.toString()),this.didOpen(e)},void 0,this.disposables);for(let e of t.workspace.notebookDocuments)this.notebookDidOpen.add(e.uri.toString()),this.didOpen(e);t.workspace.onDidChangeNotebookDocument(e=>this.didChangeNotebookDocument(e),void 0,this.disposables),this.options.save===!0&&t.workspace.onDidSaveNotebookDocument(e=>this.didSave(e),void 0,this.disposables),t.workspace.onDidCloseNotebookDocument(e=>{this.didClose(e),this.notebookDidOpen.delete(e.uri.toString())},void 0,this.disposables)}getState(){for(let e of t.workspace.notebookDocuments)if(this.getMatchingCells(e)!==void 0)return{kind:`document`,id:`$internal`,registrations:!0,matches:!0};return{kind:`document`,id:`$internal`,registrations:!0,matches:!1}}get mode(){return`notebook`}handles(e){return t.languages.match(this.selector,e)>0}didOpenNotebookCellTextDocument(e,n){if(t.languages.match(this.selector,n.document)===0||!this.notebookDidOpen.has(e.uri.toString()))return;let r=this.notebookSyncInfo.get(e.uri.toString()),i=this.cellMatches(e,n);if(r!==void 0){let t=r.uris.has(n.document.uri.toString());if(i&&t||!i&&!t)return;if(i){let t=this.getMatchingCells(e);if(t!==void 0){let n=this.asNotebookDocumentChangeEvent(e,void 0,r,t);n!==void 0&&this.doSendChange(n,t).catch(()=>{})}}}else i&&this.doSendOpen(e,[n]).catch(()=>{})}didChangeNotebookCellTextDocument(e,n){t.languages.match(this.selector,n.document)!==0&&this.doSendChange({notebook:e,cells:{textContent:[n]}},void 0).catch(()=>{})}didCloseNotebookCellTextDocument(e,t){let n=this.notebookSyncInfo.get(e.uri.toString());if(n===void 0)return;let r=t.document.uri,i=n.cells.findIndex(e=>e.document.uri.toString()===r.toString());if(i!==-1)if(i===0&&n.cells.length===1)this.doSendClose(e,n.cells).catch(()=>{});else{let t=n.cells.slice(),r=t.splice(i,1);this.doSendChange({notebook:e,cells:{structure:{array:{start:i,deleteCount:1},didClose:r}}},t).catch(()=>{})}}dispose(){for(let e of this.disposables)e.dispose()}didOpen(e,t=this.getMatchingCells(e),n=this.notebookSyncInfo.get(e.uri.toString())){if(n!==void 0)if(t!==void 0){let r=this.asNotebookDocumentChangeEvent(e,void 0,n,t);r!==void 0&&this.doSendChange(r,t).catch(()=>{})}else this.doSendClose(e,[]).catch(()=>{});else{if(t===void 0)return;this.doSendOpen(e,t).catch(()=>{})}}didChangeNotebookDocument(e){let t=e.notebook,n=this.notebookSyncInfo.get(t.uri.toString());if(n===void 0){if(e.contentChanges.length===0)return;let r=this.getMatchingCells(t);if(r===void 0)return;this.didOpen(t,r,n)}else{let r=this.getMatchingCells(t);if(r===void 0){this.didClose(t,n);return}let i=this.asNotebookDocumentChangeEvent(e.notebook,e,n,r);i!==void 0&&this.doSendChange(i,r).catch(()=>{})}}didSave(e){this.notebookSyncInfo.get(e.uri.toString())!==void 0&&this.doSendSave(e).catch(()=>{})}didClose(e,t=this.notebookSyncInfo.get(e.uri.toString())){if(t===void 0)return;let n=e.getCells().filter(e=>t.uris.has(e.document.uri.toString()));this.doSendClose(e,n).catch(()=>{})}async sendDidOpenNotebookDocument(e){let t=this.getMatchingCells(e);if(t!==void 0)return this.doSendOpen(e,t)}async doSendOpen(e,t){let n=async(e,t)=>{let n=s.c2p.asNotebookDocument(e,t,this.client.code2ProtocolConverter),i=t.map(e=>this.client.code2ProtocolConverter.asTextDocumentItem(e.document));try{await this.client.sendNotification(r.DidOpenNotebookDocumentNotification.type,{notebookDocument:n,cellTextDocuments:i})}catch(e){throw this.client.error(`Sending DidOpenNotebookDocumentNotification failed`,e),e}},i=this.client.middleware?.notebooks;return this.notebookSyncInfo.set(e.uri.toString(),d.create(t)),i?.didOpen===void 0?n(e,t):i.didOpen(e,t,n)}async sendDidChangeNotebookDocument(e){return this.doSendChange(e,void 0)}async doSendChange(e,t=this.getMatchingCells(e.notebook)){let n=async e=>{try{await this.client.sendNotification(r.DidChangeNotebookDocumentNotification.type,{notebookDocument:s.c2p.asVersionedNotebookDocumentIdentifier(e.notebook,this.client.code2ProtocolConverter),change:s.c2p.asNotebookDocumentChangeEvent(e,this.client.code2ProtocolConverter)})}catch(e){throw this.client.error(`Sending DidChangeNotebookDocumentNotification failed`,e),e}},i=this.client.middleware?.notebooks;return e.cells?.structure!==void 0&&this.notebookSyncInfo.set(e.notebook.uri.toString(),d.create(t??[])),i?.didChange===void 0?n(e):i?.didChange(e,n)}async sendDidSaveNotebookDocument(e){return this.doSendSave(e)}async doSendSave(e){let t=async e=>{try{await this.client.sendNotification(r.DidSaveNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(e.uri)}})}catch(e){throw this.client.error(`Sending DidSaveNotebookDocumentNotification failed`,e),e}},n=this.client.middleware?.notebooks;return n?.didSave===void 0?t(e):n.didSave(e,t)}async sendDidCloseNotebookDocument(e){return this.doSendClose(e,this.getMatchingCells(e)??[])}async doSendClose(e,t){let n=async(e,t)=>{try{await this.client.sendNotification(r.DidCloseNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(e.uri)},cellTextDocuments:t.map(e=>this.client.code2ProtocolConverter.asTextDocumentIdentifier(e.document))})}catch(e){throw this.client.error(`Sending DidCloseNotebookDocumentNotification failed`,e),e}},i=this.client.middleware?.notebooks;return this.notebookSyncInfo.delete(e.uri.toString()),i?.didClose===void 0?n(e,t):i.didClose(e,t,n)}asNotebookDocumentChangeEvent(e,t,n,r){if(t!==void 0&&t.notebook!==e)throw Error(`Notebook must be identical`);let i={notebook:e};t?.metadata!==void 0&&(i.metadata=s.c2p.asMetadata(t.metadata));let a;if(t?.cellChanges!==void 0&&t.cellChanges.length>0){let e=[];a=new Set(r.map(e=>e.document.uri.toString()));for(let n of t.cellChanges)a.has(n.cell.document.uri.toString())&&(n.executionSummary!==void 0||n.metadata!==void 0)&&e.push(n.cell);e.length>0&&(i.cells=i.cells??{},i.cells.data=e)}if((t?.contentChanges!==void 0&&t.contentChanges.length>0||t===void 0)&&n!==void 0&&r!==void 0){let e=n.cells,t=r,a=c.computeDiff(e,t,!1),o,s;if(a!==void 0){o=a.cells===void 0?new Map:new Map(a.cells.map(e=>[e.document.uri.toString(),e])),s=a.deleteCount===0?new Map:new Map(e.slice(a.start,a.start+a.deleteCount).map(e=>[e.document.uri.toString(),e]));for(let e of Array.from(s.keys()))o.has(e)&&(s.delete(e),o.delete(e));i.cells=i.cells??{};let t=[],n=[];if(o.size>0||s.size>0){for(let e of o.values())t.push(e);for(let e of s.values())n.push(e)}i.cells.structure={array:a,didOpen:t,didClose:n}}}return Object.keys(i).length>1?i:void 0}getMatchingCells(e,t=e.getCells()){if(this.options.notebookSelector!==void 0){for(let n of this.options.notebookSelector)if(n.notebook===void 0||l.matchNotebook(n.notebook,e)){let r=this.filterCells(e,t,n.cells);return r.length===0?void 0:r}}}cellMatches(e,t){let n=this.getMatchingCells(e,[t]);return n!==void 0&&n[0]===t}filterCells(e,t,n){let r=n===void 0?t:t.filter(e=>{let t=e.document.languageId;return n.some((e=>e.language===`*`||t===e.language))});return typeof this.client.clientOptions.notebookDocumentOptions?.filterCells==`function`?this.client.clientOptions.notebookDocumentOptions.filterCells(e,r):r}},p=class e{constructor(n){this.client=n,this.registrations=new Map,this.registrationType=r.NotebookDocumentSyncRegistrationType.type,t.workspace.onDidOpenTextDocument(t=>{if(t.uri.scheme!==e.CellScheme)return;let[n,r]=this.findNotebookDocumentAndCell(t);if(!(n===void 0||r===void 0))for(let e of this.registrations.values())e instanceof f&&e.didOpenNotebookCellTextDocument(n,r)}),t.workspace.onDidChangeTextDocument(t=>{if(t.contentChanges.length===0)return;let n=t.document;if(n.uri.scheme!==e.CellScheme)return;let[r]=this.findNotebookDocumentAndCell(n);if(r!==void 0)for(let e of this.registrations.values())e instanceof f&&e.didChangeNotebookCellTextDocument(r,t)}),t.workspace.onDidCloseTextDocument(t=>{if(t.uri.scheme!==e.CellScheme)return;let[n,r]=this.findNotebookDocumentAndCell(t);if(!(n===void 0||r===void 0))for(let e of this.registrations.values())e instanceof f&&e.didCloseNotebookCellTextDocument(n,r)})}getState(){if(this.registrations.size===0)return{kind:`document`,id:this.registrationType.method,registrations:!1,matches:!1};for(let e of this.registrations.values()){let t=e.getState();if(t.kind===`document`&&t.registrations===!0&&t.matches===!0)return{kind:`document`,id:this.registrationType.method,registrations:!0,matches:!0}}return{kind:`document`,id:this.registrationType.method,registrations:!0,matches:!1}}fillClientCapabilities(e){let t=o(o(e,`notebookDocument`),`synchronization`);t.dynamicRegistration=!0,t.executionSummarySupport=!0}preInitialize(e){let t=e.notebookDocumentSync;t!==void 0&&(this.dedicatedChannel=this.client.protocol2CodeConverter.asDocumentSelector(u.asDocumentSelector(t)))}initialize(e){let t=e.notebookDocumentSync;if(t===void 0)return;let n=t.id??i.generateUuid();this.register({id:n,registerOptions:t})}register(e){let t=new f(this.client,e.registerOptions);this.registrations.set(e.id,t)}unregister(e){let t=this.registrations.get(e);t&&t.dispose()}clear(){for(let e of this.registrations.values())e.dispose();this.registrations.clear()}handles(n){if(n.uri.scheme!==e.CellScheme)return!1;if(this.dedicatedChannel!==void 0&&t.languages.match(this.dedicatedChannel,n)>0)return!0;for(let e of this.registrations.values())if(e.handles(n))return!0;return!1}getProvider(e){for(let t of this.registrations.values())if(t.handles(e.document))return t}findNotebookDocumentAndCell(e){let n=e.uri.toString();for(let e of t.workspace.notebookDocuments)for(let t of e.getCells())if(t.document.uri.toString()===n)return[e,t];return[void 0,void 0]}};e.NotebookDocumentSyncFeature=p,p.CellScheme=`vscode-notebook-cell`})),Z=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SyncConfigurationFeature=e.toJSONObject=e.ConfigurationFeature=void 0;let t=require(`vscode`),n=W(),r=_(),i=J(),a=Y();e.ConfigurationFeature=class{constructor(e){this._client=e}getState(){return{kind:`static`}}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.configuration=!0}initialize(){let e=this._client;e.onRequest(n.ConfigurationRequest.type,(t,n)=>{let r=e=>{let t=[];for(let n of e.items){let e=n.scopeUri!==void 0&&n.scopeUri!==null?this._client.protocol2CodeConverter.asUri(n.scopeUri):void 0;t.push(this.getConfiguration(e,n.section===null?void 0:n.section))}return t},i=e.middleware.workspace;return i&&i.configuration?i.configuration(t,n,r):r(t,n)})}getConfiguration(e,n){let r=null;if(n){let i=n.lastIndexOf(`.`);if(i===-1)r=o(t.workspace.getConfiguration(void 0,e).get(n));else{let a=t.workspace.getConfiguration(n.substr(0,i),e);a&&(r=o(a.get(n.substr(i+1))))}}else{let n=t.workspace.getConfiguration(void 0,e);r={};for(let e of Object.keys(n))n.has(e)&&(r[e]=o(n.get(e)))}return r===void 0&&(r=null),r}clear(){}};function o(e){if(e){if(Array.isArray(e))return e.map(o);if(typeof e==`object`){let t=Object.create(null);for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=o(e[n]));return t}}return e}e.toJSONObject=o,e.SyncConfigurationFeature=class{constructor(e){this._client=e,this.isCleared=!1,this._listeners=new Map}getState(){return{kind:`workspace`,id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return n.DidChangeConfigurationNotification.type}fillClientCapabilities(e){(0,a.ensure)((0,a.ensure)(e,`workspace`),`didChangeConfiguration`).dynamicRegistration=!0}initialize(){this.isCleared=!1;let e=this._client.clientOptions.synchronize?.configurationSection;e!==void 0&&this.register({id:i.generateUuid(),registerOptions:{section:e}})}register(e){let n=t.workspace.onDidChangeConfiguration(t=>{this.onDidChangeConfiguration(e.registerOptions.section,t)});this._listeners.set(e.id,n),e.registerOptions.section!==void 0&&this.onDidChangeConfiguration(e.registerOptions.section,void 0)}unregister(e){let t=this._listeners.get(e);t&&(this._listeners.delete(e),t.dispose())}clear(){for(let e of this._listeners.values())e.dispose();this._listeners.clear(),this.isCleared=!0}onDidChangeConfiguration(e,t){if(this.isCleared)return;let i;if(i=r.string(e)?[e]:e,i!==void 0&&t!==void 0&&!i.some(e=>t.affectsConfiguration(e)))return;let a=async e=>e===void 0?this._client.sendNotification(n.DidChangeConfigurationNotification.type,{settings:null}):this._client.sendNotification(n.DidChangeConfigurationNotification.type,{settings:this.extractSettingsInformation(e)}),o=this._client.middleware.workspace?.didChangeConfiguration;(o?o(i,a):a(i)).catch(e=>{this._client.error(`Sending notification ${n.DidChangeConfigurationNotification.type.method} failed`,e)})}extractSettingsInformation(e){function n(e,t){let n=e;for(let e=0;e=0?t.workspace.getConfiguration(s.substr(0,c),r).get(s.substr(c+1)):t.workspace.getConfiguration(void 0,r).get(s),l){let t=e[a].split(`.`);n(i,t)[t[t.length-1]]=o(l)}}return i}}})),Ne=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DidSaveTextDocumentFeature=e.WillSaveWaitUntilFeature=e.WillSaveFeature=e.DidChangeTextDocumentFeature=e.DidCloseTextDocumentFeature=e.DidOpenTextDocumentFeature=void 0;let t=require(`vscode`),n=W(),r=Y(),i=J();e.DidOpenTextDocumentFeature=class extends r.TextDocumentEventFeature{constructor(e,i){super(e,t.workspace.onDidOpenTextDocument,n.DidOpenTextDocumentNotification.type,()=>e.middleware.didOpen,t=>e.code2ProtocolConverter.asOpenTextDocumentParams(t),e=>e,r.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=i}get openDocuments(){return this._syncedDocuments.values()}fillClientCapabilities(e){(0,r.ensure)((0,r.ensure)(e,`textDocument`),`synchronization`).dynamicRegistration=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.openClose&&this.register({id:i.generateUuid(),registerOptions:{documentSelector:t}})}get registrationType(){return n.DidOpenTextDocumentNotification.type}register(e){if(super.register(e),!e.registerOptions.documentSelector)return;let n=this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector);t.workspace.textDocuments.forEach(e=>{let r=e.uri.toString();if(!this._syncedDocuments.has(r)&&t.languages.match(n,e)>0&&!this._client.hasDedicatedTextSynchronizationFeature(e)){let t=this._client.middleware,n=e=>this._client.sendNotification(this._type,this._createParams(e));(t.didOpen?t.didOpen(e,n):n(e)).catch(e=>{this._client.error(`Sending document notification ${this._type.method} failed`,e)}),this._syncedDocuments.set(r,e)}})}getTextDocument(e){return e}notificationSent(e,t,n){this._syncedDocuments.set(e.uri.toString(),e),super.notificationSent(e,t,n)}},e.DidCloseTextDocumentFeature=class extends r.TextDocumentEventFeature{constructor(e,i,a){super(e,t.workspace.onDidCloseTextDocument,n.DidCloseTextDocumentNotification.type,()=>e.middleware.didClose,t=>e.code2ProtocolConverter.asCloseTextDocumentParams(t),e=>e,r.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=i,this._pendingTextDocumentChanges=a}get registrationType(){return n.DidCloseTextDocumentNotification.type}fillClientCapabilities(e){(0,r.ensure)((0,r.ensure)(e,`textDocument`),`synchronization`).dynamicRegistration=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.openClose&&this.register({id:i.generateUuid(),registerOptions:{documentSelector:t}})}async callback(e){await super.callback(e),this._pendingTextDocumentChanges.delete(e.uri.toString())}getTextDocument(e){return e}notificationSent(e,t,n){this._syncedDocuments.delete(e.uri.toString()),super.notificationSent(e,t,n)}unregister(e){let n=this._selectors.get(e);super.unregister(e);let r=this._selectors.values();this._syncedDocuments.forEach(e=>{if(t.languages.match(n,e)>0&&!this._selectorFilter(r,e)&&!this._client.hasDedicatedTextSynchronizationFeature(e)){let t=this._client.middleware,n=e=>this._client.sendNotification(this._type,this._createParams(e));this._syncedDocuments.delete(e.uri.toString()),(t.didClose?t.didClose(e,n):n(e)).catch(e=>{this._client.error(`Sending document notification ${this._type.method} failed`,e)})}})}},e.DidChangeTextDocumentFeature=class extends r.DynamicDocumentFeature{constructor(e,r){super(e),this._changeData=new Map,this._onNotificationSent=new t.EventEmitter,this._onPendingChangeAdded=new t.EventEmitter,this._pendingTextDocumentChanges=r,this._syncKind=n.TextDocumentSyncKind.None}get onNotificationSent(){return this._onNotificationSent.event}get onPendingChangeAdded(){return this._onPendingChangeAdded.event}get syncKind(){return this._syncKind}get registrationType(){return n.DidChangeTextDocumentNotification.type}fillClientCapabilities(e){(0,r.ensure)((0,r.ensure)(e,`textDocument`),`synchronization`).dynamicRegistration=!0}initialize(e,t){let r=e.resolvedTextDocumentSync;t&&r&&r.change!==void 0&&r.change!==n.TextDocumentSyncKind.None&&this.register({id:i.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},{syncKind:r.change})})}register(e){e.registerOptions.documentSelector&&(this._listener||=t.workspace.onDidChangeTextDocument(this.callback,this),this._changeData.set(e.id,{syncKind:e.registerOptions.syncKind,documentSelector:this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)}),this.updateSyncKind(e.registerOptions.syncKind))}*getDocumentSelectors(){for(let e of this._changeData.values())yield e.documentSelector}async callback(e){if(e.contentChanges.length===0)return;let r=e.document.uri,i=e.document.version,a=[];for(let o of this._changeData.values())if(t.languages.match(o.documentSelector,e.document)>0&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let t=this._client.middleware;if(o.syncKind===n.TextDocumentSyncKind.Incremental){let o=async e=>{let t=this._client.code2ProtocolConverter.asChangeTextDocumentParams(e,r,i);await this._client.sendNotification(n.DidChangeTextDocumentNotification.type,t),this.notificationSent(e.document,n.DidChangeTextDocumentNotification.type,t)};a.push(t.didChange?t.didChange(e,e=>o(e)):o(e))}else if(o.syncKind===n.TextDocumentSyncKind.Full){let n=async e=>{let t=e.document.uri.toString();this._pendingTextDocumentChanges.set(t,e.document),this._onPendingChangeAdded.fire()};a.push(t.didChange?t.didChange(e,e=>n(e)):n(e))}}return Promise.all(a).then(void 0,e=>{throw this._client.error(`Sending document notification ${n.DidChangeTextDocumentNotification.type.method} failed`,e),e})}notificationSent(e,t,n){this._onNotificationSent.fire({textDocument:e,type:t,params:n})}unregister(e){if(this._changeData.delete(e),this._changeData.size===0)this._listener&&=(this._listener.dispose(),void 0),this._syncKind=n.TextDocumentSyncKind.None;else{this._syncKind=n.TextDocumentSyncKind.None;for(let e of this._changeData.values())if(this.updateSyncKind(e.syncKind),this._syncKind===n.TextDocumentSyncKind.Full)break}}clear(){this._pendingTextDocumentChanges.clear(),this._changeData.clear(),this._syncKind=n.TextDocumentSyncKind.None,this._listener&&=(this._listener.dispose(),void 0)}getPendingDocumentChanges(e){if(this._pendingTextDocumentChanges.size===0)return[];let t;if(e.size===0)t=Array.from(this._pendingTextDocumentChanges.values()),this._pendingTextDocumentChanges.clear();else{t=[];for(let n of this._pendingTextDocumentChanges)e.has(n[0])||(t.push(n[1]),this._pendingTextDocumentChanges.delete(n[0]))}return t}getProvider(e){for(let n of this._changeData.values())if(t.languages.match(n.documentSelector,e)>0)return{send:e=>this.callback(e)}}updateSyncKind(e){if(this._syncKind!==n.TextDocumentSyncKind.Full)switch(e){case n.TextDocumentSyncKind.Full:this._syncKind=e;break;case n.TextDocumentSyncKind.Incremental:this._syncKind===n.TextDocumentSyncKind.None&&(this._syncKind=n.TextDocumentSyncKind.Incremental);break}}},e.WillSaveFeature=class extends r.TextDocumentEventFeature{constructor(e){super(e,t.workspace.onWillSaveTextDocument,n.WillSaveTextDocumentNotification.type,()=>e.middleware.willSave,t=>e.code2ProtocolConverter.asWillSaveTextDocumentParams(t),e=>e.document,(e,t)=>r.TextDocumentEventFeature.textDocumentFilter(e,t.document))}get registrationType(){return n.WillSaveTextDocumentNotification.type}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`synchronization`);t.willSave=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.willSave&&this.register({id:i.generateUuid(),registerOptions:{documentSelector:t}})}getTextDocument(e){return e.document}},e.WillSaveWaitUntilFeature=class extends r.DynamicDocumentFeature{constructor(e){super(e),this._selectors=new Map}getDocumentSelectors(){return this._selectors.values()}get registrationType(){return n.WillSaveTextDocumentWaitUntilRequest.type}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`synchronization`);t.willSaveWaitUntil=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.willSaveWaitUntil&&this.register({id:i.generateUuid(),registerOptions:{documentSelector:t}})}register(e){e.registerOptions.documentSelector&&(this._listener||=t.workspace.onWillSaveTextDocument(this.callback,this),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}callback(e){if(r.TextDocumentEventFeature.textDocumentFilter(this._selectors.values(),e.document)&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let t=this._client.middleware,r=e=>this._client.sendRequest(n.WillSaveTextDocumentWaitUntilRequest.type,this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(e)).then(async e=>{let t=await this._client.protocol2CodeConverter.asTextEdits(e);return t===void 0?[]:t});e.waitUntil(t.willSaveWaitUntil?t.willSaveWaitUntil(e,r):r(e))}}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._selectors.clear(),this._listener&&=(this._listener.dispose(),void 0)}},e.DidSaveTextDocumentFeature=class extends r.TextDocumentEventFeature{constructor(e){super(e,t.workspace.onDidSaveTextDocument,n.DidSaveTextDocumentNotification.type,()=>e.middleware.didSave,t=>e.code2ProtocolConverter.asSaveTextDocumentParams(t,this._includeText),e=>e,r.TextDocumentEventFeature.textDocumentFilter),this._includeText=!1}get registrationType(){return n.DidSaveTextDocumentNotification.type}fillClientCapabilities(e){(0,r.ensure)((0,r.ensure)(e,`textDocument`),`synchronization`).didSave=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;if(t&&n&&n.save){let e=typeof n.save==`boolean`?{includeText:!1}:{includeText:!!n.save.includeText};this.register({id:i.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},e)})}}register(e){this._includeText=!!e.registerOptions.includeText,super.register(e)}getTextDocument(e){return e}}})),Pe=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CompletionItemFeature=void 0;let t=require(`vscode`),n=W(),r=Y(),i=J(),a=[n.CompletionItemKind.Text,n.CompletionItemKind.Method,n.CompletionItemKind.Function,n.CompletionItemKind.Constructor,n.CompletionItemKind.Field,n.CompletionItemKind.Variable,n.CompletionItemKind.Class,n.CompletionItemKind.Interface,n.CompletionItemKind.Module,n.CompletionItemKind.Property,n.CompletionItemKind.Unit,n.CompletionItemKind.Value,n.CompletionItemKind.Enum,n.CompletionItemKind.Keyword,n.CompletionItemKind.Snippet,n.CompletionItemKind.Color,n.CompletionItemKind.File,n.CompletionItemKind.Reference,n.CompletionItemKind.Folder,n.CompletionItemKind.EnumMember,n.CompletionItemKind.Constant,n.CompletionItemKind.Struct,n.CompletionItemKind.Event,n.CompletionItemKind.Operator,n.CompletionItemKind.TypeParameter];e.CompletionItemFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.CompletionRequest.type),this.labelDetailsSupport=new Map}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`completion`);t.dynamicRegistration=!0,t.contextSupport=!0,t.completionItem={snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:[n.MarkupKind.Markdown,n.MarkupKind.PlainText],deprecatedSupport:!0,preselectSupport:!0,tagSupport:{valueSet:[n.CompletionItemTag.Deprecated]},insertReplaceSupport:!0,resolveSupport:{properties:[`documentation`,`detail`,`additionalTextEdits`]},insertTextModeSupport:{valueSet:[n.InsertTextMode.asIs,n.InsertTextMode.adjustIndentation]},labelDetailsSupport:!0},t.insertTextMode=n.InsertTextMode.adjustIndentation,t.completionItemKind={valueSet:a},t.completionList={itemDefaults:[`commitCharacters`,`editRange`,`insertTextFormat`,`insertTextMode`,`data`]}}initialize(e,t){let n=this.getRegistrationOptions(t,e.completionProvider);n&&this.register({id:i.generateUuid(),registerOptions:n})}registerLanguageProvider(e,r){this.labelDetailsSupport.set(r,!!e.completionItem?.labelDetailsSupport);let i=e.triggerCharacters??[],a=e.allCommitCharacters,o=e.documentSelector,s={provideCompletionItems:(e,t,r,i)=>{let o=this._client,s=this._client.middleware,c=(e,t,r,i)=>o.sendRequest(n.CompletionRequest.type,o.code2ProtocolConverter.asCompletionParams(e,t,r),i).then(e=>i.isCancellationRequested?null:o.protocol2CodeConverter.asCompletionResult(e,a,i),e=>o.handleFailedRequest(n.CompletionRequest.type,i,e,null));return s.provideCompletionItem?s.provideCompletionItem(e,t,i,r,c):c(e,t,i,r)},resolveCompletionItem:e.resolveProvider?(e,t)=>{let i=this._client,a=this._client.middleware,o=(e,t)=>i.sendRequest(n.CompletionResolveRequest.type,i.code2ProtocolConverter.asCompletionItem(e,!!this.labelDetailsSupport.get(r)),t).then(e=>t.isCancellationRequested?null:i.protocol2CodeConverter.asCompletionItem(e),r=>i.handleFailedRequest(n.CompletionResolveRequest.type,t,r,e));return a.resolveCompletionItem?a.resolveCompletionItem(e,t,o):o(e,t)}:void 0};return[t.languages.registerCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(o),s,...i),s]}}})),Fe=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.HoverFeature=void 0;let t=require(`vscode`),n=W(),r=Y(),i=J();e.HoverFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.HoverRequest.type)}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`hover`);t.dynamicRegistration=!0,t.contentFormat=[n.MarkupKind.Markdown,n.MarkupKind.PlainText]}initialize(e,t){let n=this.getRegistrationOptions(t,e.hoverProvider);n&&this.register({id:i.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,r={provideHover:(e,t,r)=>{let i=this._client,a=(e,t,r)=>i.sendRequest(n.HoverRequest.type,i.code2ProtocolConverter.asTextDocumentPositionParams(e,t),r).then(e=>r.isCancellationRequested?null:i.protocol2CodeConverter.asHover(e),e=>i.handleFailedRequest(n.HoverRequest.type,r,e,null)),o=i.middleware;return o.provideHover?o.provideHover(e,t,r,a):a(e,t,r)}};return[this.registerProvider(t,r),r]}registerProvider(e,n){return t.languages.registerHoverProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),n)}}})),Ie=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DefinitionFeature=void 0;let t=require(`vscode`),n=W(),r=Y(),i=J();e.DefinitionFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.DefinitionRequest.type)}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`definition`);t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.definitionProvider);n&&this.register({id:i.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,r={provideDefinition:(e,t,r)=>{let i=this._client,a=(e,t,r)=>i.sendRequest(n.DefinitionRequest.type,i.code2ProtocolConverter.asTextDocumentPositionParams(e,t),r).then(e=>r.isCancellationRequested?null:i.protocol2CodeConverter.asDefinitionResult(e,r),e=>i.handleFailedRequest(n.DefinitionRequest.type,r,e,null)),o=i.middleware;return o.provideDefinition?o.provideDefinition(e,t,r,a):a(e,t,r)}};return[this.registerProvider(t,r),r]}registerProvider(e,n){return t.languages.registerDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),n)}}})),Le=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SignatureHelpFeature=void 0;let t=require(`vscode`),n=W(),r=Y(),i=J();e.SignatureHelpFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.SignatureHelpRequest.type)}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`signatureHelp`);t.dynamicRegistration=!0,t.signatureInformation={documentationFormat:[n.MarkupKind.Markdown,n.MarkupKind.PlainText]},t.signatureInformation.parameterInformation={labelOffsetSupport:!0},t.signatureInformation.activeParameterSupport=!0,t.contextSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.signatureHelpProvider);n&&this.register({id:i.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t={provideSignatureHelp:(e,t,r,i)=>{let a=this._client,o=(e,t,r,i)=>a.sendRequest(n.SignatureHelpRequest.type,a.code2ProtocolConverter.asSignatureHelpParams(e,t,r),i).then(e=>i.isCancellationRequested?null:a.protocol2CodeConverter.asSignatureHelp(e,i),e=>a.handleFailedRequest(n.SignatureHelpRequest.type,i,e,null)),s=a.middleware;return s.provideSignatureHelp?s.provideSignatureHelp(e,t,i,r,o):o(e,t,i,r)}};return[this.registerProvider(e,t),t]}registerProvider(e,n){let r=this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector);if(e.retriggerCharacters===void 0){let i=e.triggerCharacters||[];return t.languages.registerSignatureHelpProvider(r,n,...i)}else{let i={triggerCharacters:e.triggerCharacters||[],retriggerCharacters:e.retriggerCharacters||[]};return t.languages.registerSignatureHelpProvider(r,n,i)}}}})),Re=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DocumentHighlightFeature=void 0;let t=require(`vscode`),n=W(),r=Y(),i=J();e.DocumentHighlightFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.DocumentHighlightRequest.type)}fillClientCapabilities(e){(0,r.ensure)((0,r.ensure)(e,`textDocument`),`documentHighlight`).dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentHighlightProvider);n&&this.register({id:i.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let r=e.documentSelector,i={provideDocumentHighlights:(e,t,r)=>{let i=this._client,a=(e,t,r)=>i.sendRequest(n.DocumentHighlightRequest.type,i.code2ProtocolConverter.asTextDocumentPositionParams(e,t),r).then(e=>r.isCancellationRequested?null:i.protocol2CodeConverter.asDocumentHighlights(e,r),e=>i.handleFailedRequest(n.DocumentHighlightRequest.type,r,e,null)),o=i.middleware;return o.provideDocumentHighlights?o.provideDocumentHighlights(e,t,r,a):a(e,t,r)}};return[t.languages.registerDocumentHighlightProvider(this._client.protocol2CodeConverter.asDocumentSelector(r),i),i]}}})),ze=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DocumentSymbolFeature=e.SupportedSymbolTags=e.SupportedSymbolKinds=void 0;let t=require(`vscode`),n=W(),r=Y(),i=J();e.SupportedSymbolKinds=[n.SymbolKind.File,n.SymbolKind.Module,n.SymbolKind.Namespace,n.SymbolKind.Package,n.SymbolKind.Class,n.SymbolKind.Method,n.SymbolKind.Property,n.SymbolKind.Field,n.SymbolKind.Constructor,n.SymbolKind.Enum,n.SymbolKind.Interface,n.SymbolKind.Function,n.SymbolKind.Variable,n.SymbolKind.Constant,n.SymbolKind.String,n.SymbolKind.Number,n.SymbolKind.Boolean,n.SymbolKind.Array,n.SymbolKind.Object,n.SymbolKind.Key,n.SymbolKind.Null,n.SymbolKind.EnumMember,n.SymbolKind.Struct,n.SymbolKind.Event,n.SymbolKind.Operator,n.SymbolKind.TypeParameter],e.SupportedSymbolTags=[n.SymbolTag.Deprecated],e.DocumentSymbolFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.DocumentSymbolRequest.type)}fillClientCapabilities(t){let n=(0,r.ensure)((0,r.ensure)(t,`textDocument`),`documentSymbol`);n.dynamicRegistration=!0,n.symbolKind={valueSet:e.SupportedSymbolKinds},n.hierarchicalDocumentSymbolSupport=!0,n.tagSupport={valueSet:e.SupportedSymbolTags},n.labelSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentSymbolProvider);n&&this.register({id:i.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let r=e.documentSelector,i={provideDocumentSymbols:(e,t)=>{let r=this._client,i=async(e,t)=>{try{let i=await r.sendRequest(n.DocumentSymbolRequest.type,r.code2ProtocolConverter.asDocumentSymbolParams(e),t);if(t.isCancellationRequested||i==null)return null;if(i.length===0)return[];{let e=i[0];return n.DocumentSymbol.is(e)?await r.protocol2CodeConverter.asDocumentSymbols(i,t):await r.protocol2CodeConverter.asSymbolInformations(i,t)}}catch(e){return r.handleFailedRequest(n.DocumentSymbolRequest.type,t,e,null)}},a=r.middleware;return a.provideDocumentSymbols?a.provideDocumentSymbols(e,t,i):i(e,t)}},a=e.label===void 0?void 0:{label:e.label};return[t.languages.registerDocumentSymbolProvider(this._client.protocol2CodeConverter.asDocumentSelector(r),i,a),i]}}})),Be=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WorkspaceSymbolFeature=void 0;let t=require(`vscode`),n=W(),r=Y(),i=ze(),a=J();e.WorkspaceSymbolFeature=class extends r.WorkspaceFeature{constructor(e){super(e,n.WorkspaceSymbolRequest.type)}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`workspace`),`symbol`);t.dynamicRegistration=!0,t.symbolKind={valueSet:i.SupportedSymbolKinds},t.tagSupport={valueSet:i.SupportedSymbolTags},t.resolveSupport={properties:[`location.range`]}}initialize(e){e.workspaceSymbolProvider&&this.register({id:a.generateUuid(),registerOptions:e.workspaceSymbolProvider===!0?{workDoneProgress:!1}:e.workspaceSymbolProvider})}registerLanguageProvider(e){let r={provideWorkspaceSymbols:(e,t)=>{let r=this._client,i=(e,t)=>r.sendRequest(n.WorkspaceSymbolRequest.type,{query:e},t).then(e=>t.isCancellationRequested?null:r.protocol2CodeConverter.asSymbolInformations(e,t),e=>r.handleFailedRequest(n.WorkspaceSymbolRequest.type,t,e,null)),a=r.middleware;return a.provideWorkspaceSymbols?a.provideWorkspaceSymbols(e,t,i):i(e,t)},resolveWorkspaceSymbol:e.resolveProvider===!0?(e,t)=>{let r=this._client,i=(e,t)=>r.sendRequest(n.WorkspaceSymbolResolveRequest.type,r.code2ProtocolConverter.asWorkspaceSymbol(e),t).then(e=>t.isCancellationRequested?null:r.protocol2CodeConverter.asSymbolInformation(e),e=>r.handleFailedRequest(n.WorkspaceSymbolResolveRequest.type,t,e,null)),a=r.middleware;return a.resolveWorkspaceSymbol?a.resolveWorkspaceSymbol(e,t,i):i(e,t)}:void 0};return[t.languages.registerWorkspaceSymbolProvider(r),r]}}})),Ve=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ReferencesFeature=void 0;let t=require(`vscode`),n=W(),r=Y(),i=J();e.ReferencesFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.ReferencesRequest.type)}fillClientCapabilities(e){(0,r.ensure)((0,r.ensure)(e,`textDocument`),`references`).dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.referencesProvider);n&&this.register({id:i.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,r={provideReferences:(e,t,r,i)=>{let a=this._client,o=(e,t,r,i)=>a.sendRequest(n.ReferencesRequest.type,a.code2ProtocolConverter.asReferenceParams(e,t,r),i).then(e=>i.isCancellationRequested?null:a.protocol2CodeConverter.asReferences(e,i),e=>a.handleFailedRequest(n.ReferencesRequest.type,i,e,null)),s=a.middleware;return s.provideReferences?s.provideReferences(e,t,r,i,o):o(e,t,r,i)}};return[this.registerProvider(t,r),r]}registerProvider(e,n){return t.languages.registerReferenceProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),n)}}})),He=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CodeActionFeature=void 0;let t=require(`vscode`),n=W(),r=J(),i=Y();e.CodeActionFeature=class extends i.TextDocumentLanguageFeature{constructor(e){super(e,n.CodeActionRequest.type)}fillClientCapabilities(e){let t=(0,i.ensure)((0,i.ensure)(e,`textDocument`),`codeAction`);t.dynamicRegistration=!0,t.isPreferredSupport=!0,t.disabledSupport=!0,t.dataSupport=!0,t.resolveSupport={properties:[`edit`]},t.codeActionLiteralSupport={codeActionKind:{valueSet:[n.CodeActionKind.Empty,n.CodeActionKind.QuickFix,n.CodeActionKind.Refactor,n.CodeActionKind.RefactorExtract,n.CodeActionKind.RefactorInline,n.CodeActionKind.RefactorRewrite,n.CodeActionKind.Source,n.CodeActionKind.SourceOrganizeImports]}},t.honorsChangeAnnotations=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.codeActionProvider);n&&this.register({id:r.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let r=e.documentSelector,i={provideCodeActions:(e,t,r,i)=>{let a=this._client,o=async(e,t,r,i)=>{let o={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(e),range:a.code2ProtocolConverter.asRange(t),context:a.code2ProtocolConverter.asCodeActionContextSync(r)};return a.sendRequest(n.CodeActionRequest.type,o,i).then(e=>i.isCancellationRequested||e==null?null:a.protocol2CodeConverter.asCodeActionResult(e,i),e=>a.handleFailedRequest(n.CodeActionRequest.type,i,e,null))},s=a.middleware;return s.provideCodeActions?s.provideCodeActions(e,t,r,i,o):o(e,t,r,i)},resolveCodeAction:e.resolveProvider?(e,t)=>{let r=this._client,i=this._client.middleware,a=async(e,t)=>r.sendRequest(n.CodeActionResolveRequest.type,r.code2ProtocolConverter.asCodeActionSync(e),t).then(n=>t.isCancellationRequested?e:r.protocol2CodeConverter.asCodeAction(n,t),i=>r.handleFailedRequest(n.CodeActionResolveRequest.type,t,i,e));return i.resolveCodeAction?i.resolveCodeAction(e,t,a):a(e,t)}:void 0};return[t.languages.registerCodeActionsProvider(this._client.protocol2CodeConverter.asDocumentSelector(r),i,e.codeActionKinds?{providedCodeActionKinds:this._client.protocol2CodeConverter.asCodeActionKinds(e.codeActionKinds)}:void 0),i]}}})),Ue=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CodeLensFeature=void 0;let t=require(`vscode`),n=W(),r=J(),i=Y();e.CodeLensFeature=class extends i.TextDocumentLanguageFeature{constructor(e){super(e,n.CodeLensRequest.type)}fillClientCapabilities(e){(0,i.ensure)((0,i.ensure)(e,`textDocument`),`codeLens`).dynamicRegistration=!0,(0,i.ensure)((0,i.ensure)(e,`workspace`),`codeLens`).refreshSupport=!0}initialize(e,t){this._client.onRequest(n.CodeLensRefreshRequest.type,async()=>{for(let e of this.getAllProviders())e.onDidChangeCodeLensEmitter.fire()});let i=this.getRegistrationOptions(t,e.codeLensProvider);i&&this.register({id:r.generateUuid(),registerOptions:i})}registerLanguageProvider(e){let r=e.documentSelector,i=new t.EventEmitter,a={onDidChangeCodeLenses:i.event,provideCodeLenses:(e,t)=>{let r=this._client,i=(e,t)=>r.sendRequest(n.CodeLensRequest.type,r.code2ProtocolConverter.asCodeLensParams(e),t).then(e=>t.isCancellationRequested?null:r.protocol2CodeConverter.asCodeLenses(e,t),e=>r.handleFailedRequest(n.CodeLensRequest.type,t,e,null)),a=r.middleware;return a.provideCodeLenses?a.provideCodeLenses(e,t,i):i(e,t)},resolveCodeLens:e.resolveProvider?(e,t)=>{let r=this._client,i=(e,t)=>r.sendRequest(n.CodeLensResolveRequest.type,r.code2ProtocolConverter.asCodeLens(e),t).then(n=>t.isCancellationRequested?e:r.protocol2CodeConverter.asCodeLens(n),i=>r.handleFailedRequest(n.CodeLensResolveRequest.type,t,i,e)),a=r.middleware;return a.resolveCodeLens?a.resolveCodeLens(e,t,i):i(e,t)}:void 0};return[t.languages.registerCodeLensProvider(this._client.protocol2CodeConverter.asDocumentSelector(r),a),{provider:a,onDidChangeCodeLensEmitter:i}]}}})),We=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DocumentOnTypeFormattingFeature=e.DocumentRangeFormattingFeature=e.DocumentFormattingFeature=void 0;let t=require(`vscode`),n=W(),r=J(),i=Y();var a;(function(e){function n(e){let n=t.workspace.getConfiguration(`files`,e);return{trimTrailingWhitespace:n.get(`trimTrailingWhitespace`),trimFinalNewlines:n.get(`trimFinalNewlines`),insertFinalNewline:n.get(`insertFinalNewline`)}}e.fromConfiguration=n})(a||={}),e.DocumentFormattingFeature=class extends i.TextDocumentLanguageFeature{constructor(e){super(e,n.DocumentFormattingRequest.type)}fillClientCapabilities(e){(0,i.ensure)((0,i.ensure)(e,`textDocument`),`formatting`).dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentFormattingProvider);n&&this.register({id:r.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let r=e.documentSelector,i={provideDocumentFormattingEdits:(e,t,r)=>{let i=this._client,o=(e,t,r)=>{let o={textDocument:i.code2ProtocolConverter.asTextDocumentIdentifier(e),options:i.code2ProtocolConverter.asFormattingOptions(t,a.fromConfiguration(e))};return i.sendRequest(n.DocumentFormattingRequest.type,o,r).then(e=>r.isCancellationRequested?null:i.protocol2CodeConverter.asTextEdits(e,r),e=>i.handleFailedRequest(n.DocumentFormattingRequest.type,r,e,null))},s=i.middleware;return s.provideDocumentFormattingEdits?s.provideDocumentFormattingEdits(e,t,r,o):o(e,t,r)}};return[t.languages.registerDocumentFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(r),i),i]}},e.DocumentRangeFormattingFeature=class extends i.TextDocumentLanguageFeature{constructor(e){super(e,n.DocumentRangeFormattingRequest.type)}fillClientCapabilities(e){let t=(0,i.ensure)((0,i.ensure)(e,`textDocument`),`rangeFormatting`);t.dynamicRegistration=!0,t.rangesSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentRangeFormattingProvider);n&&this.register({id:r.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let r=e.documentSelector,i={provideDocumentRangeFormattingEdits:(e,t,r,i)=>{let o=this._client,s=(e,t,r,i)=>{let s={textDocument:o.code2ProtocolConverter.asTextDocumentIdentifier(e),range:o.code2ProtocolConverter.asRange(t),options:o.code2ProtocolConverter.asFormattingOptions(r,a.fromConfiguration(e))};return o.sendRequest(n.DocumentRangeFormattingRequest.type,s,i).then(e=>i.isCancellationRequested?null:o.protocol2CodeConverter.asTextEdits(e,i),e=>o.handleFailedRequest(n.DocumentRangeFormattingRequest.type,i,e,null))},c=o.middleware;return c.provideDocumentRangeFormattingEdits?c.provideDocumentRangeFormattingEdits(e,t,r,i,s):s(e,t,r,i)}};return e.rangesSupport&&(i.provideDocumentRangesFormattingEdits=(e,t,r,i)=>{let o=this._client,s=(e,t,r,i)=>{let s={textDocument:o.code2ProtocolConverter.asTextDocumentIdentifier(e),ranges:o.code2ProtocolConverter.asRanges(t),options:o.code2ProtocolConverter.asFormattingOptions(r,a.fromConfiguration(e))};return o.sendRequest(n.DocumentRangesFormattingRequest.type,s,i).then(e=>i.isCancellationRequested?null:o.protocol2CodeConverter.asTextEdits(e,i),e=>o.handleFailedRequest(n.DocumentRangesFormattingRequest.type,i,e,null))},c=o.middleware;return c.provideDocumentRangesFormattingEdits?c.provideDocumentRangesFormattingEdits(e,t,r,i,s):s(e,t,r,i)}),[t.languages.registerDocumentRangeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(r),i),i]}},e.DocumentOnTypeFormattingFeature=class extends i.TextDocumentLanguageFeature{constructor(e){super(e,n.DocumentOnTypeFormattingRequest.type)}fillClientCapabilities(e){(0,i.ensure)((0,i.ensure)(e,`textDocument`),`onTypeFormatting`).dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentOnTypeFormattingProvider);n&&this.register({id:r.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let r=e.documentSelector,i={provideOnTypeFormattingEdits:(e,t,r,i,o)=>{let s=this._client,c=(e,t,r,i,o)=>{let c={textDocument:s.code2ProtocolConverter.asTextDocumentIdentifier(e),position:s.code2ProtocolConverter.asPosition(t),ch:r,options:s.code2ProtocolConverter.asFormattingOptions(i,a.fromConfiguration(e))};return s.sendRequest(n.DocumentOnTypeFormattingRequest.type,c,o).then(e=>o.isCancellationRequested?null:s.protocol2CodeConverter.asTextEdits(e,o),e=>s.handleFailedRequest(n.DocumentOnTypeFormattingRequest.type,o,e,null))},l=s.middleware;return l.provideOnTypeFormattingEdits?l.provideOnTypeFormattingEdits(e,t,r,i,o,c):c(e,t,r,i,o)}},o=e.moreTriggerCharacter||[];return[t.languages.registerOnTypeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(r),i,e.firstTriggerCharacter,...o),i]}}})),Ge=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RenameFeature=void 0;let t=require(`vscode`),n=W(),r=J(),i=_(),a=Y();e.RenameFeature=class extends a.TextDocumentLanguageFeature{constructor(e){super(e,n.RenameRequest.type)}fillClientCapabilities(e){let t=(0,a.ensure)((0,a.ensure)(e,`textDocument`),`rename`);t.dynamicRegistration=!0,t.prepareSupport=!0,t.prepareSupportDefaultBehavior=n.PrepareSupportDefaultBehavior.Identifier,t.honorsChangeAnnotations=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.renameProvider);n&&(i.boolean(e.renameProvider)&&(n.prepareProvider=!1),this.register({id:r.generateUuid(),registerOptions:n}))}registerLanguageProvider(e){let t=e.documentSelector,r={provideRenameEdits:(e,t,r,i)=>{let a=this._client,o=(e,t,r,i)=>{let o={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(e),position:a.code2ProtocolConverter.asPosition(t),newName:r};return a.sendRequest(n.RenameRequest.type,o,i).then(e=>i.isCancellationRequested?null:a.protocol2CodeConverter.asWorkspaceEdit(e,i),e=>a.handleFailedRequest(n.RenameRequest.type,i,e,null,!1))},s=a.middleware;return s.provideRenameEdits?s.provideRenameEdits(e,t,r,i,o):o(e,t,r,i)},prepareRename:e.prepareProvider?(e,t,r)=>{let i=this._client,a=(e,t,r)=>{let a={textDocument:i.code2ProtocolConverter.asTextDocumentIdentifier(e),position:i.code2ProtocolConverter.asPosition(t)};return i.sendRequest(n.PrepareRenameRequest.type,a,r).then(e=>r.isCancellationRequested?null:n.Range.is(e)?i.protocol2CodeConverter.asRange(e):this.isDefaultBehavior(e)?e.defaultBehavior===!0?null:Promise.reject(Error(`The element can't be renamed.`)):e&&n.Range.is(e.range)?{range:i.protocol2CodeConverter.asRange(e.range),placeholder:e.placeholder}:Promise.reject(Error(`The element can't be renamed.`)),e=>{throw typeof e.message==`string`?Error(e.message):Error(`The element can't be renamed.`)})},o=i.middleware;return o.prepareRename?o.prepareRename(e,t,r,a):a(e,t,r)}:void 0};return[this.registerProvider(t,r),r]}registerProvider(e,n){return t.languages.registerRenameProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),n)}isDefaultBehavior(e){let t=e;return t&&i.boolean(t.defaultBehavior)}}})),Ke=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DocumentLinkFeature=void 0;let t=require(`vscode`),n=W(),r=Y(),i=J();e.DocumentLinkFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.DocumentLinkRequest.type)}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`documentLink`);t.dynamicRegistration=!0,t.tooltipSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentLinkProvider);n&&this.register({id:i.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let r=e.documentSelector,i={provideDocumentLinks:(e,t)=>{let r=this._client,i=(e,t)=>r.sendRequest(n.DocumentLinkRequest.type,r.code2ProtocolConverter.asDocumentLinkParams(e),t).then(e=>t.isCancellationRequested?null:r.protocol2CodeConverter.asDocumentLinks(e,t),e=>r.handleFailedRequest(n.DocumentLinkRequest.type,t,e,null)),a=r.middleware;return a.provideDocumentLinks?a.provideDocumentLinks(e,t,i):i(e,t)},resolveDocumentLink:e.resolveProvider?(e,t)=>{let r=this._client,i=(e,t)=>r.sendRequest(n.DocumentLinkResolveRequest.type,r.code2ProtocolConverter.asDocumentLink(e),t).then(n=>t.isCancellationRequested?e:r.protocol2CodeConverter.asDocumentLink(n),i=>r.handleFailedRequest(n.DocumentLinkResolveRequest.type,t,i,e)),a=r.middleware;return a.resolveDocumentLink?a.resolveDocumentLink(e,t,i):i(e,t)}:void 0};return[t.languages.registerDocumentLinkProvider(this._client.protocol2CodeConverter.asDocumentSelector(r),i),i]}}})),qe=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ExecuteCommandFeature=void 0;let t=require(`vscode`),n=W(),r=J(),i=Y();e.ExecuteCommandFeature=class{constructor(e){this._client=e,this._commands=new Map}getState(){return{kind:`workspace`,id:this.registrationType.method,registrations:this._commands.size>0}}get registrationType(){return n.ExecuteCommandRequest.type}fillClientCapabilities(e){(0,i.ensure)((0,i.ensure)(e,`workspace`),`executeCommand`).dynamicRegistration=!0}initialize(e){e.executeCommandProvider&&this.register({id:r.generateUuid(),registerOptions:Object.assign({},e.executeCommandProvider)})}register(e){let r=this._client,i=r.middleware,a=(e,t)=>{let i={command:e,arguments:t};return r.sendRequest(n.ExecuteCommandRequest.type,i).then(void 0,e=>r.handleFailedRequest(n.ExecuteCommandRequest.type,void 0,e,void 0))};if(e.registerOptions.commands){let n=[];for(let r of e.registerOptions.commands)n.push(t.commands.registerCommand(r,(...e)=>i.executeCommand?i.executeCommand(r,e,a):a(r,e)));this._commands.set(e.id,n)}}unregister(e){let t=this._commands.get(e);t&&t.forEach(e=>e.dispose())}clear(){this._commands.forEach(e=>{e.forEach(e=>e.dispose())}),this._commands.clear()}}})),Je=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FileSystemWatcherFeature=void 0;let t=require(`vscode`),n=W(),r=Y();e.FileSystemWatcherFeature=class{constructor(e,t){this._client=e,this._notifyFileEvent=t,this._watchers=new Map}getState(){return{kind:`workspace`,id:this.registrationType.method,registrations:this._watchers.size>0}}get registrationType(){return n.DidChangeWatchedFilesNotification.type}fillClientCapabilities(e){(0,r.ensure)((0,r.ensure)(e,`workspace`),`didChangeWatchedFiles`).dynamicRegistration=!0,(0,r.ensure)((0,r.ensure)(e,`workspace`),`didChangeWatchedFiles`).relativePatternSupport=!0}initialize(e,t){}register(e){if(!Array.isArray(e.registerOptions.watchers))return;let r=[];for(let i of e.registerOptions.watchers){let e=this._client.protocol2CodeConverter.asGlobPattern(i.globPattern);if(e===void 0)continue;let a=!0,o=!0,s=!0;i.kind!==void 0&&i.kind!==null&&(a=(i.kind&n.WatchKind.Create)!==0,o=(i.kind&n.WatchKind.Change)!==0,s=(i.kind&n.WatchKind.Delete)!==0);let c=t.workspace.createFileSystemWatcher(e,!a,!o,!s);this.hookListeners(c,a,o,s,r),r.push(c)}this._watchers.set(e.id,r)}registerRaw(e,t){let n=[];for(let e of t)this.hookListeners(e,!0,!0,!0,n);this._watchers.set(e,n)}hookListeners(e,t,r,i,a){t&&e.onDidCreate(e=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(e),type:n.FileChangeType.Created}),null,a),r&&e.onDidChange(e=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(e),type:n.FileChangeType.Changed}),null,a),i&&e.onDidDelete(e=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(e),type:n.FileChangeType.Deleted}),null,a)}unregister(e){let t=this._watchers.get(e);if(t)for(let e of t)e.dispose()}clear(){this._watchers.forEach(e=>{for(let t of e)t.dispose()}),this._watchers.clear()}}})),Ye=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ColorProviderFeature=void 0;let t=require(`vscode`),n=W(),r=Y();e.ColorProviderFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.DocumentColorRequest.type)}fillClientCapabilities(e){(0,r.ensure)((0,r.ensure)(e,`textDocument`),`colorProvider`).dynamicRegistration=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.colorProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let r=e.documentSelector,i={provideColorPresentations:(e,t,r)=>{let i=this._client,a=(e,t,r)=>{let a={color:e,textDocument:i.code2ProtocolConverter.asTextDocumentIdentifier(t.document),range:i.code2ProtocolConverter.asRange(t.range)};return i.sendRequest(n.ColorPresentationRequest.type,a,r).then(e=>r.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorPresentations(e,r),e=>i.handleFailedRequest(n.ColorPresentationRequest.type,r,e,null))},o=i.middleware;return o.provideColorPresentations?o.provideColorPresentations(e,t,r,a):a(e,t,r)},provideDocumentColors:(e,t)=>{let r=this._client,i=(e,t)=>{let i={textDocument:r.code2ProtocolConverter.asTextDocumentIdentifier(e)};return r.sendRequest(n.DocumentColorRequest.type,i,t).then(e=>t.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorInformations(e,t),e=>r.handleFailedRequest(n.DocumentColorRequest.type,t,e,null))},a=r.middleware;return a.provideDocumentColors?a.provideDocumentColors(e,t,i):i(e,t)}};return[t.languages.registerColorProvider(this._client.protocol2CodeConverter.asDocumentSelector(r),i),i]}}})),Xe=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ImplementationFeature=void 0;let t=require(`vscode`),n=W(),r=Y();e.ImplementationFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.ImplementationRequest.type)}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`implementation`);t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.implementationProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,r={provideImplementation:(e,t,r)=>{let i=this._client,a=(e,t,r)=>i.sendRequest(n.ImplementationRequest.type,i.code2ProtocolConverter.asTextDocumentPositionParams(e,t),r).then(e=>r.isCancellationRequested?null:i.protocol2CodeConverter.asDefinitionResult(e,r),e=>i.handleFailedRequest(n.ImplementationRequest.type,r,e,null)),o=i.middleware;return o.provideImplementation?o.provideImplementation(e,t,r,a):a(e,t,r)}};return[this.registerProvider(t,r),r]}registerProvider(e,n){return t.languages.registerImplementationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),n)}}})),Ze=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.TypeDefinitionFeature=void 0;let t=require(`vscode`),n=W(),r=Y();e.TypeDefinitionFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.TypeDefinitionRequest.type)}fillClientCapabilities(e){(0,r.ensure)((0,r.ensure)(e,`textDocument`),`typeDefinition`).dynamicRegistration=!0;let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`typeDefinition`);t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.typeDefinitionProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,r={provideTypeDefinition:(e,t,r)=>{let i=this._client,a=(e,t,r)=>i.sendRequest(n.TypeDefinitionRequest.type,i.code2ProtocolConverter.asTextDocumentPositionParams(e,t),r).then(e=>r.isCancellationRequested?null:i.protocol2CodeConverter.asDefinitionResult(e,r),e=>i.handleFailedRequest(n.TypeDefinitionRequest.type,r,e,null)),o=i.middleware;return o.provideTypeDefinition?o.provideTypeDefinition(e,t,r,a):a(e,t,r)}};return[this.registerProvider(t,r),r]}registerProvider(e,n){return t.languages.registerTypeDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),n)}}})),Qe=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WorkspaceFoldersFeature=e.arrayDiff=void 0;let t=J(),n=require(`vscode`),r=W();function i(e,t){if(e!=null)return e[t]}function a(e,t){return e.filter(e=>t.indexOf(e)<0)}e.arrayDiff=a,e.WorkspaceFoldersFeature=class{constructor(e){this._client=e,this._listeners=new Map}getState(){return{kind:`workspace`,id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return r.DidChangeWorkspaceFoldersNotification.type}fillInitializeParams(e){let t=n.workspace.workspaceFolders;this.initializeWithFolders(t),t===void 0?e.workspaceFolders=null:e.workspaceFolders=t.map(e=>this.asProtocol(e))}initializeWithFolders(e){this._initialFolders=e}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.workspaceFolders=!0}initialize(e){let a=this._client;a.onRequest(r.WorkspaceFoldersRequest.type,e=>{let t=()=>{let e=n.workspace.workspaceFolders;return e===void 0?null:e.map(e=>this.asProtocol(e))},r=a.middleware.workspace;return r&&r.workspaceFolders?r.workspaceFolders(e,t):t(e)});let o=i(i(i(e,`workspace`),`workspaceFolders`),`changeNotifications`),s;typeof o==`string`?s=o:o===!0&&(s=t.generateUuid()),s&&this.register({id:s,registerOptions:void 0})}sendInitialEvent(e){let t;if(this._initialFolders&&e){let n=a(this._initialFolders,e),r=a(e,this._initialFolders);(r.length>0||n.length>0)&&(t=this.doSendEvent(r,n))}else this._initialFolders?t=this.doSendEvent([],this._initialFolders):e&&(t=this.doSendEvent(e,[]));t!==void 0&&t.catch(e=>{this._client.error(`Sending notification ${r.DidChangeWorkspaceFoldersNotification.type.method} failed`,e)})}doSendEvent(e,t){let n={event:{added:e.map(e=>this.asProtocol(e)),removed:t.map(e=>this.asProtocol(e))}};return this._client.sendNotification(r.DidChangeWorkspaceFoldersNotification.type,n)}register(e){let t=e.id,i=this._client,a=n.workspace.onDidChangeWorkspaceFolders(e=>{let t=e=>this.doSendEvent(e.added,e.removed),n=i.middleware.workspace;(n&&n.didChangeWorkspaceFolders?n.didChangeWorkspaceFolders(e,t):t(e)).catch(e=>{this._client.error(`Sending notification ${r.DidChangeWorkspaceFoldersNotification.type.method} failed`,e)})});this._listeners.set(t,a),this.sendInitialEvent(n.workspace.workspaceFolders)}unregister(e){let t=this._listeners.get(e);t!==void 0&&(this._listeners.delete(e),t.dispose())}clear(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}asProtocol(e){return e===void 0?null:{uri:this._client.code2ProtocolConverter.asUri(e.uri),name:e.name}}}})),$e=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FoldingRangeFeature=void 0;let t=require(`vscode`),n=W(),r=Y();e.FoldingRangeFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.FoldingRangeRequest.type)}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`foldingRange`);t.dynamicRegistration=!0,t.rangeLimit=5e3,t.lineFoldingOnly=!0,t.foldingRangeKind={valueSet:[n.FoldingRangeKind.Comment,n.FoldingRangeKind.Imports,n.FoldingRangeKind.Region]},t.foldingRange={collapsedText:!1},(0,r.ensure)((0,r.ensure)(e,`workspace`),`foldingRange`).refreshSupport=!0}initialize(e,t){this._client.onRequest(n.FoldingRangeRefreshRequest.type,async()=>{for(let e of this.getAllProviders())e.onDidChangeFoldingRange.fire()});let[r,i]=this.getRegistration(t,e.foldingRangeProvider);!r||!i||this.register({id:r,registerOptions:i})}registerLanguageProvider(e){let r=e.documentSelector,i=new t.EventEmitter,a={onDidChangeFoldingRanges:i.event,provideFoldingRanges:(e,t,r)=>{let i=this._client,a=(e,t,r)=>{let a={textDocument:i.code2ProtocolConverter.asTextDocumentIdentifier(e)};return i.sendRequest(n.FoldingRangeRequest.type,a,r).then(e=>r.isCancellationRequested?null:i.protocol2CodeConverter.asFoldingRanges(e,r),e=>i.handleFailedRequest(n.FoldingRangeRequest.type,r,e,null))},o=i.middleware;return o.provideFoldingRanges?o.provideFoldingRanges(e,t,r,a):a(e,t,r)}};return[t.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(r),a),{provider:a,onDidChangeFoldingRange:i}]}}})),et=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DeclarationFeature=void 0;let t=require(`vscode`),n=W(),r=Y();e.DeclarationFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.DeclarationRequest.type)}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`declaration`);t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.declarationProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,r={provideDeclaration:(e,t,r)=>{let i=this._client,a=(e,t,r)=>i.sendRequest(n.DeclarationRequest.type,i.code2ProtocolConverter.asTextDocumentPositionParams(e,t),r).then(e=>r.isCancellationRequested?null:i.protocol2CodeConverter.asDeclarationResult(e,r),e=>i.handleFailedRequest(n.DeclarationRequest.type,r,e,null)),o=i.middleware;return o.provideDeclaration?o.provideDeclaration(e,t,r,a):a(e,t,r)}};return[this.registerProvider(t,r),r]}registerProvider(e,n){return t.languages.registerDeclarationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),n)}}})),tt=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SelectionRangeFeature=void 0;let t=require(`vscode`),n=W(),r=Y();e.SelectionRangeFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.SelectionRangeRequest.type)}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`selectionRange`);t.dynamicRegistration=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.selectionRangeProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,r={provideSelectionRanges:(e,t,r)=>{let i=this._client,a=async(e,t,r)=>{let a={textDocument:i.code2ProtocolConverter.asTextDocumentIdentifier(e),positions:i.code2ProtocolConverter.asPositionsSync(t,r)};return i.sendRequest(n.SelectionRangeRequest.type,a,r).then(e=>r.isCancellationRequested?null:i.protocol2CodeConverter.asSelectionRanges(e,r),e=>i.handleFailedRequest(n.SelectionRangeRequest.type,r,e,null))},o=i.middleware;return o.provideSelectionRanges?o.provideSelectionRanges(e,t,r,a):a(e,t,r)}};return[this.registerProvider(t,r),r]}registerProvider(e,n){return t.languages.registerSelectionRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),n)}}})),nt=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ProgressFeature=void 0;let t=W(),n=De();function r(e,t){return e[t]===void 0&&(e[t]=Object.create(null)),e[t]}e.ProgressFeature=class{constructor(e){this._client=e,this.activeParts=new Set}getState(){return{kind:`window`,id:t.WorkDoneProgressCreateRequest.method,registrations:this.activeParts.size>0}}fillClientCapabilities(e){r(e,`window`).workDoneProgress=!0}initialize(){let e=this._client,r=e=>{this.activeParts.delete(e)};e.onRequest(t.WorkDoneProgressCreateRequest.type,e=>{this.activeParts.add(new n.ProgressPart(this._client,e.token,r))})}clear(){for(let e of this.activeParts)e.done();this.activeParts.clear()}}})),rt=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CallHierarchyFeature=void 0;let t=require(`vscode`),n=W(),r=Y();var i=class{constructor(e){this.client=e,this.middleware=e.middleware}prepareCallHierarchy(e,t,r){let i=this.client,a=this.middleware,o=(e,t,r)=>{let a=i.code2ProtocolConverter.asTextDocumentPositionParams(e,t);return i.sendRequest(n.CallHierarchyPrepareRequest.type,a,r).then(e=>r.isCancellationRequested?null:i.protocol2CodeConverter.asCallHierarchyItems(e,r),e=>i.handleFailedRequest(n.CallHierarchyPrepareRequest.type,r,e,null))};return a.prepareCallHierarchy?a.prepareCallHierarchy(e,t,r,o):o(e,t,r)}provideCallHierarchyIncomingCalls(e,t){let r=this.client,i=this.middleware,a=(e,t)=>{let i={item:r.code2ProtocolConverter.asCallHierarchyItem(e)};return r.sendRequest(n.CallHierarchyIncomingCallsRequest.type,i,t).then(e=>t.isCancellationRequested?null:r.protocol2CodeConverter.asCallHierarchyIncomingCalls(e,t),e=>r.handleFailedRequest(n.CallHierarchyIncomingCallsRequest.type,t,e,null))};return i.provideCallHierarchyIncomingCalls?i.provideCallHierarchyIncomingCalls(e,t,a):a(e,t)}provideCallHierarchyOutgoingCalls(e,t){let r=this.client,i=this.middleware,a=(e,t)=>{let i={item:r.code2ProtocolConverter.asCallHierarchyItem(e)};return r.sendRequest(n.CallHierarchyOutgoingCallsRequest.type,i,t).then(e=>t.isCancellationRequested?null:r.protocol2CodeConverter.asCallHierarchyOutgoingCalls(e,t),e=>r.handleFailedRequest(n.CallHierarchyOutgoingCallsRequest.type,t,e,null))};return i.provideCallHierarchyOutgoingCalls?i.provideCallHierarchyOutgoingCalls(e,t,a):a(e,t)}};e.CallHierarchyFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.CallHierarchyPrepareRequest.type)}fillClientCapabilities(e){let t=e,n=(0,r.ensure)((0,r.ensure)(t,`textDocument`),`callHierarchy`);n.dynamicRegistration=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.callHierarchyProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let n=this._client,r=new i(n);return[t.languages.registerCallHierarchyProvider(this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector),r),r]}}})),it=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SemanticTokensFeature=void 0;let t=require(`vscode`),n=W(),r=Y(),i=_();e.SemanticTokensFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.SemanticTokensRegistrationType.type)}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`semanticTokens`);t.dynamicRegistration=!0,t.tokenTypes=[n.SemanticTokenTypes.namespace,n.SemanticTokenTypes.type,n.SemanticTokenTypes.class,n.SemanticTokenTypes.enum,n.SemanticTokenTypes.interface,n.SemanticTokenTypes.struct,n.SemanticTokenTypes.typeParameter,n.SemanticTokenTypes.parameter,n.SemanticTokenTypes.variable,n.SemanticTokenTypes.property,n.SemanticTokenTypes.enumMember,n.SemanticTokenTypes.event,n.SemanticTokenTypes.function,n.SemanticTokenTypes.method,n.SemanticTokenTypes.macro,n.SemanticTokenTypes.keyword,n.SemanticTokenTypes.modifier,n.SemanticTokenTypes.comment,n.SemanticTokenTypes.string,n.SemanticTokenTypes.number,n.SemanticTokenTypes.regexp,n.SemanticTokenTypes.operator,n.SemanticTokenTypes.decorator],t.tokenModifiers=[n.SemanticTokenModifiers.declaration,n.SemanticTokenModifiers.definition,n.SemanticTokenModifiers.readonly,n.SemanticTokenModifiers.static,n.SemanticTokenModifiers.deprecated,n.SemanticTokenModifiers.abstract,n.SemanticTokenModifiers.async,n.SemanticTokenModifiers.modification,n.SemanticTokenModifiers.documentation,n.SemanticTokenModifiers.defaultLibrary],t.formats=[n.TokenFormat.Relative],t.requests={range:!0,full:{delta:!0}},t.multilineTokenSupport=!1,t.overlappingTokenSupport=!1,t.serverCancelSupport=!0,t.augmentsSyntaxTokens=!0,(0,r.ensure)((0,r.ensure)(e,`workspace`),`semanticTokens`).refreshSupport=!0}initialize(e,t){this._client.onRequest(n.SemanticTokensRefreshRequest.type,async()=>{for(let e of this.getAllProviders())e.onDidChangeSemanticTokensEmitter.fire()});let[r,i]=this.getRegistration(t,e.semanticTokensProvider);!r||!i||this.register({id:r,registerOptions:i})}registerLanguageProvider(e){let r=e.documentSelector,a=i.boolean(e.full)?e.full:e.full!==void 0,o=e.full!==void 0&&typeof e.full!=`boolean`&&e.full.delta===!0,s=new t.EventEmitter,c=a?{onDidChangeSemanticTokens:s.event,provideDocumentSemanticTokens:(e,t)=>{let r=this._client,i=r.middleware,a=(e,t)=>{let i={textDocument:r.code2ProtocolConverter.asTextDocumentIdentifier(e)};return r.sendRequest(n.SemanticTokensRequest.type,i,t).then(e=>t.isCancellationRequested?null:r.protocol2CodeConverter.asSemanticTokens(e,t),e=>r.handleFailedRequest(n.SemanticTokensRequest.type,t,e,null))};return i.provideDocumentSemanticTokens?i.provideDocumentSemanticTokens(e,t,a):a(e,t)},provideDocumentSemanticTokensEdits:o?(e,t,r)=>{let i=this._client,a=i.middleware,o=(e,t,r)=>{let a={textDocument:i.code2ProtocolConverter.asTextDocumentIdentifier(e),previousResultId:t};return i.sendRequest(n.SemanticTokensDeltaRequest.type,a,r).then(async e=>r.isCancellationRequested?null:n.SemanticTokens.is(e)?await i.protocol2CodeConverter.asSemanticTokens(e,r):await i.protocol2CodeConverter.asSemanticTokensEdits(e,r),e=>i.handleFailedRequest(n.SemanticTokensDeltaRequest.type,r,e,null))};return a.provideDocumentSemanticTokensEdits?a.provideDocumentSemanticTokensEdits(e,t,r,o):o(e,t,r)}:void 0}:void 0,l=e.range===!0?{provideDocumentRangeSemanticTokens:(e,t,r)=>{let i=this._client,a=i.middleware,o=(e,t,r)=>{let a={textDocument:i.code2ProtocolConverter.asTextDocumentIdentifier(e),range:i.code2ProtocolConverter.asRange(t)};return i.sendRequest(n.SemanticTokensRangeRequest.type,a,r).then(e=>r.isCancellationRequested?null:i.protocol2CodeConverter.asSemanticTokens(e,r),e=>i.handleFailedRequest(n.SemanticTokensRangeRequest.type,r,e,null))};return a.provideDocumentRangeSemanticTokens?a.provideDocumentRangeSemanticTokens(e,t,r,o):o(e,t,r)}}:void 0,u=[],d=this._client,f=d.protocol2CodeConverter.asSemanticTokensLegend(e.legend),p=d.protocol2CodeConverter.asDocumentSelector(r);return c!==void 0&&u.push(t.languages.registerDocumentSemanticTokensProvider(p,c,f)),l!==void 0&&u.push(t.languages.registerDocumentRangeSemanticTokensProvider(p,l,f)),[new t.Disposable(()=>u.forEach(e=>e.dispose())),{range:l,full:c,onDidChangeSemanticTokensEmitter:s}]}}})),at=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.WillDeleteFilesFeature=e.WillRenameFilesFeature=e.WillCreateFilesFeature=e.DidDeleteFilesFeature=e.DidRenameFilesFeature=e.DidCreateFilesFeature=void 0;let t=require(`vscode`),n=X(),r=W(),i=J();function a(e,t){return e[t]===void 0&&(e[t]={}),e[t]}function o(e,t){return e[t]}function s(e,t,n){e[t]=n}var c=class e{constructor(e,t,n,r,i){this._client=e,this._event=t,this._registrationType=n,this._clientCapability=r,this._serverCapability=i,this._filters=new Map}getState(){return{kind:`workspace`,id:this._registrationType.method,registrations:this._filters.size>0}}filterSize(){return this._filters.size}get registrationType(){return this._registrationType}fillClientCapabilities(e){let t=a(a(e,`workspace`),`fileOperations`);s(t,`dynamicRegistration`,!0),s(t,this._clientCapability,!0)}initialize(e){let t=e.workspace?.fileOperations,n=t===void 0?void 0:o(t,this._serverCapability);if(n?.filters!==void 0)try{this.register({id:i.generateUuid(),registerOptions:{filters:n.filters}})}catch(e){this._client.warn(`Ignoring invalid glob pattern for ${this._serverCapability} registration: ${e}`)}}register(t){this._listener||=this._event(this.send,this);let r=t.registerOptions.filters.map(t=>{let r=new n.Minimatch(t.pattern.glob,e.asMinimatchOptions(t.pattern.options));if(!r.makeRe())throw Error(`Invalid pattern ${t.pattern.glob}!`);return{scheme:t.scheme,matcher:r,kind:t.pattern.matches}});this._filters.set(t.id,r)}unregister(e){this._filters.delete(e),this._filters.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}clear(){this._filters.clear(),this._listener&&=(this._listener.dispose(),void 0)}getFileType(t){return e.getFileType(t)}async filter(n,i){let a=await Promise.all(n.files.map(async n=>{let a=i(n),o=a.fsPath.replace(/\\/g,`/`);for(let n of this._filters.values())for(let i of n)if(!(i.scheme!==void 0&&i.scheme!==a.scheme)){if(i.matcher.match(o)){if(i.kind===void 0)return!0;let e=await this.getFileType(a);if(e===void 0)return this._client.error(`Failed to determine file type for ${a.toString()}.`),!0;if(e===t.FileType.File&&i.kind===r.FileOperationPatternKind.file||e===t.FileType.Directory&&i.kind===r.FileOperationPatternKind.folder)return!0}else if(i.kind===r.FileOperationPatternKind.folder&&await e.getFileType(a)===t.FileType.Directory&&i.matcher.match(`${o}/`))return!0}return!1})),o=n.files.filter((e,t)=>a[t]);return{...n,files:o}}static async getFileType(e){try{return(await t.workspace.fs.stat(e)).type}catch{return}}static asMinimatchOptions(e){let t={dot:!0};return e?.ignoreCase===!0&&(t.nocase=!0),t}},l=class extends c{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i),this._notificationType=n,this._accessUri=a,this._createParams=o}async send(e){let t=await this.filter(e,this._accessUri);if(t.files.length)return this.doSend(t,async e=>this._client.sendNotification(this._notificationType,this._createParams(e)))}},u=class extends l{constructor(){super(...arguments),this._fsPathFileTypes=new Map}async getFileType(e){let t=e.fsPath;if(this._fsPathFileTypes.has(t))return this._fsPathFileTypes.get(t);let n=await c.getFileType(e);return n&&this._fsPathFileTypes.set(t,n),n}async cacheFileTypes(e,t){await this.filter(e,t)}clearFileTypeCache(){this._fsPathFileTypes.clear()}unregister(e){super.unregister(e),this.filterSize()===0&&this._willListener&&(this._willListener.dispose(),this._willListener=void 0)}clear(){super.clear(),this._willListener&&=(this._willListener.dispose(),void 0)}};e.DidCreateFilesFeature=class extends l{constructor(e){super(e,t.workspace.onDidCreateFiles,r.DidCreateFilesNotification.type,`didCreate`,`didCreate`,e=>e,e.code2ProtocolConverter.asDidCreateFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.didCreateFiles?n.didCreateFiles(e,t):t(e)}},e.DidRenameFilesFeature=class extends u{constructor(e){super(e,t.workspace.onDidRenameFiles,r.DidRenameFilesNotification.type,`didRename`,`didRename`,e=>e.oldUri,e.code2ProtocolConverter.asDidRenameFilesParams)}register(e){this._willListener||=t.workspace.onWillRenameFiles(this.willRename,this),super.register(e)}willRename(e){e.waitUntil(this.cacheFileTypes(e,e=>e.oldUri))}doSend(e,t){this.clearFileTypeCache();let n=this._client.middleware.workspace;return n?.didRenameFiles?n.didRenameFiles(e,t):t(e)}},e.DidDeleteFilesFeature=class extends u{constructor(e){super(e,t.workspace.onDidDeleteFiles,r.DidDeleteFilesNotification.type,`didDelete`,`didDelete`,e=>e,e.code2ProtocolConverter.asDidDeleteFilesParams)}register(e){this._willListener||=t.workspace.onWillDeleteFiles(this.willDelete,this),super.register(e)}willDelete(e){e.waitUntil(this.cacheFileTypes(e,e=>e))}doSend(e,t){this.clearFileTypeCache();let n=this._client.middleware.workspace;return n?.didDeleteFiles?n.didDeleteFiles(e,t):t(e)}};var d=class extends c{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i),this._requestType=n,this._accessUri=a,this._createParams=o}async send(e){let t=this.waitUntil(e);e.waitUntil(t)}async waitUntil(e){let t=await this.filter(e,this._accessUri);if(t.files.length)return this.doSend(t,e=>this._client.sendRequest(this._requestType,this._createParams(e),e.token).then(this._client.protocol2CodeConverter.asWorkspaceEdit))}};e.WillCreateFilesFeature=class extends d{constructor(e){super(e,t.workspace.onWillCreateFiles,r.WillCreateFilesRequest.type,`willCreate`,`willCreate`,e=>e,e.code2ProtocolConverter.asWillCreateFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.willCreateFiles?n.willCreateFiles(e,t):t(e)}},e.WillRenameFilesFeature=class extends d{constructor(e){super(e,t.workspace.onWillRenameFiles,r.WillRenameFilesRequest.type,`willRename`,`willRename`,e=>e.oldUri,e.code2ProtocolConverter.asWillRenameFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.willRenameFiles?n.willRenameFiles(e,t):t(e)}},e.WillDeleteFilesFeature=class extends d{constructor(e){super(e,t.workspace.onWillDeleteFiles,r.WillDeleteFilesRequest.type,`willDelete`,`willDelete`,e=>e,e.code2ProtocolConverter.asWillDeleteFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.willDeleteFiles?n.willDeleteFiles(e,t):t(e)}}})),ot=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LinkedEditingFeature=void 0;let t=require(`vscode`),n=W(),r=Y();e.LinkedEditingFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.LinkedEditingRangeRequest.type)}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`linkedEditingRange`);t.dynamicRegistration=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.linkedEditingRangeProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,r={provideLinkedEditingRanges:(e,t,r)=>{let i=this._client,a=(e,t,r)=>i.sendRequest(n.LinkedEditingRangeRequest.type,i.code2ProtocolConverter.asTextDocumentPositionParams(e,t),r).then(e=>r.isCancellationRequested?null:i.protocol2CodeConverter.asLinkedEditingRanges(e,r),e=>i.handleFailedRequest(n.LinkedEditingRangeRequest.type,r,e,null)),o=i.middleware;return o.provideLinkedEditingRange?o.provideLinkedEditingRange(e,t,r,a):a(e,t,r)}};return[this.registerProvider(t,r),r]}registerProvider(e,n){return t.languages.registerLinkedEditingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),n)}}})),st=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.TypeHierarchyFeature=void 0;let t=require(`vscode`),n=W(),r=Y();var i=class{constructor(e){this.client=e,this.middleware=e.middleware}prepareTypeHierarchy(e,t,r){let i=this.client,a=this.middleware,o=(e,t,r)=>{let a=i.code2ProtocolConverter.asTextDocumentPositionParams(e,t);return i.sendRequest(n.TypeHierarchyPrepareRequest.type,a,r).then(e=>r.isCancellationRequested?null:i.protocol2CodeConverter.asTypeHierarchyItems(e,r),e=>i.handleFailedRequest(n.TypeHierarchyPrepareRequest.type,r,e,null))};return a.prepareTypeHierarchy?a.prepareTypeHierarchy(e,t,r,o):o(e,t,r)}provideTypeHierarchySupertypes(e,t){let r=this.client,i=this.middleware,a=(e,t)=>{let i={item:r.code2ProtocolConverter.asTypeHierarchyItem(e)};return r.sendRequest(n.TypeHierarchySupertypesRequest.type,i,t).then(e=>t.isCancellationRequested?null:r.protocol2CodeConverter.asTypeHierarchyItems(e,t),e=>r.handleFailedRequest(n.TypeHierarchySupertypesRequest.type,t,e,null))};return i.provideTypeHierarchySupertypes?i.provideTypeHierarchySupertypes(e,t,a):a(e,t)}provideTypeHierarchySubtypes(e,t){let r=this.client,i=this.middleware,a=(e,t)=>{let i={item:r.code2ProtocolConverter.asTypeHierarchyItem(e)};return r.sendRequest(n.TypeHierarchySubtypesRequest.type,i,t).then(e=>t.isCancellationRequested?null:r.protocol2CodeConverter.asTypeHierarchyItems(e,t),e=>r.handleFailedRequest(n.TypeHierarchySubtypesRequest.type,t,e,null))};return i.provideTypeHierarchySubtypes?i.provideTypeHierarchySubtypes(e,t,a):a(e,t)}};e.TypeHierarchyFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.TypeHierarchyPrepareRequest.type)}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`typeHierarchy`);t.dynamicRegistration=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.typeHierarchyProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let n=this._client,r=new i(n);return[t.languages.registerTypeHierarchyProvider(n.protocol2CodeConverter.asDocumentSelector(e.documentSelector),r),r]}}})),ct=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.InlineValueFeature=void 0;let t=require(`vscode`),n=W(),r=Y();e.InlineValueFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.InlineValueRequest.type)}fillClientCapabilities(e){(0,r.ensure)((0,r.ensure)(e,`textDocument`),`inlineValue`).dynamicRegistration=!0,(0,r.ensure)((0,r.ensure)(e,`workspace`),`inlineValue`).refreshSupport=!0}initialize(e,t){this._client.onRequest(n.InlineValueRefreshRequest.type,async()=>{for(let e of this.getAllProviders())e.onDidChangeInlineValues.fire()});let[r,i]=this.getRegistration(t,e.inlineValueProvider);!r||!i||this.register({id:r,registerOptions:i})}registerLanguageProvider(e){let r=e.documentSelector,i=new t.EventEmitter,a={onDidChangeInlineValues:i.event,provideInlineValues:(e,t,r,i)=>{let a=this._client,o=(e,t,r,i)=>{let o={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(e),range:a.code2ProtocolConverter.asRange(t),context:a.code2ProtocolConverter.asInlineValueContext(r)};return a.sendRequest(n.InlineValueRequest.type,o,i).then(e=>i.isCancellationRequested?null:a.protocol2CodeConverter.asInlineValues(e,i),e=>a.handleFailedRequest(n.InlineValueRequest.type,i,e,null))},s=a.middleware;return s.provideInlineValues?s.provideInlineValues(e,t,r,i,o):o(e,t,r,i)}};return[this.registerProvider(r,a),{provider:a,onDidChangeInlineValues:i}]}registerProvider(e,n){return t.languages.registerInlineValuesProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),n)}}})),lt=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.InlayHintsFeature=void 0;let t=require(`vscode`),n=W(),r=Y();e.InlayHintsFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.InlayHintRequest.type)}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`inlayHint`);t.dynamicRegistration=!0,t.resolveSupport={properties:[`tooltip`,`textEdits`,`label.tooltip`,`label.location`,`label.command`]},(0,r.ensure)((0,r.ensure)(e,`workspace`),`inlayHint`).refreshSupport=!0}initialize(e,t){this._client.onRequest(n.InlayHintRefreshRequest.type,async()=>{for(let e of this.getAllProviders())e.onDidChangeInlayHints.fire()});let[r,i]=this.getRegistration(t,e.inlayHintProvider);!r||!i||this.register({id:r,registerOptions:i})}registerLanguageProvider(e){let r=e.documentSelector,i=new t.EventEmitter,a={onDidChangeInlayHints:i.event,provideInlayHints:(e,t,r)=>{let i=this._client,a=async(e,t,r)=>{let a={textDocument:i.code2ProtocolConverter.asTextDocumentIdentifier(e),range:i.code2ProtocolConverter.asRange(t)};try{let e=await i.sendRequest(n.InlayHintRequest.type,a,r);return r.isCancellationRequested?null:i.protocol2CodeConverter.asInlayHints(e,r)}catch(e){return i.handleFailedRequest(n.InlayHintRequest.type,r,e,null)}},o=i.middleware;return o.provideInlayHints?o.provideInlayHints(e,t,r,a):a(e,t,r)}};return a.resolveInlayHint=e.resolveProvider===!0?(e,t)=>{let r=this._client,i=async(e,t)=>{try{let i=await r.sendRequest(n.InlayHintResolveRequest.type,r.code2ProtocolConverter.asInlayHint(e),t);if(t.isCancellationRequested)return null;let a=r.protocol2CodeConverter.asInlayHint(i,t);return t.isCancellationRequested?null:a}catch(e){return r.handleFailedRequest(n.InlayHintResolveRequest.type,t,e,null)}},a=r.middleware;return a.resolveInlayHint?a.resolveInlayHint(e,t,i):i(e,t)}:void 0,[this.registerProvider(r,a),{provider:a,onDidChangeInlayHints:i}]}registerProvider(e,n){return t.languages.registerInlayHintsProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),n)}}})),ut=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.InlineCompletionItemFeature=void 0;let t=require(`vscode`),n=W(),r=Y(),i=J();e.InlineCompletionItemFeature=class extends r.TextDocumentLanguageFeature{constructor(e){super(e,n.InlineCompletionRequest.type)}fillClientCapabilities(e){let t=(0,r.ensure)((0,r.ensure)(e,`textDocument`),`inlineCompletion`);t.dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.inlineCompletionProvider);n&&this.register({id:i.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let r=e.documentSelector,i={provideInlineCompletionItems:(e,t,r,i)=>{let a=this._client,o=this._client.middleware,s=(e,t,r,i)=>a.sendRequest(n.InlineCompletionRequest.type,a.code2ProtocolConverter.asInlineCompletionParams(e,t,r),i).then(e=>i.isCancellationRequested?null:a.protocol2CodeConverter.asInlineCompletionResult(e,i),e=>a.handleFailedRequest(n.InlineCompletionRequest.type,i,e,null));return o.provideInlineCompletionItems?o.provideInlineCompletionItems(e,t,r,i,s):s(e,t,r,i)}};return[t.languages.registerInlineCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(r),i),i]}}})),dt=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ProposedFeatures=e.BaseLanguageClient=e.MessageTransports=e.SuspendMode=e.State=e.CloseAction=e.ErrorAction=e.RevealOutputChannelOn=void 0;let t=require(`vscode`),n=W(),r=Te(),i=Ee(),a=_(),o=ve(),s=J(),c=De(),l=Y(),u=je(),d=Me(),f=Z(),p=Ne(),m=Pe(),h=Fe(),g=Ie(),v=Le(),y=Re(),b=ze(),x=Be(),S=Ve(),C=He(),w=Ue(),T=We(),E=Ge(),D=Ke(),O=qe(),k=Je(),A=Ye(),j=Xe(),M=Ze(),N=Qe(),P=$e(),ee=et(),F=tt(),te=nt(),ne=rt(),I=it(),L=at(),R=ot(),re=st(),ie=ct(),z=lt(),B=ut();var V;(function(e){e[e.Debug=0]=`Debug`,e[e.Info=1]=`Info`,e[e.Warn=2]=`Warn`,e[e.Error=3]=`Error`,e[e.Never=4]=`Never`})(V||(e.RevealOutputChannelOn=V={}));var ae;(function(e){e[e.Continue=1]=`Continue`,e[e.Shutdown=2]=`Shutdown`})(ae||(e.ErrorAction=ae={}));var H;(function(e){e[e.DoNotRestart=1]=`DoNotRestart`,e[e.Restart=2]=`Restart`})(H||(e.CloseAction=H={}));var oe;(function(e){e[e.Stopped=1]=`Stopped`,e[e.Starting=3]=`Starting`,e[e.Running=2]=`Running`})(oe||(e.State=oe={}));var se;(function(e){e.off=`off`,e.on=`on`})(se||(e.SuspendMode=se={}));var ce;(function(e){function t(e){return e==null?!1:typeof e==`boolean`||typeof e==`object`&&e&&a.stringArray(e.enabledCommands)?e:!1}e.sanitizeIsTrusted=t})(ce||={});var le=class{constructor(e,t){this.client=e,this.maxRestartCount=t,this.restarts=[]}error(e,t,n){return n&&n<=3?{action:ae.Continue}:{action:ae.Shutdown}}closed(){return this.restarts.push(Date.now()),this.restarts.length<=this.maxRestartCount?{action:H.Restart}:this.restarts[this.restarts.length-1]-this.restarts[0]<=180*1e3?{action:H.DoNotRestart,message:`The ${this.client.name} server crashed ${this.maxRestartCount+1} times in the last 3 minutes. The server will not be restarted. See the output for more information.`}:(this.restarts.shift(),{action:H.Restart})}},U;(function(e){e.Initial=`initial`,e.Starting=`starting`,e.StartFailed=`startFailed`,e.Running=`running`,e.Stopping=`stopping`,e.Stopped=`stopped`})(U||={});var ue;(function(e){function t(e){return e&&n.MessageReader.is(e.reader)&&n.MessageWriter.is(e.writer)}e.is=t})(ue||(e.MessageTransports=ue={}));var de=class e{constructor(e,t,s){this._traceFormat=n.TraceFormat.Text,this._diagnosticQueue=new Map,this._diagnosticQueueState={state:`idle`},this._features=[],this._dynamicFeatures=new Map,this.workspaceEditLock=new o.Semaphore(1),this._id=e,this._name=t,s||={};let c={isTrusted:!1,supportHtml:!1};s.markdown!==void 0&&(c.isTrusted=ce.sanitizeIsTrusted(s.markdown.isTrusted),c.supportHtml=s.markdown.supportHtml===!0),this._clientOptions={documentSelector:s.documentSelector??[],synchronize:s.synchronize??{},diagnosticCollectionName:s.diagnosticCollectionName,outputChannelName:s.outputChannelName??this._name,revealOutputChannelOn:s.revealOutputChannelOn??V.Error,stdioEncoding:s.stdioEncoding??`utf8`,initializationOptions:s.initializationOptions,initializationFailedHandler:s.initializationFailedHandler,progressOnInitialization:!!s.progressOnInitialization,errorHandler:s.errorHandler??this.createDefaultErrorHandler(s.connectionOptions?.maxRestartCount),middleware:s.middleware??{},uriConverters:s.uriConverters,workspaceFolder:s.workspaceFolder,connectionOptions:s.connectionOptions,markdown:c,diagnosticPullOptions:s.diagnosticPullOptions??{onChange:!0,onSave:!1},notebookDocumentOptions:s.notebookDocumentOptions??{}},this._clientOptions.synchronize=this._clientOptions.synchronize||{},this._state=U.Initial,this._ignoredRegistrations=new Set,this._listeners=[],this._notificationHandlers=new Map,this._pendingNotificationHandlers=new Map,this._notificationDisposables=new Map,this._requestHandlers=new Map,this._pendingRequestHandlers=new Map,this._requestDisposables=new Map,this._progressHandlers=new Map,this._pendingProgressHandlers=new Map,this._progressDisposables=new Map,this._connection=void 0,this._initializeResult=void 0,s.outputChannel?(this._outputChannel=s.outputChannel,this._disposeOutputChannel=!1):(this._outputChannel=void 0,this._disposeOutputChannel=!0),this._traceOutputChannel=s.traceOutputChannel,this._diagnostics=void 0,this._pendingOpenNotifications=new Set,this._pendingChangeSemaphore=new o.Semaphore(1),this._pendingChangeDelayer=new o.Delayer(250),this._fileEvents=[],this._fileEventDelayer=new o.Delayer(250),this._onStop=void 0,this._telemetryEmitter=new n.Emitter,this._stateChangeEmitter=new n.Emitter,this._trace=n.Trace.Off,this._tracer={log:(e,t)=>{a.string(e)?this.logTrace(e,t):this.logObjectTrace(e)}},this._c2p=r.createConverter(s.uriConverters?s.uriConverters.code2Protocol:void 0),this._p2c=i.createConverter(s.uriConverters?s.uriConverters.protocol2Code:void 0,this._clientOptions.markdown.isTrusted,this._clientOptions.markdown.supportHtml),this._syncedDocuments=new Map,this.registerBuiltinFeatures()}get name(){return this._name}get middleware(){return this._clientOptions.middleware??Object.create(null)}get clientOptions(){return this._clientOptions}get protocol2CodeConverter(){return this._p2c}get code2ProtocolConverter(){return this._c2p}get onTelemetry(){return this._telemetryEmitter.event}get onDidChangeState(){return this._stateChangeEmitter.event}get outputChannel(){return this._outputChannel||=t.window.createOutputChannel(this._clientOptions.outputChannelName?this._clientOptions.outputChannelName:this._name),this._outputChannel}get traceOutputChannel(){return this._traceOutputChannel?this._traceOutputChannel:this.outputChannel}get diagnostics(){return this._diagnostics}get state(){return this.getPublicState()}get $state(){return this._state}set $state(e){let t=this.getPublicState();this._state=e;let n=this.getPublicState();n!==t&&this._stateChangeEmitter.fire({oldState:t,newState:n})}getPublicState(){switch(this.$state){case U.Starting:return oe.Starting;case U.Running:return oe.Running;default:return oe.Stopped}}get initializeResult(){return this._initializeResult}async sendRequest(e,...t){if(this.$state===U.StartFailed||this.$state===U.Stopping||this.$state===U.Stopped)return Promise.reject(new n.ResponseError(n.ErrorCodes.ConnectionInactive,`Client is not running`));let r=await this.$start();this._didChangeTextDocumentFeature.syncKind===n.TextDocumentSyncKind.Full&&await this.sendPendingFullTextDocumentChanges(r);let i=this._clientOptions.middleware?.sendRequest;if(i!==void 0){let a,o;return t.length===1?n.CancellationToken.is(t[0])?o=t[0]:a=t[0]:t.length===2&&(a=t[0],o=t[1]),i(e,a,o,(e,t,n)=>{let i=[];return t!==void 0&&i.push(t),n!==void 0&&i.push(n),r.sendRequest(e,...i)})}else return r.sendRequest(e,...t)}onRequest(e,t){let n=typeof e==`string`?e:e.method;this._requestHandlers.set(n,t);let r=this.activeConnection(),i;return r===void 0?(this._pendingRequestHandlers.set(n,t),i={dispose:()=>{this._pendingRequestHandlers.delete(n);let e=this._requestDisposables.get(n);e!==void 0&&(e.dispose(),this._requestDisposables.delete(n))}}):(this._requestDisposables.set(n,r.onRequest(e,t)),i={dispose:()=>{let e=this._requestDisposables.get(n);e!==void 0&&(e.dispose(),this._requestDisposables.delete(n))}}),{dispose:()=>{this._requestHandlers.delete(n),i.dispose()}}}async sendNotification(e,t){if(this.$state===U.StartFailed||this.$state===U.Stopping||this.$state===U.Stopped)return Promise.reject(new n.ResponseError(n.ErrorCodes.ConnectionInactive,`Client is not running`));let r=this._didChangeTextDocumentFeature.syncKind===n.TextDocumentSyncKind.Full,i;r&&typeof e!=`string`&&e.method===n.DidOpenTextDocumentNotification.method&&(i=t?.textDocument.uri,this._pendingOpenNotifications.add(i));let a=await this.$start();r&&await this.sendPendingFullTextDocumentChanges(a),i!==void 0&&this._pendingOpenNotifications.delete(i);let o=this._clientOptions.middleware?.sendNotification;return o?o(e,a.sendNotification.bind(a),t):a.sendNotification(e,t)}onNotification(e,t){let n=typeof e==`string`?e:e.method;this._notificationHandlers.set(n,t);let r=this.activeConnection(),i;return r===void 0?(this._pendingNotificationHandlers.set(n,t),i={dispose:()=>{this._pendingNotificationHandlers.delete(n);let e=this._notificationDisposables.get(n);e!==void 0&&(e.dispose(),this._notificationDisposables.delete(n))}}):(this._notificationDisposables.set(n,r.onNotification(e,t)),i={dispose:()=>{let e=this._notificationDisposables.get(n);e!==void 0&&(e.dispose(),this._notificationDisposables.delete(n))}}),{dispose:()=>{this._notificationHandlers.delete(n),i.dispose()}}}async sendProgress(e,t,r){if(this.$state===U.StartFailed||this.$state===U.Stopping||this.$state===U.Stopped)return Promise.reject(new n.ResponseError(n.ErrorCodes.ConnectionInactive,`Client is not running`));try{return(await this.$start()).sendProgress(e,t,r)}catch(e){throw this.error(`Sending progress for token ${t} failed.`,e),e}}onProgress(e,t,r){this._progressHandlers.set(t,{type:e,handler:r});let i=this.activeConnection(),a,o=this._clientOptions.middleware?.handleWorkDoneProgress,s=n.WorkDoneProgress.is(e)&&o!==void 0?e=>{o(t,e,()=>r(e))}:r;return i===void 0?(this._pendingProgressHandlers.set(t,{type:e,handler:r}),a={dispose:()=>{this._pendingProgressHandlers.delete(t);let e=this._progressDisposables.get(t);e!==void 0&&(e.dispose(),this._progressDisposables.delete(t))}}):(this._progressDisposables.set(t,i.onProgress(e,t,s)),a={dispose:()=>{let e=this._progressDisposables.get(t);e!==void 0&&(e.dispose(),this._progressDisposables.delete(t))}}),{dispose:()=>{this._progressHandlers.delete(t),a.dispose()}}}createDefaultErrorHandler(e){if(e!==void 0&&e<0)throw Error(`Invalid maxRestartCount: ${e}`);return new le(this,e??4)}async setTrace(e){this._trace=e;let t=this.activeConnection();t!==void 0&&await t.trace(this._trace,this._tracer,{sendNotification:!1,traceFormat:this._traceFormat})}data2String(e){if(e instanceof n.ResponseError){let t=e;return` Message: ${t.message}\n Code: ${t.code} ${t.data?` -`+t.data.toString():``}`}return e instanceof Error?a.string(e.stack)?e.stack:e.message:a.string(e)?e:e.toString()}debug(e,t,r=!0){this.logOutputMessage(n.MessageType.Debug,V.Debug,`Debug`,e,t,r)}info(e,t,r=!0){this.logOutputMessage(n.MessageType.Info,V.Info,`Info`,e,t,r)}warn(e,t,r=!0){this.logOutputMessage(n.MessageType.Warning,V.Warn,`Warn`,e,t,r)}error(e,t,r=!0){this.logOutputMessage(n.MessageType.Error,V.Error,`Error`,e,t,r)}logOutputMessage(e,t,n,r,i,a){this.outputChannel.appendLine(`[${n.padEnd(5)} - ${new Date().toLocaleTimeString()}] ${r}`),i!=null&&this.outputChannel.appendLine(this.data2String(i)),(a===`force`||a&&this._clientOptions.revealOutputChannelOn<=t)&&this.showNotificationMessage(e,r)}showNotificationMessage(e,r){r??=`A request has failed. See the output for more information.`,(e===n.MessageType.Error?t.window.showErrorMessage:e===n.MessageType.Warning?t.window.showWarningMessage:t.window.showInformationMessage)(r,`Go to output`).then(e=>{e!==void 0&&this.outputChannel.show(!0)})}logTrace(e,t){this.traceOutputChannel.appendLine(`[Trace - ${new Date().toLocaleTimeString()}] ${e}`),t&&this.traceOutputChannel.appendLine(this.data2String(t))}logObjectTrace(e){e.isLSPMessage&&e.type?this.traceOutputChannel.append(`[LSP - ${new Date().toLocaleTimeString()}] `):this.traceOutputChannel.append(`[Trace - ${new Date().toLocaleTimeString()}] `),e&&this.traceOutputChannel.appendLine(`${JSON.stringify(e)}`)}needsStart(){return this.$state===U.Initial||this.$state===U.Stopping||this.$state===U.Stopped}needsStop(){return this.$state===U.Starting||this.$state===U.Running}activeConnection(){return this.$state===U.Running&&this._connection!==void 0?this._connection:void 0}isRunning(){return this.$state===U.Running}async start(){if(this._disposed===`disposing`||this._disposed===`disposed`)throw Error(`Client got disposed and can't be restarted.`);if(this.$state===U.Stopping)throw Error(`Client is currently stopping. Can only restart a full stopped client`);if(this._onStart!==void 0)return this._onStart;let[e,r,i]=this.createOnStartPromise();this._onStart=e,this._diagnostics===void 0&&(this._diagnostics=this._clientOptions.diagnosticCollectionName?t.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName):t.languages.createDiagnosticCollection());for(let[e,t]of this._notificationHandlers)this._pendingNotificationHandlers.has(e)||this._pendingNotificationHandlers.set(e,t);for(let[e,t]of this._requestHandlers)this._pendingRequestHandlers.has(e)||this._pendingRequestHandlers.set(e,t);for(let[e,t]of this._progressHandlers)this._pendingProgressHandlers.has(e)||this._pendingProgressHandlers.set(e,t);this.$state=U.Starting;try{let e=await this.createConnection();e.onNotification(n.LogMessageNotification.type,e=>{switch(e.type){case n.MessageType.Error:this.error(e.message,void 0,!1);break;case n.MessageType.Warning:this.warn(e.message,void 0,!1);break;case n.MessageType.Info:this.info(e.message,void 0,!1);break;case n.MessageType.Debug:this.debug(e.message,void 0,!1);break;default:this.outputChannel.appendLine(e.message)}}),e.onNotification(n.ShowMessageNotification.type,e=>{switch(e.type){case n.MessageType.Error:t.window.showErrorMessage(e.message);break;case n.MessageType.Warning:t.window.showWarningMessage(e.message);break;case n.MessageType.Info:t.window.showInformationMessage(e.message);break;default:t.window.showInformationMessage(e.message)}}),e.onRequest(n.ShowMessageRequest.type,e=>{let r;switch(e.type){case n.MessageType.Error:r=t.window.showErrorMessage;break;case n.MessageType.Warning:r=t.window.showWarningMessage;break;case n.MessageType.Info:r=t.window.showInformationMessage;break;default:r=t.window.showInformationMessage}let i=e.actions||[];return r(e.message,...i)}),e.onNotification(n.TelemetryEventNotification.type,e=>{this._telemetryEmitter.fire(e)}),e.onRequest(n.ShowDocumentRequest.type,async e=>{let n=async e=>{let n=this.protocol2CodeConverter.asUri(e.uri);try{if(e.external===!0)return{success:await t.env.openExternal(n)};{let r={};return e.selection!==void 0&&(r.selection=this.protocol2CodeConverter.asRange(e.selection)),e.takeFocus===void 0||e.takeFocus===!1?r.preserveFocus=!0:e.takeFocus===!0&&(r.preserveFocus=!1),await t.window.showTextDocument(n,r),{success:!0}}}catch{return{success:!1}}},r=this._clientOptions.middleware.window?.showDocument;return r===void 0?n(e):r(e,n)}),e.listen(),await this.initialize(e),r()}catch(e){this.$state=U.StartFailed,this.error(`${this._name} client: couldn't create connection to server.`,e,`force`),i(e)}return this._onStart}createOnStartPromise(){let e,t;return[new Promise((n,r)=>{e=n,t=r}),e,t]}async initialize(e){this.refreshTrace(e,!1);let r=this._clientOptions.initializationOptions,[i,o]=this._clientOptions.workspaceFolder===void 0?[this._clientGetRootPath(),null]:[this._clientOptions.workspaceFolder.uri.fsPath,[{uri:this._c2p.asUri(this._clientOptions.workspaceFolder.uri),name:this._clientOptions.workspaceFolder.name}]],l={processId:null,clientInfo:{name:t.env.appName,version:t.version},locale:this.getLocale(),rootPath:i||null,rootUri:i?this._c2p.asUri(t.Uri.file(i)):null,capabilities:this.computeClientCapabilities(),initializationOptions:a.func(r)?r():r,trace:n.Trace.toString(this._trace),workspaceFolders:o};if(this.fillInitializeParams(l),this._clientOptions.progressOnInitialization){let t=s.generateUuid(),n=new c.ProgressPart(e,t);l.workDoneToken=t;try{let t=await this.doInitialize(e,l);return n.done(),t}catch(e){throw n.cancel(),e}}else return this.doInitialize(e,l)}async doInitialize(e,r){try{let t=await e.initialize(r);if(t.capabilities.positionEncoding!==void 0&&t.capabilities.positionEncoding!==n.PositionEncodingKind.UTF16)throw Error(`Unsupported position encoding (${t.capabilities.positionEncoding}) received from server ${this.name}`);this._initializeResult=t,this.$state=U.Running;let i;a.number(t.capabilities.textDocumentSync)?i=t.capabilities.textDocumentSync===n.TextDocumentSyncKind.None?{openClose:!1,change:n.TextDocumentSyncKind.None,save:void 0}:{openClose:!0,change:t.capabilities.textDocumentSync,save:{includeText:!1}}:t.capabilities.textDocumentSync!==void 0&&t.capabilities.textDocumentSync!==null&&(i=t.capabilities.textDocumentSync),this._capabilities=Object.assign({},t.capabilities,{resolvedTextDocumentSync:i}),e.onNotification(n.PublishDiagnosticsNotification.type,e=>this.handleDiagnostics(e)),e.onRequest(n.RegistrationRequest.type,e=>this.handleRegistrationRequest(e)),e.onRequest(`client/registerFeature`,e=>this.handleRegistrationRequest(e)),e.onRequest(n.UnregistrationRequest.type,e=>this.handleUnregistrationRequest(e)),e.onRequest(`client/unregisterFeature`,e=>this.handleUnregistrationRequest(e)),e.onRequest(n.ApplyWorkspaceEditRequest.type,e=>this.handleApplyWorkspaceEdit(e));for(let[t,n]of this._pendingNotificationHandlers)this._notificationDisposables.set(t,e.onNotification(t,n));this._pendingNotificationHandlers.clear();for(let[t,n]of this._pendingRequestHandlers)this._requestDisposables.set(t,e.onRequest(t,n));this._pendingRequestHandlers.clear();for(let[t,n]of this._pendingProgressHandlers)this._progressDisposables.set(t,e.onProgress(n.type,t,n.handler));return this._pendingProgressHandlers.clear(),await e.sendNotification(n.InitializedNotification.type,{}),this.hookFileEvents(e),this.hookConfigurationChanged(e),this.initializeFeatures(e),t}catch(r){throw this._clientOptions.initializationFailedHandler?this._clientOptions.initializationFailedHandler(r)?this.initialize(e):this.stop():r instanceof n.ResponseError&&r.data&&r.data.retry?t.window.showErrorMessage(r.message,{title:`Retry`,id:`retry`}).then(t=>{t&&t.id===`retry`?this.initialize(e):this.stop()}):(r&&r.message&&t.window.showErrorMessage(r.message),this.error(`Server initialization failed.`,r),this.stop()),r}}_clientGetRootPath(){let e=t.workspace.workspaceFolders;if(!e||e.length===0)return;let n=e[0];if(n.uri.scheme===`file`)return n.uri.fsPath}stop(e=2e3){return this.shutdown(`stop`,e)}dispose(e=2e3){try{return this._disposed=`disposing`,this.stop(e)}finally{this._disposed=`disposed`}}async shutdown(e,t){if(this.$state===U.Stopped||this.$state===U.Initial)return;if(this.$state===U.Stopping){if(this._onStop!==void 0)return this._onStop;throw Error(`Client is stopping but no stop promise available.`)}let r=this.activeConnection();if(r===void 0||this.$state!==U.Running)throw Error(`Client is not running and can't be stopped. It's current state is: ${this.$state}`);this._initializeResult=void 0,this.$state=U.Stopping,this.cleanUp(e);let i=new Promise(e=>{(0,n.RAL)().timer.setTimeout(e,t)}),a=(async e=>(await e.shutdown(),await e.exit(),e))(r);return this._onStop=Promise.race([i,a]).then(e=>{if(e!==void 0)e.end(),e.dispose();else throw this.error(`Stopping server timed out`,void 0,!1),Error(`Stopping the server timed out`)},e=>{throw this.error(`Stopping server failed`,e,!1),e}).finally(()=>{this.$state=U.Stopped,e===`stop`&&this.cleanUpChannel(),this._onStart=void 0,this._onStop=void 0,this._connection=void 0,this._ignoredRegistrations.clear()})}cleanUp(e){this._fileEvents=[],this._fileEventDelayer.cancel();let t=this._listeners.splice(0,this._listeners.length);for(let e of t)e.dispose();this._syncedDocuments&&this._syncedDocuments.clear();for(let e of Array.from(this._features.entries()).map(e=>e[1]).reverse())e.clear();e===`stop`&&this._diagnostics!==void 0&&(this._diagnostics.dispose(),this._diagnostics=void 0),this._idleInterval!==void 0&&(this._idleInterval.dispose(),this._idleInterval=void 0)}cleanUpChannel(){this._outputChannel!==void 0&&this._disposeOutputChannel&&(this._outputChannel.dispose(),this._outputChannel=void 0)}notifyFileEvent(e){let t=this;async function r(e){return t._fileEvents.push(e),t._fileEventDelayer.trigger(async()=>{await t.sendNotification(n.DidChangeWatchedFilesNotification.type,{changes:t._fileEvents}),t._fileEvents=[]})}let i=this.clientOptions.middleware?.workspace;(i?.didChangeWatchedFile?i.didChangeWatchedFile(e,r):r(e)).catch(e=>{t.error(`Notify file events failed.`,e)})}async sendPendingFullTextDocumentChanges(e){return this._pendingChangeSemaphore.lock(async()=>{try{let t=this._didChangeTextDocumentFeature.getPendingDocumentChanges(this._pendingOpenNotifications);if(t.length===0)return;for(let r of t){let t=this.code2ProtocolConverter.asChangeTextDocumentParams(r);await e.sendNotification(n.DidChangeTextDocumentNotification.type,t),this._didChangeTextDocumentFeature.notificationSent(r,n.DidChangeTextDocumentNotification.type,t)}}catch(e){throw this.error(`Sending pending changes failed`,e,!1),e}})}triggerPendingChangeDelivery(){this._pendingChangeDelayer.trigger(async()=>{let e=this.activeConnection();if(e===void 0){this.triggerPendingChangeDelivery();return}await this.sendPendingFullTextDocumentChanges(e)}).catch(e=>this.error(`Delivering pending changes failed`,e,!1))}handleDiagnostics(e){if(!this._diagnostics)return;let t=e.uri;this._diagnosticQueueState.state===`busy`&&this._diagnosticQueueState.document===t&&this._diagnosticQueueState.tokenSource.cancel(),this._diagnosticQueue.set(e.uri,e.diagnostics),this.triggerDiagnosticQueue()}triggerDiagnosticQueue(){(0,n.RAL)().timer.setImmediate(()=>{this.workDiagnosticQueue()})}workDiagnosticQueue(){if(this._diagnosticQueueState.state===`busy`)return;let e=this._diagnosticQueue.entries().next();if(e.done===!0)return;let[n,r]=e.value;this._diagnosticQueue.delete(n);let i=new t.CancellationTokenSource;this._diagnosticQueueState={state:`busy`,document:n,tokenSource:i},this._p2c.asDiagnostics(r,i.token).then(e=>{if(!i.token.isCancellationRequested){let t=this._p2c.asUri(n),r=this.clientOptions.middleware;r.handleDiagnostics?r.handleDiagnostics(t,e,(e,t)=>this.setDiagnostics(e,t)):this.setDiagnostics(t,e)}}).finally(()=>{this._diagnosticQueueState={state:`idle`},this.triggerDiagnosticQueue()})}setDiagnostics(e,t){this._diagnostics&&this._diagnostics.set(e,t)}getLocale(){return t.env.language}async $start(){if(this.$state===U.StartFailed)throw Error(`Previous start failed. Can't restart server.`);await this.start();let e=this.activeConnection();if(e===void 0)throw Error(`Starting server failed`);return e}async createConnection(){let e=(e,t,n)=>{this.handleConnectionError(e,t,n).catch(e=>this.error(`Handling connection error failed`,e))},t=()=>{this.handleConnectionClosed().catch(e=>this.error(`Handling connection close failed`,e))},n=await this.createMessageTransports(this._clientOptions.stdioEncoding||`utf8`);return this._connection=pe(n.reader,n.writer,e,t,this._clientOptions.connectionOptions),this._connection}async handleConnectionClosed(){if(this.$state===U.Stopped)return;try{this._connection!==void 0&&this._connection.dispose()}catch{}let e={action:H.DoNotRestart};if(this.$state!==U.Stopping)try{e=await this._clientOptions.errorHandler.closed()}catch{}this._connection=void 0,e.action===H.DoNotRestart?(this.error(e.message??`Connection to server got closed. Server will not be restarted.`,void 0,e.handled===!0?!1:`force`),this.cleanUp(`stop`),this.$state===U.Starting?this.$state=U.StartFailed:this.$state=U.Stopped,this._onStop=Promise.resolve(),this._onStart=void 0):e.action===H.Restart&&(this.info(e.message??`Connection to server got closed. Server will restart.`,!e.handled),this.cleanUp(`restart`),this.$state=U.Initial,this._onStop=Promise.resolve(),this._onStart=void 0,this.start().catch(e=>this.error(`Restarting server failed`,e,`force`)))}async handleConnectionError(e,t,n){let r=await this._clientOptions.errorHandler.error(e,t,n);r.action===ae.Shutdown?(this.error(r.message??`Client ${this._name}: connection to server is erroring.\n${e.message}\nShutting down server.`,void 0,r.handled===!0?!1:`force`),this.stop().catch(e=>{this.error(`Stopping server failed`,e,!1)})):this.error(r.message??`Client ${this._name}: connection to server is erroring.\n${e.message}`,void 0,r.handled===!0?!1:`force`)}hookConfigurationChanged(e){this._listeners.push(t.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)}))}refreshTrace(e,r=!1){let i=t.workspace.getConfiguration(this._id),a=n.Trace.Off,o=n.TraceFormat.Text;if(i){let e=i.get(`trace.server`,`off`);typeof e==`string`?a=n.Trace.fromString(e):(a=n.Trace.fromString(i.get(`trace.server.verbosity`,`off`)),o=n.TraceFormat.fromString(i.get(`trace.server.format`,`text`)))}this._trace=a,this._traceFormat=o,e.trace(this._trace,this._tracer,{sendNotification:r,traceFormat:this._traceFormat}).catch(e=>{this.error(`Updating trace failed with error`,e,!1)})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let r;r=a.array(t)?t:[t],r&&this._dynamicFeatures.get(n.DidChangeWatchedFilesNotification.type.method).registerRaw(s.generateUuid(),r)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),l.DynamicFeature.is(e)){let t=e.registrationType;this._dynamicFeatures.set(t.method,e)}}getFeature(e){return this._dynamicFeatures.get(e)}hasDedicatedTextSynchronizationFeature(e){let t=this.getFeature(n.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof d.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){let e=new Map;this.registerFeature(new f.ConfigurationFeature(this)),this.registerFeature(new p.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this._didChangeTextDocumentFeature=new p.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new p.WillSaveFeature(this)),this.registerFeature(new p.WillSaveWaitUntilFeature(this)),this.registerFeature(new p.DidSaveTextDocumentFeature(this)),this.registerFeature(new p.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new k.FileSystemWatcherFeature(this,e=>this.notifyFileEvent(e))),this.registerFeature(new m.CompletionItemFeature(this)),this.registerFeature(new h.HoverFeature(this)),this.registerFeature(new v.SignatureHelpFeature(this)),this.registerFeature(new g.DefinitionFeature(this)),this.registerFeature(new S.ReferencesFeature(this)),this.registerFeature(new y.DocumentHighlightFeature(this)),this.registerFeature(new b.DocumentSymbolFeature(this)),this.registerFeature(new x.WorkspaceSymbolFeature(this)),this.registerFeature(new C.CodeActionFeature(this)),this.registerFeature(new w.CodeLensFeature(this)),this.registerFeature(new T.DocumentFormattingFeature(this)),this.registerFeature(new T.DocumentRangeFormattingFeature(this)),this.registerFeature(new T.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new E.RenameFeature(this)),this.registerFeature(new D.DocumentLinkFeature(this)),this.registerFeature(new O.ExecuteCommandFeature(this)),this.registerFeature(new f.SyncConfigurationFeature(this)),this.registerFeature(new M.TypeDefinitionFeature(this)),this.registerFeature(new j.ImplementationFeature(this)),this.registerFeature(new A.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new N.WorkspaceFoldersFeature(this)),this.registerFeature(new P.FoldingRangeFeature(this)),this.registerFeature(new ee.DeclarationFeature(this)),this.registerFeature(new F.SelectionRangeFeature(this)),this.registerFeature(new te.ProgressFeature(this)),this.registerFeature(new ne.CallHierarchyFeature(this)),this.registerFeature(new I.SemanticTokensFeature(this)),this.registerFeature(new R.LinkedEditingFeature(this)),this.registerFeature(new L.DidCreateFilesFeature(this)),this.registerFeature(new L.DidRenameFilesFeature(this)),this.registerFeature(new L.DidDeleteFilesFeature(this)),this.registerFeature(new L.WillCreateFilesFeature(this)),this.registerFeature(new L.WillRenameFilesFeature(this)),this.registerFeature(new L.WillDeleteFilesFeature(this)),this.registerFeature(new re.TypeHierarchyFeature(this)),this.registerFeature(new ie.InlineValueFeature(this)),this.registerFeature(new z.InlayHintsFeature(this)),this.registerFeature(new u.DiagnosticFeature(this)),this.registerFeature(new d.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(me.createAll(this))}fillInitializeParams(e){for(let t of this._features)a.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){let t={};(0,l.ensure)(t,`workspace`).applyEdit=!0;let r=(0,l.ensure)((0,l.ensure)(t,`workspace`),`workspaceEdit`);r.documentChanges=!0,r.resourceOperations=[n.ResourceOperationKind.Create,n.ResourceOperationKind.Rename,n.ResourceOperationKind.Delete],r.failureHandling=n.FailureHandlingKind.TextOnlyTransactional,r.normalizesLineEndings=!0,r.changeAnnotationSupport={groupsOnLabel:!0};let i=(0,l.ensure)((0,l.ensure)(t,`textDocument`),`publishDiagnostics`);i.relatedInformation=!0,i.versionSupport=!1,i.tagSupport={valueSet:[n.DiagnosticTag.Unnecessary,n.DiagnosticTag.Deprecated]},i.codeDescriptionSupport=!0,i.dataSupport=!0;let a=(0,l.ensure)(t,`window`),o=(0,l.ensure)(a,`showMessage`);o.messageActionItem={additionalPropertiesSupport:!0};let s=(0,l.ensure)(a,`showDocument`);s.support=!0;let c=(0,l.ensure)(t,`general`);c.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(e.RequestsToCancelOnContentModified)},c.regularExpressions={engine:`ECMAScript`,version:`ES2020`},c.markdown={parser:`marked`,version:`1.1.0`},c.positionEncodings=[`utf-16`],this._clientOptions.markdown.supportHtml&&(c.markdown.allowedTags=`ul.li.p.code.blockquote.ol.h1.h2.h3.h4.h5.h6.hr.em.pre.table.thead.tbody.tr.th.td.div.del.a.strong.br.img.span`.split(`.`));for(let e of this._features)e.fillClientCapabilities(t);return t}initializeFeatures(e){let t=this._clientOptions.documentSelector;for(let e of this._features)a.func(e.preInitialize)&&e.preInitialize(this._capabilities,t);for(let e of this._features)e.initialize(this._capabilities,t)}async handleRegistrationRequest(e){let t=this.clientOptions.middleware?.handleRegisterCapability;return t?t(e,e=>this.doRegisterCapability(e)):this.doRegisterCapability(e)}async doRegisterCapability(e){if(!this.isRunning()){for(let t of e.registrations)this._ignoredRegistrations.add(t.id);return}for(let t of e.registrations){let e=this._dynamicFeatures.get(t.method);if(e===void 0)return Promise.reject(Error(`No feature implementation for ${t.method} found. Registration failed.`));let n=t.registerOptions??{};n.documentSelector=n.documentSelector??this._clientOptions.documentSelector;let r={id:t.id,registerOptions:n};try{e.register(r)}catch(e){return Promise.reject(e)}}}async handleUnregistrationRequest(e){let t=this.clientOptions.middleware?.handleUnregisterCapability;return t?t(e,e=>this.doUnregisterCapability(e)):this.doUnregisterCapability(e)}async doUnregisterCapability(e){for(let t of e.unregisterations){if(this._ignoredRegistrations.has(t.id))continue;let e=this._dynamicFeatures.get(t.method);if(!e)return Promise.reject(Error(`No feature implementation for ${t.method} found. Unregistration failed.`));e.unregister(t.id)}}async handleApplyWorkspaceEdit(e){let r=e.edit,i=await this.workspaceEditLock.lock(()=>this._p2c.asWorkspaceEdit(r)),o=new Map;t.workspace.textDocuments.forEach(e=>o.set(e.uri.toString(),e));let s=!1;if(r.documentChanges){for(let e of r.documentChanges)if(n.TextDocumentEdit.is(e)&&e.textDocument.version&&e.textDocument.version>=0){let t=this._p2c.asUri(e.textDocument.uri).toString(),n=o.get(t);if(n&&n.version!==e.textDocument.version){s=!0;break}}}return s?Promise.resolve({applied:!1}):a.asPromise(t.workspace.applyEdit(i).then(e=>({applied:e})))}handleFailedRequest(r,i,a,o,s=!0){if(a instanceof n.ResponseError){if(a.code===n.ErrorCodes.PendingResponseRejected||a.code===n.ErrorCodes.ConnectionInactive)return o;if(a.code===n.LSPErrorCodes.RequestCancelled||a.code===n.LSPErrorCodes.ServerCancelled){if(i!==void 0&&i.isCancellationRequested)return o;throw a.data===void 0?new t.CancellationError:new l.LSPCancellationError(a.data)}else if(a.code===n.LSPErrorCodes.ContentModified){if(e.RequestsToCancelOnContentModified.has(r.method)||e.CancellableResolveCalls.has(r.method))throw new t.CancellationError;return o}}throw this.error(`Request ${r.method} failed.`,a,s),a}};e.BaseLanguageClient=de,de.RequestsToCancelOnContentModified=new Set([n.SemanticTokensRequest.method,n.SemanticTokensRangeRequest.method,n.SemanticTokensDeltaRequest.method]),de.CancellableResolveCalls=new Set([n.CompletionResolveRequest.method,n.CodeLensResolveRequest.method,n.CodeActionResolveRequest.method,n.InlayHintResolveRequest.method,n.DocumentLinkResolveRequest.method,n.WorkspaceSymbolResolveRequest.method]);var fe=class{error(e){(0,n.RAL)().console.error(e)}warn(e){(0,n.RAL)().console.warn(e)}info(e){(0,n.RAL)().console.info(e)}log(e){(0,n.RAL)().console.log(e)}};function pe(e,t,r,i,o){let s=new fe,c=(0,n.createProtocolConnection)(e,t,s,o);return c.onError(e=>{r(e[0],e[1],e[2])}),c.onClose(i),{listen:()=>c.listen(),sendRequest:c.sendRequest,onRequest:c.onRequest,hasPendingResponse:c.hasPendingResponse,sendNotification:c.sendNotification,onNotification:c.onNotification,onProgress:c.onProgress,sendProgress:c.sendProgress,trace:(e,t,r)=>{let i={sendNotification:!1,traceFormat:n.TraceFormat.Text};return r===void 0?c.trace(e,t,i):(a.boolean(r),c.trace(e,t,r))},initialize:e=>c.sendRequest(n.InitializeRequest.type,e),shutdown:()=>c.sendRequest(n.ShutdownRequest.type,void 0),exit:()=>c.sendNotification(n.ExitNotification.type),end:()=>c.end(),dispose:()=>c.dispose()}}var me;(function(e){function t(e){return[new B.InlineCompletionItemFeature(e)]}e.createAll=t})(me||(e.ProposedFeatures=me={}))})),ft=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.terminate=void 0;let t=require(`child_process`),n=require(`path`),r=process.platform===`win32`,i=process.platform===`darwin`,a=process.platform===`linux`;function o(e,o){if(r)try{let n={stdio:[`pipe`,`pipe`,`ignore`]};return o&&(n.cwd=o),t.execFileSync(`taskkill`,[`/T`,`/F`,`/PID`,e.pid.toString()],n),!0}catch{return!1}else if(a||i)try{var s=(0,n.join)(__dirname,`terminateProcess.sh`);return!t.spawnSync(s,[e.pid.toString()]).error}catch{return!1}else return e.kill(`SIGKILL`),!0}e.terminate=o})),pt=o(((e,t)=>{t.exports=W()})),mt=o(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),ht=o(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),gt=o(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=ht(),a=mt();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),_t=o(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),vt=o(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:er(t,e)}})),yt=o(((e,t)=>{let n=mt(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=ht(),{safeRe:a,t:o}=gt(),s=_t(),{compareIdentifiers:c}=vt();t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&tt.major?1:this.minort.minor?1:this.patcht.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),bt=o(((e,t)=>{let n=yt();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),xt=o(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),St=o(((e,t)=>{let n=yt();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),Ct=o(((e,t)=>{let n=St();t.exports=(e,t,r)=>n(e,t,r)===0})),wt=o(((e,t)=>{let n=St();t.exports=(e,t,r)=>n(e,t,r)!==0})),Tt=o(((e,t)=>{let n=St();t.exports=(e,t,r)=>n(e,t,r)>0})),Et=o(((e,t)=>{let n=St();t.exports=(e,t,r)=>n(e,t,r)>=0})),Dt=o(((e,t)=>{let n=St();t.exports=(e,t,r)=>n(e,t,r)<0})),Ot=o(((e,t)=>{let n=St();t.exports=(e,t,r)=>n(e,t,r)<=0})),kt=o(((e,t)=>{let n=Ct(),r=wt(),i=Tt(),a=Et(),o=Dt(),s=Ot();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),At=o(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new l(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=_t(),{safeRe:i,t:a}=gt(),o=kt(),s=mt(),c=yt(),l=jt()})),jt=o(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&g(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(s,O(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[l.COMPARATORTRIM],u),o(`comparator trim`,e),e=e.replace(c[l.TILDETRIM],d),o(`tilde trim`,e),e=e.replace(c[l.CARETTRIM],f),o(`caret trim`,e);let g=e.split(` `).map(e=>v(e,this.options)).join(` `).split(/\s+/).map(e=>D(e,this.options));i&&(g=g.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[l.COMPARATORLOOSE])))),o(`range list`,g);let _=new Map,y=g.map(e=>new a(e,this.options));for(let e of y){if(h(e))return[e];_.set(e.value,e)}_.size>1&&_.has(``)&&_.delete(``);let b=[..._.values()];return r.set(t,b),b}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>_(e,n)&&t.set.some(t=>_(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;te.value===`<0.0.0-0`,g=e=>e.value===``,_=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},v=(e,t)=>(e=e.replace(c[l.BUILD],``),o(`comp`,e,t),e=S(e,t),o(`caret`,e),e=b(e,t),o(`tildes`,e),e=w(e,t),o(`xrange`,e),e=E(e,t),o(`stars`,e),e),y=e=>!e||e.toLowerCase()===`x`||e===`*`,b=(e,t)=>e.trim().split(/\s+/).map(e=>x(e,t)).join(` `),x=(e,t)=>{let n=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(n,(t,n,r,i,a)=>{o(`tilde`,e,t,n,r,i,a);let s;return y(n)?s=``:y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o(`replaceTilde pr`,a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o(`tilde return`,s),s})},S=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(` `),C=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[l.CARETLOOSE]:c[l.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return y(n)?c=``:y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},w=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>T(e,t)).join(` `)),T=(e,t)=>{e=e.trim();let n=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{o(`xRange`,e,n,r,i,a,s,c);let l=y(i),u=l||y(a),d=u||y(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},E=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[l.STAR],``)),D=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],``)),O=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=y(r)?``:y(i)?`>=${r}.0.0${e?`-0`:``}`:y(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=y(l)?``:y(u)?`<${+l+1}.0.0-0`:y(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),k=(e,t,n)=>{for(let n=0;n0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),Mt=o(((e,t)=>{let n=jt();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),Nt=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.DiagnosticPullMode=e.vsdiag=void 0,n(W(),e),n(Y(),e);var r=je();Object.defineProperty(e,`vsdiag`,{enumerable:!0,get:function(){return r.vsdiag}}),Object.defineProperty(e,`DiagnosticPullMode`,{enumerable:!0,get:function(){return r.DiagnosticPullMode}}),n(dt(),e)})),Pt=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.SettingMonitor=e.LanguageClient=e.TransportKind=void 0;let r=require(`child_process`),i=require(`fs`),a=require(`path`),o=require(`vscode`),s=_(),c=dt(),l=ft(),u=pt(),d=bt(),f=Mt();n(pt(),e),n(Nt(),e);let p=`^1.82.0`;var m;(function(e){e[e.stdio=0]=`stdio`,e[e.ipc=1]=`ipc`,e[e.pipe=2]=`pipe`,e[e.socket=3]=`socket`})(m||(e.TransportKind=m={}));var h;(function(e){function t(e){let t=e;return t&&t.kind===m.socket&&s.number(t.port)}e.isSocket=t})(h||={});var g;(function(e){function t(e){return s.string(e.command)}e.is=t})(g||={});var v;(function(e){function t(e){return s.string(e.module)}e.is=t})(v||={});var y;(function(e){function t(e){let t=e;return t&&t.writer!==void 0&&t.reader!==void 0}e.is=t})(y||={});var b;(function(e){function t(e){let t=e;return t&&t.process!==void 0&&typeof t.detached==`boolean`}e.is=t})(b||={}),e.LanguageClient=class extends c.BaseLanguageClient{constructor(e,t,n,r,i){let a,o,c,l,u;s.string(t)?(a=e,o=t,c=n,l=r,u=!!i):(a=e.toLowerCase(),o=e,c=t,l=n,u=r),u===void 0&&(u=!1),super(a,o,l),this._serverOptions=c,this._forceDebug=u,this._isInDebugMode=u;try{this.checkVersion()}catch(e){throw s.string(e.message)&&this.outputChannel.appendLine(e.message),e}}checkVersion(){let e=d(o.version);if(!e)throw Error(`No valid VS Code version detected. Version string is: ${o.version}`);if(e.prerelease&&e.prerelease.length>0&&(e.prerelease=[]),!f(e,p))throw Error(`The language client requires VS Code version ${p} but received version ${o.version}`)}get isInDebugMode(){return this._isInDebugMode}async restart(){await this.stop(),this.isInDebugMode&&await new Promise(e=>setTimeout(e,1e3)),await this.start()}stop(e=2e3){return super.stop(e).finally(()=>{if(this._serverProcess){let e=this._serverProcess;this._serverProcess=void 0,(this._isDetached===void 0||!this._isDetached)&&this.checkProcessDied(e),this._isDetached=void 0}})}checkProcessDied(e){!e||e.pid===void 0||setTimeout(()=>{try{e.pid!==void 0&&(process.kill(e.pid,0),(0,l.terminate)(e))}catch{}},2e3)}handleConnectionClosed(){return this._serverProcess=void 0,super.handleConnectionClosed()}fillInitializeParams(e){super.fillInitializeParams(e),e.processId===null&&(e.processId=process.pid)}createMessageTransports(e){function t(e,t){if(!e&&!t)return;let n=Object.create(null);return Object.keys(process.env).forEach(e=>n[e]=process.env[e]),t&&(n.ELECTRON_RUN_AS_NODE=`1`,n.ELECTRON_NO_ASAR=`1`),e&&Object.keys(e).forEach(t=>n[t]=e[t]),n}let n=[`--debug=`,`--debug-brk=`,`--inspect=`,`--inspect-brk=`],i=[`--debug`,`--debug-brk`,`--inspect`,`--inspect-brk`];function a(){let e=process.execArgv;return e?e.some(e=>n.some(t=>e.startsWith(t))||i.some(t=>e===t)):!1}function o(e){if(e.stdin===null||e.stdout===null||e.stderr===null)throw Error(`Process created without stdio streams`)}let l=this._serverOptions;if(s.func(l))return l().then(t=>{if(c.MessageTransports.is(t))return this._isDetached=!!t.detached,t;if(y.is(t))return this._isDetached=!!t.detached,{reader:new u.StreamMessageReader(t.reader),writer:new u.StreamMessageWriter(t.writer)};{let n;return b.is(t)?(n=t.process,this._isDetached=t.detached):(n=t,this._isDetached=!1),n.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),{reader:new u.StreamMessageReader(n.stdout),writer:new u.StreamMessageWriter(n.stdin)}}});let d,f=l;return f.run||f.debug?this._forceDebug||a()?(d=f.debug,this._isInDebugMode=!0):(d=f.run,this._isInDebugMode=!1):d=l,this._getServerWorkingDir(d.options).then(n=>{if(v.is(d)&&d.module){let i=d,a=i.transport||m.stdio;if(i.runtime){let o=[],c=i.options??Object.create(null);c.execArgv&&c.execArgv.forEach(e=>o.push(e)),o.push(i.module),i.args&&i.args.forEach(e=>o.push(e));let l=Object.create(null);l.cwd=n,l.env=t(c.env,!1);let d=this._getRuntimePath(i.runtime,n),f;if(a===m.ipc?(l.stdio=[null,null,null,`ipc`],o.push(`--node-ipc`)):a===m.stdio?o.push(`--stdio`):a===m.pipe?(f=(0,u.generateRandomPipeName)(),o.push(`--pipe=${f}`)):h.isSocket(a)&&o.push(`--socket=${a.port}`),o.push(`--clientProcessId=${process.pid.toString()}`),a===m.ipc||a===m.stdio){let t=r.spawn(d,o,l);return!t||!t.pid?x(t,`Launching server using runtime ${d} failed.`):(this._serverProcess=t,t.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),a===m.ipc?(t.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),Promise.resolve({reader:new u.IPCMessageReader(t),writer:new u.IPCMessageWriter(t)})):Promise.resolve({reader:new u.StreamMessageReader(t.stdout),writer:new u.StreamMessageWriter(t.stdin)}))}else if(a===m.pipe)return(0,u.createClientPipeTransport)(f).then(t=>{let n=r.spawn(d,o,l);return!n||!n.pid?x(n,`Launching server using runtime ${d} failed.`):(this._serverProcess=n,n.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),n.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),t.onConnected().then(e=>({reader:e[0],writer:e[1]})))});else if(h.isSocket(a))return(0,u.createClientSocketTransport)(a.port).then(t=>{let n=r.spawn(d,o,l);return!n||!n.pid?x(n,`Launching server using runtime ${d} failed.`):(this._serverProcess=n,n.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),n.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),t.onConnected().then(e=>({reader:e[0],writer:e[1]})))})}else{let c;return new Promise((l,d)=>{let f=(i.args&&i.args.slice())??[];a===m.ipc?f.push(`--node-ipc`):a===m.stdio?f.push(`--stdio`):a===m.pipe?(c=(0,u.generateRandomPipeName)(),f.push(`--pipe=${c}`)):h.isSocket(a)&&f.push(`--socket=${a.port}`),f.push(`--clientProcessId=${process.pid.toString()}`);let p=i.options??Object.create(null);if(p.env=t(p.env,!0),p.execArgv=p.execArgv||[],p.cwd=n,p.silent=!0,a===m.ipc||a===m.stdio){let t=r.fork(i.module,f||[],p);o(t),this._serverProcess=t,t.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),a===m.ipc?(t.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),l({reader:new u.IPCMessageReader(this._serverProcess),writer:new u.IPCMessageWriter(this._serverProcess)})):l({reader:new u.StreamMessageReader(t.stdout),writer:new u.StreamMessageWriter(t.stdin)})}else a===m.pipe?(0,u.createClientPipeTransport)(c).then(t=>{let n=r.fork(i.module,f||[],p);o(n),this._serverProcess=n,n.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),n.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),t.onConnected().then(e=>{l({reader:e[0],writer:e[1]})},d)},d):h.isSocket(a)&&(0,u.createClientSocketTransport)(a.port).then(t=>{let n=r.fork(i.module,f||[],p);o(n),this._serverProcess=n,n.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),n.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),t.onConnected().then(e=>{l({reader:e[0],writer:e[1]})},d)},d)})}}else if(g.is(d)&&d.command){let t=d,i=d.args===void 0?[]:d.args.slice(0),a,o=d.transport;if(o===m.stdio)i.push(`--stdio`);else if(o===m.pipe)a=(0,u.generateRandomPipeName)(),i.push(`--pipe=${a}`);else if(h.isSocket(o))i.push(`--socket=${o.port}`);else if(o===m.ipc)throw Error(`Transport kind ipc is not support for command executable`);let c=Object.assign({},t.options);if(c.cwd=c.cwd||n,o===void 0||o===m.stdio){let n=r.spawn(t.command,i,c);return!n||!n.pid?x(n,`Launching server using command ${t.command} failed.`):(n.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),this._serverProcess=n,this._isDetached=!!c.detached,Promise.resolve({reader:new u.StreamMessageReader(n.stdout),writer:new u.StreamMessageWriter(n.stdin)}))}else if(o===m.pipe)return(0,u.createClientPipeTransport)(a).then(n=>{let a=r.spawn(t.command,i,c);return!a||!a.pid?x(a,`Launching server using command ${t.command} failed.`):(this._serverProcess=a,this._isDetached=!!c.detached,a.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),a.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),n.onConnected().then(e=>({reader:e[0],writer:e[1]})))});else if(h.isSocket(o))return(0,u.createClientSocketTransport)(o.port).then(n=>{let a=r.spawn(t.command,i,c);return!a||!a.pid?x(a,`Launching server using command ${t.command} failed.`):(this._serverProcess=a,this._isDetached=!!c.detached,a.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),a.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),n.onConnected().then(e=>({reader:e[0],writer:e[1]})))})}return Promise.reject(Error(`Unsupported server configuration `+JSON.stringify(l,null,4)))}).finally(()=>{this._serverProcess!==void 0&&this._serverProcess.on(`exit`,(e,t)=>{e!==null&&this.error(`Server process exited with code ${e}.`,void 0,!1),t!==null&&this.error(`Server process exited with signal ${t}.`,void 0,!1)})})}_getRuntimePath(e,t){if(a.isAbsolute(e))return e;let n=this._mainGetRootPath();if(n!==void 0){let t=a.join(n,e);if(i.existsSync(t))return t}if(t!==void 0){let n=a.join(t,e);if(i.existsSync(n))return n}return e}_mainGetRootPath(){let e=o.workspace.workspaceFolders;if(!e||e.length===0)return;let t=e[0];if(t.uri.scheme===`file`)return t.uri.fsPath}_getServerWorkingDir(e){let t=e&&e.cwd;return t||=this.clientOptions.workspaceFolder?this.clientOptions.workspaceFolder.uri.fsPath:this._mainGetRootPath(),t?new Promise(e=>{i.lstat(t,(n,r)=>{e(!n&&r.isDirectory()?t:void 0)})}):Promise.resolve(void 0)}},e.SettingMonitor=class{constructor(e,t){this._client=e,this._setting=t,this._listeners=[]}start(){return o.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration,this,this._listeners),this.onDidChangeConfiguration(),new o.Disposable(()=>{this._client.needsStop()&&this._client.stop()})}onDidChangeConfiguration(){let e=this._setting.indexOf(`.`),t=e>=0?this._setting.substr(0,e):this._setting,n=e>=0?this._setting.substr(e+1):void 0,r=n?o.workspace.getConfiguration(t).get(n,!1):o.workspace.getConfiguration(t);r&&this._client.needsStart()?this._client.start().catch(e=>this._client.error(`Start failed after configuration change`,e,`force`)):!r&&this._client.needsStop()&&this._client.stop().catch(e=>this._client.error(`Stop failed after configuration change`,e,`force`))}};function x(e,t){return e===null?Promise.reject(t):new Promise((n,r)=>{e.on(`error`,e=>{r(`${t} ${e}`)}),setImmediate(()=>r(t))})}})),Ft=o(((e,t)=>{t.exports=Pt()})),It=W(),Lt=Ft();const Rt=`fallow`,zt=()=>l.workspace.getConfiguration(Rt),Bt=()=>zt().get(`lspPath`,``),Vt=()=>zt().get(`configPath`,``).trim(),Ht=()=>{let e=Vt();if(!e||d.isAbsolute(e))return e;let t=l.workspace.workspaceFolders?.[0]?.uri.fsPath;return t?d.resolve(t,e):e},Ut=()=>zt().get(`autoDownload`,!0),Wt=()=>zt().get(`issueTypes`,{"unused-files":!0,"unused-exports":!0,"unused-types":!0,"private-type-leaks":!0,"unused-dependencies":!0,"unused-dev-dependencies":!0,"unused-optional-dependencies":!0,"unused-enum-members":!0,"unused-class-members":!0,"unresolved-imports":!0,"unlisted-dependencies":!0,"duplicate-exports":!0,"type-only-dependencies":!0,"test-only-dependencies":!0,"circular-dependencies":!0,"boundary-violation":!0,"stale-suppressions":!0,"unused-catalog-entries":!0,"unresolved-catalog-references":!0}),Gt=()=>zt().get(`duplication.threshold`,5),Kt=()=>zt().get(`duplication.mode`,`mild`),qt=()=>zt().get(`production`,!1),Jt=()=>zt().get(`changedSince`,``).trim(),Yt=()=>zt().get(`trace.server`,`off`),Xt=e=>l.workspace.onDidChangeConfiguration(t=>{t.affectsConfiguration(Rt)&&e(t)}),Zt=()=>f.platform()===`win32`?`.exe`:``,Qt=e=>{let t=l.workspace.workspaceFolders;if(!t||t.length===0)return null;let n=`${e}${Zt()}`,r=d.join(t[0].uri.fsPath,`node_modules`,`.bin`,n);return u.existsSync(r)?r:null},$t=e=>{let t=`${e}${Zt()}`,n=(process.env.PATH??``).split(d.delimiter);for(let e of n){let n=d.join(e,t);if(u.existsSync(n))return n}return null},en=`fallow.diagnosticFilter.v1`,tn=[{code:`code-duplication`,label:`Code Duplication`},{code:`unused-file`,label:`Unused Files`},{code:`unused-export`,label:`Unused Exports`},{code:`unused-type`,label:`Unused Types`},{code:`private-type-leak`,label:`Private Type Leaks`},{code:`unused-dependency`,label:`Unused Dependencies`},{code:`unused-dev-dependency`,label:`Unused Dev Dependencies`},{code:`unused-optional-dependency`,label:`Unused Optional Dependencies`},{code:`unused-enum-member`,label:`Unused Enum Members`},{code:`unused-class-member`,label:`Unused Class Members`},{code:`unresolved-import`,label:`Unresolved Imports`},{code:`unlisted-dependency`,label:`Unlisted Dependencies`},{code:`duplicate-export`,label:`Duplicate Exports`},{code:`type-only-dependency`,label:`Type-Only Dependencies`},{code:`test-only-dependency`,label:`Test-Only Dependencies`},{code:`circular-dependency`,label:`Circular Dependencies`},{code:`boundary-violation`,label:`Boundary Violations`},{code:`stale-suppression`,label:`Stale Suppressions`},{code:`unused-catalog-entry`,label:`Unused Catalog Entries`},{code:`unresolved-catalog-reference`,label:`Unresolved Catalog References`}];let nn=tn;const rn=e=>{if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.code==`string`&&t.code.length>0&&typeof t.label==`string`&&t.label.length>0},an=e=>{if(!Array.isArray(e))return null;let t=e.filter(rn);return t.length!==e.length||t.length===0?null:t.map(({code:e,label:t})=>({code:e,label:t}))},on=e=>{e.length!==0&&(nn=e.slice())},sn=()=>{nn=tn},cn=()=>nn,ln=e=>e.source===`fallow`,un=e=>{let t=e.code;if(t==null)return null;if(typeof t==`string`)return t;if(typeof t==`number`)return String(t);if(typeof t==`object`&&`value`in t){let e=t.value;return typeof e==`string`?e:String(e)}return null};var dn=class{mutedAll=!1;mutedCategories=new Set;cache=new Map;client=null;persistQueue=Promise.resolve();emitter=new l.EventEmitter;onDidChange=this.emitter.event;constructor(e){this.memento=e;let t=e.get(en);if(t){this.mutedAll=t.mutedAll===!0;let e=t.mutedCategories??[];this.mutedCategories=new Set(e)}}attachClient(e){this.client=e,this.refresh()}detachClient(){this.client=null,this.cache.clear()}dispose(){this.emitter.dispose()}isMutedAll(){return this.mutedAll}isCategoryMuted(e){return this.mutedCategories.has(e)}anythingMuted(){return this.mutedAll||this.mutedCategories.size>0}mutedCategoriesSnapshot(){return new Set(this.mutedCategories)}setMutedAll(e){this.mutedAll!==e&&(this.mutedAll=e,this.persist(),this.refresh(),this.emitChange())}toggleMutedAll(){return this.setMutedAll(!this.mutedAll),this.mutedAll}setCategoryMuted(e,t){t!==this.mutedCategories.has(e)&&(t?this.mutedCategories.add(e):this.mutedCategories.delete(e),this.persist(),this.refresh(),this.emitChange())}setMutedCategories(e){let t=this.mutedCategories.size!==e.size;if(!t){for(let n of e)if(!this.mutedCategories.has(n)){t=!0;break}}t&&(this.mutedCategories=new Set(e),this.persist(),this.refresh(),this.emitChange())}toggleCategory(e){let t=!this.mutedCategories.has(e);return this.setCategoryMuted(e,t),t}clearAllMutes(){this.anythingMuted()&&(this.mutedAll=!1,this.mutedCategories.clear(),this.persist(),this.refresh(),this.emitChange())}evictUri(e){this.cache.delete(e.toString())}applyFilter(e){return this.anythingMuted()?e.filter(e=>{if(!ln(e))return!0;if(this.mutedAll)return!1;let t=un(e);return t===null?!0:!this.mutedCategories.has(t)}):e.slice()}handleDiagnostics(e,t,n){let r=e.toString();this.evictIfFull(r),this.cache.set(r,t.slice()),n(e,this.applyFilter(t))}async provideDiagnostics(e,t,n,r){let i=await r(e,t,n);if(!i||i.kind!==`full`)return i;let a=(`uri`in e&&e.uri!==void 0?e.uri:e).toString();return this.evictIfFull(a),this.cache.set(a,i.items.slice()),{...i,items:this.applyFilter(i.items)}}refresh(){let e=this.client?.diagnostics;if(!e)return;let t=Array.from(this.cache.entries());for(let[n,r]of t)e.set(l.Uri.parse(n),this.applyFilter(r))}evictIfFull(e){if(this.cache.size<5e3||this.cache.has(e))return;let t=this.cache.keys().next().value;t!==void 0&&this.cache.delete(t)}persist(){let e={mutedAll:this.mutedAll,mutedCategories:Array.from(this.mutedCategories)};this.persistQueue=this.persistQueue.then(()=>Promise.resolve(this.memento.update(en,e)),()=>Promise.resolve(this.memento.update(en,e)))}emitChange(){this.emitter.fire({mutedAll:this.mutedAll,mutedCategories:this.mutedCategoriesSnapshot()})}};const fn=`fallow-lsp`,pn=`fallow`,mn=`.fallow-version`,hn=`.sig`,gn=Buffer.from([131,78,111,215,115,51,230,238,223,119,147,71,199,16,172,180,3,210,216,35,77,85,159,94,215,200,126,85,42,222,11,209]),_n=Buffer.from([48,42,48,5,6,3,43,101,112,3,33,0]),vn={"User-Agent":`fallow-vscode`},yn=(e,t)=>e===`darwin`&&t===`arm64`?`darwin-arm64`:e===`darwin`&&t===`x64`?`darwin-x64`:e===`linux`&&t===`x64`?`linux-x64-gnu`:e===`linux`&&t===`arm64`?`linux-arm64-gnu`:e===`win32`&&t===`arm64`?`win32-arm64-msvc`:e===`win32`&&t===`x64`?`win32-x64-msvc`:null,bn=()=>yn(f.platform(),f.arch()),xn=(e,t)=>new Promise((n,r)=>{h.get(e,{headers:vn},e=>{if(e.statusCode&&e.statusCode>=300&&e.statusCode<400&&e.headers.location){e.resume(),xn(e.headers.location,t).then(n,r);return}if(e.statusCode&&e.statusCode>=400){e.resume(),r(Error(`HTTP ${e.statusCode}`));return}t(e).then(n,r)}).on(`error`,r)}),Sn=e=>xn(e,async e=>{let t=[];return await new Promise((n,r)=>{e.on(`data`,e=>t.push(e)),e.on(`end`,()=>n(Buffer.concat(t).toString())),e.on(`error`,r)})}),Cn=(e,t)=>xn(e,async e=>await new Promise((n,r)=>{let i=u.createWriteStream(t);e.pipe(i),i.on(`finish`,()=>{i.close(),n()}),i.on(`error`,e=>{u.unlink(t,()=>{}),r(e)})})),wn=e=>{let t=d.join(e.globalStorageUri.fsPath,`bin`);return u.existsSync(t)||u.mkdirSync(t,{recursive:!0}),t},Tn=e=>`${e}${hn}`,En=e=>`${e}.sha256`,Dn=e=>[d.join(e,`${fn}${Zt()}`),d.join(e,`${pn}${Zt()}`)],On=e=>{for(let t of Dn(e))for(let e of[t,Tn(t),En(t)])try{u.existsSync(e)&&u.unlinkSync(e)}catch{}try{let t=d.join(e,mn);u.existsSync(t)&&u.unlinkSync(t)}catch{}},kn=(e,t)=>{try{u.writeFileSync(d.join(e,mn),t,`utf-8`)}catch{}},An=e=>{try{return u.readFileSync(d.join(e,mn),`utf-8`).trim()||null}catch{return null}},jn=e=>{try{return(0,p.execFileSync)(e,[`--version`],{timeout:5e3,encoding:`utf-8`}).trim().match(/(\d+\.\d+\.\d+)/)?.[1]??null}catch{return null}},Mn=e=>{try{let t=Tn(e),n=u.readFileSync(e),r=u.readFileSync(t);return(0,m.verify)(null,n,(0,m.createPublicKey)({key:Buffer.concat([_n,gn]),format:`der`,type:`spki`}),r)}catch{return!1}},Nn=e=>{if(!e)return null;let t=e.trim().toLowerCase();if(!t.startsWith(`sha256:`))return null;let n=t.slice(7);return/^[0-9a-f]{64}$/.test(n)?n:null},Pn=(e,t)=>{try{u.writeFileSync(En(e),t,`utf-8`)}catch{}},Fn=e=>{try{return Nn(`sha256:${u.readFileSync(En(e),`utf-8`).trim()}`)}catch{return null}},In=(e,t)=>{try{let n=Nn(`sha256:${t}`);if(!n)return!1;let r=u.readFileSync(e);return(0,m.createHash)(`sha256`).update(r).digest(`hex`)===n}catch{return!1}},Ln=(e,t,n,r)=>{let i=Tn(t);if(u.existsSync(i))return Mn(t)?!0:(r?.appendLine(`Fallow: installed ${n} binary failed Ed25519 signature verification. Re-downloading.`),On(e),!1);let a=Fn(t);return a&&In(t,a)?(r?.appendLine(`Fallow: installed ${n} binary reused via stored SHA-256 digest verification.`),!0):(r?.appendLine(`Fallow: installed ${n} binary is neither signature-verified nor digest-verified. Re-downloading.`),On(e),!1)},Rn=(e,t,n,r)=>{let i=l.extensions.getExtension(`fallow-rs.fallow-vscode`)?.packageJSON?.version;if(!i)return!0;let a=An(e)??jn(t);return a===i?!0:(r?.appendLine(`Fallow: installed ${n} binary is v${a??`unknown`}, extension is v${i}. Re-downloading.`),On(e),!1)},zn=(e,t,n,r)=>{let i=wn(e),a=d.join(i,`${t}${Zt()}`);return!u.existsSync(a)||!Ln(i,a,n,r)||!Rn(i,a,n,r)?null:a},Bn=(e,t)=>zn(e,fn,`LSP`,t),Vn=(e,t)=>zn(e,pn,`CLI`,t),Hn=async(e,t,n,r)=>{let i=Zt(),a=`${t}-${n}${i}`,o=e.assets.find(e=>e.name===a);if(!o)return null;let s=e.assets.find(e=>e.name===`${a}${hn}`),c=Nn(o.digest),l=d.join(r,`${t}${i}`),p=Tn(l),m=En(l);try{if(await Cn(o.browser_download_url,l),s){if(await Cn(s.browser_download_url,p),!Mn(l))throw Error(`${a} failed Ed25519 signature verification`);u.existsSync(m)&&u.unlinkSync(m)}else if(c){if(!In(l,c))throw Error(`${a} failed SHA-256 digest verification`);Pn(l,c)}else throw Error(`${a} is missing both a signature asset and a GitHub release digest`);f.platform()!==`win32`&&u.chmodSync(l,493)}catch(e){for(let e of[l,p,m])try{u.existsSync(e)&&u.unlinkSync(e)}catch{}throw e}return l},Un=async e=>{let t=bn();return t?l.window.withProgress({location:l.ProgressLocation.Notification,title:`Fallow: Downloading binaries...`,cancellable:!1},async()=>{try{let n=await Sn(`https://api.github.com/repos/fallow-rs/fallow/releases/latest`),r=JSON.parse(n),i=wn(e),a=await Hn(r,fn,t,i);if(!a)return l.window.showErrorMessage(`Fallow: no LSP binary found for ${t} in release ${r.tag_name}`),null;let o=l.extensions.getExtension(`fallow-rs.fallow-vscode`)?.packageJSON?.version;o&&kn(i,o);let s=null;try{s=await Hn(r,pn,t,i)}catch(e){let t=e instanceof Error?e.message:String(e);l.window.showWarningMessage(`Fallow: CLI download skipped: ${t}`)}return s?l.window.showInformationMessage(`Fallow: ${r.tag_name} installed (LSP + CLI).`):l.window.showInformationMessage(`Fallow: LSP ${r.tag_name} installed. CLI binary not found in release — tree views require the fallow CLI in PATH.`),a}catch(e){let t=e instanceof Error?e.message:String(e);return l.window.showErrorMessage(`Fallow: failed to download binaries: ${t}`),null}}):(l.window.showErrorMessage(`Fallow: unsupported platform ${f.platform()}-${f.arch()}`),null)};let Wn=null;const Gn=(e,t)=>{let n=l.extensions.getExtension(`fallow-rs.fallow-vscode`)?.packageJSON?.version;if(!n)return;let r=jn(e);if(r&&r!==n){let e=`Fallow: binary in PATH is v${r}, extension is v${n}. Update the binary or remove it from PATH to use the bundled version.`;t?.appendLine(e),l.window.showWarningMessage(e)}},Kn=async(e,t)=>{let n=Bt();if(n)return u.existsSync(n)?(t?.appendLine(`Binary resolution: using fallow.lspPath setting: ${n}`),n):(l.window.showWarningMessage(`Fallow: configured LSP path "${n}" does not exist.`),null);let r=Qt(`fallow-lsp`);if(r)return t?.appendLine(`Binary resolution: using local node_modules/.bin: ${r}`),r;t?.appendLine(`Binary resolution: no local node_modules/.bin/fallow-lsp found`);let i=$t(`fallow-lsp`);if(i)return t?.appendLine(`Binary resolution: using system PATH: ${i}`),Gn(i,t),i;t?.appendLine(`Binary resolution: fallow-lsp not found in PATH`);let a=Bn(e,t);if(a)return t?.appendLine(`Binary resolution: using previously downloaded binary: ${a}`),a;if(Ut())return Un(e);let o=await l.window.showErrorMessage(`Fallow: fallow-lsp binary not found. Would you like to download it?`,`Download`,`Set Path`,`Cancel`);return o===`Download`?Un(e):(o===`Set Path`&&l.commands.executeCommand(`workbench.action.openSettings`,`fallow.lspPath`),null)},qn=async(e,t)=>{try{let n=an(await e.sendRequest(`fallow/issueTypes`));if(!n){sn(),t.appendLine(`fallow/issueTypes returned an invalid response; using bundled diagnostic categories.`);return}on(n),t.appendLine(`Loaded ${n.length} diagnostic categories from fallow-lsp.`)}catch(e){sn();let n=e instanceof Error?e.message:String(e);t.appendLine(`fallow/issueTypes unavailable (${n}); using bundled diagnostic categories.`)}},Jn=async(e,t,n)=>{let r=await Kn(e,t);if(!r)return null;t.appendLine(`Using fallow-lsp binary: ${r}`);let i={command:r,transport:Lt.TransportKind.stdio},a=Yt();Wn=new Lt.LanguageClient(`fallow`,`Fallow Language Server`,i,{documentSelector:[{scheme:`file`,language:`javascript`},{scheme:`file`,language:`javascriptreact`},{scheme:`file`,language:`typescript`},{scheme:`file`,language:`typescriptreact`},{scheme:`file`,language:`vue`},{scheme:`file`,language:`svelte`},{scheme:`file`,language:`astro`},{scheme:`file`,language:`mdx`},{scheme:`file`,language:`json`}],outputChannel:t,traceOutputChannel:t,initializationOptions:{issueTypes:Wt(),changedSince:Jt(),configPath:Ht()},middleware:n?{handleDiagnostics:(e,t,r)=>n.handleDiagnostics(e,t,r),provideDiagnostics:(e,t,r,i)=>n.provideDiagnostics(e,t,r,i)}:void 0}),a!==`off`&&Wn.setTrace(a===`verbose`?It.Trace.Verbose:It.Trace.Messages);try{await Wn.start(),t.appendLine(`Fallow language server started.`),await qn(Wn,t)}catch(e){let n=e instanceof Error?e.message:String(e);return t.appendLine(`Failed to start language server: ${n}`),l.window.showErrorMessage(`Fallow: failed to start language server. Check the output channel for details.`),Wn=null,null}return n?.attachClient(Wn),Wn},Yn=async()=>{Wn&&=(await Wn.stop(),null)},Xn=async(e,t,n)=>(n?.detachClient(),await Yn(),Jn(e,t,n)),Zn=(e,t)=>{let n=e?[`fix`,`--dry-run`,`--format`,`json`,`--quiet`]:[`fix`,`--yes`,`--format`,`json`,`--quiet`];return t&&n.push(`--production`),n},Qn=e=>e.name??e.package??e.file??`unknown`,$n=e=>e.path?`${e.path}${e.line?`:${e.line}`:``}`:e.location??``,er=e=>[...e.map(e=>({label:Qn(e),description:e.type.replace(/_/g,` `),detail:$n(e),action:`navigate`,fix:e})),{label:`Apply all fixes`,description:`${e.length} fix${e.length===1?``:`es`}`,action:`apply-all`}],tr=(e,t)=>{let n=t.path??t.file;return n?{absolutePath:d.isAbsolute(n)?n:d.resolve(e,n),line:Math.max(0,(t.line??1)-1)}:null},nr=e=>{let t=Bt();if(t){let e=d.dirname(t),n=d.join(e,`fallow${Zt()}`);if(u.existsSync(n))return n}return Qt(`fallow`)||$t(`fallow`)||Vn(e)||null},rr=(e,t,n)=>new Promise((r,i)=>{let a=nr(e);if(!a){i(Error(`fallow CLI binary not found in PATH.`));return}let o=p.spawn(a,[...t],{cwd:n,stdio:[`ignore`,`pipe`,`pipe`]}),s=``,c=``;o.stdout?.setEncoding(`utf8`),o.stdout?.on(`data`,e=>{s+=e}),o.stderr?.setEncoding(`utf8`),o.stderr?.on(`data`,e=>{c+=e}),o.on(`error`,e=>{i(e)}),o.on(`close`,(e,t)=>{if(t){i(Error(`fallow exited via signal ${t}`));return}if(e!==null&&e!==0&&e!==1){i(Error(c.trim()||`fallow exited with code ${e}`));return}r(s)})}),ir=e=>{let t=Wt(),n={...e,unused_files:t[`unused-files`]?e.unused_files:[],unused_exports:t[`unused-exports`]?e.unused_exports:[],unused_types:t[`unused-types`]?e.unused_types:[],private_type_leaks:t[`private-type-leaks`]?e.private_type_leaks:[],unused_dependencies:t[`unused-dependencies`]?e.unused_dependencies:[],unused_dev_dependencies:t[`unused-dev-dependencies`]?e.unused_dev_dependencies:[],unused_optional_dependencies:t[`unused-optional-dependencies`]?e.unused_optional_dependencies:[],unused_enum_members:t[`unused-enum-members`]?e.unused_enum_members:[],unused_class_members:t[`unused-class-members`]?e.unused_class_members:[],unresolved_imports:t[`unresolved-imports`]?e.unresolved_imports:[],unlisted_dependencies:t[`unlisted-dependencies`]?e.unlisted_dependencies:[],duplicate_exports:t[`duplicate-exports`]?e.duplicate_exports:[],type_only_dependencies:t[`type-only-dependencies`]?e.type_only_dependencies:[],test_only_dependencies:t[`test-only-dependencies`]?e.test_only_dependencies:[],circular_dependencies:t[`circular-dependencies`]?e.circular_dependencies:[],boundary_violations:t[`boundary-violation`]?e.boundary_violations:[],stale_suppressions:t[`stale-suppressions`]?e.stale_suppressions:[],unused_catalog_entries:t[`unused-catalog-entries`]?e.unused_catalog_entries:[],unresolved_catalog_references:t[`unresolved-catalog-references`]?e.unresolved_catalog_references:[]},r=g(n),i={total_issues:r,unused_files:n.unused_files.length,unused_exports:n.unused_exports.length,unused_types:n.unused_types.length,private_type_leaks:n.private_type_leaks?.length??0,unused_dependencies:n.unused_dependencies.length+n.unused_dev_dependencies.length+(n.unused_optional_dependencies?.length??0),unused_enum_members:n.unused_enum_members.length,unused_class_members:n.unused_class_members.length,unresolved_imports:n.unresolved_imports.length,unlisted_dependencies:n.unlisted_dependencies.length,duplicate_exports:n.duplicate_exports.length,type_only_dependencies:n.type_only_dependencies?.length??0,test_only_dependencies:n.test_only_dependencies?.length??0,circular_dependencies:n.circular_dependencies?.length??0,boundary_violations:n.boundary_violations?.length??0,stale_suppressions:n.stale_suppressions?.length??0,unused_catalog_entries:n.unused_catalog_entries?.length??0,unresolved_catalog_references:n.unresolved_catalog_references?.length??0};return{...n,total_issues:r,summary:i}},ar=()=>{let e=l.workspace.workspaceFolders;return!e||e.length===0?null:e[0].uri.fsPath},or=async()=>await l.window.showWarningMessage(`Fallow: This will unexport unused exports (keeps the code) and remove unused dependencies from package.json. Continue?`,`Yes`,`No`)===`Yes`,sr=async(e,t)=>{if(!t)return;let n=tr(e,t);n&&await l.window.showTextDocument(l.Uri.file(n.absolutePath),{selection:new l.Range(n.line,0,n.line,0)})},cr=async(e,t)=>{if(t.fixes.length===0){l.window.showInformationMessage(`Fallow: no fixes available.`);return}let n=[];for(let e of er(t.fixes)){if(e.action===`apply-all`){n.push({label:``,kind:l.QuickPickItemKind.Separator,action:`navigate`}),n.push({label:`$(play) Apply all fixes`,description:e.description,action:e.action});continue}n.push({label:`$(wrench) ${e.label}`,description:e.description,detail:e.detail,action:e.action,fix:e.fix})}let r=await l.window.showQuickPick(n,{title:`Fallow: ${t.fixes.length} fix${t.fixes.length===1?``:`es`} available`,placeHolder:`Review fixes — select 'Apply all fixes' to apply, or click a fix to navigate`});if(r){if(r.action===`apply-all`){l.commands.executeCommand(`fallow.fix`);return}await sr(e,r.fix)}},lr=async e=>{let t=ar();if(!t)return l.window.showWarningMessage(`Fallow: no workspace folder open.`),{check:null,dupes:null};let n=null,r=null;try{let i=[`--format`,`json`,`--quiet`,`--skip`,`health`];qt()&&i.push(`--production`);let a=Jt();a&&i.push(`--changed-since`,a);let o=Ht();o&&i.push(`--config`,o),i.push(`--dupes-mode`,Kt()),i.push(`--dupes-threshold`,String(Gt()));let s=await rr(e,i,t);if(s.trim().length===0)return{check:n,dupes:r};let c=JSON.parse(s);n=c.check?ir(c.check):null,r=c.dupes??null}catch(e){let t=e instanceof Error?e.message:String(e);throw l.window.showErrorMessage(`Fallow analysis failed: ${t}`),e}return{check:n,dupes:r}},ur=async(e,t)=>{let n=ar();if(!n)return l.window.showWarningMessage(`Fallow: no workspace folder open.`),null;if(!t&&!await or())return null;try{let r=Zn(t,qt()),i=Ht();i&&r.push(`--config`,i);let a=await rr(e,r,n),o=JSON.parse(a);if(t)await cr(n,o);else{let e=o.fixes.length;l.window.showInformationMessage(`Fallow: applied ${e} fix${e===1?``:`es`}.`)}return o}catch(e){let t=e instanceof Error?e.message:String(e);return l.window.showErrorMessage(`Fallow fix failed: ${t}`),null}},dr=`code-duplication`,fr=l.CodeActionKind.QuickFix.append(`fallow.mute`),pr=[`javascript`,`javascriptreact`,`typescript`,`typescriptreact`,`vue`,`svelte`,`astro`,`mdx`,`json`],mr=e=>cn().find(t=>t.code===e)?.label??e,hr=e=>e===1?`category`:`categories`,gr=e=>{if(e.isMutedAll())return`Fallow: hiding all`;let t=e.mutedCategoriesSnapshot().size;return`Fallow: hiding ${t} ${hr(t)}`},_r=e=>{let t=pr.map(e=>({scheme:`file`,language:e})),n=l.languages.createLanguageStatusItem(`fallow.diagnosticMutes`,[]);n.name=`Fallow Mute`,n.accessibilityInformation={label:`Fallow diagnostic mute status`,role:`button`};let r=()=>{if(!e.anythingMuted()){n.selector=[],n.severity=l.LanguageStatusSeverity.Information,n.text=`$(check) Fallow`,n.detail=`all findings visible`,n.command=void 0;return}n.selector=t,n.severity=l.LanguageStatusSeverity.Warning,n.text=`$(eye-closed) ${gr(e)}`,n.detail=`click to manage`,n.command={command:`fallow.manageDiagnosticMutes`,title:`Manage`,tooltip:`Manage Fallow diagnostic mutes`}};return r(),e.onDidChange(r),n},vr={toggleAll:{iconPath:new l.ThemeIcon(`eye-closed`),tooltip:`Toggle mute for ALL Fallow findings`},clearAll:{iconPath:new l.ThemeIcon(`clear-all`),tooltip:`Show all Fallow findings (clear all mutes)`}},yr=async e=>{let t=l.window.createQuickPick();t.title=`Fallow: manage diagnostic mutes (CI is unaffected)`,t.placeholder=`Check categories to hide them in the editor. Press Enter to apply.`,t.canSelectMany=!0,t.matchOnDetail=!0,t.buttons=[vr.toggleAll,vr.clearAll];let n=[{label:`$(eye-closed) All Fallow Findings`,description:e.isMutedAll()?`currently hidden`:`currently visible`,detail:`Global editor-only mute. Use the title buttons to toggle or clear it.`,code:null,picked:e.isMutedAll(),alwaysShow:e.isMutedAll()},...cn().map(({code:t,label:n})=>({label:n,description:t,code:t,picked:e.isMutedAll()||e.isCategoryMuted(t)}))];t.items=n,t.selectedItems=n.filter(e=>e.picked===!0),await new Promise(n=>{t.onDidTriggerButton(n=>{n===vr.toggleAll?e.toggleMutedAll():n===vr.clearAll&&e.clearAllMutes(),t.hide()}),t.onDidAccept(()=>{let n=t.selectedItems.some(e=>e.code===null),r=new Set(t.selectedItems.map(e=>e.code).filter(e=>e!==null));n?e.setMutedAll(!0):(e.isMutedAll()&&e.setMutedAll(!1),e.setMutedCategories(r)),t.hide()}),t.onDidHide(()=>{t.dispose(),n()}),t.show()})},br=e=>{l.commands.executeCommand(`setContext`,`fallow.duplicatesMuted`,e.isCategoryMuted(dr)||e.isMutedAll()),l.commands.executeCommand(`setContext`,`fallow.allDiagnosticsMuted`,e.isMutedAll())};var xr=class{static providedKinds=[fr];provideCodeActions(e,t,n){let r=new Set,i=[];for(let e of n.diagnostics){if(!ln(e))continue;let t=un(e);if(!t||r.has(t))continue;r.add(t);let n=mr(t),a=new l.CodeAction(`Mute Fallow ${n.toLowerCase()} findings in this workspace`,fr);a.command={command:`fallow.muteDiagnosticCategory`,title:`Mute Fallow category`,arguments:[t]},a.diagnostics=[e],i.push(a)}return i}};const Sr=(e,t)=>{let n=_r(t);e.subscriptions.push(n),e.subscriptions.push(t.onDidChange(()=>br(t))),br(t),e.subscriptions.push(l.workspace.onDidCloseTextDocument(e=>{t.evictUri(e.uri)})),e.subscriptions.push(l.commands.registerCommand(`fallow.toggleMuteDuplicates`,()=>{let e=t.toggleCategory(dr);l.window.setStatusBarMessage(e?`Fallow: muted code-duplication findings (CI is unaffected)`:`Fallow: showing code-duplication findings`,4e3)})),e.subscriptions.push(l.commands.registerCommand(`fallow.toggleAllDiagnostics`,()=>{let e=t.toggleMutedAll();l.window.setStatusBarMessage(e?`Fallow: muted all findings (CI is unaffected)`:`Fallow: showing all findings`,4e3)})),e.subscriptions.push(l.commands.registerCommand(`fallow.manageDiagnosticMutes`,async()=>{await yr(t)})),e.subscriptions.push(l.commands.registerCommand(`fallow.clearDiagnosticMutes`,()=>{t.clearAllMutes()})),e.subscriptions.push(l.commands.registerCommand(`fallow.muteDiagnosticCategory`,e=>{typeof e==`string`&&e.length>0&&t.setCategoryMuted(e,!0)}));for(let t of pr)e.subscriptions.push(l.languages.registerCodeActionsProvider({scheme:`file`,language:t},new xr,{providedCodeActionKinds:xr.providedKinds}))},Cr=(e,t)=>({totalIssues:g(e),unusedFiles:e?.unused_files.length??0,unusedExports:e?.unused_exports.length??0,unusedTypes:e?.unused_types.length??0,privateTypeLeaks:e?.private_type_leaks?.length??0,unusedDependencies:e?.unused_dependencies.length??0,unusedDevDependencies:e?.unused_dev_dependencies.length??0,unusedOptionalDependencies:e?.unused_optional_dependencies?.length??0,unusedEnumMembers:e?.unused_enum_members.length??0,unusedClassMembers:e?.unused_class_members.length??0,unresolvedImports:e?.unresolved_imports.length??0,unlistedDependencies:e?.unlisted_dependencies.length??0,duplicateExports:e?.duplicate_exports.length??0,typeOnlyDependencies:e?.type_only_dependencies?.length??0,testOnlyDependencies:e?.test_only_dependencies?.length??0,circularDependencies:e?.circular_dependencies?.length??0,boundaryViolations:e?.boundary_violations?.length??0,staleSuppressions:e?.stale_suppressions?.length??0,unusedCatalogEntries:e?.unused_catalog_entries?.length??0,unresolvedCatalogReferences:e?.unresolved_catalog_references?.length??0,duplicationPercentage:t?.stats.duplication_percentage??0,cloneGroups:t?.stats.clone_groups??0}),wr=[{count:`unresolvedImports`,icon:`$(error)`,label:`unresolved imports`},{count:`unusedFiles`,icon:`$(warning)`,label:`unused files`},{count:`unusedExports`,icon:`$(warning)`,label:`unused exports`},{count:`unusedTypes`,icon:`$(info)`,label:`unused types`},{count:`privateTypeLeaks`,icon:`$(warning)`,label:`private type leaks`},{count:`unusedDependencies`,icon:`$(warning)`,label:`unused dependencies`},{count:`unusedDevDependencies`,icon:`$(warning)`,label:`unused dev dependencies`},{count:`unusedOptionalDependencies`,icon:`$(warning)`,label:`unused optional dependencies`},{count:`unusedEnumMembers`,icon:`$(info)`,label:`unused enum members`},{count:`unusedClassMembers`,icon:`$(info)`,label:`unused class members`},{count:`unlistedDependencies`,icon:`$(warning)`,label:`unlisted dependencies`},{count:`duplicateExports`,icon:`$(warning)`,label:`duplicate exports`},{count:`typeOnlyDependencies`,icon:`$(info)`,label:`type-only dependencies`},{count:`testOnlyDependencies`,icon:`$(info)`,label:`test-only dependencies`},{count:`circularDependencies`,icon:`$(warning)`,label:`circular dependencies`},{count:`boundaryViolations`,icon:`$(warning)`,label:`boundary violations`},{count:`staleSuppressions`,icon:`$(info)`,label:`stale suppressions`},{count:`unusedCatalogEntries`,icon:`$(warning)`,label:`unused catalog entries`},{count:`unresolvedCatalogReferences`,icon:`$(error)`,label:`unresolved catalog references`}],Tr=e=>Number.isFinite(e)?e:0,Er=e=>[`${e.totalIssues} issues`,`${Tr(e.duplicationPercentage).toFixed(1)}% duplication`],Dr=e=>e.unresolvedImports>0?`statusBarItem.errorBackground`:e.totalIssues>0?`statusBarItem.warningBackground`:null,Or=e=>e.replace(/\s+/g,` `).trim(),kr=e=>{let t=Or(e);return t.length>48?`${t.slice(0,45).trimEnd()}...`:t},Ar=(e,t)=>t?`${e} (since ${kr(t)})`:e,jr=e=>Or(e).replace(/([\\`*_{}[\]()#+.!|>-])/g,`\\$1`),Mr=(e,t=null)=>{let n=[`**Fallow** - Analysis Results +`+t.data.toString():``}`}return e instanceof Error?a.string(e.stack)?e.stack:e.message:a.string(e)?e:e.toString()}debug(e,t,r=!0){this.logOutputMessage(n.MessageType.Debug,V.Debug,`Debug`,e,t,r)}info(e,t,r=!0){this.logOutputMessage(n.MessageType.Info,V.Info,`Info`,e,t,r)}warn(e,t,r=!0){this.logOutputMessage(n.MessageType.Warning,V.Warn,`Warn`,e,t,r)}error(e,t,r=!0){this.logOutputMessage(n.MessageType.Error,V.Error,`Error`,e,t,r)}logOutputMessage(e,t,n,r,i,a){this.outputChannel.appendLine(`[${n.padEnd(5)} - ${new Date().toLocaleTimeString()}] ${r}`),i!=null&&this.outputChannel.appendLine(this.data2String(i)),(a===`force`||a&&this._clientOptions.revealOutputChannelOn<=t)&&this.showNotificationMessage(e,r)}showNotificationMessage(e,r){r??=`A request has failed. See the output for more information.`,(e===n.MessageType.Error?t.window.showErrorMessage:e===n.MessageType.Warning?t.window.showWarningMessage:t.window.showInformationMessage)(r,`Go to output`).then(e=>{e!==void 0&&this.outputChannel.show(!0)})}logTrace(e,t){this.traceOutputChannel.appendLine(`[Trace - ${new Date().toLocaleTimeString()}] ${e}`),t&&this.traceOutputChannel.appendLine(this.data2String(t))}logObjectTrace(e){e.isLSPMessage&&e.type?this.traceOutputChannel.append(`[LSP - ${new Date().toLocaleTimeString()}] `):this.traceOutputChannel.append(`[Trace - ${new Date().toLocaleTimeString()}] `),e&&this.traceOutputChannel.appendLine(`${JSON.stringify(e)}`)}needsStart(){return this.$state===U.Initial||this.$state===U.Stopping||this.$state===U.Stopped}needsStop(){return this.$state===U.Starting||this.$state===U.Running}activeConnection(){return this.$state===U.Running&&this._connection!==void 0?this._connection:void 0}isRunning(){return this.$state===U.Running}async start(){if(this._disposed===`disposing`||this._disposed===`disposed`)throw Error(`Client got disposed and can't be restarted.`);if(this.$state===U.Stopping)throw Error(`Client is currently stopping. Can only restart a full stopped client`);if(this._onStart!==void 0)return this._onStart;let[e,r,i]=this.createOnStartPromise();this._onStart=e,this._diagnostics===void 0&&(this._diagnostics=this._clientOptions.diagnosticCollectionName?t.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName):t.languages.createDiagnosticCollection());for(let[e,t]of this._notificationHandlers)this._pendingNotificationHandlers.has(e)||this._pendingNotificationHandlers.set(e,t);for(let[e,t]of this._requestHandlers)this._pendingRequestHandlers.has(e)||this._pendingRequestHandlers.set(e,t);for(let[e,t]of this._progressHandlers)this._pendingProgressHandlers.has(e)||this._pendingProgressHandlers.set(e,t);this.$state=U.Starting;try{let e=await this.createConnection();e.onNotification(n.LogMessageNotification.type,e=>{switch(e.type){case n.MessageType.Error:this.error(e.message,void 0,!1);break;case n.MessageType.Warning:this.warn(e.message,void 0,!1);break;case n.MessageType.Info:this.info(e.message,void 0,!1);break;case n.MessageType.Debug:this.debug(e.message,void 0,!1);break;default:this.outputChannel.appendLine(e.message)}}),e.onNotification(n.ShowMessageNotification.type,e=>{switch(e.type){case n.MessageType.Error:t.window.showErrorMessage(e.message);break;case n.MessageType.Warning:t.window.showWarningMessage(e.message);break;case n.MessageType.Info:t.window.showInformationMessage(e.message);break;default:t.window.showInformationMessage(e.message)}}),e.onRequest(n.ShowMessageRequest.type,e=>{let r;switch(e.type){case n.MessageType.Error:r=t.window.showErrorMessage;break;case n.MessageType.Warning:r=t.window.showWarningMessage;break;case n.MessageType.Info:r=t.window.showInformationMessage;break;default:r=t.window.showInformationMessage}let i=e.actions||[];return r(e.message,...i)}),e.onNotification(n.TelemetryEventNotification.type,e=>{this._telemetryEmitter.fire(e)}),e.onRequest(n.ShowDocumentRequest.type,async e=>{let n=async e=>{let n=this.protocol2CodeConverter.asUri(e.uri);try{if(e.external===!0)return{success:await t.env.openExternal(n)};{let r={};return e.selection!==void 0&&(r.selection=this.protocol2CodeConverter.asRange(e.selection)),e.takeFocus===void 0||e.takeFocus===!1?r.preserveFocus=!0:e.takeFocus===!0&&(r.preserveFocus=!1),await t.window.showTextDocument(n,r),{success:!0}}}catch{return{success:!1}}},r=this._clientOptions.middleware.window?.showDocument;return r===void 0?n(e):r(e,n)}),e.listen(),await this.initialize(e),r()}catch(e){this.$state=U.StartFailed,this.error(`${this._name} client: couldn't create connection to server.`,e,`force`),i(e)}return this._onStart}createOnStartPromise(){let e,t;return[new Promise((n,r)=>{e=n,t=r}),e,t]}async initialize(e){this.refreshTrace(e,!1);let r=this._clientOptions.initializationOptions,[i,o]=this._clientOptions.workspaceFolder===void 0?[this._clientGetRootPath(),null]:[this._clientOptions.workspaceFolder.uri.fsPath,[{uri:this._c2p.asUri(this._clientOptions.workspaceFolder.uri),name:this._clientOptions.workspaceFolder.name}]],l={processId:null,clientInfo:{name:t.env.appName,version:t.version},locale:this.getLocale(),rootPath:i||null,rootUri:i?this._c2p.asUri(t.Uri.file(i)):null,capabilities:this.computeClientCapabilities(),initializationOptions:a.func(r)?r():r,trace:n.Trace.toString(this._trace),workspaceFolders:o};if(this.fillInitializeParams(l),this._clientOptions.progressOnInitialization){let t=s.generateUuid(),n=new c.ProgressPart(e,t);l.workDoneToken=t;try{let t=await this.doInitialize(e,l);return n.done(),t}catch(e){throw n.cancel(),e}}else return this.doInitialize(e,l)}async doInitialize(e,r){try{let t=await e.initialize(r);if(t.capabilities.positionEncoding!==void 0&&t.capabilities.positionEncoding!==n.PositionEncodingKind.UTF16)throw Error(`Unsupported position encoding (${t.capabilities.positionEncoding}) received from server ${this.name}`);this._initializeResult=t,this.$state=U.Running;let i;a.number(t.capabilities.textDocumentSync)?i=t.capabilities.textDocumentSync===n.TextDocumentSyncKind.None?{openClose:!1,change:n.TextDocumentSyncKind.None,save:void 0}:{openClose:!0,change:t.capabilities.textDocumentSync,save:{includeText:!1}}:t.capabilities.textDocumentSync!==void 0&&t.capabilities.textDocumentSync!==null&&(i=t.capabilities.textDocumentSync),this._capabilities=Object.assign({},t.capabilities,{resolvedTextDocumentSync:i}),e.onNotification(n.PublishDiagnosticsNotification.type,e=>this.handleDiagnostics(e)),e.onRequest(n.RegistrationRequest.type,e=>this.handleRegistrationRequest(e)),e.onRequest(`client/registerFeature`,e=>this.handleRegistrationRequest(e)),e.onRequest(n.UnregistrationRequest.type,e=>this.handleUnregistrationRequest(e)),e.onRequest(`client/unregisterFeature`,e=>this.handleUnregistrationRequest(e)),e.onRequest(n.ApplyWorkspaceEditRequest.type,e=>this.handleApplyWorkspaceEdit(e));for(let[t,n]of this._pendingNotificationHandlers)this._notificationDisposables.set(t,e.onNotification(t,n));this._pendingNotificationHandlers.clear();for(let[t,n]of this._pendingRequestHandlers)this._requestDisposables.set(t,e.onRequest(t,n));this._pendingRequestHandlers.clear();for(let[t,n]of this._pendingProgressHandlers)this._progressDisposables.set(t,e.onProgress(n.type,t,n.handler));return this._pendingProgressHandlers.clear(),await e.sendNotification(n.InitializedNotification.type,{}),this.hookFileEvents(e),this.hookConfigurationChanged(e),this.initializeFeatures(e),t}catch(r){throw this._clientOptions.initializationFailedHandler?this._clientOptions.initializationFailedHandler(r)?this.initialize(e):this.stop():r instanceof n.ResponseError&&r.data&&r.data.retry?t.window.showErrorMessage(r.message,{title:`Retry`,id:`retry`}).then(t=>{t&&t.id===`retry`?this.initialize(e):this.stop()}):(r&&r.message&&t.window.showErrorMessage(r.message),this.error(`Server initialization failed.`,r),this.stop()),r}}_clientGetRootPath(){let e=t.workspace.workspaceFolders;if(!e||e.length===0)return;let n=e[0];if(n.uri.scheme===`file`)return n.uri.fsPath}stop(e=2e3){return this.shutdown(`stop`,e)}dispose(e=2e3){try{return this._disposed=`disposing`,this.stop(e)}finally{this._disposed=`disposed`}}async shutdown(e,t){if(this.$state===U.Stopped||this.$state===U.Initial)return;if(this.$state===U.Stopping){if(this._onStop!==void 0)return this._onStop;throw Error(`Client is stopping but no stop promise available.`)}let r=this.activeConnection();if(r===void 0||this.$state!==U.Running)throw Error(`Client is not running and can't be stopped. It's current state is: ${this.$state}`);this._initializeResult=void 0,this.$state=U.Stopping,this.cleanUp(e);let i=new Promise(e=>{(0,n.RAL)().timer.setTimeout(e,t)}),a=(async e=>(await e.shutdown(),await e.exit(),e))(r);return this._onStop=Promise.race([i,a]).then(e=>{if(e!==void 0)e.end(),e.dispose();else throw this.error(`Stopping server timed out`,void 0,!1),Error(`Stopping the server timed out`)},e=>{throw this.error(`Stopping server failed`,e,!1),e}).finally(()=>{this.$state=U.Stopped,e===`stop`&&this.cleanUpChannel(),this._onStart=void 0,this._onStop=void 0,this._connection=void 0,this._ignoredRegistrations.clear()})}cleanUp(e){this._fileEvents=[],this._fileEventDelayer.cancel();let t=this._listeners.splice(0,this._listeners.length);for(let e of t)e.dispose();this._syncedDocuments&&this._syncedDocuments.clear();for(let e of Array.from(this._features.entries()).map(e=>e[1]).reverse())e.clear();e===`stop`&&this._diagnostics!==void 0&&(this._diagnostics.dispose(),this._diagnostics=void 0),this._idleInterval!==void 0&&(this._idleInterval.dispose(),this._idleInterval=void 0)}cleanUpChannel(){this._outputChannel!==void 0&&this._disposeOutputChannel&&(this._outputChannel.dispose(),this._outputChannel=void 0)}notifyFileEvent(e){let t=this;async function r(e){return t._fileEvents.push(e),t._fileEventDelayer.trigger(async()=>{await t.sendNotification(n.DidChangeWatchedFilesNotification.type,{changes:t._fileEvents}),t._fileEvents=[]})}let i=this.clientOptions.middleware?.workspace;(i?.didChangeWatchedFile?i.didChangeWatchedFile(e,r):r(e)).catch(e=>{t.error(`Notify file events failed.`,e)})}async sendPendingFullTextDocumentChanges(e){return this._pendingChangeSemaphore.lock(async()=>{try{let t=this._didChangeTextDocumentFeature.getPendingDocumentChanges(this._pendingOpenNotifications);if(t.length===0)return;for(let r of t){let t=this.code2ProtocolConverter.asChangeTextDocumentParams(r);await e.sendNotification(n.DidChangeTextDocumentNotification.type,t),this._didChangeTextDocumentFeature.notificationSent(r,n.DidChangeTextDocumentNotification.type,t)}}catch(e){throw this.error(`Sending pending changes failed`,e,!1),e}})}triggerPendingChangeDelivery(){this._pendingChangeDelayer.trigger(async()=>{let e=this.activeConnection();if(e===void 0){this.triggerPendingChangeDelivery();return}await this.sendPendingFullTextDocumentChanges(e)}).catch(e=>this.error(`Delivering pending changes failed`,e,!1))}handleDiagnostics(e){if(!this._diagnostics)return;let t=e.uri;this._diagnosticQueueState.state===`busy`&&this._diagnosticQueueState.document===t&&this._diagnosticQueueState.tokenSource.cancel(),this._diagnosticQueue.set(e.uri,e.diagnostics),this.triggerDiagnosticQueue()}triggerDiagnosticQueue(){(0,n.RAL)().timer.setImmediate(()=>{this.workDiagnosticQueue()})}workDiagnosticQueue(){if(this._diagnosticQueueState.state===`busy`)return;let e=this._diagnosticQueue.entries().next();if(e.done===!0)return;let[n,r]=e.value;this._diagnosticQueue.delete(n);let i=new t.CancellationTokenSource;this._diagnosticQueueState={state:`busy`,document:n,tokenSource:i},this._p2c.asDiagnostics(r,i.token).then(e=>{if(!i.token.isCancellationRequested){let t=this._p2c.asUri(n),r=this.clientOptions.middleware;r.handleDiagnostics?r.handleDiagnostics(t,e,(e,t)=>this.setDiagnostics(e,t)):this.setDiagnostics(t,e)}}).finally(()=>{this._diagnosticQueueState={state:`idle`},this.triggerDiagnosticQueue()})}setDiagnostics(e,t){this._diagnostics&&this._diagnostics.set(e,t)}getLocale(){return t.env.language}async $start(){if(this.$state===U.StartFailed)throw Error(`Previous start failed. Can't restart server.`);await this.start();let e=this.activeConnection();if(e===void 0)throw Error(`Starting server failed`);return e}async createConnection(){let e=(e,t,n)=>{this.handleConnectionError(e,t,n).catch(e=>this.error(`Handling connection error failed`,e))},t=()=>{this.handleConnectionClosed().catch(e=>this.error(`Handling connection close failed`,e))},n=await this.createMessageTransports(this._clientOptions.stdioEncoding||`utf8`);return this._connection=pe(n.reader,n.writer,e,t,this._clientOptions.connectionOptions),this._connection}async handleConnectionClosed(){if(this.$state===U.Stopped)return;try{this._connection!==void 0&&this._connection.dispose()}catch{}let e={action:H.DoNotRestart};if(this.$state!==U.Stopping)try{e=await this._clientOptions.errorHandler.closed()}catch{}this._connection=void 0,e.action===H.DoNotRestart?(this.error(e.message??`Connection to server got closed. Server will not be restarted.`,void 0,e.handled===!0?!1:`force`),this.cleanUp(`stop`),this.$state===U.Starting?this.$state=U.StartFailed:this.$state=U.Stopped,this._onStop=Promise.resolve(),this._onStart=void 0):e.action===H.Restart&&(this.info(e.message??`Connection to server got closed. Server will restart.`,!e.handled),this.cleanUp(`restart`),this.$state=U.Initial,this._onStop=Promise.resolve(),this._onStart=void 0,this.start().catch(e=>this.error(`Restarting server failed`,e,`force`)))}async handleConnectionError(e,t,n){let r=await this._clientOptions.errorHandler.error(e,t,n);r.action===ae.Shutdown?(this.error(r.message??`Client ${this._name}: connection to server is erroring.\n${e.message}\nShutting down server.`,void 0,r.handled===!0?!1:`force`),this.stop().catch(e=>{this.error(`Stopping server failed`,e,!1)})):this.error(r.message??`Client ${this._name}: connection to server is erroring.\n${e.message}`,void 0,r.handled===!0?!1:`force`)}hookConfigurationChanged(e){this._listeners.push(t.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)}))}refreshTrace(e,r=!1){let i=t.workspace.getConfiguration(this._id),a=n.Trace.Off,o=n.TraceFormat.Text;if(i){let e=i.get(`trace.server`,`off`);typeof e==`string`?a=n.Trace.fromString(e):(a=n.Trace.fromString(i.get(`trace.server.verbosity`,`off`)),o=n.TraceFormat.fromString(i.get(`trace.server.format`,`text`)))}this._trace=a,this._traceFormat=o,e.trace(this._trace,this._tracer,{sendNotification:r,traceFormat:this._traceFormat}).catch(e=>{this.error(`Updating trace failed with error`,e,!1)})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let r;r=a.array(t)?t:[t],r&&this._dynamicFeatures.get(n.DidChangeWatchedFilesNotification.type.method).registerRaw(s.generateUuid(),r)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),l.DynamicFeature.is(e)){let t=e.registrationType;this._dynamicFeatures.set(t.method,e)}}getFeature(e){return this._dynamicFeatures.get(e)}hasDedicatedTextSynchronizationFeature(e){let t=this.getFeature(n.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof d.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){let e=new Map;this.registerFeature(new f.ConfigurationFeature(this)),this.registerFeature(new p.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this._didChangeTextDocumentFeature=new p.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new p.WillSaveFeature(this)),this.registerFeature(new p.WillSaveWaitUntilFeature(this)),this.registerFeature(new p.DidSaveTextDocumentFeature(this)),this.registerFeature(new p.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new k.FileSystemWatcherFeature(this,e=>this.notifyFileEvent(e))),this.registerFeature(new m.CompletionItemFeature(this)),this.registerFeature(new h.HoverFeature(this)),this.registerFeature(new v.SignatureHelpFeature(this)),this.registerFeature(new g.DefinitionFeature(this)),this.registerFeature(new S.ReferencesFeature(this)),this.registerFeature(new y.DocumentHighlightFeature(this)),this.registerFeature(new b.DocumentSymbolFeature(this)),this.registerFeature(new x.WorkspaceSymbolFeature(this)),this.registerFeature(new C.CodeActionFeature(this)),this.registerFeature(new w.CodeLensFeature(this)),this.registerFeature(new T.DocumentFormattingFeature(this)),this.registerFeature(new T.DocumentRangeFormattingFeature(this)),this.registerFeature(new T.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new E.RenameFeature(this)),this.registerFeature(new D.DocumentLinkFeature(this)),this.registerFeature(new O.ExecuteCommandFeature(this)),this.registerFeature(new f.SyncConfigurationFeature(this)),this.registerFeature(new M.TypeDefinitionFeature(this)),this.registerFeature(new j.ImplementationFeature(this)),this.registerFeature(new A.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new N.WorkspaceFoldersFeature(this)),this.registerFeature(new P.FoldingRangeFeature(this)),this.registerFeature(new ee.DeclarationFeature(this)),this.registerFeature(new F.SelectionRangeFeature(this)),this.registerFeature(new te.ProgressFeature(this)),this.registerFeature(new ne.CallHierarchyFeature(this)),this.registerFeature(new I.SemanticTokensFeature(this)),this.registerFeature(new R.LinkedEditingFeature(this)),this.registerFeature(new L.DidCreateFilesFeature(this)),this.registerFeature(new L.DidRenameFilesFeature(this)),this.registerFeature(new L.DidDeleteFilesFeature(this)),this.registerFeature(new L.WillCreateFilesFeature(this)),this.registerFeature(new L.WillRenameFilesFeature(this)),this.registerFeature(new L.WillDeleteFilesFeature(this)),this.registerFeature(new re.TypeHierarchyFeature(this)),this.registerFeature(new ie.InlineValueFeature(this)),this.registerFeature(new z.InlayHintsFeature(this)),this.registerFeature(new u.DiagnosticFeature(this)),this.registerFeature(new d.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(me.createAll(this))}fillInitializeParams(e){for(let t of this._features)a.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){let t={};(0,l.ensure)(t,`workspace`).applyEdit=!0;let r=(0,l.ensure)((0,l.ensure)(t,`workspace`),`workspaceEdit`);r.documentChanges=!0,r.resourceOperations=[n.ResourceOperationKind.Create,n.ResourceOperationKind.Rename,n.ResourceOperationKind.Delete],r.failureHandling=n.FailureHandlingKind.TextOnlyTransactional,r.normalizesLineEndings=!0,r.changeAnnotationSupport={groupsOnLabel:!0};let i=(0,l.ensure)((0,l.ensure)(t,`textDocument`),`publishDiagnostics`);i.relatedInformation=!0,i.versionSupport=!1,i.tagSupport={valueSet:[n.DiagnosticTag.Unnecessary,n.DiagnosticTag.Deprecated]},i.codeDescriptionSupport=!0,i.dataSupport=!0;let a=(0,l.ensure)(t,`window`),o=(0,l.ensure)(a,`showMessage`);o.messageActionItem={additionalPropertiesSupport:!0};let s=(0,l.ensure)(a,`showDocument`);s.support=!0;let c=(0,l.ensure)(t,`general`);c.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(e.RequestsToCancelOnContentModified)},c.regularExpressions={engine:`ECMAScript`,version:`ES2020`},c.markdown={parser:`marked`,version:`1.1.0`},c.positionEncodings=[`utf-16`],this._clientOptions.markdown.supportHtml&&(c.markdown.allowedTags=`ul.li.p.code.blockquote.ol.h1.h2.h3.h4.h5.h6.hr.em.pre.table.thead.tbody.tr.th.td.div.del.a.strong.br.img.span`.split(`.`));for(let e of this._features)e.fillClientCapabilities(t);return t}initializeFeatures(e){let t=this._clientOptions.documentSelector;for(let e of this._features)a.func(e.preInitialize)&&e.preInitialize(this._capabilities,t);for(let e of this._features)e.initialize(this._capabilities,t)}async handleRegistrationRequest(e){let t=this.clientOptions.middleware?.handleRegisterCapability;return t?t(e,e=>this.doRegisterCapability(e)):this.doRegisterCapability(e)}async doRegisterCapability(e){if(!this.isRunning()){for(let t of e.registrations)this._ignoredRegistrations.add(t.id);return}for(let t of e.registrations){let e=this._dynamicFeatures.get(t.method);if(e===void 0)return Promise.reject(Error(`No feature implementation for ${t.method} found. Registration failed.`));let n=t.registerOptions??{};n.documentSelector=n.documentSelector??this._clientOptions.documentSelector;let r={id:t.id,registerOptions:n};try{e.register(r)}catch(e){return Promise.reject(e)}}}async handleUnregistrationRequest(e){let t=this.clientOptions.middleware?.handleUnregisterCapability;return t?t(e,e=>this.doUnregisterCapability(e)):this.doUnregisterCapability(e)}async doUnregisterCapability(e){for(let t of e.unregisterations){if(this._ignoredRegistrations.has(t.id))continue;let e=this._dynamicFeatures.get(t.method);if(!e)return Promise.reject(Error(`No feature implementation for ${t.method} found. Unregistration failed.`));e.unregister(t.id)}}async handleApplyWorkspaceEdit(e){let r=e.edit,i=await this.workspaceEditLock.lock(()=>this._p2c.asWorkspaceEdit(r)),o=new Map;t.workspace.textDocuments.forEach(e=>o.set(e.uri.toString(),e));let s=!1;if(r.documentChanges){for(let e of r.documentChanges)if(n.TextDocumentEdit.is(e)&&e.textDocument.version&&e.textDocument.version>=0){let t=this._p2c.asUri(e.textDocument.uri).toString(),n=o.get(t);if(n&&n.version!==e.textDocument.version){s=!0;break}}}return s?Promise.resolve({applied:!1}):a.asPromise(t.workspace.applyEdit(i).then(e=>({applied:e})))}handleFailedRequest(r,i,a,o,s=!0){if(a instanceof n.ResponseError){if(a.code===n.ErrorCodes.PendingResponseRejected||a.code===n.ErrorCodes.ConnectionInactive)return o;if(a.code===n.LSPErrorCodes.RequestCancelled||a.code===n.LSPErrorCodes.ServerCancelled){if(i!==void 0&&i.isCancellationRequested)return o;throw a.data===void 0?new t.CancellationError:new l.LSPCancellationError(a.data)}else if(a.code===n.LSPErrorCodes.ContentModified){if(e.RequestsToCancelOnContentModified.has(r.method)||e.CancellableResolveCalls.has(r.method))throw new t.CancellationError;return o}}throw this.error(`Request ${r.method} failed.`,a,s),a}};e.BaseLanguageClient=de,de.RequestsToCancelOnContentModified=new Set([n.SemanticTokensRequest.method,n.SemanticTokensRangeRequest.method,n.SemanticTokensDeltaRequest.method]),de.CancellableResolveCalls=new Set([n.CompletionResolveRequest.method,n.CodeLensResolveRequest.method,n.CodeActionResolveRequest.method,n.InlayHintResolveRequest.method,n.DocumentLinkResolveRequest.method,n.WorkspaceSymbolResolveRequest.method]);var fe=class{error(e){(0,n.RAL)().console.error(e)}warn(e){(0,n.RAL)().console.warn(e)}info(e){(0,n.RAL)().console.info(e)}log(e){(0,n.RAL)().console.log(e)}};function pe(e,t,r,i,o){let s=new fe,c=(0,n.createProtocolConnection)(e,t,s,o);return c.onError(e=>{r(e[0],e[1],e[2])}),c.onClose(i),{listen:()=>c.listen(),sendRequest:c.sendRequest,onRequest:c.onRequest,hasPendingResponse:c.hasPendingResponse,sendNotification:c.sendNotification,onNotification:c.onNotification,onProgress:c.onProgress,sendProgress:c.sendProgress,trace:(e,t,r)=>{let i={sendNotification:!1,traceFormat:n.TraceFormat.Text};return r===void 0?c.trace(e,t,i):(a.boolean(r),c.trace(e,t,r))},initialize:e=>c.sendRequest(n.InitializeRequest.type,e),shutdown:()=>c.sendRequest(n.ShutdownRequest.type,void 0),exit:()=>c.sendNotification(n.ExitNotification.type),end:()=>c.end(),dispose:()=>c.dispose()}}var me;(function(e){function t(e){return[new B.InlineCompletionItemFeature(e)]}e.createAll=t})(me||(e.ProposedFeatures=me={}))})),ft=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.terminate=void 0;let t=require(`child_process`),n=require(`path`),r=process.platform===`win32`,i=process.platform===`darwin`,a=process.platform===`linux`;function o(e,o){if(r)try{let n={stdio:[`pipe`,`pipe`,`ignore`]};return o&&(n.cwd=o),t.execFileSync(`taskkill`,[`/T`,`/F`,`/PID`,e.pid.toString()],n),!0}catch{return!1}else if(a||i)try{var s=(0,n.join)(__dirname,`terminateProcess.sh`);return!t.spawnSync(s,[e.pid.toString()]).error}catch{return!1}else return e.kill(`SIGKILL`),!0}e.terminate=o})),pt=o(((e,t)=>{t.exports=W()})),mt=o(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),ht=o(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),gt=o(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=ht(),a=mt();e=t.exports={};let o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),_t=o(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),vt=o(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:er(t,e)}})),yt=o(((e,t)=>{let n=mt(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=ht(),{safeRe:a,t:o}=gt(),s=_t(),{compareIdentifiers:c}=vt();t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&tt.major?1:this.minort.minor?1:this.patcht.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),bt=o(((e,t)=>{let n=yt();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),xt=o(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),St=o(((e,t)=>{let n=yt();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),Ct=o(((e,t)=>{let n=St();t.exports=(e,t,r)=>n(e,t,r)===0})),wt=o(((e,t)=>{let n=St();t.exports=(e,t,r)=>n(e,t,r)!==0})),Tt=o(((e,t)=>{let n=St();t.exports=(e,t,r)=>n(e,t,r)>0})),Et=o(((e,t)=>{let n=St();t.exports=(e,t,r)=>n(e,t,r)>=0})),Dt=o(((e,t)=>{let n=St();t.exports=(e,t,r)=>n(e,t,r)<0})),Ot=o(((e,t)=>{let n=St();t.exports=(e,t,r)=>n(e,t,r)<=0})),kt=o(((e,t)=>{let n=Ct(),r=wt(),i=Tt(),a=Et(),o=Dt(),s=Ot();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),At=o(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new l(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=_t(),{safeRe:i,t:a}=gt(),o=kt(),s=mt(),c=yt(),l=jt()})),jt=o(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&g(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];e=e.replace(s,O(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[l.COMPARATORTRIM],u),o(`comparator trim`,e),e=e.replace(c[l.TILDETRIM],d),o(`tilde trim`,e),e=e.replace(c[l.CARETTRIM],f),o(`caret trim`,e);let g=e.split(` `).map(e=>v(e,this.options)).join(` `).split(/\s+/).map(e=>D(e,this.options));i&&(g=g.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[l.COMPARATORLOOSE])))),o(`range list`,g);let _=new Map,y=g.map(e=>new a(e,this.options));for(let e of y){if(h(e))return[e];_.set(e.value,e)}_.size>1&&_.has(``)&&_.delete(``);let b=[..._.values()];return r.set(t,b),b}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>_(e,n)&&t.set.some(t=>_(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;te.value===`<0.0.0-0`,g=e=>e.value===``,_=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},v=(e,t)=>(e=e.replace(c[l.BUILD],``),o(`comp`,e,t),e=S(e,t),o(`caret`,e),e=b(e,t),o(`tildes`,e),e=w(e,t),o(`xrange`,e),e=E(e,t),o(`stars`,e),e),y=e=>!e||e.toLowerCase()===`x`||e===`*`,b=(e,t)=>e.trim().split(/\s+/).map(e=>x(e,t)).join(` `),x=(e,t)=>{let n=t.loose?c[l.TILDELOOSE]:c[l.TILDE];return e.replace(n,(t,n,r,i,a)=>{o(`tilde`,e,t,n,r,i,a);let s;return y(n)?s=``:y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o(`replaceTilde pr`,a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o(`tilde return`,s),s})},S=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(` `),C=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[l.CARETLOOSE]:c[l.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return y(n)?c=``:y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},w=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>T(e,t)).join(` `)),T=(e,t)=>{e=e.trim();let n=t.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{o(`xRange`,e,n,r,i,a,s,c);let l=y(i),u=l||y(a),d=u||y(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},E=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[l.STAR],``)),D=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?l.GTE0PRE:l.GTE0],``)),O=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=y(r)?``:y(i)?`>=${r}.0.0${e?`-0`:``}`:y(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=y(l)?``:y(u)?`<${+l+1}.0.0-0`:y(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),k=(e,t,n)=>{for(let n=0;n0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),Mt=o(((e,t)=>{let n=jt();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),Nt=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.DiagnosticPullMode=e.vsdiag=void 0,n(W(),e),n(Y(),e);var r=je();Object.defineProperty(e,`vsdiag`,{enumerable:!0,get:function(){return r.vsdiag}}),Object.defineProperty(e,`DiagnosticPullMode`,{enumerable:!0,get:function(){return r.DiagnosticPullMode}}),n(dt(),e)})),Pt=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.SettingMonitor=e.LanguageClient=e.TransportKind=void 0;let r=require(`child_process`),i=require(`fs`),a=require(`path`),o=require(`vscode`),s=_(),c=dt(),l=ft(),u=pt(),d=bt(),f=Mt();n(pt(),e),n(Nt(),e);let p=`^1.82.0`;var m;(function(e){e[e.stdio=0]=`stdio`,e[e.ipc=1]=`ipc`,e[e.pipe=2]=`pipe`,e[e.socket=3]=`socket`})(m||(e.TransportKind=m={}));var h;(function(e){function t(e){let t=e;return t&&t.kind===m.socket&&s.number(t.port)}e.isSocket=t})(h||={});var g;(function(e){function t(e){return s.string(e.command)}e.is=t})(g||={});var v;(function(e){function t(e){return s.string(e.module)}e.is=t})(v||={});var y;(function(e){function t(e){let t=e;return t&&t.writer!==void 0&&t.reader!==void 0}e.is=t})(y||={});var b;(function(e){function t(e){let t=e;return t&&t.process!==void 0&&typeof t.detached==`boolean`}e.is=t})(b||={}),e.LanguageClient=class extends c.BaseLanguageClient{constructor(e,t,n,r,i){let a,o,c,l,u;s.string(t)?(a=e,o=t,c=n,l=r,u=!!i):(a=e.toLowerCase(),o=e,c=t,l=n,u=r),u===void 0&&(u=!1),super(a,o,l),this._serverOptions=c,this._forceDebug=u,this._isInDebugMode=u;try{this.checkVersion()}catch(e){throw s.string(e.message)&&this.outputChannel.appendLine(e.message),e}}checkVersion(){let e=d(o.version);if(!e)throw Error(`No valid VS Code version detected. Version string is: ${o.version}`);if(e.prerelease&&e.prerelease.length>0&&(e.prerelease=[]),!f(e,p))throw Error(`The language client requires VS Code version ${p} but received version ${o.version}`)}get isInDebugMode(){return this._isInDebugMode}async restart(){await this.stop(),this.isInDebugMode&&await new Promise(e=>setTimeout(e,1e3)),await this.start()}stop(e=2e3){return super.stop(e).finally(()=>{if(this._serverProcess){let e=this._serverProcess;this._serverProcess=void 0,(this._isDetached===void 0||!this._isDetached)&&this.checkProcessDied(e),this._isDetached=void 0}})}checkProcessDied(e){!e||e.pid===void 0||setTimeout(()=>{try{e.pid!==void 0&&(process.kill(e.pid,0),(0,l.terminate)(e))}catch{}},2e3)}handleConnectionClosed(){return this._serverProcess=void 0,super.handleConnectionClosed()}fillInitializeParams(e){super.fillInitializeParams(e),e.processId===null&&(e.processId=process.pid)}createMessageTransports(e){function t(e,t){if(!e&&!t)return;let n=Object.create(null);return Object.keys(process.env).forEach(e=>n[e]=process.env[e]),t&&(n.ELECTRON_RUN_AS_NODE=`1`,n.ELECTRON_NO_ASAR=`1`),e&&Object.keys(e).forEach(t=>n[t]=e[t]),n}let n=[`--debug=`,`--debug-brk=`,`--inspect=`,`--inspect-brk=`],i=[`--debug`,`--debug-brk`,`--inspect`,`--inspect-brk`];function a(){let e=process.execArgv;return e?e.some(e=>n.some(t=>e.startsWith(t))||i.some(t=>e===t)):!1}function o(e){if(e.stdin===null||e.stdout===null||e.stderr===null)throw Error(`Process created without stdio streams`)}let l=this._serverOptions;if(s.func(l))return l().then(t=>{if(c.MessageTransports.is(t))return this._isDetached=!!t.detached,t;if(y.is(t))return this._isDetached=!!t.detached,{reader:new u.StreamMessageReader(t.reader),writer:new u.StreamMessageWriter(t.writer)};{let n;return b.is(t)?(n=t.process,this._isDetached=t.detached):(n=t,this._isDetached=!1),n.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),{reader:new u.StreamMessageReader(n.stdout),writer:new u.StreamMessageWriter(n.stdin)}}});let d,f=l;return f.run||f.debug?this._forceDebug||a()?(d=f.debug,this._isInDebugMode=!0):(d=f.run,this._isInDebugMode=!1):d=l,this._getServerWorkingDir(d.options).then(n=>{if(v.is(d)&&d.module){let i=d,a=i.transport||m.stdio;if(i.runtime){let o=[],c=i.options??Object.create(null);c.execArgv&&c.execArgv.forEach(e=>o.push(e)),o.push(i.module),i.args&&i.args.forEach(e=>o.push(e));let l=Object.create(null);l.cwd=n,l.env=t(c.env,!1);let d=this._getRuntimePath(i.runtime,n),f;if(a===m.ipc?(l.stdio=[null,null,null,`ipc`],o.push(`--node-ipc`)):a===m.stdio?o.push(`--stdio`):a===m.pipe?(f=(0,u.generateRandomPipeName)(),o.push(`--pipe=${f}`)):h.isSocket(a)&&o.push(`--socket=${a.port}`),o.push(`--clientProcessId=${process.pid.toString()}`),a===m.ipc||a===m.stdio){let t=r.spawn(d,o,l);return!t||!t.pid?x(t,`Launching server using runtime ${d} failed.`):(this._serverProcess=t,t.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),a===m.ipc?(t.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),Promise.resolve({reader:new u.IPCMessageReader(t),writer:new u.IPCMessageWriter(t)})):Promise.resolve({reader:new u.StreamMessageReader(t.stdout),writer:new u.StreamMessageWriter(t.stdin)}))}else if(a===m.pipe)return(0,u.createClientPipeTransport)(f).then(t=>{let n=r.spawn(d,o,l);return!n||!n.pid?x(n,`Launching server using runtime ${d} failed.`):(this._serverProcess=n,n.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),n.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),t.onConnected().then(e=>({reader:e[0],writer:e[1]})))});else if(h.isSocket(a))return(0,u.createClientSocketTransport)(a.port).then(t=>{let n=r.spawn(d,o,l);return!n||!n.pid?x(n,`Launching server using runtime ${d} failed.`):(this._serverProcess=n,n.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),n.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),t.onConnected().then(e=>({reader:e[0],writer:e[1]})))})}else{let c;return new Promise((l,d)=>{let f=(i.args&&i.args.slice())??[];a===m.ipc?f.push(`--node-ipc`):a===m.stdio?f.push(`--stdio`):a===m.pipe?(c=(0,u.generateRandomPipeName)(),f.push(`--pipe=${c}`)):h.isSocket(a)&&f.push(`--socket=${a.port}`),f.push(`--clientProcessId=${process.pid.toString()}`);let p=i.options??Object.create(null);if(p.env=t(p.env,!0),p.execArgv=p.execArgv||[],p.cwd=n,p.silent=!0,a===m.ipc||a===m.stdio){let t=r.fork(i.module,f||[],p);o(t),this._serverProcess=t,t.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),a===m.ipc?(t.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),l({reader:new u.IPCMessageReader(this._serverProcess),writer:new u.IPCMessageWriter(this._serverProcess)})):l({reader:new u.StreamMessageReader(t.stdout),writer:new u.StreamMessageWriter(t.stdin)})}else a===m.pipe?(0,u.createClientPipeTransport)(c).then(t=>{let n=r.fork(i.module,f||[],p);o(n),this._serverProcess=n,n.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),n.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),t.onConnected().then(e=>{l({reader:e[0],writer:e[1]})},d)},d):h.isSocket(a)&&(0,u.createClientSocketTransport)(a.port).then(t=>{let n=r.fork(i.module,f||[],p);o(n),this._serverProcess=n,n.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),n.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),t.onConnected().then(e=>{l({reader:e[0],writer:e[1]})},d)},d)})}}else if(g.is(d)&&d.command){let t=d,i=d.args===void 0?[]:d.args.slice(0),a,o=d.transport;if(o===m.stdio)i.push(`--stdio`);else if(o===m.pipe)a=(0,u.generateRandomPipeName)(),i.push(`--pipe=${a}`);else if(h.isSocket(o))i.push(`--socket=${o.port}`);else if(o===m.ipc)throw Error(`Transport kind ipc is not support for command executable`);let c=Object.assign({},t.options);if(c.cwd=c.cwd||n,o===void 0||o===m.stdio){let n=r.spawn(t.command,i,c);return!n||!n.pid?x(n,`Launching server using command ${t.command} failed.`):(n.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),this._serverProcess=n,this._isDetached=!!c.detached,Promise.resolve({reader:new u.StreamMessageReader(n.stdout),writer:new u.StreamMessageWriter(n.stdin)}))}else if(o===m.pipe)return(0,u.createClientPipeTransport)(a).then(n=>{let a=r.spawn(t.command,i,c);return!a||!a.pid?x(a,`Launching server using command ${t.command} failed.`):(this._serverProcess=a,this._isDetached=!!c.detached,a.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),a.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),n.onConnected().then(e=>({reader:e[0],writer:e[1]})))});else if(h.isSocket(o))return(0,u.createClientSocketTransport)(o.port).then(n=>{let a=r.spawn(t.command,i,c);return!a||!a.pid?x(a,`Launching server using command ${t.command} failed.`):(this._serverProcess=a,this._isDetached=!!c.detached,a.stderr.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),a.stdout.on(`data`,t=>this.outputChannel.append(s.string(t)?t:t.toString(e))),n.onConnected().then(e=>({reader:e[0],writer:e[1]})))})}return Promise.reject(Error(`Unsupported server configuration `+JSON.stringify(l,null,4)))}).finally(()=>{this._serverProcess!==void 0&&this._serverProcess.on(`exit`,(e,t)=>{e!==null&&this.error(`Server process exited with code ${e}.`,void 0,!1),t!==null&&this.error(`Server process exited with signal ${t}.`,void 0,!1)})})}_getRuntimePath(e,t){if(a.isAbsolute(e))return e;let n=this._mainGetRootPath();if(n!==void 0){let t=a.join(n,e);if(i.existsSync(t))return t}if(t!==void 0){let n=a.join(t,e);if(i.existsSync(n))return n}return e}_mainGetRootPath(){let e=o.workspace.workspaceFolders;if(!e||e.length===0)return;let t=e[0];if(t.uri.scheme===`file`)return t.uri.fsPath}_getServerWorkingDir(e){let t=e&&e.cwd;return t||=this.clientOptions.workspaceFolder?this.clientOptions.workspaceFolder.uri.fsPath:this._mainGetRootPath(),t?new Promise(e=>{i.lstat(t,(n,r)=>{e(!n&&r.isDirectory()?t:void 0)})}):Promise.resolve(void 0)}},e.SettingMonitor=class{constructor(e,t){this._client=e,this._setting=t,this._listeners=[]}start(){return o.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration,this,this._listeners),this.onDidChangeConfiguration(),new o.Disposable(()=>{this._client.needsStop()&&this._client.stop()})}onDidChangeConfiguration(){let e=this._setting.indexOf(`.`),t=e>=0?this._setting.substr(0,e):this._setting,n=e>=0?this._setting.substr(e+1):void 0,r=n?o.workspace.getConfiguration(t).get(n,!1):o.workspace.getConfiguration(t);r&&this._client.needsStart()?this._client.start().catch(e=>this._client.error(`Start failed after configuration change`,e,`force`)):!r&&this._client.needsStop()&&this._client.stop().catch(e=>this._client.error(`Stop failed after configuration change`,e,`force`))}};function x(e,t){return e===null?Promise.reject(t):new Promise((n,r)=>{e.on(`error`,e=>{r(`${t} ${e}`)}),setImmediate(()=>r(t))})}})),Ft=o(((e,t)=>{t.exports=Pt()})),It=W(),Lt=Ft();const Rt=`fallow`,zt=()=>l.workspace.getConfiguration(Rt),Bt=()=>zt().get(`lspPath`,``),Vt=()=>zt().get(`configPath`,``).trim(),Ht=()=>{let e=Vt();if(!e||d.isAbsolute(e))return e;let t=l.workspace.workspaceFolders?.[0]?.uri.fsPath;return t?d.resolve(t,e):e},Ut=()=>zt().get(`autoDownload`,!0),Wt=()=>zt().get(`issueTypes`,{"unused-files":!0,"unused-exports":!0,"unused-types":!0,"private-type-leaks":!0,"unused-dependencies":!0,"unused-dev-dependencies":!0,"unused-optional-dependencies":!0,"unused-enum-members":!0,"unused-class-members":!0,"unresolved-imports":!0,"unlisted-dependencies":!0,"duplicate-exports":!0,"type-only-dependencies":!0,"test-only-dependencies":!0,"circular-dependencies":!0,"boundary-violation":!0,"stale-suppressions":!0,"unused-catalog-entries":!0,"unresolved-catalog-references":!0,"unused-dependency-overrides":!0,"misconfigured-dependency-overrides":!0}),Gt=()=>zt().get(`duplication.threshold`,5),Kt=()=>zt().get(`duplication.mode`,`mild`),qt=()=>zt().get(`production`,!1),Jt=()=>zt().get(`changedSince`,``).trim(),Yt=()=>zt().get(`trace.server`,`off`),Xt=e=>l.workspace.onDidChangeConfiguration(t=>{t.affectsConfiguration(Rt)&&e(t)}),Zt=()=>f.platform()===`win32`?`.exe`:``,Qt=e=>{let t=l.workspace.workspaceFolders;if(!t||t.length===0)return null;let n=`${e}${Zt()}`,r=d.join(t[0].uri.fsPath,`node_modules`,`.bin`,n);return u.existsSync(r)?r:null},$t=e=>{let t=`${e}${Zt()}`,n=(process.env.PATH??``).split(d.delimiter);for(let e of n){let n=d.join(e,t);if(u.existsSync(n))return n}return null},en=`fallow.diagnosticFilter.v1`,tn=[{code:`code-duplication`,label:`Code Duplication`},{code:`unused-file`,label:`Unused Files`},{code:`unused-export`,label:`Unused Exports`},{code:`unused-type`,label:`Unused Types`},{code:`private-type-leak`,label:`Private Type Leaks`},{code:`unused-dependency`,label:`Unused Dependencies`},{code:`unused-dev-dependency`,label:`Unused Dev Dependencies`},{code:`unused-optional-dependency`,label:`Unused Optional Dependencies`},{code:`unused-enum-member`,label:`Unused Enum Members`},{code:`unused-class-member`,label:`Unused Class Members`},{code:`unresolved-import`,label:`Unresolved Imports`},{code:`unlisted-dependency`,label:`Unlisted Dependencies`},{code:`duplicate-export`,label:`Duplicate Exports`},{code:`type-only-dependency`,label:`Type-Only Dependencies`},{code:`test-only-dependency`,label:`Test-Only Dependencies`},{code:`circular-dependency`,label:`Circular Dependencies`},{code:`boundary-violation`,label:`Boundary Violations`},{code:`stale-suppression`,label:`Stale Suppressions`},{code:`unused-catalog-entry`,label:`Unused Catalog Entries`},{code:`unresolved-catalog-reference`,label:`Unresolved Catalog References`},{code:`unused-dependency-override`,label:`Unused Dependency Overrides`},{code:`misconfigured-dependency-override`,label:`Misconfigured Dependency Overrides`}];let nn=tn;const rn=e=>{if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.code==`string`&&t.code.length>0&&typeof t.label==`string`&&t.label.length>0},an=e=>{if(!Array.isArray(e))return null;let t=e.filter(rn);return t.length!==e.length||t.length===0?null:t.map(({code:e,label:t})=>({code:e,label:t}))},on=e=>{e.length!==0&&(nn=e.slice())},sn=()=>{nn=tn},cn=()=>nn,ln=e=>e.source===`fallow`,un=e=>{let t=e.code;if(t==null)return null;if(typeof t==`string`)return t;if(typeof t==`number`)return String(t);if(typeof t==`object`&&`value`in t){let e=t.value;return typeof e==`string`?e:String(e)}return null};var dn=class{mutedAll=!1;mutedCategories=new Set;cache=new Map;client=null;persistQueue=Promise.resolve();emitter=new l.EventEmitter;onDidChange=this.emitter.event;constructor(e){this.memento=e;let t=e.get(en);if(t){this.mutedAll=t.mutedAll===!0;let e=t.mutedCategories??[];this.mutedCategories=new Set(e)}}attachClient(e){this.client=e,this.refresh()}detachClient(){this.client=null,this.cache.clear()}dispose(){this.emitter.dispose()}isMutedAll(){return this.mutedAll}isCategoryMuted(e){return this.mutedCategories.has(e)}anythingMuted(){return this.mutedAll||this.mutedCategories.size>0}mutedCategoriesSnapshot(){return new Set(this.mutedCategories)}setMutedAll(e){this.mutedAll!==e&&(this.mutedAll=e,this.persist(),this.refresh(),this.emitChange())}toggleMutedAll(){return this.setMutedAll(!this.mutedAll),this.mutedAll}setCategoryMuted(e,t){t!==this.mutedCategories.has(e)&&(t?this.mutedCategories.add(e):this.mutedCategories.delete(e),this.persist(),this.refresh(),this.emitChange())}setMutedCategories(e){let t=this.mutedCategories.size!==e.size;if(!t){for(let n of e)if(!this.mutedCategories.has(n)){t=!0;break}}t&&(this.mutedCategories=new Set(e),this.persist(),this.refresh(),this.emitChange())}toggleCategory(e){let t=!this.mutedCategories.has(e);return this.setCategoryMuted(e,t),t}clearAllMutes(){this.anythingMuted()&&(this.mutedAll=!1,this.mutedCategories.clear(),this.persist(),this.refresh(),this.emitChange())}evictUri(e){this.cache.delete(e.toString())}applyFilter(e){return this.anythingMuted()?e.filter(e=>{if(!ln(e))return!0;if(this.mutedAll)return!1;let t=un(e);return t===null?!0:!this.mutedCategories.has(t)}):e.slice()}handleDiagnostics(e,t,n){let r=e.toString();this.evictIfFull(r),this.cache.set(r,t.slice()),n(e,this.applyFilter(t))}async provideDiagnostics(e,t,n,r){let i=await r(e,t,n);if(!i||i.kind!==`full`)return i;let a=(`uri`in e&&e.uri!==void 0?e.uri:e).toString();return this.evictIfFull(a),this.cache.set(a,i.items.slice()),{...i,items:this.applyFilter(i.items)}}refresh(){let e=this.client?.diagnostics;if(!e)return;let t=Array.from(this.cache.entries());for(let[n,r]of t)e.set(l.Uri.parse(n),this.applyFilter(r))}evictIfFull(e){if(this.cache.size<5e3||this.cache.has(e))return;let t=this.cache.keys().next().value;t!==void 0&&this.cache.delete(t)}persist(){let e={mutedAll:this.mutedAll,mutedCategories:Array.from(this.mutedCategories)};this.persistQueue=this.persistQueue.then(()=>Promise.resolve(this.memento.update(en,e)),()=>Promise.resolve(this.memento.update(en,e)))}emitChange(){this.emitter.fire({mutedAll:this.mutedAll,mutedCategories:this.mutedCategoriesSnapshot()})}};const fn=`fallow-lsp`,pn=`fallow`,mn=`.fallow-version`,hn=`.sig`,gn=Buffer.from([131,78,111,215,115,51,230,238,223,119,147,71,199,16,172,180,3,210,216,35,77,85,159,94,215,200,126,85,42,222,11,209]),_n=Buffer.from([48,42,48,5,6,3,43,101,112,3,33,0]),vn={"User-Agent":`fallow-vscode`},yn=(e,t)=>e===`darwin`&&t===`arm64`?`darwin-arm64`:e===`darwin`&&t===`x64`?`darwin-x64`:e===`linux`&&t===`x64`?`linux-x64-gnu`:e===`linux`&&t===`arm64`?`linux-arm64-gnu`:e===`win32`&&t===`arm64`?`win32-arm64-msvc`:e===`win32`&&t===`x64`?`win32-x64-msvc`:null,bn=()=>yn(f.platform(),f.arch()),xn=(e,t)=>new Promise((n,r)=>{h.get(e,{headers:vn},e=>{if(e.statusCode&&e.statusCode>=300&&e.statusCode<400&&e.headers.location){e.resume(),xn(e.headers.location,t).then(n,r);return}if(e.statusCode&&e.statusCode>=400){e.resume(),r(Error(`HTTP ${e.statusCode}`));return}t(e).then(n,r)}).on(`error`,r)}),Sn=e=>xn(e,async e=>{let t=[];return await new Promise((n,r)=>{e.on(`data`,e=>t.push(e)),e.on(`end`,()=>n(Buffer.concat(t).toString())),e.on(`error`,r)})}),Cn=(e,t)=>xn(e,async e=>await new Promise((n,r)=>{let i=u.createWriteStream(t);e.pipe(i),i.on(`finish`,()=>{i.close(),n()}),i.on(`error`,e=>{u.unlink(t,()=>{}),r(e)})})),wn=e=>{let t=d.join(e.globalStorageUri.fsPath,`bin`);return u.existsSync(t)||u.mkdirSync(t,{recursive:!0}),t},Tn=e=>`${e}${hn}`,En=e=>`${e}.sha256`,Dn=e=>[d.join(e,`${fn}${Zt()}`),d.join(e,`${pn}${Zt()}`)],On=e=>{for(let t of Dn(e))for(let e of[t,Tn(t),En(t)])try{u.existsSync(e)&&u.unlinkSync(e)}catch{}try{let t=d.join(e,mn);u.existsSync(t)&&u.unlinkSync(t)}catch{}},kn=(e,t)=>{try{u.writeFileSync(d.join(e,mn),t,`utf-8`)}catch{}},An=e=>{try{return u.readFileSync(d.join(e,mn),`utf-8`).trim()||null}catch{return null}},jn=e=>{try{return(0,p.execFileSync)(e,[`--version`],{timeout:5e3,encoding:`utf-8`}).trim().match(/(\d+\.\d+\.\d+)/)?.[1]??null}catch{return null}},Mn=e=>{try{let t=Tn(e),n=u.readFileSync(e),r=u.readFileSync(t);return(0,m.verify)(null,n,(0,m.createPublicKey)({key:Buffer.concat([_n,gn]),format:`der`,type:`spki`}),r)}catch{return!1}},Nn=e=>{if(!e)return null;let t=e.trim().toLowerCase();if(!t.startsWith(`sha256:`))return null;let n=t.slice(7);return/^[0-9a-f]{64}$/.test(n)?n:null},Pn=(e,t)=>{try{u.writeFileSync(En(e),t,`utf-8`)}catch{}},Fn=e=>{try{return Nn(`sha256:${u.readFileSync(En(e),`utf-8`).trim()}`)}catch{return null}},In=(e,t)=>{try{let n=Nn(`sha256:${t}`);if(!n)return!1;let r=u.readFileSync(e);return(0,m.createHash)(`sha256`).update(r).digest(`hex`)===n}catch{return!1}},Ln=(e,t,n,r)=>{let i=Tn(t);if(u.existsSync(i))return Mn(t)?!0:(r?.appendLine(`Fallow: installed ${n} binary failed Ed25519 signature verification. Re-downloading.`),On(e),!1);let a=Fn(t);return a&&In(t,a)?(r?.appendLine(`Fallow: installed ${n} binary reused via stored SHA-256 digest verification.`),!0):(r?.appendLine(`Fallow: installed ${n} binary is neither signature-verified nor digest-verified. Re-downloading.`),On(e),!1)},Rn=(e,t,n,r)=>{let i=l.extensions.getExtension(`fallow-rs.fallow-vscode`)?.packageJSON?.version;if(!i)return!0;let a=An(e)??jn(t);return a===i?!0:(r?.appendLine(`Fallow: installed ${n} binary is v${a??`unknown`}, extension is v${i}. Re-downloading.`),On(e),!1)},zn=(e,t,n,r)=>{let i=wn(e),a=d.join(i,`${t}${Zt()}`);return!u.existsSync(a)||!Ln(i,a,n,r)||!Rn(i,a,n,r)?null:a},Bn=(e,t)=>zn(e,fn,`LSP`,t),Vn=(e,t)=>zn(e,pn,`CLI`,t),Hn=async(e,t,n,r)=>{let i=Zt(),a=`${t}-${n}${i}`,o=e.assets.find(e=>e.name===a);if(!o)return null;let s=e.assets.find(e=>e.name===`${a}${hn}`),c=Nn(o.digest),l=d.join(r,`${t}${i}`),p=Tn(l),m=En(l);try{if(await Cn(o.browser_download_url,l),s){if(await Cn(s.browser_download_url,p),!Mn(l))throw Error(`${a} failed Ed25519 signature verification`);u.existsSync(m)&&u.unlinkSync(m)}else if(c){if(!In(l,c))throw Error(`${a} failed SHA-256 digest verification`);Pn(l,c)}else throw Error(`${a} is missing both a signature asset and a GitHub release digest`);f.platform()!==`win32`&&u.chmodSync(l,493)}catch(e){for(let e of[l,p,m])try{u.existsSync(e)&&u.unlinkSync(e)}catch{}throw e}return l},Un=async e=>{let t=bn();return t?l.window.withProgress({location:l.ProgressLocation.Notification,title:`Fallow: Downloading binaries...`,cancellable:!1},async()=>{try{let n=await Sn(`https://api.github.com/repos/fallow-rs/fallow/releases/latest`),r=JSON.parse(n),i=wn(e),a=await Hn(r,fn,t,i);if(!a)return l.window.showErrorMessage(`Fallow: no LSP binary found for ${t} in release ${r.tag_name}`),null;let o=l.extensions.getExtension(`fallow-rs.fallow-vscode`)?.packageJSON?.version;o&&kn(i,o);let s=null;try{s=await Hn(r,pn,t,i)}catch(e){let t=e instanceof Error?e.message:String(e);l.window.showWarningMessage(`Fallow: CLI download skipped: ${t}`)}return s?l.window.showInformationMessage(`Fallow: ${r.tag_name} installed (LSP + CLI).`):l.window.showInformationMessage(`Fallow: LSP ${r.tag_name} installed. CLI binary not found in release — tree views require the fallow CLI in PATH.`),a}catch(e){let t=e instanceof Error?e.message:String(e);return l.window.showErrorMessage(`Fallow: failed to download binaries: ${t}`),null}}):(l.window.showErrorMessage(`Fallow: unsupported platform ${f.platform()}-${f.arch()}`),null)};let Wn=null;const Gn=(e,t)=>{let n=l.extensions.getExtension(`fallow-rs.fallow-vscode`)?.packageJSON?.version;if(!n)return;let r=jn(e);if(r&&r!==n){let e=`Fallow: binary in PATH is v${r}, extension is v${n}. Update the binary or remove it from PATH to use the bundled version.`;t?.appendLine(e),l.window.showWarningMessage(e)}},Kn=async(e,t)=>{let n=Bt();if(n)return u.existsSync(n)?(t?.appendLine(`Binary resolution: using fallow.lspPath setting: ${n}`),n):(l.window.showWarningMessage(`Fallow: configured LSP path "${n}" does not exist.`),null);let r=Qt(`fallow-lsp`);if(r)return t?.appendLine(`Binary resolution: using local node_modules/.bin: ${r}`),r;t?.appendLine(`Binary resolution: no local node_modules/.bin/fallow-lsp found`);let i=$t(`fallow-lsp`);if(i)return t?.appendLine(`Binary resolution: using system PATH: ${i}`),Gn(i,t),i;t?.appendLine(`Binary resolution: fallow-lsp not found in PATH`);let a=Bn(e,t);if(a)return t?.appendLine(`Binary resolution: using previously downloaded binary: ${a}`),a;if(Ut())return Un(e);let o=await l.window.showErrorMessage(`Fallow: fallow-lsp binary not found. Would you like to download it?`,`Download`,`Set Path`,`Cancel`);return o===`Download`?Un(e):(o===`Set Path`&&l.commands.executeCommand(`workbench.action.openSettings`,`fallow.lspPath`),null)},qn=async(e,t)=>{try{let n=an(await e.sendRequest(`fallow/issueTypes`));if(!n){sn(),t.appendLine(`fallow/issueTypes returned an invalid response; using bundled diagnostic categories.`);return}on(n),t.appendLine(`Loaded ${n.length} diagnostic categories from fallow-lsp.`)}catch(e){sn();let n=e instanceof Error?e.message:String(e);t.appendLine(`fallow/issueTypes unavailable (${n}); using bundled diagnostic categories.`)}},Jn=async(e,t,n)=>{let r=await Kn(e,t);if(!r)return null;t.appendLine(`Using fallow-lsp binary: ${r}`);let i={command:r,transport:Lt.TransportKind.stdio},a=Yt();Wn=new Lt.LanguageClient(`fallow`,`Fallow Language Server`,i,{documentSelector:[{scheme:`file`,language:`javascript`},{scheme:`file`,language:`javascriptreact`},{scheme:`file`,language:`typescript`},{scheme:`file`,language:`typescriptreact`},{scheme:`file`,language:`vue`},{scheme:`file`,language:`svelte`},{scheme:`file`,language:`astro`},{scheme:`file`,language:`mdx`},{scheme:`file`,language:`json`}],outputChannel:t,traceOutputChannel:t,initializationOptions:{issueTypes:Wt(),changedSince:Jt(),configPath:Ht()},middleware:n?{handleDiagnostics:(e,t,r)=>n.handleDiagnostics(e,t,r),provideDiagnostics:(e,t,r,i)=>n.provideDiagnostics(e,t,r,i)}:void 0}),a!==`off`&&Wn.setTrace(a===`verbose`?It.Trace.Verbose:It.Trace.Messages);try{await Wn.start(),t.appendLine(`Fallow language server started.`),await qn(Wn,t)}catch(e){let n=e instanceof Error?e.message:String(e);return t.appendLine(`Failed to start language server: ${n}`),l.window.showErrorMessage(`Fallow: failed to start language server. Check the output channel for details.`),Wn=null,null}return n?.attachClient(Wn),Wn},Yn=async()=>{Wn&&=(await Wn.stop(),null)},Xn=async(e,t,n)=>(n?.detachClient(),await Yn(),Jn(e,t,n)),Zn=(e,t)=>{let n=e?[`fix`,`--dry-run`,`--format`,`json`,`--quiet`]:[`fix`,`--yes`,`--format`,`json`,`--quiet`];return t&&n.push(`--production`),n},Qn=e=>e.name??e.package??e.file??`unknown`,$n=e=>e.path?`${e.path}${e.line?`:${e.line}`:``}`:e.location??``,er=e=>[...e.map(e=>({label:Qn(e),description:e.type.replace(/_/g,` `),detail:$n(e),action:`navigate`,fix:e})),{label:`Apply all fixes`,description:`${e.length} fix${e.length===1?``:`es`}`,action:`apply-all`}],tr=(e,t)=>{let n=t.path??t.file;return n?{absolutePath:d.isAbsolute(n)?n:d.resolve(e,n),line:Math.max(0,(t.line??1)-1)}:null},nr=e=>{let t=Bt();if(t){let e=d.dirname(t),n=d.join(e,`fallow${Zt()}`);if(u.existsSync(n))return n}return Qt(`fallow`)||$t(`fallow`)||Vn(e)||null},rr=(e,t,n)=>new Promise((r,i)=>{let a=nr(e);if(!a){i(Error(`fallow CLI binary not found in PATH.`));return}let o=p.spawn(a,[...t],{cwd:n,stdio:[`ignore`,`pipe`,`pipe`]}),s=``,c=``;o.stdout?.setEncoding(`utf8`),o.stdout?.on(`data`,e=>{s+=e}),o.stderr?.setEncoding(`utf8`),o.stderr?.on(`data`,e=>{c+=e}),o.on(`error`,e=>{i(e)}),o.on(`close`,(e,t)=>{if(t){i(Error(`fallow exited via signal ${t}`));return}if(e!==null&&e!==0&&e!==1){i(Error(c.trim()||`fallow exited with code ${e}`));return}r(s)})}),ir=e=>{let t=Wt(),n={...e,unused_files:t[`unused-files`]?e.unused_files:[],unused_exports:t[`unused-exports`]?e.unused_exports:[],unused_types:t[`unused-types`]?e.unused_types:[],private_type_leaks:t[`private-type-leaks`]?e.private_type_leaks:[],unused_dependencies:t[`unused-dependencies`]?e.unused_dependencies:[],unused_dev_dependencies:t[`unused-dev-dependencies`]?e.unused_dev_dependencies:[],unused_optional_dependencies:t[`unused-optional-dependencies`]?e.unused_optional_dependencies:[],unused_enum_members:t[`unused-enum-members`]?e.unused_enum_members:[],unused_class_members:t[`unused-class-members`]?e.unused_class_members:[],unresolved_imports:t[`unresolved-imports`]?e.unresolved_imports:[],unlisted_dependencies:t[`unlisted-dependencies`]?e.unlisted_dependencies:[],duplicate_exports:t[`duplicate-exports`]?e.duplicate_exports:[],type_only_dependencies:t[`type-only-dependencies`]?e.type_only_dependencies:[],test_only_dependencies:t[`test-only-dependencies`]?e.test_only_dependencies:[],circular_dependencies:t[`circular-dependencies`]?e.circular_dependencies:[],boundary_violations:t[`boundary-violation`]?e.boundary_violations:[],stale_suppressions:t[`stale-suppressions`]?e.stale_suppressions:[],unused_catalog_entries:t[`unused-catalog-entries`]?e.unused_catalog_entries:[],unresolved_catalog_references:t[`unresolved-catalog-references`]?e.unresolved_catalog_references:[],unused_dependency_overrides:t[`unused-dependency-overrides`]?e.unused_dependency_overrides:[],misconfigured_dependency_overrides:t[`misconfigured-dependency-overrides`]?e.misconfigured_dependency_overrides:[]},r=g(n),i={total_issues:r,unused_files:n.unused_files.length,unused_exports:n.unused_exports.length,unused_types:n.unused_types.length,private_type_leaks:n.private_type_leaks?.length??0,unused_dependencies:n.unused_dependencies.length+n.unused_dev_dependencies.length+(n.unused_optional_dependencies?.length??0),unused_enum_members:n.unused_enum_members.length,unused_class_members:n.unused_class_members.length,unresolved_imports:n.unresolved_imports.length,unlisted_dependencies:n.unlisted_dependencies.length,duplicate_exports:n.duplicate_exports.length,type_only_dependencies:n.type_only_dependencies?.length??0,test_only_dependencies:n.test_only_dependencies?.length??0,circular_dependencies:n.circular_dependencies?.length??0,boundary_violations:n.boundary_violations?.length??0,stale_suppressions:n.stale_suppressions?.length??0,unused_catalog_entries:n.unused_catalog_entries?.length??0,unresolved_catalog_references:n.unresolved_catalog_references?.length??0};return{...n,total_issues:r,summary:i}},ar=()=>{let e=l.workspace.workspaceFolders;return!e||e.length===0?null:e[0].uri.fsPath},or=async()=>await l.window.showWarningMessage(`Fallow: This will unexport unused exports (keeps the code) and remove unused dependencies from package.json. Continue?`,`Yes`,`No`)===`Yes`,sr=async(e,t)=>{if(!t)return;let n=tr(e,t);n&&await l.window.showTextDocument(l.Uri.file(n.absolutePath),{selection:new l.Range(n.line,0,n.line,0)})},cr=async(e,t)=>{if(t.fixes.length===0){l.window.showInformationMessage(`Fallow: no fixes available.`);return}let n=[];for(let e of er(t.fixes)){if(e.action===`apply-all`){n.push({label:``,kind:l.QuickPickItemKind.Separator,action:`navigate`}),n.push({label:`$(play) Apply all fixes`,description:e.description,action:e.action});continue}n.push({label:`$(wrench) ${e.label}`,description:e.description,detail:e.detail,action:e.action,fix:e.fix})}let r=await l.window.showQuickPick(n,{title:`Fallow: ${t.fixes.length} fix${t.fixes.length===1?``:`es`} available`,placeHolder:`Review fixes — select 'Apply all fixes' to apply, or click a fix to navigate`});if(r){if(r.action===`apply-all`){l.commands.executeCommand(`fallow.fix`);return}await sr(e,r.fix)}},lr=async e=>{let t=ar();if(!t)return l.window.showWarningMessage(`Fallow: no workspace folder open.`),{check:null,dupes:null};let n=null,r=null;try{let i=[`--format`,`json`,`--quiet`,`--skip`,`health`];qt()&&i.push(`--production`);let a=Jt();a&&i.push(`--changed-since`,a);let o=Ht();o&&i.push(`--config`,o),i.push(`--dupes-mode`,Kt()),i.push(`--dupes-threshold`,String(Gt()));let s=await rr(e,i,t);if(s.trim().length===0)return{check:n,dupes:r};let c=JSON.parse(s);n=c.check?ir(c.check):null,r=c.dupes??null}catch(e){let t=e instanceof Error?e.message:String(e);throw l.window.showErrorMessage(`Fallow analysis failed: ${t}`),e}return{check:n,dupes:r}},ur=async(e,t)=>{let n=ar();if(!n)return l.window.showWarningMessage(`Fallow: no workspace folder open.`),null;if(!t&&!await or())return null;try{let r=Zn(t,qt()),i=Ht();i&&r.push(`--config`,i);let a=await rr(e,r,n),o=JSON.parse(a);if(t)await cr(n,o);else{let e=o.fixes.length;l.window.showInformationMessage(`Fallow: applied ${e} fix${e===1?``:`es`}.`)}return o}catch(e){let t=e instanceof Error?e.message:String(e);return l.window.showErrorMessage(`Fallow fix failed: ${t}`),null}},dr=`code-duplication`,fr=l.CodeActionKind.QuickFix.append(`fallow.mute`),pr=[`javascript`,`javascriptreact`,`typescript`,`typescriptreact`,`vue`,`svelte`,`astro`,`mdx`,`json`],mr=e=>cn().find(t=>t.code===e)?.label??e,hr=e=>e===1?`category`:`categories`,gr=e=>{if(e.isMutedAll())return`Fallow: hiding all`;let t=e.mutedCategoriesSnapshot().size;return`Fallow: hiding ${t} ${hr(t)}`},_r=e=>{let t=pr.map(e=>({scheme:`file`,language:e})),n=l.languages.createLanguageStatusItem(`fallow.diagnosticMutes`,[]);n.name=`Fallow Mute`,n.accessibilityInformation={label:`Fallow diagnostic mute status`,role:`button`};let r=()=>{if(!e.anythingMuted()){n.selector=[],n.severity=l.LanguageStatusSeverity.Information,n.text=`$(check) Fallow`,n.detail=`all findings visible`,n.command=void 0;return}n.selector=t,n.severity=l.LanguageStatusSeverity.Warning,n.text=`$(eye-closed) ${gr(e)}`,n.detail=`click to manage`,n.command={command:`fallow.manageDiagnosticMutes`,title:`Manage`,tooltip:`Manage Fallow diagnostic mutes`}};return r(),e.onDidChange(r),n},vr={toggleAll:{iconPath:new l.ThemeIcon(`eye-closed`),tooltip:`Toggle mute for ALL Fallow findings`},clearAll:{iconPath:new l.ThemeIcon(`clear-all`),tooltip:`Show all Fallow findings (clear all mutes)`}},yr=async e=>{let t=l.window.createQuickPick();t.title=`Fallow: manage diagnostic mutes (CI is unaffected)`,t.placeholder=`Check categories to hide them in the editor. Press Enter to apply.`,t.canSelectMany=!0,t.matchOnDetail=!0,t.buttons=[vr.toggleAll,vr.clearAll];let n=[{label:`$(eye-closed) All Fallow Findings`,description:e.isMutedAll()?`currently hidden`:`currently visible`,detail:`Global editor-only mute. Use the title buttons to toggle or clear it.`,code:null,picked:e.isMutedAll(),alwaysShow:e.isMutedAll()},...cn().map(({code:t,label:n})=>({label:n,description:t,code:t,picked:e.isMutedAll()||e.isCategoryMuted(t)}))];t.items=n,t.selectedItems=n.filter(e=>e.picked===!0),await new Promise(n=>{t.onDidTriggerButton(n=>{n===vr.toggleAll?e.toggleMutedAll():n===vr.clearAll&&e.clearAllMutes(),t.hide()}),t.onDidAccept(()=>{let n=t.selectedItems.some(e=>e.code===null),r=new Set(t.selectedItems.map(e=>e.code).filter(e=>e!==null));n?e.setMutedAll(!0):(e.isMutedAll()&&e.setMutedAll(!1),e.setMutedCategories(r)),t.hide()}),t.onDidHide(()=>{t.dispose(),n()}),t.show()})},br=e=>{l.commands.executeCommand(`setContext`,`fallow.duplicatesMuted`,e.isCategoryMuted(dr)||e.isMutedAll()),l.commands.executeCommand(`setContext`,`fallow.allDiagnosticsMuted`,e.isMutedAll())};var xr=class{static providedKinds=[fr];provideCodeActions(e,t,n){let r=new Set,i=[];for(let e of n.diagnostics){if(!ln(e))continue;let t=un(e);if(!t||r.has(t))continue;r.add(t);let n=mr(t),a=new l.CodeAction(`Mute Fallow ${n.toLowerCase()} findings in this workspace`,fr);a.command={command:`fallow.muteDiagnosticCategory`,title:`Mute Fallow category`,arguments:[t]},a.diagnostics=[e],i.push(a)}return i}};const Sr=(e,t)=>{let n=_r(t);e.subscriptions.push(n),e.subscriptions.push(t.onDidChange(()=>br(t))),br(t),e.subscriptions.push(l.workspace.onDidCloseTextDocument(e=>{t.evictUri(e.uri)})),e.subscriptions.push(l.commands.registerCommand(`fallow.toggleMuteDuplicates`,()=>{let e=t.toggleCategory(dr);l.window.setStatusBarMessage(e?`Fallow: muted code-duplication findings (CI is unaffected)`:`Fallow: showing code-duplication findings`,4e3)})),e.subscriptions.push(l.commands.registerCommand(`fallow.toggleAllDiagnostics`,()=>{let e=t.toggleMutedAll();l.window.setStatusBarMessage(e?`Fallow: muted all findings (CI is unaffected)`:`Fallow: showing all findings`,4e3)})),e.subscriptions.push(l.commands.registerCommand(`fallow.manageDiagnosticMutes`,async()=>{await yr(t)})),e.subscriptions.push(l.commands.registerCommand(`fallow.clearDiagnosticMutes`,()=>{t.clearAllMutes()})),e.subscriptions.push(l.commands.registerCommand(`fallow.muteDiagnosticCategory`,e=>{typeof e==`string`&&e.length>0&&t.setCategoryMuted(e,!0)}));for(let t of pr)e.subscriptions.push(l.languages.registerCodeActionsProvider({scheme:`file`,language:t},new xr,{providedCodeActionKinds:xr.providedKinds}))},Cr=(e,t)=>({totalIssues:g(e),unusedFiles:e?.unused_files.length??0,unusedExports:e?.unused_exports.length??0,unusedTypes:e?.unused_types.length??0,privateTypeLeaks:e?.private_type_leaks?.length??0,unusedDependencies:e?.unused_dependencies.length??0,unusedDevDependencies:e?.unused_dev_dependencies.length??0,unusedOptionalDependencies:e?.unused_optional_dependencies?.length??0,unusedEnumMembers:e?.unused_enum_members.length??0,unusedClassMembers:e?.unused_class_members.length??0,unresolvedImports:e?.unresolved_imports.length??0,unlistedDependencies:e?.unlisted_dependencies.length??0,duplicateExports:e?.duplicate_exports.length??0,typeOnlyDependencies:e?.type_only_dependencies?.length??0,testOnlyDependencies:e?.test_only_dependencies?.length??0,circularDependencies:e?.circular_dependencies?.length??0,boundaryViolations:e?.boundary_violations?.length??0,staleSuppressions:e?.stale_suppressions?.length??0,unusedCatalogEntries:e?.unused_catalog_entries?.length??0,unresolvedCatalogReferences:e?.unresolved_catalog_references?.length??0,unusedDependencyOverrides:e?.unused_dependency_overrides?.length??0,misconfiguredDependencyOverrides:e?.misconfigured_dependency_overrides?.length??0,duplicationPercentage:t?.stats.duplication_percentage??0,cloneGroups:t?.stats.clone_groups??0}),wr=[{count:`unresolvedImports`,icon:`$(error)`,label:`unresolved imports`},{count:`unusedFiles`,icon:`$(warning)`,label:`unused files`},{count:`unusedExports`,icon:`$(warning)`,label:`unused exports`},{count:`unusedTypes`,icon:`$(info)`,label:`unused types`},{count:`privateTypeLeaks`,icon:`$(warning)`,label:`private type leaks`},{count:`unusedDependencies`,icon:`$(warning)`,label:`unused dependencies`},{count:`unusedDevDependencies`,icon:`$(warning)`,label:`unused dev dependencies`},{count:`unusedOptionalDependencies`,icon:`$(warning)`,label:`unused optional dependencies`},{count:`unusedEnumMembers`,icon:`$(info)`,label:`unused enum members`},{count:`unusedClassMembers`,icon:`$(info)`,label:`unused class members`},{count:`unlistedDependencies`,icon:`$(warning)`,label:`unlisted dependencies`},{count:`duplicateExports`,icon:`$(warning)`,label:`duplicate exports`},{count:`typeOnlyDependencies`,icon:`$(info)`,label:`type-only dependencies`},{count:`testOnlyDependencies`,icon:`$(info)`,label:`test-only dependencies`},{count:`circularDependencies`,icon:`$(warning)`,label:`circular dependencies`},{count:`boundaryViolations`,icon:`$(warning)`,label:`boundary violations`},{count:`staleSuppressions`,icon:`$(info)`,label:`stale suppressions`},{count:`unusedCatalogEntries`,icon:`$(warning)`,label:`unused catalog entries`},{count:`unresolvedCatalogReferences`,icon:`$(error)`,label:`unresolved catalog references`},{count:`unusedDependencyOverrides`,icon:`$(warning)`,label:`unused dependency overrides`},{count:`misconfiguredDependencyOverrides`,icon:`$(error)`,label:`misconfigured dependency overrides`}],Tr=e=>Number.isFinite(e)?e:0,Er=e=>[`${e.totalIssues} issues`,`${Tr(e.duplicationPercentage).toFixed(1)}% duplication`],Dr=e=>e.unresolvedImports>0?`statusBarItem.errorBackground`:e.totalIssues>0?`statusBarItem.warningBackground`:null,Or=e=>e.replace(/\s+/g,` `).trim(),kr=e=>{let t=Or(e);return t.length>48?`${t.slice(0,45).trimEnd()}...`:t},Ar=(e,t)=>t?`${e} (since ${kr(t)})`:e,jr=e=>Or(e).replace(/([\\`*_{}[\]()#+.!|>-])/g,`\\$1`),Mr=(e,t=null)=>{let n=[`**Fallow** - Analysis Results `],r=Tr(e.duplicationPercentage);t&&n.push(`$(git-branch) Scoped to changes since ${jr(t)}`);for(let t of wr){let r=e[t.count];typeof r==`number`&&r>0&&n.push(`${t.icon} ${r} ${t.label}`)}return e.cloneGroups>0&&n.push(`$(copy) ${e.cloneGroups} clone groups (${r.toFixed(1)}% duplication)`),e.totalIssues===0&&e.cloneGroups===0&&n.push(`$(check) No issues found`),n.push(` --- `),n.push(`[$(play) Run Analysis](command:fallow.analyze) · [$(wrench) Auto-Fix](command:fallow.fix) · [$(output) Output](command:fallow.showOutput)`),n.join(` -`)};let Q=null;const Nr=()=>Jt()||null,Pr=()=>(Q=l.window.createStatusBarItem(l.StatusBarAlignment.Left,50),Q.command=`fallow.analyze`,Q.text=Ar(`$(search) Fallow`,Nr()),Q.show(),Q),Fr=(e,t)=>{if(!Q)return;let n=Cr(e,t);Lr(n);let r=[];e&&r.push(`${n.totalIssues} issues`),t&&r.push(`${n.duplicationPercentage.toFixed(1)}% duplication`),Rr(r)},Ir=e=>{Q&&(Lr(e),Rr(Er(e)))},Lr=e=>{if(!Q)return;let t=Dr(e);Q.backgroundColor=t?new l.ThemeColor(t):void 0;let n=new l.MarkdownString(Mr(e,Jt()||null));n.isTrusted=!0,n.supportThemeIcons=!0,Q.tooltip=n},Rr=e=>{if(!Q)return;let t=e.length>0?`$(search) Fallow: ${e.join(` | `)}`:`$(search) Fallow`;Q.text=Ar(t,Nr())},zr=()=>{Q&&(Q.text=Ar(`$(loading~spin) Fallow: Analyzing...`,Nr()))},Br=()=>{Q&&(Q.text=Ar(`$(error) Fallow: Error`,Nr()))},Vr=()=>{Q&&=(Q.dispose(),null)},Hr=(e,t)=>{if(!e)return{absolute:``,relative:``};let n=t&&!d.isAbsolute(e)?d.resolve(t,e):e;return{absolute:n,relative:t?d.relative(t,n):e}},Ur={"unused-files":`Unused Files`,"unused-exports":`Unused Exports`,"unused-types":`Unused Types`,"private-type-leaks":`Private Type Leaks`,"unused-dependencies":`Unused Dependencies`,"unused-dev-dependencies":`Unused Dev Dependencies`,"unused-optional-dependencies":`Unused Optional Dependencies`,"unused-enum-members":`Unused Enum Members`,"unused-class-members":`Unused Class Members`,"unresolved-imports":`Unresolved Imports`,"unlisted-dependencies":`Unlisted Dependencies`,"duplicate-exports":`Duplicate Exports`,"type-only-dependencies":`Type-Only Dependencies`,"test-only-dependencies":`Test-Only Dependencies`,"circular-dependencies":`Circular Dependencies`,"boundary-violation":`Boundary Violations`,"stale-suppressions":`Stale Suppressions`,"unused-catalog-entries":`Unused Catalog Entries`,"unresolved-catalog-references":`Unresolved Catalog References`},Wr=e=>Hr(e,l.workspace.workspaceFolders?.[0]?.uri.fsPath),Gr={"unused-files":`file-code`,"unused-exports":`symbol-method`,"unused-types":`symbol-interface`,"private-type-leaks":`symbol-interface`,"unused-dependencies":`package`,"unused-dev-dependencies":`package`,"unused-optional-dependencies":`package`,"unused-enum-members":`symbol-enum-member`,"unused-class-members":`symbol-field`,"unresolved-imports":`error`,"unlisted-dependencies":`package`,"duplicate-exports":`files`,"type-only-dependencies":`symbol-interface`,"test-only-dependencies":`beaker`,"circular-dependencies":`sync`,"boundary-violation":`symbol-namespace`,"stale-suppressions":`trash`,"unused-catalog-entries":`package`,"unresolved-catalog-references":`error`},Kr={"unused-files":`file`,"unused-exports":`symbol-method`,"unused-types":`symbol-interface`,"private-type-leaks":`symbol-interface`,"unused-dependencies":`package`,"unused-dev-dependencies":`package`,"unused-optional-dependencies":`package`,"unused-enum-members":`symbol-enum-member`,"unused-class-members":`symbol-field`,"unresolved-imports":`error`,"unlisted-dependencies":`package`,"duplicate-exports":`copy`,"type-only-dependencies":`package`,"test-only-dependencies":`beaker`,"circular-dependencies":`sync`,"boundary-violation":`symbol-namespace`,"stale-suppressions":`trash`,"unused-catalog-entries":`package`,"unresolved-catalog-references":`error`},qr=e=>e.type===`jsdoc_tag`?`@expected-unused ${e.export_name}`:e.issue_kind?e.is_file_level?`file ${e.issue_kind}`:e.issue_kind:e.is_file_level?`file suppression`:`line suppression`;var Jr=class extends l.TreeItem{issues;constructor(e,t){super(`${Ur[e]} (${t.length})`,l.TreeItemCollapsibleState.Collapsed),this.category=e,this.issues=t,this.contextValue=`category`,this.iconPath=new l.ThemeIcon(Gr[e]??`warning`)}},$=class extends l.TreeItem{constructor(e,t,n,r,i){super(e,l.TreeItemCollapsibleState.None),this.filePath=t,this.line=n,this.col=r;let{absolute:a,relative:o}=Wr(t);this.description=`${o}:${n}`,this.tooltip=`${e}\n${a}:${n}:${r}`,this.contextValue=`issue`,this.command={command:`vscode.open`,title:`Open File`,arguments:[l.Uri.file(a),{selection:new l.Range(Math.max(0,n-1),r,Math.max(0,n-1),r)}]},this.iconPath=new l.ThemeIcon(Kr[i]??`warning`)}},Yr=class{result=null;view=null;_onDidChangeTreeData=new l.EventEmitter;onDidChangeTreeData=this._onDidChangeTreeData.event;setView(e){this.view=e}update(e){this.result=e,this._onDidChangeTreeData.fire(),this.updateBadge()}updateBadge(){if(!this.view)return;if(!this.result){this.view.badge=void 0;return}let e=g(this.result);this.view.badge=e>0?{value:e,tooltip:`${e} issue${e===1?``:`s`}`}:void 0}getTreeItem(e){return e}getChildren(e){if(e instanceof Jr)return[...e.issues];if(!this.result)return[];let t=[],n=(e,n)=>{n.length>0&&t.push(new Jr(e,n))};return n(`unused-files`,this.result.unused_files.map(e=>new $(d.basename(e.path),e.path,1,0,`unused-files`))),n(`unused-exports`,this.result.unused_exports.map(e=>new $(e.export_name,e.path,e.line,e.col,`unused-exports`))),n(`unused-types`,this.result.unused_types.map(e=>new $(e.export_name,e.path,e.line,e.col,`unused-types`))),n(`private-type-leaks`,(this.result.private_type_leaks??[]).map(e=>new $(`${e.export_name} -> ${e.type_name}`,e.path,e.line,e.col,`private-type-leaks`))),n(`unused-dependencies`,this.result.unused_dependencies.map(e=>new $(e.package_name,e.path,e.line,0,`unused-dependencies`))),n(`unused-dev-dependencies`,this.result.unused_dev_dependencies.map(e=>new $(e.package_name,e.path,e.line,0,`unused-dev-dependencies`))),this.result.unused_optional_dependencies&&n(`unused-optional-dependencies`,this.result.unused_optional_dependencies.map(e=>new $(e.package_name,e.path,e.line,0,`unused-optional-dependencies`))),n(`unused-enum-members`,this.result.unused_enum_members.map(e=>new $(`${e.parent_name}.${e.member_name}`,e.path,e.line,e.col,`unused-enum-members`))),n(`unused-class-members`,this.result.unused_class_members.map(e=>new $(`${e.parent_name}.${e.member_name}`,e.path,e.line,e.col,`unused-class-members`))),n(`unresolved-imports`,this.result.unresolved_imports.map(e=>new $(e.specifier,e.path,e.line,e.col,`unresolved-imports`))),n(`unlisted-dependencies`,this.result.unlisted_dependencies.flatMap(e=>e.imported_from.map(t=>new $(e.package_name,t.path,t.line,t.col,`unlisted-dependencies`)))),n(`duplicate-exports`,this.result.duplicate_exports.flatMap(e=>e.locations.map(t=>new $(e.export_name,t.path,t.line,t.col,`duplicate-exports`)))),this.result.type_only_dependencies&&n(`type-only-dependencies`,this.result.type_only_dependencies.map(e=>new $(e.package_name,e.path,e.line,0,`type-only-dependencies`))),this.result.test_only_dependencies&&n(`test-only-dependencies`,this.result.test_only_dependencies.map(e=>new $(e.package_name,e.path,e.line,0,`test-only-dependencies`))),this.result.circular_dependencies&&n(`circular-dependencies`,this.result.circular_dependencies.map(e=>new $(`${e.length} files`,e.files[0]??``,e.line,e.col,`circular-dependencies`))),this.result.boundary_violations&&n(`boundary-violation`,this.result.boundary_violations.map(e=>new $(`${e.from_zone} -> ${e.to_zone}`,e.from_path,e.line,e.col,`boundary-violation`))),this.result.stale_suppressions&&n(`stale-suppressions`,this.result.stale_suppressions.map(e=>new $(qr(e.origin),e.path,e.line,e.col,`stale-suppressions`))),this.result.unused_catalog_entries&&n(`unused-catalog-entries`,this.result.unused_catalog_entries.map(e=>new $(e.catalog_name===`default`?e.entry_name:`${e.entry_name} (${e.catalog_name})`,e.path,e.line,0,`unused-catalog-entries`))),this.result.unresolved_catalog_references&&n(`unresolved-catalog-references`,this.result.unresolved_catalog_references.map(e=>new $(e.catalog_name===`default`?e.entry_name:`${e.entry_name} (${e.catalog_name})`,e.path,e.line,0,`unresolved-catalog-references`))),t}dispose(){this._onDidChangeTreeData.dispose()}},Xr=class extends l.TreeItem{instances;constructor(e,t){let n=e.instances.map(e=>new Zr(e.file,e.start_line,e.end_line));super(`Clone #${t+1} (${e.line_count} lines, ${e.instances.length} instances)`,l.TreeItemCollapsibleState.Collapsed),this.instances=n,this.contextValue=`cloneFamily`,this.iconPath=new l.ThemeIcon(`files`)}},Zr=class extends l.TreeItem{constructor(e,t,n){let r=d.basename(e);super(`${r}:${t}-${n}`,l.TreeItemCollapsibleState.None),this.filePath=e,this.startLine=t,this.endLine=n;let{absolute:i,relative:a}=Wr(e);this.description=a,this.tooltip=`${i}:${t}-${n}`,this.contextValue=`cloneInstance`,this.command={command:`vscode.open`,title:`Open File`,arguments:[l.Uri.file(i),{selection:new l.Range(Math.max(0,t-1),0,Math.max(0,n-1),0)}]},this.iconPath=new l.ThemeIcon(`copy`)}},Qr=class{result=null;_onDidChangeTreeData=new l.EventEmitter;onDidChangeTreeData=this._onDidChangeTreeData.event;update(e){this.result=e,this._onDidChangeTreeData.fire()}getTreeItem(e){return e}getChildren(e){return e instanceof Xr?[...e.instances]:this.result?this.result.clone_groups.map((e,t)=>new Xr(e,t)):[]}dispose(){this._onDidChangeTreeData.dispose()}};let $r,ei=null,ti=null;const ni=async e=>{$r=l.window.createOutputChannel(`Fallow`),e.subscriptions.push($r);let t=Pr();e.subscriptions.push(t);let n=new dn(e.workspaceState);e.subscriptions.push({dispose:()=>n.dispose()}),Sr(e,n);let r=new Yr,i=new Qr,a=!1,o=async()=>{zr(),await l.window.withProgress({location:l.ProgressLocation.Notification,title:`Fallow: Analyzing...`,cancellable:!1},async()=>{try{let{check:t,dupes:n}=await lr(e);ei=t,ti=n,d(),l.commands.executeCommand(`setContext`,`fallow.hasAnalyzed`,!0);let r=g(t);r>0?l.window.showInformationMessage(`Fallow: found ${r} issue${r===1?``:`s`}. Open the Fallow sidebar to explore.`,`Open Sidebar`).then(e=>{e===`Open Sidebar`&&l.commands.executeCommand(`fallow.deadCode.focus`)}):l.window.showInformationMessage(`Fallow: no issues found.`)}catch{Br()}})},s=l.window.createTreeView(`fallow.deadCode`,{treeDataProvider:r});r.setView(s);let c=l.window.createTreeView(`fallow.duplicates`,{treeDataProvider:i});e.subscriptions.push(s,c);let u=()=>{a||(a=!0,o())};e.subscriptions.push(s.onDidChangeVisibility(e=>{e.visible&&u()})),e.subscriptions.push(c.onDidChangeVisibility(e=>{e.visible&&u()}));let d=()=>{r.update(ei),i.update(ti),Fr(ei,ti)};e.subscriptions.push(l.commands.registerCommand(`fallow.analyze`,async()=>{a=!0,await o()})),e.subscriptions.push(l.commands.registerCommand(`fallow.fix`,async()=>{await l.workspace.saveAll(!1),await ur(e,!1),await Xn(e,$r,n),a=!0,await o()})),e.subscriptions.push(l.commands.registerCommand(`fallow.fixDryRun`,async()=>{await ur(e,!0)})),e.subscriptions.push(l.commands.registerCommand(`fallow.restart`,async()=>{$r.appendLine(`Restarting language server...`),await Xn(e,$r,n)})),e.subscriptions.push(l.commands.registerCommand(`fallow.showOutput`,()=>{$r.show()})),e.subscriptions.push(l.commands.registerCommand(`fallow.openSidebar`,()=>{l.commands.executeCommand(`fallow.deadCode.focus`)})),e.subscriptions.push(l.commands.registerCommand(`fallow.openSettings`,()=>{l.commands.executeCommand(`workbench.action.openSettings`,`fallow`)})),e.subscriptions.push(l.commands.registerCommand(`fallow.noop`,()=>{})),e.subscriptions.push(Xt(async t=>{let r=t.affectsConfiguration(`fallow.lspPath`)||t.affectsConfiguration(`fallow.configPath`)||t.affectsConfiguration(`fallow.trace.server`)||t.affectsConfiguration(`fallow.issueTypes`)||t.affectsConfiguration(`fallow.changedSince`),i=t.affectsConfiguration(`fallow.configPath`)||t.affectsConfiguration(`fallow.production`)||t.affectsConfiguration(`fallow.duplication`)||t.affectsConfiguration(`fallow.issueTypes`)||t.affectsConfiguration(`fallow.changedSince`);r&&($r.appendLine(`Configuration changed, restarting server...`),await Xn(e,$r,n)),i&&o()}));let f=await Jn(e,$r,n);if(f){e.subscriptions.push({dispose:()=>void Yn()});let t=f.onNotification(`fallow/analysisComplete`,e=>{Ir(e),l.commands.executeCommand(`setContext`,`fallow.hasAnalyzed`,!0)});e.subscriptions.push(t)}return e.globalState.get(`fallow.walkthroughShown`)||(e.globalState.update(`fallow.walkthroughShown`,!0),l.commands.executeCommand(`workbench.action.openWalkthrough`,`fallow-rs.fallow-vscode#fallow.gettingStarted`,!1)),{runAnalysis:lr,runFix:ur}},ri=async()=>{Vr(),await Yn()};exports.activate=ni,exports.deactivate=ri; +`)};let Q=null;const Nr=()=>Jt()||null,Pr=()=>(Q=l.window.createStatusBarItem(l.StatusBarAlignment.Left,50),Q.command=`fallow.analyze`,Q.text=Ar(`$(search) Fallow`,Nr()),Q.show(),Q),Fr=(e,t)=>{if(!Q)return;let n=Cr(e,t);Lr(n);let r=[];e&&r.push(`${n.totalIssues} issues`),t&&r.push(`${n.duplicationPercentage.toFixed(1)}% duplication`),Rr(r)},Ir=e=>{Q&&(Lr(e),Rr(Er(e)))},Lr=e=>{if(!Q)return;let t=Dr(e);Q.backgroundColor=t?new l.ThemeColor(t):void 0;let n=new l.MarkdownString(Mr(e,Jt()||null));n.isTrusted=!0,n.supportThemeIcons=!0,Q.tooltip=n},Rr=e=>{if(!Q)return;let t=e.length>0?`$(search) Fallow: ${e.join(` | `)}`:`$(search) Fallow`;Q.text=Ar(t,Nr())},zr=()=>{Q&&(Q.text=Ar(`$(loading~spin) Fallow: Analyzing...`,Nr()))},Br=()=>{Q&&(Q.text=Ar(`$(error) Fallow: Error`,Nr()))},Vr=()=>{Q&&=(Q.dispose(),null)},Hr=(e,t)=>{if(!e)return{absolute:``,relative:``};let n=t&&!d.isAbsolute(e)?d.resolve(t,e):e;return{absolute:n,relative:t?d.relative(t,n):e}},Ur={"unused-files":`Unused Files`,"unused-exports":`Unused Exports`,"unused-types":`Unused Types`,"private-type-leaks":`Private Type Leaks`,"unused-dependencies":`Unused Dependencies`,"unused-dev-dependencies":`Unused Dev Dependencies`,"unused-optional-dependencies":`Unused Optional Dependencies`,"unused-enum-members":`Unused Enum Members`,"unused-class-members":`Unused Class Members`,"unresolved-imports":`Unresolved Imports`,"unlisted-dependencies":`Unlisted Dependencies`,"duplicate-exports":`Duplicate Exports`,"type-only-dependencies":`Type-Only Dependencies`,"test-only-dependencies":`Test-Only Dependencies`,"circular-dependencies":`Circular Dependencies`,"boundary-violation":`Boundary Violations`,"stale-suppressions":`Stale Suppressions`,"unused-catalog-entries":`Unused Catalog Entries`,"unresolved-catalog-references":`Unresolved Catalog References`,"unused-dependency-overrides":`Unused Dependency Overrides`,"misconfigured-dependency-overrides":`Misconfigured Dependency Overrides`},Wr=e=>Hr(e,l.workspace.workspaceFolders?.[0]?.uri.fsPath),Gr={"unused-files":`file-code`,"unused-exports":`symbol-method`,"unused-types":`symbol-interface`,"private-type-leaks":`symbol-interface`,"unused-dependencies":`package`,"unused-dev-dependencies":`package`,"unused-optional-dependencies":`package`,"unused-enum-members":`symbol-enum-member`,"unused-class-members":`symbol-field`,"unresolved-imports":`error`,"unlisted-dependencies":`package`,"duplicate-exports":`files`,"type-only-dependencies":`symbol-interface`,"test-only-dependencies":`beaker`,"circular-dependencies":`sync`,"boundary-violation":`symbol-namespace`,"stale-suppressions":`trash`,"unused-catalog-entries":`package`,"unresolved-catalog-references":`error`,"unused-dependency-overrides":`package`,"misconfigured-dependency-overrides":`error`},Kr={"unused-files":`file`,"unused-exports":`symbol-method`,"unused-types":`symbol-interface`,"private-type-leaks":`symbol-interface`,"unused-dependencies":`package`,"unused-dev-dependencies":`package`,"unused-optional-dependencies":`package`,"unused-enum-members":`symbol-enum-member`,"unused-class-members":`symbol-field`,"unresolved-imports":`error`,"unlisted-dependencies":`package`,"duplicate-exports":`copy`,"type-only-dependencies":`package`,"test-only-dependencies":`beaker`,"circular-dependencies":`sync`,"boundary-violation":`symbol-namespace`,"stale-suppressions":`trash`,"unused-catalog-entries":`package`,"unresolved-catalog-references":`error`,"unused-dependency-overrides":`package`,"misconfigured-dependency-overrides":`error`},qr=e=>e.type===`jsdoc_tag`?`@expected-unused ${e.export_name}`:e.issue_kind?e.is_file_level?`file ${e.issue_kind}`:e.issue_kind:e.is_file_level?`file suppression`:`line suppression`;var Jr=class extends l.TreeItem{issues;constructor(e,t){super(`${Ur[e]} (${t.length})`,l.TreeItemCollapsibleState.Collapsed),this.category=e,this.issues=t,this.contextValue=`category`,this.iconPath=new l.ThemeIcon(Gr[e]??`warning`)}},$=class extends l.TreeItem{constructor(e,t,n,r,i){super(e,l.TreeItemCollapsibleState.None),this.filePath=t,this.line=n,this.col=r;let{absolute:a,relative:o}=Wr(t);this.description=`${o}:${n}`,this.tooltip=`${e}\n${a}:${n}:${r}`,this.contextValue=`issue`,this.command={command:`vscode.open`,title:`Open File`,arguments:[l.Uri.file(a),{selection:new l.Range(Math.max(0,n-1),r,Math.max(0,n-1),r)}]},this.iconPath=new l.ThemeIcon(Kr[i]??`warning`)}},Yr=class{result=null;view=null;_onDidChangeTreeData=new l.EventEmitter;onDidChangeTreeData=this._onDidChangeTreeData.event;setView(e){this.view=e}update(e){this.result=e,this._onDidChangeTreeData.fire(),this.updateBadge()}updateBadge(){if(!this.view)return;if(!this.result){this.view.badge=void 0;return}let e=g(this.result);this.view.badge=e>0?{value:e,tooltip:`${e} issue${e===1?``:`s`}`}:void 0}getTreeItem(e){return e}getChildren(e){if(e instanceof Jr)return[...e.issues];if(!this.result)return[];let t=[],n=(e,n)=>{n.length>0&&t.push(new Jr(e,n))};return n(`unused-files`,this.result.unused_files.map(e=>new $(d.basename(e.path),e.path,1,0,`unused-files`))),n(`unused-exports`,this.result.unused_exports.map(e=>new $(e.export_name,e.path,e.line,e.col,`unused-exports`))),n(`unused-types`,this.result.unused_types.map(e=>new $(e.export_name,e.path,e.line,e.col,`unused-types`))),n(`private-type-leaks`,(this.result.private_type_leaks??[]).map(e=>new $(`${e.export_name} -> ${e.type_name}`,e.path,e.line,e.col,`private-type-leaks`))),n(`unused-dependencies`,this.result.unused_dependencies.map(e=>new $(e.package_name,e.path,e.line,0,`unused-dependencies`))),n(`unused-dev-dependencies`,this.result.unused_dev_dependencies.map(e=>new $(e.package_name,e.path,e.line,0,`unused-dev-dependencies`))),this.result.unused_optional_dependencies&&n(`unused-optional-dependencies`,this.result.unused_optional_dependencies.map(e=>new $(e.package_name,e.path,e.line,0,`unused-optional-dependencies`))),n(`unused-enum-members`,this.result.unused_enum_members.map(e=>new $(`${e.parent_name}.${e.member_name}`,e.path,e.line,e.col,`unused-enum-members`))),n(`unused-class-members`,this.result.unused_class_members.map(e=>new $(`${e.parent_name}.${e.member_name}`,e.path,e.line,e.col,`unused-class-members`))),n(`unresolved-imports`,this.result.unresolved_imports.map(e=>new $(e.specifier,e.path,e.line,e.col,`unresolved-imports`))),n(`unlisted-dependencies`,this.result.unlisted_dependencies.flatMap(e=>e.imported_from.map(t=>new $(e.package_name,t.path,t.line,t.col,`unlisted-dependencies`)))),n(`duplicate-exports`,this.result.duplicate_exports.flatMap(e=>e.locations.map(t=>new $(e.export_name,t.path,t.line,t.col,`duplicate-exports`)))),this.result.type_only_dependencies&&n(`type-only-dependencies`,this.result.type_only_dependencies.map(e=>new $(e.package_name,e.path,e.line,0,`type-only-dependencies`))),this.result.test_only_dependencies&&n(`test-only-dependencies`,this.result.test_only_dependencies.map(e=>new $(e.package_name,e.path,e.line,0,`test-only-dependencies`))),this.result.circular_dependencies&&n(`circular-dependencies`,this.result.circular_dependencies.map(e=>new $(`${e.length} files`,e.files[0]??``,e.line,e.col,`circular-dependencies`))),this.result.boundary_violations&&n(`boundary-violation`,this.result.boundary_violations.map(e=>new $(`${e.from_zone} -> ${e.to_zone}`,e.from_path,e.line,e.col,`boundary-violation`))),this.result.stale_suppressions&&n(`stale-suppressions`,this.result.stale_suppressions.map(e=>new $(qr(e.origin),e.path,e.line,e.col,`stale-suppressions`))),this.result.unused_catalog_entries&&n(`unused-catalog-entries`,this.result.unused_catalog_entries.map(e=>new $(e.catalog_name===`default`?e.entry_name:`${e.entry_name} (${e.catalog_name})`,e.path,e.line,0,`unused-catalog-entries`))),this.result.unresolved_catalog_references&&n(`unresolved-catalog-references`,this.result.unresolved_catalog_references.map(e=>new $(e.catalog_name===`default`?e.entry_name:`${e.entry_name} (${e.catalog_name})`,e.path,e.line,0,`unresolved-catalog-references`))),this.result.unused_dependency_overrides&&n(`unused-dependency-overrides`,this.result.unused_dependency_overrides.map(e=>new $(`${e.raw_key} (${e.source})`,e.path,e.line,0,`unused-dependency-overrides`))),this.result.misconfigured_dependency_overrides&&n(`misconfigured-dependency-overrides`,this.result.misconfigured_dependency_overrides.map(e=>new $(`${e.raw_key} (${e.source})`,e.path,e.line,0,`misconfigured-dependency-overrides`))),t}dispose(){this._onDidChangeTreeData.dispose()}},Xr=class extends l.TreeItem{instances;constructor(e,t){let n=e.instances.map(e=>new Zr(e.file,e.start_line,e.end_line));super(`Clone #${t+1} (${e.line_count} lines, ${e.instances.length} instances)`,l.TreeItemCollapsibleState.Collapsed),this.instances=n,this.contextValue=`cloneFamily`,this.iconPath=new l.ThemeIcon(`files`)}},Zr=class extends l.TreeItem{constructor(e,t,n){let r=d.basename(e);super(`${r}:${t}-${n}`,l.TreeItemCollapsibleState.None),this.filePath=e,this.startLine=t,this.endLine=n;let{absolute:i,relative:a}=Wr(e);this.description=a,this.tooltip=`${i}:${t}-${n}`,this.contextValue=`cloneInstance`,this.command={command:`vscode.open`,title:`Open File`,arguments:[l.Uri.file(i),{selection:new l.Range(Math.max(0,t-1),0,Math.max(0,n-1),0)}]},this.iconPath=new l.ThemeIcon(`copy`)}},Qr=class{result=null;_onDidChangeTreeData=new l.EventEmitter;onDidChangeTreeData=this._onDidChangeTreeData.event;update(e){this.result=e,this._onDidChangeTreeData.fire()}getTreeItem(e){return e}getChildren(e){return e instanceof Xr?[...e.instances]:this.result?this.result.clone_groups.map((e,t)=>new Xr(e,t)):[]}dispose(){this._onDidChangeTreeData.dispose()}};let $r,ei=null,ti=null;const ni=async e=>{$r=l.window.createOutputChannel(`Fallow`),e.subscriptions.push($r);let t=Pr();e.subscriptions.push(t);let n=new dn(e.workspaceState);e.subscriptions.push({dispose:()=>n.dispose()}),Sr(e,n);let r=new Yr,i=new Qr,a=!1,o=async()=>{zr(),await l.window.withProgress({location:l.ProgressLocation.Notification,title:`Fallow: Analyzing...`,cancellable:!1},async()=>{try{let{check:t,dupes:n}=await lr(e);ei=t,ti=n,d(),l.commands.executeCommand(`setContext`,`fallow.hasAnalyzed`,!0);let r=g(t);r>0?l.window.showInformationMessage(`Fallow: found ${r} issue${r===1?``:`s`}. Open the Fallow sidebar to explore.`,`Open Sidebar`).then(e=>{e===`Open Sidebar`&&l.commands.executeCommand(`fallow.deadCode.focus`)}):l.window.showInformationMessage(`Fallow: no issues found.`)}catch{Br()}})},s=l.window.createTreeView(`fallow.deadCode`,{treeDataProvider:r});r.setView(s);let c=l.window.createTreeView(`fallow.duplicates`,{treeDataProvider:i});e.subscriptions.push(s,c);let u=()=>{a||(a=!0,o())};e.subscriptions.push(s.onDidChangeVisibility(e=>{e.visible&&u()})),e.subscriptions.push(c.onDidChangeVisibility(e=>{e.visible&&u()}));let d=()=>{r.update(ei),i.update(ti),Fr(ei,ti)};e.subscriptions.push(l.commands.registerCommand(`fallow.analyze`,async()=>{a=!0,await o()})),e.subscriptions.push(l.commands.registerCommand(`fallow.fix`,async()=>{await l.workspace.saveAll(!1),await ur(e,!1),await Xn(e,$r,n),a=!0,await o()})),e.subscriptions.push(l.commands.registerCommand(`fallow.fixDryRun`,async()=>{await ur(e,!0)})),e.subscriptions.push(l.commands.registerCommand(`fallow.restart`,async()=>{$r.appendLine(`Restarting language server...`),await Xn(e,$r,n)})),e.subscriptions.push(l.commands.registerCommand(`fallow.showOutput`,()=>{$r.show()})),e.subscriptions.push(l.commands.registerCommand(`fallow.openSidebar`,()=>{l.commands.executeCommand(`fallow.deadCode.focus`)})),e.subscriptions.push(l.commands.registerCommand(`fallow.openSettings`,()=>{l.commands.executeCommand(`workbench.action.openSettings`,`fallow`)})),e.subscriptions.push(l.commands.registerCommand(`fallow.noop`,()=>{})),e.subscriptions.push(Xt(async t=>{let r=t.affectsConfiguration(`fallow.lspPath`)||t.affectsConfiguration(`fallow.configPath`)||t.affectsConfiguration(`fallow.trace.server`)||t.affectsConfiguration(`fallow.issueTypes`)||t.affectsConfiguration(`fallow.changedSince`),i=t.affectsConfiguration(`fallow.configPath`)||t.affectsConfiguration(`fallow.production`)||t.affectsConfiguration(`fallow.duplication`)||t.affectsConfiguration(`fallow.issueTypes`)||t.affectsConfiguration(`fallow.changedSince`);r&&($r.appendLine(`Configuration changed, restarting server...`),await Xn(e,$r,n)),i&&o()}));let f=await Jn(e,$r,n);if(f){e.subscriptions.push({dispose:()=>void Yn()});let t=f.onNotification(`fallow/analysisComplete`,e=>{Ir(e),l.commands.executeCommand(`setContext`,`fallow.hasAnalyzed`,!0)});e.subscriptions.push(t)}return e.globalState.get(`fallow.walkthroughShown`)||(e.globalState.update(`fallow.walkthroughShown`,!0),l.commands.executeCommand(`workbench.action.openWalkthrough`,`fallow-rs.fallow-vscode#fallow.gettingStarted`,!1)),{runAnalysis:lr,runFix:ur}},ri=async()=>{Vr(),await Yn()};exports.activate=ni,exports.deactivate=ri; //# sourceMappingURL=extension.js.map \ No newline at end of file diff --git a/editors/vscode/dist/extension.js.map b/editors/vscode/dist/extension.js.map index b1f74f0e0..5080a356b 100644 --- a/editors/vscode/dist/extension.js.map +++ b/editors/vscode/dist/extension.js.map @@ -1 +1 @@ -{"version":3,"file":"extension.js","names":["exports","path","exports","exports","exports","code","code","code","vscode","vscode","code","code","code","code","code","code","vscode_1","vscode_1","vscode_1","vscode","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode","code","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","candidate","cp","exports","exports","path","os","path","fs","os","https","fs","path","fs","TransportKind","LanguageClient","Trace","path","path","fs","child_process","resolveFilePath","path","resolveFilePathPure","path"],"sources":["../src/analysis-utils.ts","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/utils/is.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/node/ril.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/node/main.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/node.js","../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/umd/main.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/node/main.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/utils/async.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolCompletionItem.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolCodeLens.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolDocumentLink.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolCodeAction.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolDiagnostic.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolCallHierarchyItem.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolTypeHierarchyItem.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolWorkspaceSymbol.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolInlayHint.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/codeConverter.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolConverter.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/utils/uuid.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/progressPart.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/features.js","../node_modules/.pnpm/minimatch@5.1.9/node_modules/minimatch/lib/path.js","../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js","../node_modules/.pnpm/brace-expansion@2.1.0/node_modules/brace-expansion/index.js","../node_modules/.pnpm/minimatch@5.1.9/node_modules/minimatch/minimatch.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/diagnostic.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/notebook.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/configuration.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/textSynchronization.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/completion.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/hover.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/definition.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/signatureHelp.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/documentHighlight.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/documentSymbol.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/workspaceSymbol.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/reference.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/codeAction.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/codeLens.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/formatting.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/rename.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/documentLink.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/executeCommand.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/fileSystemWatcher.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/colorProvider.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/implementation.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/typeDefinition.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/workspaceFolder.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/foldingRange.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/declaration.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/selectionRange.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/progress.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/callHierarchy.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/semanticTokens.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/fileOperations.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/linkedEditingRange.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/typeHierarchy.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/inlineValue.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/inlayHint.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/inlineCompletion.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/client.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/node/processes.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/node.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/api.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/node/main.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/node.js","../src/config.ts","../src/binary-utils.ts","../src/diagnosticFilter.ts","../src/download.ts","../src/client.ts","../src/fix-utils.ts","../src/commands.ts","../src/diagnosticMute.ts","../src/statusBar-utils.ts","../src/statusBar.ts","../src/treeView-utils.ts","../src/labels.ts","../src/treeView.ts","../src/extension.ts"],"sourcesContent":["import type { FallowCheckResult } from \"./types.js\";\n\nexport const countCheckIssues = (result: FallowCheckResult | null): number => {\n if (!result) {\n return 0;\n }\n\n return (\n result.unused_files.length +\n result.unused_exports.length +\n result.unused_types.length +\n (result.private_type_leaks?.length ?? 0) +\n result.unused_dependencies.length +\n result.unused_dev_dependencies.length +\n (result.unused_optional_dependencies?.length ?? 0) +\n result.unused_enum_members.length +\n result.unused_class_members.length +\n result.unresolved_imports.length +\n result.unlisted_dependencies.length +\n result.duplicate_exports.length +\n (result.type_only_dependencies?.length ?? 0) +\n (result.test_only_dependencies?.length ?? 0) +\n (result.circular_dependencies?.length ?? 0) +\n (result.boundary_violations?.length ?? 0) +\n (result.stale_suppressions?.length ?? 0) +\n (result.unused_catalog_entries?.length ?? 0) +\n (result.unresolved_catalog_references?.length ?? 0)\n );\n};\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.asPromise = exports.thenable = exports.typedArray = exports.stringArray = exports.array = exports.func = exports.error = exports.number = exports.string = exports.boolean = void 0;\nfunction boolean(value) {\n return value === true || value === false;\n}\nexports.boolean = boolean;\nfunction string(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexports.string = string;\nfunction number(value) {\n return typeof value === 'number' || value instanceof Number;\n}\nexports.number = number;\nfunction error(value) {\n return value instanceof Error;\n}\nexports.error = error;\nfunction func(value) {\n return typeof value === 'function';\n}\nexports.func = func;\nfunction array(value) {\n return Array.isArray(value);\n}\nexports.array = array;\nfunction stringArray(value) {\n return array(value) && value.every(elem => string(elem));\n}\nexports.stringArray = stringArray;\nfunction typedArray(value, check) {\n return Array.isArray(value) && value.every(check);\n}\nexports.typedArray = typedArray;\nfunction thenable(value) {\n return value && func(value.then);\n}\nexports.thenable = thenable;\nfunction asPromise(value) {\n if (value instanceof Promise) {\n return value;\n }\n else if (thenable(value)) {\n return new Promise((resolve, reject) => {\n value.then((resolved) => resolve(resolved), (error) => reject(error));\n });\n }\n else {\n return Promise.resolve(value);\n }\n}\nexports.asPromise = asPromise;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.stringArray = exports.array = exports.func = exports.error = exports.number = exports.string = exports.boolean = void 0;\nfunction boolean(value) {\n return value === true || value === false;\n}\nexports.boolean = boolean;\nfunction string(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexports.string = string;\nfunction number(value) {\n return typeof value === 'number' || value instanceof Number;\n}\nexports.number = number;\nfunction error(value) {\n return value instanceof Error;\n}\nexports.error = error;\nfunction func(value) {\n return typeof value === 'function';\n}\nexports.func = func;\nfunction array(value) {\n return Array.isArray(value);\n}\nexports.array = array;\nfunction stringArray(value) {\n return array(value) && value.every(elem => string(elem));\n}\nexports.stringArray = stringArray;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Message = exports.NotificationType9 = exports.NotificationType8 = exports.NotificationType7 = exports.NotificationType6 = exports.NotificationType5 = exports.NotificationType4 = exports.NotificationType3 = exports.NotificationType2 = exports.NotificationType1 = exports.NotificationType0 = exports.NotificationType = exports.RequestType9 = exports.RequestType8 = exports.RequestType7 = exports.RequestType6 = exports.RequestType5 = exports.RequestType4 = exports.RequestType3 = exports.RequestType2 = exports.RequestType1 = exports.RequestType = exports.RequestType0 = exports.AbstractMessageSignature = exports.ParameterStructures = exports.ResponseError = exports.ErrorCodes = void 0;\nconst is = require(\"./is\");\n/**\n * Predefined error codes.\n */\nvar ErrorCodes;\n(function (ErrorCodes) {\n // Defined by JSON RPC\n ErrorCodes.ParseError = -32700;\n ErrorCodes.InvalidRequest = -32600;\n ErrorCodes.MethodNotFound = -32601;\n ErrorCodes.InvalidParams = -32602;\n ErrorCodes.InternalError = -32603;\n /**\n * This is the start range of JSON RPC reserved error codes.\n * It doesn't denote a real error code. No application error codes should\n * be defined between the start and end range. For backwards\n * compatibility the `ServerNotInitialized` and the `UnknownErrorCode`\n * are left in the range.\n *\n * @since 3.16.0\n */\n ErrorCodes.jsonrpcReservedErrorRangeStart = -32099;\n /** @deprecated use jsonrpcReservedErrorRangeStart */\n ErrorCodes.serverErrorStart = -32099;\n /**\n * An error occurred when write a message to the transport layer.\n */\n ErrorCodes.MessageWriteError = -32099;\n /**\n * An error occurred when reading a message from the transport layer.\n */\n ErrorCodes.MessageReadError = -32098;\n /**\n * The connection got disposed or lost and all pending responses got\n * rejected.\n */\n ErrorCodes.PendingResponseRejected = -32097;\n /**\n * The connection is inactive and a use of it failed.\n */\n ErrorCodes.ConnectionInactive = -32096;\n /**\n * Error code indicating that a server received a notification or\n * request before the server has received the `initialize` request.\n */\n ErrorCodes.ServerNotInitialized = -32002;\n ErrorCodes.UnknownErrorCode = -32001;\n /**\n * This is the end range of JSON RPC reserved error codes.\n * It doesn't denote a real error code.\n *\n * @since 3.16.0\n */\n ErrorCodes.jsonrpcReservedErrorRangeEnd = -32000;\n /** @deprecated use jsonrpcReservedErrorRangeEnd */\n ErrorCodes.serverErrorEnd = -32000;\n})(ErrorCodes || (exports.ErrorCodes = ErrorCodes = {}));\n/**\n * An error object return in a response in case a request\n * has failed.\n */\nclass ResponseError extends Error {\n constructor(code, message, data) {\n super(message);\n this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode;\n this.data = data;\n Object.setPrototypeOf(this, ResponseError.prototype);\n }\n toJson() {\n const result = {\n code: this.code,\n message: this.message\n };\n if (this.data !== undefined) {\n result.data = this.data;\n }\n return result;\n }\n}\nexports.ResponseError = ResponseError;\nclass ParameterStructures {\n constructor(kind) {\n this.kind = kind;\n }\n static is(value) {\n return value === ParameterStructures.auto || value === ParameterStructures.byName || value === ParameterStructures.byPosition;\n }\n toString() {\n return this.kind;\n }\n}\nexports.ParameterStructures = ParameterStructures;\n/**\n * The parameter structure is automatically inferred on the number of parameters\n * and the parameter type in case of a single param.\n */\nParameterStructures.auto = new ParameterStructures('auto');\n/**\n * Forces `byPosition` parameter structure. This is useful if you have a single\n * parameter which has a literal type.\n */\nParameterStructures.byPosition = new ParameterStructures('byPosition');\n/**\n * Forces `byName` parameter structure. This is only useful when having a single\n * parameter. The library will report errors if used with a different number of\n * parameters.\n */\nParameterStructures.byName = new ParameterStructures('byName');\n/**\n * An abstract implementation of a MessageType.\n */\nclass AbstractMessageSignature {\n constructor(method, numberOfParams) {\n this.method = method;\n this.numberOfParams = numberOfParams;\n }\n get parameterStructures() {\n return ParameterStructures.auto;\n }\n}\nexports.AbstractMessageSignature = AbstractMessageSignature;\n/**\n * Classes to type request response pairs\n */\nclass RequestType0 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 0);\n }\n}\nexports.RequestType0 = RequestType0;\nclass RequestType extends AbstractMessageSignature {\n constructor(method, _parameterStructures = ParameterStructures.auto) {\n super(method, 1);\n this._parameterStructures = _parameterStructures;\n }\n get parameterStructures() {\n return this._parameterStructures;\n }\n}\nexports.RequestType = RequestType;\nclass RequestType1 extends AbstractMessageSignature {\n constructor(method, _parameterStructures = ParameterStructures.auto) {\n super(method, 1);\n this._parameterStructures = _parameterStructures;\n }\n get parameterStructures() {\n return this._parameterStructures;\n }\n}\nexports.RequestType1 = RequestType1;\nclass RequestType2 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 2);\n }\n}\nexports.RequestType2 = RequestType2;\nclass RequestType3 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 3);\n }\n}\nexports.RequestType3 = RequestType3;\nclass RequestType4 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 4);\n }\n}\nexports.RequestType4 = RequestType4;\nclass RequestType5 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 5);\n }\n}\nexports.RequestType5 = RequestType5;\nclass RequestType6 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 6);\n }\n}\nexports.RequestType6 = RequestType6;\nclass RequestType7 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 7);\n }\n}\nexports.RequestType7 = RequestType7;\nclass RequestType8 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 8);\n }\n}\nexports.RequestType8 = RequestType8;\nclass RequestType9 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 9);\n }\n}\nexports.RequestType9 = RequestType9;\nclass NotificationType extends AbstractMessageSignature {\n constructor(method, _parameterStructures = ParameterStructures.auto) {\n super(method, 1);\n this._parameterStructures = _parameterStructures;\n }\n get parameterStructures() {\n return this._parameterStructures;\n }\n}\nexports.NotificationType = NotificationType;\nclass NotificationType0 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 0);\n }\n}\nexports.NotificationType0 = NotificationType0;\nclass NotificationType1 extends AbstractMessageSignature {\n constructor(method, _parameterStructures = ParameterStructures.auto) {\n super(method, 1);\n this._parameterStructures = _parameterStructures;\n }\n get parameterStructures() {\n return this._parameterStructures;\n }\n}\nexports.NotificationType1 = NotificationType1;\nclass NotificationType2 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 2);\n }\n}\nexports.NotificationType2 = NotificationType2;\nclass NotificationType3 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 3);\n }\n}\nexports.NotificationType3 = NotificationType3;\nclass NotificationType4 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 4);\n }\n}\nexports.NotificationType4 = NotificationType4;\nclass NotificationType5 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 5);\n }\n}\nexports.NotificationType5 = NotificationType5;\nclass NotificationType6 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 6);\n }\n}\nexports.NotificationType6 = NotificationType6;\nclass NotificationType7 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 7);\n }\n}\nexports.NotificationType7 = NotificationType7;\nclass NotificationType8 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 8);\n }\n}\nexports.NotificationType8 = NotificationType8;\nclass NotificationType9 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 9);\n }\n}\nexports.NotificationType9 = NotificationType9;\nvar Message;\n(function (Message) {\n /**\n * Tests if the given message is a request message\n */\n function isRequest(message) {\n const candidate = message;\n return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id));\n }\n Message.isRequest = isRequest;\n /**\n * Tests if the given message is a notification message\n */\n function isNotification(message) {\n const candidate = message;\n return candidate && is.string(candidate.method) && message.id === void 0;\n }\n Message.isNotification = isNotification;\n /**\n * Tests if the given message is a response message\n */\n function isResponse(message) {\n const candidate = message;\n return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);\n }\n Message.isResponse = isResponse;\n})(Message || (exports.Message = Message = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LRUCache = exports.LinkedMap = exports.Touch = void 0;\nvar Touch;\n(function (Touch) {\n Touch.None = 0;\n Touch.First = 1;\n Touch.AsOld = Touch.First;\n Touch.Last = 2;\n Touch.AsNew = Touch.Last;\n})(Touch || (exports.Touch = Touch = {}));\nclass LinkedMap {\n constructor() {\n this[_a] = 'LinkedMap';\n this._map = new Map();\n this._head = undefined;\n this._tail = undefined;\n this._size = 0;\n this._state = 0;\n }\n clear() {\n this._map.clear();\n this._head = undefined;\n this._tail = undefined;\n this._size = 0;\n this._state++;\n }\n isEmpty() {\n return !this._head && !this._tail;\n }\n get size() {\n return this._size;\n }\n get first() {\n return this._head?.value;\n }\n get last() {\n return this._tail?.value;\n }\n has(key) {\n return this._map.has(key);\n }\n get(key, touch = Touch.None) {\n const item = this._map.get(key);\n if (!item) {\n return undefined;\n }\n if (touch !== Touch.None) {\n this.touch(item, touch);\n }\n return item.value;\n }\n set(key, value, touch = Touch.None) {\n let item = this._map.get(key);\n if (item) {\n item.value = value;\n if (touch !== Touch.None) {\n this.touch(item, touch);\n }\n }\n else {\n item = { key, value, next: undefined, previous: undefined };\n switch (touch) {\n case Touch.None:\n this.addItemLast(item);\n break;\n case Touch.First:\n this.addItemFirst(item);\n break;\n case Touch.Last:\n this.addItemLast(item);\n break;\n default:\n this.addItemLast(item);\n break;\n }\n this._map.set(key, item);\n this._size++;\n }\n return this;\n }\n delete(key) {\n return !!this.remove(key);\n }\n remove(key) {\n const item = this._map.get(key);\n if (!item) {\n return undefined;\n }\n this._map.delete(key);\n this.removeItem(item);\n this._size--;\n return item.value;\n }\n shift() {\n if (!this._head && !this._tail) {\n return undefined;\n }\n if (!this._head || !this._tail) {\n throw new Error('Invalid list');\n }\n const item = this._head;\n this._map.delete(item.key);\n this.removeItem(item);\n this._size--;\n return item.value;\n }\n forEach(callbackfn, thisArg) {\n const state = this._state;\n let current = this._head;\n while (current) {\n if (thisArg) {\n callbackfn.bind(thisArg)(current.value, current.key, this);\n }\n else {\n callbackfn(current.value, current.key, this);\n }\n if (this._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n current = current.next;\n }\n }\n keys() {\n const state = this._state;\n let current = this._head;\n const iterator = {\n [Symbol.iterator]: () => {\n return iterator;\n },\n next: () => {\n if (this._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: current.key, done: false };\n current = current.next;\n return result;\n }\n else {\n return { value: undefined, done: true };\n }\n }\n };\n return iterator;\n }\n values() {\n const state = this._state;\n let current = this._head;\n const iterator = {\n [Symbol.iterator]: () => {\n return iterator;\n },\n next: () => {\n if (this._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: current.value, done: false };\n current = current.next;\n return result;\n }\n else {\n return { value: undefined, done: true };\n }\n }\n };\n return iterator;\n }\n entries() {\n const state = this._state;\n let current = this._head;\n const iterator = {\n [Symbol.iterator]: () => {\n return iterator;\n },\n next: () => {\n if (this._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: [current.key, current.value], done: false };\n current = current.next;\n return result;\n }\n else {\n return { value: undefined, done: true };\n }\n }\n };\n return iterator;\n }\n [(_a = Symbol.toStringTag, Symbol.iterator)]() {\n return this.entries();\n }\n trimOld(newSize) {\n if (newSize >= this.size) {\n return;\n }\n if (newSize === 0) {\n this.clear();\n return;\n }\n let current = this._head;\n let currentSize = this.size;\n while (current && currentSize > newSize) {\n this._map.delete(current.key);\n current = current.next;\n currentSize--;\n }\n this._head = current;\n this._size = currentSize;\n if (current) {\n current.previous = undefined;\n }\n this._state++;\n }\n addItemFirst(item) {\n // First time Insert\n if (!this._head && !this._tail) {\n this._tail = item;\n }\n else if (!this._head) {\n throw new Error('Invalid list');\n }\n else {\n item.next = this._head;\n this._head.previous = item;\n }\n this._head = item;\n this._state++;\n }\n addItemLast(item) {\n // First time Insert\n if (!this._head && !this._tail) {\n this._head = item;\n }\n else if (!this._tail) {\n throw new Error('Invalid list');\n }\n else {\n item.previous = this._tail;\n this._tail.next = item;\n }\n this._tail = item;\n this._state++;\n }\n removeItem(item) {\n if (item === this._head && item === this._tail) {\n this._head = undefined;\n this._tail = undefined;\n }\n else if (item === this._head) {\n // This can only happened if size === 1 which is handle\n // by the case above.\n if (!item.next) {\n throw new Error('Invalid list');\n }\n item.next.previous = undefined;\n this._head = item.next;\n }\n else if (item === this._tail) {\n // This can only happened if size === 1 which is handle\n // by the case above.\n if (!item.previous) {\n throw new Error('Invalid list');\n }\n item.previous.next = undefined;\n this._tail = item.previous;\n }\n else {\n const next = item.next;\n const previous = item.previous;\n if (!next || !previous) {\n throw new Error('Invalid list');\n }\n next.previous = previous;\n previous.next = next;\n }\n item.next = undefined;\n item.previous = undefined;\n this._state++;\n }\n touch(item, touch) {\n if (!this._head || !this._tail) {\n throw new Error('Invalid list');\n }\n if ((touch !== Touch.First && touch !== Touch.Last)) {\n return;\n }\n if (touch === Touch.First) {\n if (item === this._head) {\n return;\n }\n const next = item.next;\n const previous = item.previous;\n // Unlink the item\n if (item === this._tail) {\n // previous must be defined since item was not head but is tail\n // So there are more than on item in the map\n previous.next = undefined;\n this._tail = previous;\n }\n else {\n // Both next and previous are not undefined since item was neither head nor tail.\n next.previous = previous;\n previous.next = next;\n }\n // Insert the node at head\n item.previous = undefined;\n item.next = this._head;\n this._head.previous = item;\n this._head = item;\n this._state++;\n }\n else if (touch === Touch.Last) {\n if (item === this._tail) {\n return;\n }\n const next = item.next;\n const previous = item.previous;\n // Unlink the item.\n if (item === this._head) {\n // next must be defined since item was not tail but is head\n // So there are more than on item in the map\n next.previous = undefined;\n this._head = next;\n }\n else {\n // Both next and previous are not undefined since item was neither head nor tail.\n next.previous = previous;\n previous.next = next;\n }\n item.next = undefined;\n item.previous = this._tail;\n this._tail.next = item;\n this._tail = item;\n this._state++;\n }\n }\n toJSON() {\n const data = [];\n this.forEach((value, key) => {\n data.push([key, value]);\n });\n return data;\n }\n fromJSON(data) {\n this.clear();\n for (const [key, value] of data) {\n this.set(key, value);\n }\n }\n}\nexports.LinkedMap = LinkedMap;\nclass LRUCache extends LinkedMap {\n constructor(limit, ratio = 1) {\n super();\n this._limit = limit;\n this._ratio = Math.min(Math.max(0, ratio), 1);\n }\n get limit() {\n return this._limit;\n }\n set limit(limit) {\n this._limit = limit;\n this.checkTrim();\n }\n get ratio() {\n return this._ratio;\n }\n set ratio(ratio) {\n this._ratio = Math.min(Math.max(0, ratio), 1);\n this.checkTrim();\n }\n get(key, touch = Touch.AsNew) {\n return super.get(key, touch);\n }\n peek(key) {\n return super.get(key, Touch.None);\n }\n set(key, value) {\n super.set(key, value, Touch.Last);\n this.checkTrim();\n return this;\n }\n checkTrim() {\n if (this.size > this._limit) {\n this.trimOld(Math.round(this._limit * this._ratio));\n }\n }\n}\nexports.LRUCache = LRUCache;\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Disposable = void 0;\nvar Disposable;\n(function (Disposable) {\n function create(func) {\n return {\n dispose: func\n };\n }\n Disposable.create = create;\n})(Disposable || (exports.Disposable = Disposable = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nlet _ral;\nfunction RAL() {\n if (_ral === undefined) {\n throw new Error(`No runtime abstraction layer installed`);\n }\n return _ral;\n}\n(function (RAL) {\n function install(ral) {\n if (ral === undefined) {\n throw new Error(`No runtime abstraction layer provided`);\n }\n _ral = ral;\n }\n RAL.install = install;\n})(RAL || (RAL = {}));\nexports.default = RAL;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emitter = exports.Event = void 0;\nconst ral_1 = require(\"./ral\");\nvar Event;\n(function (Event) {\n const _disposable = { dispose() { } };\n Event.None = function () { return _disposable; };\n})(Event || (exports.Event = Event = {}));\nclass CallbackList {\n add(callback, context = null, bucket) {\n if (!this._callbacks) {\n this._callbacks = [];\n this._contexts = [];\n }\n this._callbacks.push(callback);\n this._contexts.push(context);\n if (Array.isArray(bucket)) {\n bucket.push({ dispose: () => this.remove(callback, context) });\n }\n }\n remove(callback, context = null) {\n if (!this._callbacks) {\n return;\n }\n let foundCallbackWithDifferentContext = false;\n for (let i = 0, len = this._callbacks.length; i < len; i++) {\n if (this._callbacks[i] === callback) {\n if (this._contexts[i] === context) {\n // callback & context match => remove it\n this._callbacks.splice(i, 1);\n this._contexts.splice(i, 1);\n return;\n }\n else {\n foundCallbackWithDifferentContext = true;\n }\n }\n }\n if (foundCallbackWithDifferentContext) {\n throw new Error('When adding a listener with a context, you should remove it with the same context');\n }\n }\n invoke(...args) {\n if (!this._callbacks) {\n return [];\n }\n const ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0);\n for (let i = 0, len = callbacks.length; i < len; i++) {\n try {\n ret.push(callbacks[i].apply(contexts[i], args));\n }\n catch (e) {\n // eslint-disable-next-line no-console\n (0, ral_1.default)().console.error(e);\n }\n }\n return ret;\n }\n isEmpty() {\n return !this._callbacks || this._callbacks.length === 0;\n }\n dispose() {\n this._callbacks = undefined;\n this._contexts = undefined;\n }\n}\nclass Emitter {\n constructor(_options) {\n this._options = _options;\n }\n /**\n * For the public to allow to subscribe\n * to events from this Emitter\n */\n get event() {\n if (!this._event) {\n this._event = (listener, thisArgs, disposables) => {\n if (!this._callbacks) {\n this._callbacks = new CallbackList();\n }\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\n this._options.onFirstListenerAdd(this);\n }\n this._callbacks.add(listener, thisArgs);\n const result = {\n dispose: () => {\n if (!this._callbacks) {\n // disposable is disposed after emitter is disposed.\n return;\n }\n this._callbacks.remove(listener, thisArgs);\n result.dispose = Emitter._noop;\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\n this._options.onLastListenerRemove(this);\n }\n }\n };\n if (Array.isArray(disposables)) {\n disposables.push(result);\n }\n return result;\n };\n }\n return this._event;\n }\n /**\n * To be kept private to fire an event to\n * subscribers\n */\n fire(event) {\n if (this._callbacks) {\n this._callbacks.invoke.call(this._callbacks, event);\n }\n }\n dispose() {\n if (this._callbacks) {\n this._callbacks.dispose();\n this._callbacks = undefined;\n }\n }\n}\nexports.Emitter = Emitter;\nEmitter._noop = function () { };\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CancellationTokenSource = exports.CancellationToken = void 0;\nconst ral_1 = require(\"./ral\");\nconst Is = require(\"./is\");\nconst events_1 = require(\"./events\");\nvar CancellationToken;\n(function (CancellationToken) {\n CancellationToken.None = Object.freeze({\n isCancellationRequested: false,\n onCancellationRequested: events_1.Event.None\n });\n CancellationToken.Cancelled = Object.freeze({\n isCancellationRequested: true,\n onCancellationRequested: events_1.Event.None\n });\n function is(value) {\n const candidate = value;\n return candidate && (candidate === CancellationToken.None\n || candidate === CancellationToken.Cancelled\n || (Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested));\n }\n CancellationToken.is = is;\n})(CancellationToken || (exports.CancellationToken = CancellationToken = {}));\nconst shortcutEvent = Object.freeze(function (callback, context) {\n const handle = (0, ral_1.default)().timer.setTimeout(callback.bind(context), 0);\n return { dispose() { handle.dispose(); } };\n});\nclass MutableToken {\n constructor() {\n this._isCancelled = false;\n }\n cancel() {\n if (!this._isCancelled) {\n this._isCancelled = true;\n if (this._emitter) {\n this._emitter.fire(undefined);\n this.dispose();\n }\n }\n }\n get isCancellationRequested() {\n return this._isCancelled;\n }\n get onCancellationRequested() {\n if (this._isCancelled) {\n return shortcutEvent;\n }\n if (!this._emitter) {\n this._emitter = new events_1.Emitter();\n }\n return this._emitter.event;\n }\n dispose() {\n if (this._emitter) {\n this._emitter.dispose();\n this._emitter = undefined;\n }\n }\n}\nclass CancellationTokenSource {\n get token() {\n if (!this._token) {\n // be lazy and create the token only when\n // actually needed\n this._token = new MutableToken();\n }\n return this._token;\n }\n cancel() {\n if (!this._token) {\n // save an object by returning the default\n // cancelled token when cancellation happens\n // before someone asks for the token\n this._token = CancellationToken.Cancelled;\n }\n else {\n this._token.cancel();\n }\n }\n dispose() {\n if (!this._token) {\n // ensure to initialize with an empty token if we had none\n this._token = CancellationToken.None;\n }\n else if (this._token instanceof MutableToken) {\n // actually dispose\n this._token.dispose();\n }\n }\n}\nexports.CancellationTokenSource = CancellationTokenSource;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SharedArrayReceiverStrategy = exports.SharedArraySenderStrategy = void 0;\nconst cancellation_1 = require(\"./cancellation\");\nvar CancellationState;\n(function (CancellationState) {\n CancellationState.Continue = 0;\n CancellationState.Cancelled = 1;\n})(CancellationState || (CancellationState = {}));\nclass SharedArraySenderStrategy {\n constructor() {\n this.buffers = new Map();\n }\n enableCancellation(request) {\n if (request.id === null) {\n return;\n }\n const buffer = new SharedArrayBuffer(4);\n const data = new Int32Array(buffer, 0, 1);\n data[0] = CancellationState.Continue;\n this.buffers.set(request.id, buffer);\n request.$cancellationData = buffer;\n }\n async sendCancellation(_conn, id) {\n const buffer = this.buffers.get(id);\n if (buffer === undefined) {\n return;\n }\n const data = new Int32Array(buffer, 0, 1);\n Atomics.store(data, 0, CancellationState.Cancelled);\n }\n cleanup(id) {\n this.buffers.delete(id);\n }\n dispose() {\n this.buffers.clear();\n }\n}\nexports.SharedArraySenderStrategy = SharedArraySenderStrategy;\nclass SharedArrayBufferCancellationToken {\n constructor(buffer) {\n this.data = new Int32Array(buffer, 0, 1);\n }\n get isCancellationRequested() {\n return Atomics.load(this.data, 0) === CancellationState.Cancelled;\n }\n get onCancellationRequested() {\n throw new Error(`Cancellation over SharedArrayBuffer doesn't support cancellation events`);\n }\n}\nclass SharedArrayBufferCancellationTokenSource {\n constructor(buffer) {\n this.token = new SharedArrayBufferCancellationToken(buffer);\n }\n cancel() {\n }\n dispose() {\n }\n}\nclass SharedArrayReceiverStrategy {\n constructor() {\n this.kind = 'request';\n }\n createCancellationTokenSource(request) {\n const buffer = request.$cancellationData;\n if (buffer === undefined) {\n return new cancellation_1.CancellationTokenSource();\n }\n return new SharedArrayBufferCancellationTokenSource(buffer);\n }\n}\nexports.SharedArrayReceiverStrategy = SharedArrayReceiverStrategy;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Semaphore = void 0;\nconst ral_1 = require(\"./ral\");\nclass Semaphore {\n constructor(capacity = 1) {\n if (capacity <= 0) {\n throw new Error('Capacity must be greater than 0');\n }\n this._capacity = capacity;\n this._active = 0;\n this._waiting = [];\n }\n lock(thunk) {\n return new Promise((resolve, reject) => {\n this._waiting.push({ thunk, resolve, reject });\n this.runNext();\n });\n }\n get active() {\n return this._active;\n }\n runNext() {\n if (this._waiting.length === 0 || this._active === this._capacity) {\n return;\n }\n (0, ral_1.default)().timer.setImmediate(() => this.doRunNext());\n }\n doRunNext() {\n if (this._waiting.length === 0 || this._active === this._capacity) {\n return;\n }\n const next = this._waiting.shift();\n this._active++;\n if (this._active > this._capacity) {\n throw new Error(`To many thunks active`);\n }\n try {\n const result = next.thunk();\n if (result instanceof Promise) {\n result.then((value) => {\n this._active--;\n next.resolve(value);\n this.runNext();\n }, (err) => {\n this._active--;\n next.reject(err);\n this.runNext();\n });\n }\n else {\n this._active--;\n next.resolve(result);\n this.runNext();\n }\n }\n catch (err) {\n this._active--;\n next.reject(err);\n this.runNext();\n }\n }\n}\nexports.Semaphore = Semaphore;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ReadableStreamMessageReader = exports.AbstractMessageReader = exports.MessageReader = void 0;\nconst ral_1 = require(\"./ral\");\nconst Is = require(\"./is\");\nconst events_1 = require(\"./events\");\nconst semaphore_1 = require(\"./semaphore\");\nvar MessageReader;\n(function (MessageReader) {\n function is(value) {\n let candidate = value;\n return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) &&\n Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage);\n }\n MessageReader.is = is;\n})(MessageReader || (exports.MessageReader = MessageReader = {}));\nclass AbstractMessageReader {\n constructor() {\n this.errorEmitter = new events_1.Emitter();\n this.closeEmitter = new events_1.Emitter();\n this.partialMessageEmitter = new events_1.Emitter();\n }\n dispose() {\n this.errorEmitter.dispose();\n this.closeEmitter.dispose();\n }\n get onError() {\n return this.errorEmitter.event;\n }\n fireError(error) {\n this.errorEmitter.fire(this.asError(error));\n }\n get onClose() {\n return this.closeEmitter.event;\n }\n fireClose() {\n this.closeEmitter.fire(undefined);\n }\n get onPartialMessage() {\n return this.partialMessageEmitter.event;\n }\n firePartialMessage(info) {\n this.partialMessageEmitter.fire(info);\n }\n asError(error) {\n if (error instanceof Error) {\n return error;\n }\n else {\n return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);\n }\n }\n}\nexports.AbstractMessageReader = AbstractMessageReader;\nvar ResolvedMessageReaderOptions;\n(function (ResolvedMessageReaderOptions) {\n function fromOptions(options) {\n let charset;\n let result;\n let contentDecoder;\n const contentDecoders = new Map();\n let contentTypeDecoder;\n const contentTypeDecoders = new Map();\n if (options === undefined || typeof options === 'string') {\n charset = options ?? 'utf-8';\n }\n else {\n charset = options.charset ?? 'utf-8';\n if (options.contentDecoder !== undefined) {\n contentDecoder = options.contentDecoder;\n contentDecoders.set(contentDecoder.name, contentDecoder);\n }\n if (options.contentDecoders !== undefined) {\n for (const decoder of options.contentDecoders) {\n contentDecoders.set(decoder.name, decoder);\n }\n }\n if (options.contentTypeDecoder !== undefined) {\n contentTypeDecoder = options.contentTypeDecoder;\n contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);\n }\n if (options.contentTypeDecoders !== undefined) {\n for (const decoder of options.contentTypeDecoders) {\n contentTypeDecoders.set(decoder.name, decoder);\n }\n }\n }\n if (contentTypeDecoder === undefined) {\n contentTypeDecoder = (0, ral_1.default)().applicationJson.decoder;\n contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);\n }\n return { charset, contentDecoder, contentDecoders, contentTypeDecoder, contentTypeDecoders };\n }\n ResolvedMessageReaderOptions.fromOptions = fromOptions;\n})(ResolvedMessageReaderOptions || (ResolvedMessageReaderOptions = {}));\nclass ReadableStreamMessageReader extends AbstractMessageReader {\n constructor(readable, options) {\n super();\n this.readable = readable;\n this.options = ResolvedMessageReaderOptions.fromOptions(options);\n this.buffer = (0, ral_1.default)().messageBuffer.create(this.options.charset);\n this._partialMessageTimeout = 10000;\n this.nextMessageLength = -1;\n this.messageToken = 0;\n this.readSemaphore = new semaphore_1.Semaphore(1);\n }\n set partialMessageTimeout(timeout) {\n this._partialMessageTimeout = timeout;\n }\n get partialMessageTimeout() {\n return this._partialMessageTimeout;\n }\n listen(callback) {\n this.nextMessageLength = -1;\n this.messageToken = 0;\n this.partialMessageTimer = undefined;\n this.callback = callback;\n const result = this.readable.onData((data) => {\n this.onData(data);\n });\n this.readable.onError((error) => this.fireError(error));\n this.readable.onClose(() => this.fireClose());\n return result;\n }\n onData(data) {\n try {\n this.buffer.append(data);\n while (true) {\n if (this.nextMessageLength === -1) {\n const headers = this.buffer.tryReadHeaders(true);\n if (!headers) {\n return;\n }\n const contentLength = headers.get('content-length');\n if (!contentLength) {\n this.fireError(new Error(`Header must provide a Content-Length property.\\n${JSON.stringify(Object.fromEntries(headers))}`));\n return;\n }\n const length = parseInt(contentLength);\n if (isNaN(length)) {\n this.fireError(new Error(`Content-Length value must be a number. Got ${contentLength}`));\n return;\n }\n this.nextMessageLength = length;\n }\n const body = this.buffer.tryReadBody(this.nextMessageLength);\n if (body === undefined) {\n /** We haven't received the full message yet. */\n this.setPartialMessageTimer();\n return;\n }\n this.clearPartialMessageTimer();\n this.nextMessageLength = -1;\n // Make sure that we convert one received message after the\n // other. Otherwise it could happen that a decoding of a second\n // smaller message finished before the decoding of a first larger\n // message and then we would deliver the second message first.\n this.readSemaphore.lock(async () => {\n const bytes = this.options.contentDecoder !== undefined\n ? await this.options.contentDecoder.decode(body)\n : body;\n const message = await this.options.contentTypeDecoder.decode(bytes, this.options);\n this.callback(message);\n }).catch((error) => {\n this.fireError(error);\n });\n }\n }\n catch (error) {\n this.fireError(error);\n }\n }\n clearPartialMessageTimer() {\n if (this.partialMessageTimer) {\n this.partialMessageTimer.dispose();\n this.partialMessageTimer = undefined;\n }\n }\n setPartialMessageTimer() {\n this.clearPartialMessageTimer();\n if (this._partialMessageTimeout <= 0) {\n return;\n }\n this.partialMessageTimer = (0, ral_1.default)().timer.setTimeout((token, timeout) => {\n this.partialMessageTimer = undefined;\n if (token === this.messageToken) {\n this.firePartialMessage({ messageToken: token, waitingTime: timeout });\n this.setPartialMessageTimer();\n }\n }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout);\n }\n}\nexports.ReadableStreamMessageReader = ReadableStreamMessageReader;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WriteableStreamMessageWriter = exports.AbstractMessageWriter = exports.MessageWriter = void 0;\nconst ral_1 = require(\"./ral\");\nconst Is = require(\"./is\");\nconst semaphore_1 = require(\"./semaphore\");\nconst events_1 = require(\"./events\");\nconst ContentLength = 'Content-Length: ';\nconst CRLF = '\\r\\n';\nvar MessageWriter;\n(function (MessageWriter) {\n function is(value) {\n let candidate = value;\n return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) &&\n Is.func(candidate.onError) && Is.func(candidate.write);\n }\n MessageWriter.is = is;\n})(MessageWriter || (exports.MessageWriter = MessageWriter = {}));\nclass AbstractMessageWriter {\n constructor() {\n this.errorEmitter = new events_1.Emitter();\n this.closeEmitter = new events_1.Emitter();\n }\n dispose() {\n this.errorEmitter.dispose();\n this.closeEmitter.dispose();\n }\n get onError() {\n return this.errorEmitter.event;\n }\n fireError(error, message, count) {\n this.errorEmitter.fire([this.asError(error), message, count]);\n }\n get onClose() {\n return this.closeEmitter.event;\n }\n fireClose() {\n this.closeEmitter.fire(undefined);\n }\n asError(error) {\n if (error instanceof Error) {\n return error;\n }\n else {\n return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);\n }\n }\n}\nexports.AbstractMessageWriter = AbstractMessageWriter;\nvar ResolvedMessageWriterOptions;\n(function (ResolvedMessageWriterOptions) {\n function fromOptions(options) {\n if (options === undefined || typeof options === 'string') {\n return { charset: options ?? 'utf-8', contentTypeEncoder: (0, ral_1.default)().applicationJson.encoder };\n }\n else {\n return { charset: options.charset ?? 'utf-8', contentEncoder: options.contentEncoder, contentTypeEncoder: options.contentTypeEncoder ?? (0, ral_1.default)().applicationJson.encoder };\n }\n }\n ResolvedMessageWriterOptions.fromOptions = fromOptions;\n})(ResolvedMessageWriterOptions || (ResolvedMessageWriterOptions = {}));\nclass WriteableStreamMessageWriter extends AbstractMessageWriter {\n constructor(writable, options) {\n super();\n this.writable = writable;\n this.options = ResolvedMessageWriterOptions.fromOptions(options);\n this.errorCount = 0;\n this.writeSemaphore = new semaphore_1.Semaphore(1);\n this.writable.onError((error) => this.fireError(error));\n this.writable.onClose(() => this.fireClose());\n }\n async write(msg) {\n return this.writeSemaphore.lock(async () => {\n const payload = this.options.contentTypeEncoder.encode(msg, this.options).then((buffer) => {\n if (this.options.contentEncoder !== undefined) {\n return this.options.contentEncoder.encode(buffer);\n }\n else {\n return buffer;\n }\n });\n return payload.then((buffer) => {\n const headers = [];\n headers.push(ContentLength, buffer.byteLength.toString(), CRLF);\n headers.push(CRLF);\n return this.doWrite(msg, headers, buffer);\n }, (error) => {\n this.fireError(error);\n throw error;\n });\n });\n }\n async doWrite(msg, headers, data) {\n try {\n await this.writable.write(headers.join(''), 'ascii');\n return this.writable.write(data);\n }\n catch (error) {\n this.handleError(error, msg);\n return Promise.reject(error);\n }\n }\n handleError(error, msg) {\n this.errorCount++;\n this.fireError(error, msg, this.errorCount);\n }\n end() {\n this.writable.end();\n }\n}\nexports.WriteableStreamMessageWriter = WriteableStreamMessageWriter;\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AbstractMessageBuffer = void 0;\nconst CR = 13;\nconst LF = 10;\nconst CRLF = '\\r\\n';\nclass AbstractMessageBuffer {\n constructor(encoding = 'utf-8') {\n this._encoding = encoding;\n this._chunks = [];\n this._totalLength = 0;\n }\n get encoding() {\n return this._encoding;\n }\n append(chunk) {\n const toAppend = typeof chunk === 'string' ? this.fromString(chunk, this._encoding) : chunk;\n this._chunks.push(toAppend);\n this._totalLength += toAppend.byteLength;\n }\n tryReadHeaders(lowerCaseKeys = false) {\n if (this._chunks.length === 0) {\n return undefined;\n }\n let state = 0;\n let chunkIndex = 0;\n let offset = 0;\n let chunkBytesRead = 0;\n row: while (chunkIndex < this._chunks.length) {\n const chunk = this._chunks[chunkIndex];\n offset = 0;\n column: while (offset < chunk.length) {\n const value = chunk[offset];\n switch (value) {\n case CR:\n switch (state) {\n case 0:\n state = 1;\n break;\n case 2:\n state = 3;\n break;\n default:\n state = 0;\n }\n break;\n case LF:\n switch (state) {\n case 1:\n state = 2;\n break;\n case 3:\n state = 4;\n offset++;\n break row;\n default:\n state = 0;\n }\n break;\n default:\n state = 0;\n }\n offset++;\n }\n chunkBytesRead += chunk.byteLength;\n chunkIndex++;\n }\n if (state !== 4) {\n return undefined;\n }\n // The buffer contains the two CRLF at the end. So we will\n // have two empty lines after the split at the end as well.\n const buffer = this._read(chunkBytesRead + offset);\n const result = new Map();\n const headers = this.toString(buffer, 'ascii').split(CRLF);\n if (headers.length < 2) {\n return result;\n }\n for (let i = 0; i < headers.length - 2; i++) {\n const header = headers[i];\n const index = header.indexOf(':');\n if (index === -1) {\n throw new Error(`Message header must separate key and value using ':'\\n${header}`);\n }\n const key = header.substr(0, index);\n const value = header.substr(index + 1).trim();\n result.set(lowerCaseKeys ? key.toLowerCase() : key, value);\n }\n return result;\n }\n tryReadBody(length) {\n if (this._totalLength < length) {\n return undefined;\n }\n return this._read(length);\n }\n get numberOfBytes() {\n return this._totalLength;\n }\n _read(byteCount) {\n if (byteCount === 0) {\n return this.emptyBuffer();\n }\n if (byteCount > this._totalLength) {\n throw new Error(`Cannot read so many bytes!`);\n }\n if (this._chunks[0].byteLength === byteCount) {\n // super fast path, precisely first chunk must be returned\n const chunk = this._chunks[0];\n this._chunks.shift();\n this._totalLength -= byteCount;\n return this.asNative(chunk);\n }\n if (this._chunks[0].byteLength > byteCount) {\n // fast path, the reading is entirely within the first chunk\n const chunk = this._chunks[0];\n const result = this.asNative(chunk, byteCount);\n this._chunks[0] = chunk.slice(byteCount);\n this._totalLength -= byteCount;\n return result;\n }\n const result = this.allocNative(byteCount);\n let resultOffset = 0;\n let chunkIndex = 0;\n while (byteCount > 0) {\n const chunk = this._chunks[chunkIndex];\n if (chunk.byteLength > byteCount) {\n // this chunk will survive\n const chunkPart = chunk.slice(0, byteCount);\n result.set(chunkPart, resultOffset);\n resultOffset += byteCount;\n this._chunks[chunkIndex] = chunk.slice(byteCount);\n this._totalLength -= byteCount;\n byteCount -= byteCount;\n }\n else {\n // this chunk will be entirely read\n result.set(chunk, resultOffset);\n resultOffset += chunk.byteLength;\n this._chunks.shift();\n this._totalLength -= chunk.byteLength;\n byteCount -= chunk.byteLength;\n }\n }\n return result;\n }\n}\nexports.AbstractMessageBuffer = AbstractMessageBuffer;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createMessageConnection = exports.ConnectionOptions = exports.MessageStrategy = exports.CancellationStrategy = exports.CancellationSenderStrategy = exports.CancellationReceiverStrategy = exports.RequestCancellationReceiverStrategy = exports.IdCancellationReceiverStrategy = exports.ConnectionStrategy = exports.ConnectionError = exports.ConnectionErrors = exports.LogTraceNotification = exports.SetTraceNotification = exports.TraceFormat = exports.TraceValues = exports.Trace = exports.NullLogger = exports.ProgressType = exports.ProgressToken = void 0;\nconst ral_1 = require(\"./ral\");\nconst Is = require(\"./is\");\nconst messages_1 = require(\"./messages\");\nconst linkedMap_1 = require(\"./linkedMap\");\nconst events_1 = require(\"./events\");\nconst cancellation_1 = require(\"./cancellation\");\nvar CancelNotification;\n(function (CancelNotification) {\n CancelNotification.type = new messages_1.NotificationType('$/cancelRequest');\n})(CancelNotification || (CancelNotification = {}));\nvar ProgressToken;\n(function (ProgressToken) {\n function is(value) {\n return typeof value === 'string' || typeof value === 'number';\n }\n ProgressToken.is = is;\n})(ProgressToken || (exports.ProgressToken = ProgressToken = {}));\nvar ProgressNotification;\n(function (ProgressNotification) {\n ProgressNotification.type = new messages_1.NotificationType('$/progress');\n})(ProgressNotification || (ProgressNotification = {}));\nclass ProgressType {\n constructor() {\n }\n}\nexports.ProgressType = ProgressType;\nvar StarRequestHandler;\n(function (StarRequestHandler) {\n function is(value) {\n return Is.func(value);\n }\n StarRequestHandler.is = is;\n})(StarRequestHandler || (StarRequestHandler = {}));\nexports.NullLogger = Object.freeze({\n error: () => { },\n warn: () => { },\n info: () => { },\n log: () => { }\n});\nvar Trace;\n(function (Trace) {\n Trace[Trace[\"Off\"] = 0] = \"Off\";\n Trace[Trace[\"Messages\"] = 1] = \"Messages\";\n Trace[Trace[\"Compact\"] = 2] = \"Compact\";\n Trace[Trace[\"Verbose\"] = 3] = \"Verbose\";\n})(Trace || (exports.Trace = Trace = {}));\nvar TraceValues;\n(function (TraceValues) {\n /**\n * Turn tracing off.\n */\n TraceValues.Off = 'off';\n /**\n * Trace messages only.\n */\n TraceValues.Messages = 'messages';\n /**\n * Compact message tracing.\n */\n TraceValues.Compact = 'compact';\n /**\n * Verbose message tracing.\n */\n TraceValues.Verbose = 'verbose';\n})(TraceValues || (exports.TraceValues = TraceValues = {}));\n(function (Trace) {\n function fromString(value) {\n if (!Is.string(value)) {\n return Trace.Off;\n }\n value = value.toLowerCase();\n switch (value) {\n case 'off':\n return Trace.Off;\n case 'messages':\n return Trace.Messages;\n case 'compact':\n return Trace.Compact;\n case 'verbose':\n return Trace.Verbose;\n default:\n return Trace.Off;\n }\n }\n Trace.fromString = fromString;\n function toString(value) {\n switch (value) {\n case Trace.Off:\n return 'off';\n case Trace.Messages:\n return 'messages';\n case Trace.Compact:\n return 'compact';\n case Trace.Verbose:\n return 'verbose';\n default:\n return 'off';\n }\n }\n Trace.toString = toString;\n})(Trace || (exports.Trace = Trace = {}));\nvar TraceFormat;\n(function (TraceFormat) {\n TraceFormat[\"Text\"] = \"text\";\n TraceFormat[\"JSON\"] = \"json\";\n})(TraceFormat || (exports.TraceFormat = TraceFormat = {}));\n(function (TraceFormat) {\n function fromString(value) {\n if (!Is.string(value)) {\n return TraceFormat.Text;\n }\n value = value.toLowerCase();\n if (value === 'json') {\n return TraceFormat.JSON;\n }\n else {\n return TraceFormat.Text;\n }\n }\n TraceFormat.fromString = fromString;\n})(TraceFormat || (exports.TraceFormat = TraceFormat = {}));\nvar SetTraceNotification;\n(function (SetTraceNotification) {\n SetTraceNotification.type = new messages_1.NotificationType('$/setTrace');\n})(SetTraceNotification || (exports.SetTraceNotification = SetTraceNotification = {}));\nvar LogTraceNotification;\n(function (LogTraceNotification) {\n LogTraceNotification.type = new messages_1.NotificationType('$/logTrace');\n})(LogTraceNotification || (exports.LogTraceNotification = LogTraceNotification = {}));\nvar ConnectionErrors;\n(function (ConnectionErrors) {\n /**\n * The connection is closed.\n */\n ConnectionErrors[ConnectionErrors[\"Closed\"] = 1] = \"Closed\";\n /**\n * The connection got disposed.\n */\n ConnectionErrors[ConnectionErrors[\"Disposed\"] = 2] = \"Disposed\";\n /**\n * The connection is already in listening mode.\n */\n ConnectionErrors[ConnectionErrors[\"AlreadyListening\"] = 3] = \"AlreadyListening\";\n})(ConnectionErrors || (exports.ConnectionErrors = ConnectionErrors = {}));\nclass ConnectionError extends Error {\n constructor(code, message) {\n super(message);\n this.code = code;\n Object.setPrototypeOf(this, ConnectionError.prototype);\n }\n}\nexports.ConnectionError = ConnectionError;\nvar ConnectionStrategy;\n(function (ConnectionStrategy) {\n function is(value) {\n const candidate = value;\n return candidate && Is.func(candidate.cancelUndispatched);\n }\n ConnectionStrategy.is = is;\n})(ConnectionStrategy || (exports.ConnectionStrategy = ConnectionStrategy = {}));\nvar IdCancellationReceiverStrategy;\n(function (IdCancellationReceiverStrategy) {\n function is(value) {\n const candidate = value;\n return candidate && (candidate.kind === undefined || candidate.kind === 'id') && Is.func(candidate.createCancellationTokenSource) && (candidate.dispose === undefined || Is.func(candidate.dispose));\n }\n IdCancellationReceiverStrategy.is = is;\n})(IdCancellationReceiverStrategy || (exports.IdCancellationReceiverStrategy = IdCancellationReceiverStrategy = {}));\nvar RequestCancellationReceiverStrategy;\n(function (RequestCancellationReceiverStrategy) {\n function is(value) {\n const candidate = value;\n return candidate && candidate.kind === 'request' && Is.func(candidate.createCancellationTokenSource) && (candidate.dispose === undefined || Is.func(candidate.dispose));\n }\n RequestCancellationReceiverStrategy.is = is;\n})(RequestCancellationReceiverStrategy || (exports.RequestCancellationReceiverStrategy = RequestCancellationReceiverStrategy = {}));\nvar CancellationReceiverStrategy;\n(function (CancellationReceiverStrategy) {\n CancellationReceiverStrategy.Message = Object.freeze({\n createCancellationTokenSource(_) {\n return new cancellation_1.CancellationTokenSource();\n }\n });\n function is(value) {\n return IdCancellationReceiverStrategy.is(value) || RequestCancellationReceiverStrategy.is(value);\n }\n CancellationReceiverStrategy.is = is;\n})(CancellationReceiverStrategy || (exports.CancellationReceiverStrategy = CancellationReceiverStrategy = {}));\nvar CancellationSenderStrategy;\n(function (CancellationSenderStrategy) {\n CancellationSenderStrategy.Message = Object.freeze({\n sendCancellation(conn, id) {\n return conn.sendNotification(CancelNotification.type, { id });\n },\n cleanup(_) { }\n });\n function is(value) {\n const candidate = value;\n return candidate && Is.func(candidate.sendCancellation) && Is.func(candidate.cleanup);\n }\n CancellationSenderStrategy.is = is;\n})(CancellationSenderStrategy || (exports.CancellationSenderStrategy = CancellationSenderStrategy = {}));\nvar CancellationStrategy;\n(function (CancellationStrategy) {\n CancellationStrategy.Message = Object.freeze({\n receiver: CancellationReceiverStrategy.Message,\n sender: CancellationSenderStrategy.Message\n });\n function is(value) {\n const candidate = value;\n return candidate && CancellationReceiverStrategy.is(candidate.receiver) && CancellationSenderStrategy.is(candidate.sender);\n }\n CancellationStrategy.is = is;\n})(CancellationStrategy || (exports.CancellationStrategy = CancellationStrategy = {}));\nvar MessageStrategy;\n(function (MessageStrategy) {\n function is(value) {\n const candidate = value;\n return candidate && Is.func(candidate.handleMessage);\n }\n MessageStrategy.is = is;\n})(MessageStrategy || (exports.MessageStrategy = MessageStrategy = {}));\nvar ConnectionOptions;\n(function (ConnectionOptions) {\n function is(value) {\n const candidate = value;\n return candidate && (CancellationStrategy.is(candidate.cancellationStrategy) || ConnectionStrategy.is(candidate.connectionStrategy) || MessageStrategy.is(candidate.messageStrategy));\n }\n ConnectionOptions.is = is;\n})(ConnectionOptions || (exports.ConnectionOptions = ConnectionOptions = {}));\nvar ConnectionState;\n(function (ConnectionState) {\n ConnectionState[ConnectionState[\"New\"] = 1] = \"New\";\n ConnectionState[ConnectionState[\"Listening\"] = 2] = \"Listening\";\n ConnectionState[ConnectionState[\"Closed\"] = 3] = \"Closed\";\n ConnectionState[ConnectionState[\"Disposed\"] = 4] = \"Disposed\";\n})(ConnectionState || (ConnectionState = {}));\nfunction createMessageConnection(messageReader, messageWriter, _logger, options) {\n const logger = _logger !== undefined ? _logger : exports.NullLogger;\n let sequenceNumber = 0;\n let notificationSequenceNumber = 0;\n let unknownResponseSequenceNumber = 0;\n const version = '2.0';\n let starRequestHandler = undefined;\n const requestHandlers = new Map();\n let starNotificationHandler = undefined;\n const notificationHandlers = new Map();\n const progressHandlers = new Map();\n let timer;\n let messageQueue = new linkedMap_1.LinkedMap();\n let responsePromises = new Map();\n let knownCanceledRequests = new Set();\n let requestTokens = new Map();\n let trace = Trace.Off;\n let traceFormat = TraceFormat.Text;\n let tracer;\n let state = ConnectionState.New;\n const errorEmitter = new events_1.Emitter();\n const closeEmitter = new events_1.Emitter();\n const unhandledNotificationEmitter = new events_1.Emitter();\n const unhandledProgressEmitter = new events_1.Emitter();\n const disposeEmitter = new events_1.Emitter();\n const cancellationStrategy = (options && options.cancellationStrategy) ? options.cancellationStrategy : CancellationStrategy.Message;\n function createRequestQueueKey(id) {\n if (id === null) {\n throw new Error(`Can't send requests with id null since the response can't be correlated.`);\n }\n return 'req-' + id.toString();\n }\n function createResponseQueueKey(id) {\n if (id === null) {\n return 'res-unknown-' + (++unknownResponseSequenceNumber).toString();\n }\n else {\n return 'res-' + id.toString();\n }\n }\n function createNotificationQueueKey() {\n return 'not-' + (++notificationSequenceNumber).toString();\n }\n function addMessageToQueue(queue, message) {\n if (messages_1.Message.isRequest(message)) {\n queue.set(createRequestQueueKey(message.id), message);\n }\n else if (messages_1.Message.isResponse(message)) {\n queue.set(createResponseQueueKey(message.id), message);\n }\n else {\n queue.set(createNotificationQueueKey(), message);\n }\n }\n function cancelUndispatched(_message) {\n return undefined;\n }\n function isListening() {\n return state === ConnectionState.Listening;\n }\n function isClosed() {\n return state === ConnectionState.Closed;\n }\n function isDisposed() {\n return state === ConnectionState.Disposed;\n }\n function closeHandler() {\n if (state === ConnectionState.New || state === ConnectionState.Listening) {\n state = ConnectionState.Closed;\n closeEmitter.fire(undefined);\n }\n // If the connection is disposed don't sent close events.\n }\n function readErrorHandler(error) {\n errorEmitter.fire([error, undefined, undefined]);\n }\n function writeErrorHandler(data) {\n errorEmitter.fire(data);\n }\n messageReader.onClose(closeHandler);\n messageReader.onError(readErrorHandler);\n messageWriter.onClose(closeHandler);\n messageWriter.onError(writeErrorHandler);\n function triggerMessageQueue() {\n if (timer || messageQueue.size === 0) {\n return;\n }\n timer = (0, ral_1.default)().timer.setImmediate(() => {\n timer = undefined;\n processMessageQueue();\n });\n }\n function handleMessage(message) {\n if (messages_1.Message.isRequest(message)) {\n handleRequest(message);\n }\n else if (messages_1.Message.isNotification(message)) {\n handleNotification(message);\n }\n else if (messages_1.Message.isResponse(message)) {\n handleResponse(message);\n }\n else {\n handleInvalidMessage(message);\n }\n }\n function processMessageQueue() {\n if (messageQueue.size === 0) {\n return;\n }\n const message = messageQueue.shift();\n try {\n const messageStrategy = options?.messageStrategy;\n if (MessageStrategy.is(messageStrategy)) {\n messageStrategy.handleMessage(message, handleMessage);\n }\n else {\n handleMessage(message);\n }\n }\n finally {\n triggerMessageQueue();\n }\n }\n const callback = (message) => {\n try {\n // We have received a cancellation message. Check if the message is still in the queue\n // and cancel it if allowed to do so.\n if (messages_1.Message.isNotification(message) && message.method === CancelNotification.type.method) {\n const cancelId = message.params.id;\n const key = createRequestQueueKey(cancelId);\n const toCancel = messageQueue.get(key);\n if (messages_1.Message.isRequest(toCancel)) {\n const strategy = options?.connectionStrategy;\n const response = (strategy && strategy.cancelUndispatched) ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel);\n if (response && (response.error !== undefined || response.result !== undefined)) {\n messageQueue.delete(key);\n requestTokens.delete(cancelId);\n response.id = toCancel.id;\n traceSendingResponse(response, message.method, Date.now());\n messageWriter.write(response).catch(() => logger.error(`Sending response for canceled message failed.`));\n return;\n }\n }\n const cancellationToken = requestTokens.get(cancelId);\n // The request is already running. Cancel the token\n if (cancellationToken !== undefined) {\n cancellationToken.cancel();\n traceReceivedNotification(message);\n return;\n }\n else {\n // Remember the cancel but still queue the message to\n // clean up state in process message.\n knownCanceledRequests.add(cancelId);\n }\n }\n addMessageToQueue(messageQueue, message);\n }\n finally {\n triggerMessageQueue();\n }\n };\n function handleRequest(requestMessage) {\n if (isDisposed()) {\n // we return here silently since we fired an event when the\n // connection got disposed.\n return;\n }\n function reply(resultOrError, method, startTime) {\n const message = {\n jsonrpc: version,\n id: requestMessage.id\n };\n if (resultOrError instanceof messages_1.ResponseError) {\n message.error = resultOrError.toJson();\n }\n else {\n message.result = resultOrError === undefined ? null : resultOrError;\n }\n traceSendingResponse(message, method, startTime);\n messageWriter.write(message).catch(() => logger.error(`Sending response failed.`));\n }\n function replyError(error, method, startTime) {\n const message = {\n jsonrpc: version,\n id: requestMessage.id,\n error: error.toJson()\n };\n traceSendingResponse(message, method, startTime);\n messageWriter.write(message).catch(() => logger.error(`Sending response failed.`));\n }\n function replySuccess(result, method, startTime) {\n // The JSON RPC defines that a response must either have a result or an error\n // So we can't treat undefined as a valid response result.\n if (result === undefined) {\n result = null;\n }\n const message = {\n jsonrpc: version,\n id: requestMessage.id,\n result: result\n };\n traceSendingResponse(message, method, startTime);\n messageWriter.write(message).catch(() => logger.error(`Sending response failed.`));\n }\n traceReceivedRequest(requestMessage);\n const element = requestHandlers.get(requestMessage.method);\n let type;\n let requestHandler;\n if (element) {\n type = element.type;\n requestHandler = element.handler;\n }\n const startTime = Date.now();\n if (requestHandler || starRequestHandler) {\n const tokenKey = requestMessage.id ?? String(Date.now()); //\n const cancellationSource = IdCancellationReceiverStrategy.is(cancellationStrategy.receiver)\n ? cancellationStrategy.receiver.createCancellationTokenSource(tokenKey)\n : cancellationStrategy.receiver.createCancellationTokenSource(requestMessage);\n if (requestMessage.id !== null && knownCanceledRequests.has(requestMessage.id)) {\n cancellationSource.cancel();\n }\n if (requestMessage.id !== null) {\n requestTokens.set(tokenKey, cancellationSource);\n }\n try {\n let handlerResult;\n if (requestHandler) {\n if (requestMessage.params === undefined) {\n if (type !== undefined && type.numberOfParams !== 0) {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines ${type.numberOfParams} params but received none.`), requestMessage.method, startTime);\n return;\n }\n handlerResult = requestHandler(cancellationSource.token);\n }\n else if (Array.isArray(requestMessage.params)) {\n if (type !== undefined && type.parameterStructures === messages_1.ParameterStructures.byName) {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by name but received parameters by position`), requestMessage.method, startTime);\n return;\n }\n handlerResult = requestHandler(...requestMessage.params, cancellationSource.token);\n }\n else {\n if (type !== undefined && type.parameterStructures === messages_1.ParameterStructures.byPosition) {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by position but received parameters by name`), requestMessage.method, startTime);\n return;\n }\n handlerResult = requestHandler(requestMessage.params, cancellationSource.token);\n }\n }\n else if (starRequestHandler) {\n handlerResult = starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token);\n }\n const promise = handlerResult;\n if (!handlerResult) {\n requestTokens.delete(tokenKey);\n replySuccess(handlerResult, requestMessage.method, startTime);\n }\n else if (promise.then) {\n promise.then((resultOrError) => {\n requestTokens.delete(tokenKey);\n reply(resultOrError, requestMessage.method, startTime);\n }, error => {\n requestTokens.delete(tokenKey);\n if (error instanceof messages_1.ResponseError) {\n replyError(error, requestMessage.method, startTime);\n }\n else if (error && Is.string(error.message)) {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);\n }\n else {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);\n }\n });\n }\n else {\n requestTokens.delete(tokenKey);\n reply(handlerResult, requestMessage.method, startTime);\n }\n }\n catch (error) {\n requestTokens.delete(tokenKey);\n if (error instanceof messages_1.ResponseError) {\n reply(error, requestMessage.method, startTime);\n }\n else if (error && Is.string(error.message)) {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);\n }\n else {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);\n }\n }\n }\n else {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime);\n }\n }\n function handleResponse(responseMessage) {\n if (isDisposed()) {\n // See handle request.\n return;\n }\n if (responseMessage.id === null) {\n if (responseMessage.error) {\n logger.error(`Received response message without id: Error is: \\n${JSON.stringify(responseMessage.error, undefined, 4)}`);\n }\n else {\n logger.error(`Received response message without id. No further error information provided.`);\n }\n }\n else {\n const key = responseMessage.id;\n const responsePromise = responsePromises.get(key);\n traceReceivedResponse(responseMessage, responsePromise);\n if (responsePromise !== undefined) {\n responsePromises.delete(key);\n try {\n if (responseMessage.error) {\n const error = responseMessage.error;\n responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data));\n }\n else if (responseMessage.result !== undefined) {\n responsePromise.resolve(responseMessage.result);\n }\n else {\n throw new Error('Should never happen.');\n }\n }\n catch (error) {\n if (error.message) {\n logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`);\n }\n else {\n logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`);\n }\n }\n }\n }\n }\n function handleNotification(message) {\n if (isDisposed()) {\n // See handle request.\n return;\n }\n let type = undefined;\n let notificationHandler;\n if (message.method === CancelNotification.type.method) {\n const cancelId = message.params.id;\n knownCanceledRequests.delete(cancelId);\n traceReceivedNotification(message);\n return;\n }\n else {\n const element = notificationHandlers.get(message.method);\n if (element) {\n notificationHandler = element.handler;\n type = element.type;\n }\n }\n if (notificationHandler || starNotificationHandler) {\n try {\n traceReceivedNotification(message);\n if (notificationHandler) {\n if (message.params === undefined) {\n if (type !== undefined) {\n if (type.numberOfParams !== 0 && type.parameterStructures !== messages_1.ParameterStructures.byName) {\n logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but received none.`);\n }\n }\n notificationHandler();\n }\n else if (Array.isArray(message.params)) {\n // There are JSON-RPC libraries that send progress message as positional params although\n // specified as named. So convert them if this is the case.\n const params = message.params;\n if (message.method === ProgressNotification.type.method && params.length === 2 && ProgressToken.is(params[0])) {\n notificationHandler({ token: params[0], value: params[1] });\n }\n else {\n if (type !== undefined) {\n if (type.parameterStructures === messages_1.ParameterStructures.byName) {\n logger.error(`Notification ${message.method} defines parameters by name but received parameters by position`);\n }\n if (type.numberOfParams !== message.params.length) {\n logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but received ${params.length} arguments`);\n }\n }\n notificationHandler(...params);\n }\n }\n else {\n if (type !== undefined && type.parameterStructures === messages_1.ParameterStructures.byPosition) {\n logger.error(`Notification ${message.method} defines parameters by position but received parameters by name`);\n }\n notificationHandler(message.params);\n }\n }\n else if (starNotificationHandler) {\n starNotificationHandler(message.method, message.params);\n }\n }\n catch (error) {\n if (error.message) {\n logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`);\n }\n else {\n logger.error(`Notification handler '${message.method}' failed unexpectedly.`);\n }\n }\n }\n else {\n unhandledNotificationEmitter.fire(message);\n }\n }\n function handleInvalidMessage(message) {\n if (!message) {\n logger.error('Received empty message.');\n return;\n }\n logger.error(`Received message which is neither a response nor a notification message:\\n${JSON.stringify(message, null, 4)}`);\n // Test whether we find an id to reject the promise\n const responseMessage = message;\n if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) {\n const key = responseMessage.id;\n const responseHandler = responsePromises.get(key);\n if (responseHandler) {\n responseHandler.reject(new Error('The received response has neither a result nor an error property.'));\n }\n }\n }\n function stringifyTrace(params) {\n if (params === undefined || params === null) {\n return undefined;\n }\n switch (trace) {\n case Trace.Verbose:\n return JSON.stringify(params, null, 4);\n case Trace.Compact:\n return JSON.stringify(params);\n default:\n return undefined;\n }\n }\n function traceSendingRequest(message) {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if ((trace === Trace.Verbose || trace === Trace.Compact) && message.params) {\n data = `Params: ${stringifyTrace(message.params)}\\n\\n`;\n }\n tracer.log(`Sending request '${message.method} - (${message.id})'.`, data);\n }\n else {\n logLSPMessage('send-request', message);\n }\n }\n function traceSendingNotification(message) {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if (trace === Trace.Verbose || trace === Trace.Compact) {\n if (message.params) {\n data = `Params: ${stringifyTrace(message.params)}\\n\\n`;\n }\n else {\n data = 'No parameters provided.\\n\\n';\n }\n }\n tracer.log(`Sending notification '${message.method}'.`, data);\n }\n else {\n logLSPMessage('send-notification', message);\n }\n }\n function traceSendingResponse(message, method, startTime) {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if (trace === Trace.Verbose || trace === Trace.Compact) {\n if (message.error && message.error.data) {\n data = `Error data: ${stringifyTrace(message.error.data)}\\n\\n`;\n }\n else {\n if (message.result) {\n data = `Result: ${stringifyTrace(message.result)}\\n\\n`;\n }\n else if (message.error === undefined) {\n data = 'No result returned.\\n\\n';\n }\n }\n }\n tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data);\n }\n else {\n logLSPMessage('send-response', message);\n }\n }\n function traceReceivedRequest(message) {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if ((trace === Trace.Verbose || trace === Trace.Compact) && message.params) {\n data = `Params: ${stringifyTrace(message.params)}\\n\\n`;\n }\n tracer.log(`Received request '${message.method} - (${message.id})'.`, data);\n }\n else {\n logLSPMessage('receive-request', message);\n }\n }\n function traceReceivedNotification(message) {\n if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if (trace === Trace.Verbose || trace === Trace.Compact) {\n if (message.params) {\n data = `Params: ${stringifyTrace(message.params)}\\n\\n`;\n }\n else {\n data = 'No parameters provided.\\n\\n';\n }\n }\n tracer.log(`Received notification '${message.method}'.`, data);\n }\n else {\n logLSPMessage('receive-notification', message);\n }\n }\n function traceReceivedResponse(message, responsePromise) {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if (trace === Trace.Verbose || trace === Trace.Compact) {\n if (message.error && message.error.data) {\n data = `Error data: ${stringifyTrace(message.error.data)}\\n\\n`;\n }\n else {\n if (message.result) {\n data = `Result: ${stringifyTrace(message.result)}\\n\\n`;\n }\n else if (message.error === undefined) {\n data = 'No result returned.\\n\\n';\n }\n }\n }\n if (responsePromise) {\n const error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : '';\n tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data);\n }\n else {\n tracer.log(`Received response ${message.id} without active response promise.`, data);\n }\n }\n else {\n logLSPMessage('receive-response', message);\n }\n }\n function logLSPMessage(type, message) {\n if (!tracer || trace === Trace.Off) {\n return;\n }\n const lspMessage = {\n isLSPMessage: true,\n type,\n message,\n timestamp: Date.now()\n };\n tracer.log(lspMessage);\n }\n function throwIfClosedOrDisposed() {\n if (isClosed()) {\n throw new ConnectionError(ConnectionErrors.Closed, 'Connection is closed.');\n }\n if (isDisposed()) {\n throw new ConnectionError(ConnectionErrors.Disposed, 'Connection is disposed.');\n }\n }\n function throwIfListening() {\n if (isListening()) {\n throw new ConnectionError(ConnectionErrors.AlreadyListening, 'Connection is already listening');\n }\n }\n function throwIfNotListening() {\n if (!isListening()) {\n throw new Error('Call listen() first.');\n }\n }\n function undefinedToNull(param) {\n if (param === undefined) {\n return null;\n }\n else {\n return param;\n }\n }\n function nullToUndefined(param) {\n if (param === null) {\n return undefined;\n }\n else {\n return param;\n }\n }\n function isNamedParam(param) {\n return param !== undefined && param !== null && !Array.isArray(param) && typeof param === 'object';\n }\n function computeSingleParam(parameterStructures, param) {\n switch (parameterStructures) {\n case messages_1.ParameterStructures.auto:\n if (isNamedParam(param)) {\n return nullToUndefined(param);\n }\n else {\n return [undefinedToNull(param)];\n }\n case messages_1.ParameterStructures.byName:\n if (!isNamedParam(param)) {\n throw new Error(`Received parameters by name but param is not an object literal.`);\n }\n return nullToUndefined(param);\n case messages_1.ParameterStructures.byPosition:\n return [undefinedToNull(param)];\n default:\n throw new Error(`Unknown parameter structure ${parameterStructures.toString()}`);\n }\n }\n function computeMessageParams(type, params) {\n let result;\n const numberOfParams = type.numberOfParams;\n switch (numberOfParams) {\n case 0:\n result = undefined;\n break;\n case 1:\n result = computeSingleParam(type.parameterStructures, params[0]);\n break;\n default:\n result = [];\n for (let i = 0; i < params.length && i < numberOfParams; i++) {\n result.push(undefinedToNull(params[i]));\n }\n if (params.length < numberOfParams) {\n for (let i = params.length; i < numberOfParams; i++) {\n result.push(null);\n }\n }\n break;\n }\n return result;\n }\n const connection = {\n sendNotification: (type, ...args) => {\n throwIfClosedOrDisposed();\n let method;\n let messageParams;\n if (Is.string(type)) {\n method = type;\n const first = args[0];\n let paramStart = 0;\n let parameterStructures = messages_1.ParameterStructures.auto;\n if (messages_1.ParameterStructures.is(first)) {\n paramStart = 1;\n parameterStructures = first;\n }\n let paramEnd = args.length;\n const numberOfParams = paramEnd - paramStart;\n switch (numberOfParams) {\n case 0:\n messageParams = undefined;\n break;\n case 1:\n messageParams = computeSingleParam(parameterStructures, args[paramStart]);\n break;\n default:\n if (parameterStructures === messages_1.ParameterStructures.byName) {\n throw new Error(`Received ${numberOfParams} parameters for 'by Name' notification parameter structure.`);\n }\n messageParams = args.slice(paramStart, paramEnd).map(value => undefinedToNull(value));\n break;\n }\n }\n else {\n const params = args;\n method = type.method;\n messageParams = computeMessageParams(type, params);\n }\n const notificationMessage = {\n jsonrpc: version,\n method: method,\n params: messageParams\n };\n traceSendingNotification(notificationMessage);\n return messageWriter.write(notificationMessage).catch((error) => {\n logger.error(`Sending notification failed.`);\n throw error;\n });\n },\n onNotification: (type, handler) => {\n throwIfClosedOrDisposed();\n let method;\n if (Is.func(type)) {\n starNotificationHandler = type;\n }\n else if (handler) {\n if (Is.string(type)) {\n method = type;\n notificationHandlers.set(type, { type: undefined, handler });\n }\n else {\n method = type.method;\n notificationHandlers.set(type.method, { type, handler });\n }\n }\n return {\n dispose: () => {\n if (method !== undefined) {\n notificationHandlers.delete(method);\n }\n else {\n starNotificationHandler = undefined;\n }\n }\n };\n },\n onProgress: (_type, token, handler) => {\n if (progressHandlers.has(token)) {\n throw new Error(`Progress handler for token ${token} already registered`);\n }\n progressHandlers.set(token, handler);\n return {\n dispose: () => {\n progressHandlers.delete(token);\n }\n };\n },\n sendProgress: (_type, token, value) => {\n // This should not await but simple return to ensure that we don't have another\n // async scheduling. Otherwise one send could overtake another send.\n return connection.sendNotification(ProgressNotification.type, { token, value });\n },\n onUnhandledProgress: unhandledProgressEmitter.event,\n sendRequest: (type, ...args) => {\n throwIfClosedOrDisposed();\n throwIfNotListening();\n let method;\n let messageParams;\n let token = undefined;\n if (Is.string(type)) {\n method = type;\n const first = args[0];\n const last = args[args.length - 1];\n let paramStart = 0;\n let parameterStructures = messages_1.ParameterStructures.auto;\n if (messages_1.ParameterStructures.is(first)) {\n paramStart = 1;\n parameterStructures = first;\n }\n let paramEnd = args.length;\n if (cancellation_1.CancellationToken.is(last)) {\n paramEnd = paramEnd - 1;\n token = last;\n }\n const numberOfParams = paramEnd - paramStart;\n switch (numberOfParams) {\n case 0:\n messageParams = undefined;\n break;\n case 1:\n messageParams = computeSingleParam(parameterStructures, args[paramStart]);\n break;\n default:\n if (parameterStructures === messages_1.ParameterStructures.byName) {\n throw new Error(`Received ${numberOfParams} parameters for 'by Name' request parameter structure.`);\n }\n messageParams = args.slice(paramStart, paramEnd).map(value => undefinedToNull(value));\n break;\n }\n }\n else {\n const params = args;\n method = type.method;\n messageParams = computeMessageParams(type, params);\n const numberOfParams = type.numberOfParams;\n token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : undefined;\n }\n const id = sequenceNumber++;\n let disposable;\n if (token) {\n disposable = token.onCancellationRequested(() => {\n const p = cancellationStrategy.sender.sendCancellation(connection, id);\n if (p === undefined) {\n logger.log(`Received no promise from cancellation strategy when cancelling id ${id}`);\n return Promise.resolve();\n }\n else {\n return p.catch(() => {\n logger.log(`Sending cancellation messages for id ${id} failed`);\n });\n }\n });\n }\n const requestMessage = {\n jsonrpc: version,\n id: id,\n method: method,\n params: messageParams\n };\n traceSendingRequest(requestMessage);\n if (typeof cancellationStrategy.sender.enableCancellation === 'function') {\n cancellationStrategy.sender.enableCancellation(requestMessage);\n }\n return new Promise(async (resolve, reject) => {\n const resolveWithCleanup = (r) => {\n resolve(r);\n cancellationStrategy.sender.cleanup(id);\n disposable?.dispose();\n };\n const rejectWithCleanup = (r) => {\n reject(r);\n cancellationStrategy.sender.cleanup(id);\n disposable?.dispose();\n };\n const responsePromise = { method: method, timerStart: Date.now(), resolve: resolveWithCleanup, reject: rejectWithCleanup };\n try {\n await messageWriter.write(requestMessage);\n responsePromises.set(id, responsePromise);\n }\n catch (error) {\n logger.error(`Sending request failed.`);\n // Writing the message failed. So we need to reject the promise.\n responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, error.message ? error.message : 'Unknown reason'));\n throw error;\n }\n });\n },\n onRequest: (type, handler) => {\n throwIfClosedOrDisposed();\n let method = null;\n if (StarRequestHandler.is(type)) {\n method = undefined;\n starRequestHandler = type;\n }\n else if (Is.string(type)) {\n method = null;\n if (handler !== undefined) {\n method = type;\n requestHandlers.set(type, { handler: handler, type: undefined });\n }\n }\n else {\n if (handler !== undefined) {\n method = type.method;\n requestHandlers.set(type.method, { type, handler });\n }\n }\n return {\n dispose: () => {\n if (method === null) {\n return;\n }\n if (method !== undefined) {\n requestHandlers.delete(method);\n }\n else {\n starRequestHandler = undefined;\n }\n }\n };\n },\n hasPendingResponse: () => {\n return responsePromises.size > 0;\n },\n trace: async (_value, _tracer, sendNotificationOrTraceOptions) => {\n let _sendNotification = false;\n let _traceFormat = TraceFormat.Text;\n if (sendNotificationOrTraceOptions !== undefined) {\n if (Is.boolean(sendNotificationOrTraceOptions)) {\n _sendNotification = sendNotificationOrTraceOptions;\n }\n else {\n _sendNotification = sendNotificationOrTraceOptions.sendNotification || false;\n _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text;\n }\n }\n trace = _value;\n traceFormat = _traceFormat;\n if (trace === Trace.Off) {\n tracer = undefined;\n }\n else {\n tracer = _tracer;\n }\n if (_sendNotification && !isClosed() && !isDisposed()) {\n await connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) });\n }\n },\n onError: errorEmitter.event,\n onClose: closeEmitter.event,\n onUnhandledNotification: unhandledNotificationEmitter.event,\n onDispose: disposeEmitter.event,\n end: () => {\n messageWriter.end();\n },\n dispose: () => {\n if (isDisposed()) {\n return;\n }\n state = ConnectionState.Disposed;\n disposeEmitter.fire(undefined);\n const error = new messages_1.ResponseError(messages_1.ErrorCodes.PendingResponseRejected, 'Pending response rejected since connection got disposed');\n for (const promise of responsePromises.values()) {\n promise.reject(error);\n }\n responsePromises = new Map();\n requestTokens = new Map();\n knownCanceledRequests = new Set();\n messageQueue = new linkedMap_1.LinkedMap();\n // Test for backwards compatibility\n if (Is.func(messageWriter.dispose)) {\n messageWriter.dispose();\n }\n if (Is.func(messageReader.dispose)) {\n messageReader.dispose();\n }\n },\n listen: () => {\n throwIfClosedOrDisposed();\n throwIfListening();\n state = ConnectionState.Listening;\n messageReader.listen(callback);\n },\n inspect: () => {\n // eslint-disable-next-line no-console\n (0, ral_1.default)().console.log('inspect');\n }\n };\n connection.onNotification(LogTraceNotification.type, (params) => {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n const verbose = trace === Trace.Verbose || trace === Trace.Compact;\n tracer.log(params.message, verbose ? params.verbose : undefined);\n });\n connection.onNotification(ProgressNotification.type, (params) => {\n const handler = progressHandlers.get(params.token);\n if (handler) {\n handler(params.value);\n }\n else {\n unhandledProgressEmitter.fire(params);\n }\n });\n return connection;\n}\nexports.createMessageConnection = createMessageConnection;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n/// \nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProgressType = exports.ProgressToken = exports.createMessageConnection = exports.NullLogger = exports.ConnectionOptions = exports.ConnectionStrategy = exports.AbstractMessageBuffer = exports.WriteableStreamMessageWriter = exports.AbstractMessageWriter = exports.MessageWriter = exports.ReadableStreamMessageReader = exports.AbstractMessageReader = exports.MessageReader = exports.SharedArrayReceiverStrategy = exports.SharedArraySenderStrategy = exports.CancellationToken = exports.CancellationTokenSource = exports.Emitter = exports.Event = exports.Disposable = exports.LRUCache = exports.Touch = exports.LinkedMap = exports.ParameterStructures = exports.NotificationType9 = exports.NotificationType8 = exports.NotificationType7 = exports.NotificationType6 = exports.NotificationType5 = exports.NotificationType4 = exports.NotificationType3 = exports.NotificationType2 = exports.NotificationType1 = exports.NotificationType0 = exports.NotificationType = exports.ErrorCodes = exports.ResponseError = exports.RequestType9 = exports.RequestType8 = exports.RequestType7 = exports.RequestType6 = exports.RequestType5 = exports.RequestType4 = exports.RequestType3 = exports.RequestType2 = exports.RequestType1 = exports.RequestType0 = exports.RequestType = exports.Message = exports.RAL = void 0;\nexports.MessageStrategy = exports.CancellationStrategy = exports.CancellationSenderStrategy = exports.CancellationReceiverStrategy = exports.ConnectionError = exports.ConnectionErrors = exports.LogTraceNotification = exports.SetTraceNotification = exports.TraceFormat = exports.TraceValues = exports.Trace = void 0;\nconst messages_1 = require(\"./messages\");\nObject.defineProperty(exports, \"Message\", { enumerable: true, get: function () { return messages_1.Message; } });\nObject.defineProperty(exports, \"RequestType\", { enumerable: true, get: function () { return messages_1.RequestType; } });\nObject.defineProperty(exports, \"RequestType0\", { enumerable: true, get: function () { return messages_1.RequestType0; } });\nObject.defineProperty(exports, \"RequestType1\", { enumerable: true, get: function () { return messages_1.RequestType1; } });\nObject.defineProperty(exports, \"RequestType2\", { enumerable: true, get: function () { return messages_1.RequestType2; } });\nObject.defineProperty(exports, \"RequestType3\", { enumerable: true, get: function () { return messages_1.RequestType3; } });\nObject.defineProperty(exports, \"RequestType4\", { enumerable: true, get: function () { return messages_1.RequestType4; } });\nObject.defineProperty(exports, \"RequestType5\", { enumerable: true, get: function () { return messages_1.RequestType5; } });\nObject.defineProperty(exports, \"RequestType6\", { enumerable: true, get: function () { return messages_1.RequestType6; } });\nObject.defineProperty(exports, \"RequestType7\", { enumerable: true, get: function () { return messages_1.RequestType7; } });\nObject.defineProperty(exports, \"RequestType8\", { enumerable: true, get: function () { return messages_1.RequestType8; } });\nObject.defineProperty(exports, \"RequestType9\", { enumerable: true, get: function () { return messages_1.RequestType9; } });\nObject.defineProperty(exports, \"ResponseError\", { enumerable: true, get: function () { return messages_1.ResponseError; } });\nObject.defineProperty(exports, \"ErrorCodes\", { enumerable: true, get: function () { return messages_1.ErrorCodes; } });\nObject.defineProperty(exports, \"NotificationType\", { enumerable: true, get: function () { return messages_1.NotificationType; } });\nObject.defineProperty(exports, \"NotificationType0\", { enumerable: true, get: function () { return messages_1.NotificationType0; } });\nObject.defineProperty(exports, \"NotificationType1\", { enumerable: true, get: function () { return messages_1.NotificationType1; } });\nObject.defineProperty(exports, \"NotificationType2\", { enumerable: true, get: function () { return messages_1.NotificationType2; } });\nObject.defineProperty(exports, \"NotificationType3\", { enumerable: true, get: function () { return messages_1.NotificationType3; } });\nObject.defineProperty(exports, \"NotificationType4\", { enumerable: true, get: function () { return messages_1.NotificationType4; } });\nObject.defineProperty(exports, \"NotificationType5\", { enumerable: true, get: function () { return messages_1.NotificationType5; } });\nObject.defineProperty(exports, \"NotificationType6\", { enumerable: true, get: function () { return messages_1.NotificationType6; } });\nObject.defineProperty(exports, \"NotificationType7\", { enumerable: true, get: function () { return messages_1.NotificationType7; } });\nObject.defineProperty(exports, \"NotificationType8\", { enumerable: true, get: function () { return messages_1.NotificationType8; } });\nObject.defineProperty(exports, \"NotificationType9\", { enumerable: true, get: function () { return messages_1.NotificationType9; } });\nObject.defineProperty(exports, \"ParameterStructures\", { enumerable: true, get: function () { return messages_1.ParameterStructures; } });\nconst linkedMap_1 = require(\"./linkedMap\");\nObject.defineProperty(exports, \"LinkedMap\", { enumerable: true, get: function () { return linkedMap_1.LinkedMap; } });\nObject.defineProperty(exports, \"LRUCache\", { enumerable: true, get: function () { return linkedMap_1.LRUCache; } });\nObject.defineProperty(exports, \"Touch\", { enumerable: true, get: function () { return linkedMap_1.Touch; } });\nconst disposable_1 = require(\"./disposable\");\nObject.defineProperty(exports, \"Disposable\", { enumerable: true, get: function () { return disposable_1.Disposable; } });\nconst events_1 = require(\"./events\");\nObject.defineProperty(exports, \"Event\", { enumerable: true, get: function () { return events_1.Event; } });\nObject.defineProperty(exports, \"Emitter\", { enumerable: true, get: function () { return events_1.Emitter; } });\nconst cancellation_1 = require(\"./cancellation\");\nObject.defineProperty(exports, \"CancellationTokenSource\", { enumerable: true, get: function () { return cancellation_1.CancellationTokenSource; } });\nObject.defineProperty(exports, \"CancellationToken\", { enumerable: true, get: function () { return cancellation_1.CancellationToken; } });\nconst sharedArrayCancellation_1 = require(\"./sharedArrayCancellation\");\nObject.defineProperty(exports, \"SharedArraySenderStrategy\", { enumerable: true, get: function () { return sharedArrayCancellation_1.SharedArraySenderStrategy; } });\nObject.defineProperty(exports, \"SharedArrayReceiverStrategy\", { enumerable: true, get: function () { return sharedArrayCancellation_1.SharedArrayReceiverStrategy; } });\nconst messageReader_1 = require(\"./messageReader\");\nObject.defineProperty(exports, \"MessageReader\", { enumerable: true, get: function () { return messageReader_1.MessageReader; } });\nObject.defineProperty(exports, \"AbstractMessageReader\", { enumerable: true, get: function () { return messageReader_1.AbstractMessageReader; } });\nObject.defineProperty(exports, \"ReadableStreamMessageReader\", { enumerable: true, get: function () { return messageReader_1.ReadableStreamMessageReader; } });\nconst messageWriter_1 = require(\"./messageWriter\");\nObject.defineProperty(exports, \"MessageWriter\", { enumerable: true, get: function () { return messageWriter_1.MessageWriter; } });\nObject.defineProperty(exports, \"AbstractMessageWriter\", { enumerable: true, get: function () { return messageWriter_1.AbstractMessageWriter; } });\nObject.defineProperty(exports, \"WriteableStreamMessageWriter\", { enumerable: true, get: function () { return messageWriter_1.WriteableStreamMessageWriter; } });\nconst messageBuffer_1 = require(\"./messageBuffer\");\nObject.defineProperty(exports, \"AbstractMessageBuffer\", { enumerable: true, get: function () { return messageBuffer_1.AbstractMessageBuffer; } });\nconst connection_1 = require(\"./connection\");\nObject.defineProperty(exports, \"ConnectionStrategy\", { enumerable: true, get: function () { return connection_1.ConnectionStrategy; } });\nObject.defineProperty(exports, \"ConnectionOptions\", { enumerable: true, get: function () { return connection_1.ConnectionOptions; } });\nObject.defineProperty(exports, \"NullLogger\", { enumerable: true, get: function () { return connection_1.NullLogger; } });\nObject.defineProperty(exports, \"createMessageConnection\", { enumerable: true, get: function () { return connection_1.createMessageConnection; } });\nObject.defineProperty(exports, \"ProgressToken\", { enumerable: true, get: function () { return connection_1.ProgressToken; } });\nObject.defineProperty(exports, \"ProgressType\", { enumerable: true, get: function () { return connection_1.ProgressType; } });\nObject.defineProperty(exports, \"Trace\", { enumerable: true, get: function () { return connection_1.Trace; } });\nObject.defineProperty(exports, \"TraceValues\", { enumerable: true, get: function () { return connection_1.TraceValues; } });\nObject.defineProperty(exports, \"TraceFormat\", { enumerable: true, get: function () { return connection_1.TraceFormat; } });\nObject.defineProperty(exports, \"SetTraceNotification\", { enumerable: true, get: function () { return connection_1.SetTraceNotification; } });\nObject.defineProperty(exports, \"LogTraceNotification\", { enumerable: true, get: function () { return connection_1.LogTraceNotification; } });\nObject.defineProperty(exports, \"ConnectionErrors\", { enumerable: true, get: function () { return connection_1.ConnectionErrors; } });\nObject.defineProperty(exports, \"ConnectionError\", { enumerable: true, get: function () { return connection_1.ConnectionError; } });\nObject.defineProperty(exports, \"CancellationReceiverStrategy\", { enumerable: true, get: function () { return connection_1.CancellationReceiverStrategy; } });\nObject.defineProperty(exports, \"CancellationSenderStrategy\", { enumerable: true, get: function () { return connection_1.CancellationSenderStrategy; } });\nObject.defineProperty(exports, \"CancellationStrategy\", { enumerable: true, get: function () { return connection_1.CancellationStrategy; } });\nObject.defineProperty(exports, \"MessageStrategy\", { enumerable: true, get: function () { return connection_1.MessageStrategy; } });\nconst ral_1 = require(\"./ral\");\nexports.RAL = ral_1.default;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"util\");\nconst api_1 = require(\"../common/api\");\nclass MessageBuffer extends api_1.AbstractMessageBuffer {\n constructor(encoding = 'utf-8') {\n super(encoding);\n }\n emptyBuffer() {\n return MessageBuffer.emptyBuffer;\n }\n fromString(value, encoding) {\n return Buffer.from(value, encoding);\n }\n toString(value, encoding) {\n if (value instanceof Buffer) {\n return value.toString(encoding);\n }\n else {\n return new util_1.TextDecoder(encoding).decode(value);\n }\n }\n asNative(buffer, length) {\n if (length === undefined) {\n return buffer instanceof Buffer ? buffer : Buffer.from(buffer);\n }\n else {\n return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer, 0, length);\n }\n }\n allocNative(length) {\n return Buffer.allocUnsafe(length);\n }\n}\nMessageBuffer.emptyBuffer = Buffer.allocUnsafe(0);\nclass ReadableStreamWrapper {\n constructor(stream) {\n this.stream = stream;\n }\n onClose(listener) {\n this.stream.on('close', listener);\n return api_1.Disposable.create(() => this.stream.off('close', listener));\n }\n onError(listener) {\n this.stream.on('error', listener);\n return api_1.Disposable.create(() => this.stream.off('error', listener));\n }\n onEnd(listener) {\n this.stream.on('end', listener);\n return api_1.Disposable.create(() => this.stream.off('end', listener));\n }\n onData(listener) {\n this.stream.on('data', listener);\n return api_1.Disposable.create(() => this.stream.off('data', listener));\n }\n}\nclass WritableStreamWrapper {\n constructor(stream) {\n this.stream = stream;\n }\n onClose(listener) {\n this.stream.on('close', listener);\n return api_1.Disposable.create(() => this.stream.off('close', listener));\n }\n onError(listener) {\n this.stream.on('error', listener);\n return api_1.Disposable.create(() => this.stream.off('error', listener));\n }\n onEnd(listener) {\n this.stream.on('end', listener);\n return api_1.Disposable.create(() => this.stream.off('end', listener));\n }\n write(data, encoding) {\n return new Promise((resolve, reject) => {\n const callback = (error) => {\n if (error === undefined || error === null) {\n resolve();\n }\n else {\n reject(error);\n }\n };\n if (typeof data === 'string') {\n this.stream.write(data, encoding, callback);\n }\n else {\n this.stream.write(data, callback);\n }\n });\n }\n end() {\n this.stream.end();\n }\n}\nconst _ril = Object.freeze({\n messageBuffer: Object.freeze({\n create: (encoding) => new MessageBuffer(encoding)\n }),\n applicationJson: Object.freeze({\n encoder: Object.freeze({\n name: 'application/json',\n encode: (msg, options) => {\n try {\n return Promise.resolve(Buffer.from(JSON.stringify(msg, undefined, 0), options.charset));\n }\n catch (err) {\n return Promise.reject(err);\n }\n }\n }),\n decoder: Object.freeze({\n name: 'application/json',\n decode: (buffer, options) => {\n try {\n if (buffer instanceof Buffer) {\n return Promise.resolve(JSON.parse(buffer.toString(options.charset)));\n }\n else {\n return Promise.resolve(JSON.parse(new util_1.TextDecoder(options.charset).decode(buffer)));\n }\n }\n catch (err) {\n return Promise.reject(err);\n }\n }\n })\n }),\n stream: Object.freeze({\n asReadableStream: (stream) => new ReadableStreamWrapper(stream),\n asWritableStream: (stream) => new WritableStreamWrapper(stream)\n }),\n console: console,\n timer: Object.freeze({\n setTimeout(callback, ms, ...args) {\n const handle = setTimeout(callback, ms, ...args);\n return { dispose: () => clearTimeout(handle) };\n },\n setImmediate(callback, ...args) {\n const handle = setImmediate(callback, ...args);\n return { dispose: () => clearImmediate(handle) };\n },\n setInterval(callback, ms, ...args) {\n const handle = setInterval(callback, ms, ...args);\n return { dispose: () => clearInterval(handle) };\n }\n })\n});\nfunction RIL() {\n return _ril;\n}\n(function (RIL) {\n function install() {\n api_1.RAL.install(_ril);\n }\n RIL.install = install;\n})(RIL || (RIL = {}));\nexports.default = RIL;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createMessageConnection = exports.createServerSocketTransport = exports.createClientSocketTransport = exports.createServerPipeTransport = exports.createClientPipeTransport = exports.generateRandomPipeName = exports.StreamMessageWriter = exports.StreamMessageReader = exports.SocketMessageWriter = exports.SocketMessageReader = exports.PortMessageWriter = exports.PortMessageReader = exports.IPCMessageWriter = exports.IPCMessageReader = void 0;\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ----------------------------------------------------------------------------------------- */\nconst ril_1 = require(\"./ril\");\n// Install the node runtime abstract.\nril_1.default.install();\nconst path = require(\"path\");\nconst os = require(\"os\");\nconst crypto_1 = require(\"crypto\");\nconst net_1 = require(\"net\");\nconst api_1 = require(\"../common/api\");\n__exportStar(require(\"../common/api\"), exports);\nclass IPCMessageReader extends api_1.AbstractMessageReader {\n constructor(process) {\n super();\n this.process = process;\n let eventEmitter = this.process;\n eventEmitter.on('error', (error) => this.fireError(error));\n eventEmitter.on('close', () => this.fireClose());\n }\n listen(callback) {\n this.process.on('message', callback);\n return api_1.Disposable.create(() => this.process.off('message', callback));\n }\n}\nexports.IPCMessageReader = IPCMessageReader;\nclass IPCMessageWriter extends api_1.AbstractMessageWriter {\n constructor(process) {\n super();\n this.process = process;\n this.errorCount = 0;\n const eventEmitter = this.process;\n eventEmitter.on('error', (error) => this.fireError(error));\n eventEmitter.on('close', () => this.fireClose);\n }\n write(msg) {\n try {\n if (typeof this.process.send === 'function') {\n this.process.send(msg, undefined, undefined, (error) => {\n if (error) {\n this.errorCount++;\n this.handleError(error, msg);\n }\n else {\n this.errorCount = 0;\n }\n });\n }\n return Promise.resolve();\n }\n catch (error) {\n this.handleError(error, msg);\n return Promise.reject(error);\n }\n }\n handleError(error, msg) {\n this.errorCount++;\n this.fireError(error, msg, this.errorCount);\n }\n end() {\n }\n}\nexports.IPCMessageWriter = IPCMessageWriter;\nclass PortMessageReader extends api_1.AbstractMessageReader {\n constructor(port) {\n super();\n this.onData = new api_1.Emitter;\n port.on('close', () => this.fireClose);\n port.on('error', (error) => this.fireError(error));\n port.on('message', (message) => {\n this.onData.fire(message);\n });\n }\n listen(callback) {\n return this.onData.event(callback);\n }\n}\nexports.PortMessageReader = PortMessageReader;\nclass PortMessageWriter extends api_1.AbstractMessageWriter {\n constructor(port) {\n super();\n this.port = port;\n this.errorCount = 0;\n port.on('close', () => this.fireClose());\n port.on('error', (error) => this.fireError(error));\n }\n write(msg) {\n try {\n this.port.postMessage(msg);\n return Promise.resolve();\n }\n catch (error) {\n this.handleError(error, msg);\n return Promise.reject(error);\n }\n }\n handleError(error, msg) {\n this.errorCount++;\n this.fireError(error, msg, this.errorCount);\n }\n end() {\n }\n}\nexports.PortMessageWriter = PortMessageWriter;\nclass SocketMessageReader extends api_1.ReadableStreamMessageReader {\n constructor(socket, encoding = 'utf-8') {\n super((0, ril_1.default)().stream.asReadableStream(socket), encoding);\n }\n}\nexports.SocketMessageReader = SocketMessageReader;\nclass SocketMessageWriter extends api_1.WriteableStreamMessageWriter {\n constructor(socket, options) {\n super((0, ril_1.default)().stream.asWritableStream(socket), options);\n this.socket = socket;\n }\n dispose() {\n super.dispose();\n this.socket.destroy();\n }\n}\nexports.SocketMessageWriter = SocketMessageWriter;\nclass StreamMessageReader extends api_1.ReadableStreamMessageReader {\n constructor(readable, encoding) {\n super((0, ril_1.default)().stream.asReadableStream(readable), encoding);\n }\n}\nexports.StreamMessageReader = StreamMessageReader;\nclass StreamMessageWriter extends api_1.WriteableStreamMessageWriter {\n constructor(writable, options) {\n super((0, ril_1.default)().stream.asWritableStream(writable), options);\n }\n}\nexports.StreamMessageWriter = StreamMessageWriter;\nconst XDG_RUNTIME_DIR = process.env['XDG_RUNTIME_DIR'];\nconst safeIpcPathLengths = new Map([\n ['linux', 107],\n ['darwin', 103]\n]);\nfunction generateRandomPipeName() {\n const randomSuffix = (0, crypto_1.randomBytes)(21).toString('hex');\n if (process.platform === 'win32') {\n return `\\\\\\\\.\\\\pipe\\\\vscode-jsonrpc-${randomSuffix}-sock`;\n }\n let result;\n if (XDG_RUNTIME_DIR) {\n result = path.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`);\n }\n else {\n result = path.join(os.tmpdir(), `vscode-${randomSuffix}.sock`);\n }\n const limit = safeIpcPathLengths.get(process.platform);\n if (limit !== undefined && result.length > limit) {\n (0, ril_1.default)().console.warn(`WARNING: IPC handle \"${result}\" is longer than ${limit} characters.`);\n }\n return result;\n}\nexports.generateRandomPipeName = generateRandomPipeName;\nfunction createClientPipeTransport(pipeName, encoding = 'utf-8') {\n let connectResolve;\n const connected = new Promise((resolve, _reject) => {\n connectResolve = resolve;\n });\n return new Promise((resolve, reject) => {\n let server = (0, net_1.createServer)((socket) => {\n server.close();\n connectResolve([\n new SocketMessageReader(socket, encoding),\n new SocketMessageWriter(socket, encoding)\n ]);\n });\n server.on('error', reject);\n server.listen(pipeName, () => {\n server.removeListener('error', reject);\n resolve({\n onConnected: () => { return connected; }\n });\n });\n });\n}\nexports.createClientPipeTransport = createClientPipeTransport;\nfunction createServerPipeTransport(pipeName, encoding = 'utf-8') {\n const socket = (0, net_1.createConnection)(pipeName);\n return [\n new SocketMessageReader(socket, encoding),\n new SocketMessageWriter(socket, encoding)\n ];\n}\nexports.createServerPipeTransport = createServerPipeTransport;\nfunction createClientSocketTransport(port, encoding = 'utf-8') {\n let connectResolve;\n const connected = new Promise((resolve, _reject) => {\n connectResolve = resolve;\n });\n return new Promise((resolve, reject) => {\n const server = (0, net_1.createServer)((socket) => {\n server.close();\n connectResolve([\n new SocketMessageReader(socket, encoding),\n new SocketMessageWriter(socket, encoding)\n ]);\n });\n server.on('error', reject);\n server.listen(port, '127.0.0.1', () => {\n server.removeListener('error', reject);\n resolve({\n onConnected: () => { return connected; }\n });\n });\n });\n}\nexports.createClientSocketTransport = createClientSocketTransport;\nfunction createServerSocketTransport(port, encoding = 'utf-8') {\n const socket = (0, net_1.createConnection)(port, '127.0.0.1');\n return [\n new SocketMessageReader(socket, encoding),\n new SocketMessageWriter(socket, encoding)\n ];\n}\nexports.createServerSocketTransport = createServerSocketTransport;\nfunction isReadableStream(value) {\n const candidate = value;\n return candidate.read !== undefined && candidate.addListener !== undefined;\n}\nfunction isWritableStream(value) {\n const candidate = value;\n return candidate.write !== undefined && candidate.addListener !== undefined;\n}\nfunction createMessageConnection(input, output, logger, options) {\n if (!logger) {\n logger = api_1.NullLogger;\n }\n const reader = isReadableStream(input) ? new StreamMessageReader(input) : input;\n const writer = isWritableStream(output) ? new StreamMessageWriter(output) : output;\n if (api_1.ConnectionStrategy.is(options)) {\n options = { connectionStrategy: options };\n }\n return (0, api_1.createMessageConnection)(reader, writer, logger, options);\n}\nexports.createMessageConnection = createMessageConnection;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ----------------------------------------------------------------------------------------- */\n'use strict';\n\nmodule.exports = require('./lib/node/main');","(function (factory) {\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n var v = factory(require, exports);\n if (v !== undefined) module.exports = v;\n }\n else if (typeof define === \"function\" && define.amd) {\n define([\"require\", \"exports\"], factory);\n }\n})(function (require, exports) {\n /* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n 'use strict';\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.TextDocument = exports.EOL = exports.WorkspaceFolder = exports.InlineCompletionContext = exports.SelectedCompletionInfo = exports.InlineCompletionTriggerKind = exports.InlineCompletionList = exports.InlineCompletionItem = exports.StringValue = exports.InlayHint = exports.InlayHintLabelPart = exports.InlayHintKind = exports.InlineValueContext = exports.InlineValueEvaluatableExpression = exports.InlineValueVariableLookup = exports.InlineValueText = exports.SemanticTokens = exports.SemanticTokenModifiers = exports.SemanticTokenTypes = exports.SelectionRange = exports.DocumentLink = exports.FormattingOptions = exports.CodeLens = exports.CodeAction = exports.CodeActionContext = exports.CodeActionTriggerKind = exports.CodeActionKind = exports.DocumentSymbol = exports.WorkspaceSymbol = exports.SymbolInformation = exports.SymbolTag = exports.SymbolKind = exports.DocumentHighlight = exports.DocumentHighlightKind = exports.SignatureInformation = exports.ParameterInformation = exports.Hover = exports.MarkedString = exports.CompletionList = exports.CompletionItem = exports.CompletionItemLabelDetails = exports.InsertTextMode = exports.InsertReplaceEdit = exports.CompletionItemTag = exports.InsertTextFormat = exports.CompletionItemKind = exports.MarkupContent = exports.MarkupKind = exports.TextDocumentItem = exports.OptionalVersionedTextDocumentIdentifier = exports.VersionedTextDocumentIdentifier = exports.TextDocumentIdentifier = exports.WorkspaceChange = exports.WorkspaceEdit = exports.DeleteFile = exports.RenameFile = exports.CreateFile = exports.TextDocumentEdit = exports.AnnotatedTextEdit = exports.ChangeAnnotationIdentifier = exports.ChangeAnnotation = exports.TextEdit = exports.Command = exports.Diagnostic = exports.CodeDescription = exports.DiagnosticTag = exports.DiagnosticSeverity = exports.DiagnosticRelatedInformation = exports.FoldingRange = exports.FoldingRangeKind = exports.ColorPresentation = exports.ColorInformation = exports.Color = exports.LocationLink = exports.Location = exports.Range = exports.Position = exports.uinteger = exports.integer = exports.URI = exports.DocumentUri = void 0;\n var DocumentUri;\n (function (DocumentUri) {\n function is(value) {\n return typeof value === 'string';\n }\n DocumentUri.is = is;\n })(DocumentUri || (exports.DocumentUri = DocumentUri = {}));\n var URI;\n (function (URI) {\n function is(value) {\n return typeof value === 'string';\n }\n URI.is = is;\n })(URI || (exports.URI = URI = {}));\n var integer;\n (function (integer) {\n integer.MIN_VALUE = -2147483648;\n integer.MAX_VALUE = 2147483647;\n function is(value) {\n return typeof value === 'number' && integer.MIN_VALUE <= value && value <= integer.MAX_VALUE;\n }\n integer.is = is;\n })(integer || (exports.integer = integer = {}));\n var uinteger;\n (function (uinteger) {\n uinteger.MIN_VALUE = 0;\n uinteger.MAX_VALUE = 2147483647;\n function is(value) {\n return typeof value === 'number' && uinteger.MIN_VALUE <= value && value <= uinteger.MAX_VALUE;\n }\n uinteger.is = is;\n })(uinteger || (exports.uinteger = uinteger = {}));\n /**\n * The Position namespace provides helper functions to work with\n * {@link Position} literals.\n */\n var Position;\n (function (Position) {\n /**\n * Creates a new Position literal from the given line and character.\n * @param line The position's line.\n * @param character The position's character.\n */\n function create(line, character) {\n if (line === Number.MAX_VALUE) {\n line = uinteger.MAX_VALUE;\n }\n if (character === Number.MAX_VALUE) {\n character = uinteger.MAX_VALUE;\n }\n return { line: line, character: character };\n }\n Position.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Position} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);\n }\n Position.is = is;\n })(Position || (exports.Position = Position = {}));\n /**\n * The Range namespace provides helper functions to work with\n * {@link Range} literals.\n */\n var Range;\n (function (Range) {\n function create(one, two, three, four) {\n if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {\n return { start: Position.create(one, two), end: Position.create(three, four) };\n }\n else if (Position.is(one) && Position.is(two)) {\n return { start: one, end: two };\n }\n else {\n throw new Error(\"Range#create called with invalid arguments[\".concat(one, \", \").concat(two, \", \").concat(three, \", \").concat(four, \"]\"));\n }\n }\n Range.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Range} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }\n Range.is = is;\n })(Range || (exports.Range = Range = {}));\n /**\n * The Location namespace provides helper functions to work with\n * {@link Location} literals.\n */\n var Location;\n (function (Location) {\n /**\n * Creates a Location literal.\n * @param uri The location's uri.\n * @param range The location's range.\n */\n function create(uri, range) {\n return { uri: uri, range: range };\n }\n Location.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Location} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));\n }\n Location.is = is;\n })(Location || (exports.Location = Location = {}));\n /**\n * The LocationLink namespace provides helper functions to work with\n * {@link LocationLink} literals.\n */\n var LocationLink;\n (function (LocationLink) {\n /**\n * Creates a LocationLink literal.\n * @param targetUri The definition's uri.\n * @param targetRange The full range of the definition.\n * @param targetSelectionRange The span of the symbol definition at the target.\n * @param originSelectionRange The span of the symbol being defined in the originating source file.\n */\n function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {\n return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };\n }\n LocationLink.create = create;\n /**\n * Checks whether the given literal conforms to the {@link LocationLink} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)\n && Range.is(candidate.targetSelectionRange)\n && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));\n }\n LocationLink.is = is;\n })(LocationLink || (exports.LocationLink = LocationLink = {}));\n /**\n * The Color namespace provides helper functions to work with\n * {@link Color} literals.\n */\n var Color;\n (function (Color) {\n /**\n * Creates a new Color literal.\n */\n function create(red, green, blue, alpha) {\n return {\n red: red,\n green: green,\n blue: blue,\n alpha: alpha,\n };\n }\n Color.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Color} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1)\n && Is.numberRange(candidate.green, 0, 1)\n && Is.numberRange(candidate.blue, 0, 1)\n && Is.numberRange(candidate.alpha, 0, 1);\n }\n Color.is = is;\n })(Color || (exports.Color = Color = {}));\n /**\n * The ColorInformation namespace provides helper functions to work with\n * {@link ColorInformation} literals.\n */\n var ColorInformation;\n (function (ColorInformation) {\n /**\n * Creates a new ColorInformation literal.\n */\n function create(range, color) {\n return {\n range: range,\n color: color,\n };\n }\n ColorInformation.create = create;\n /**\n * Checks whether the given literal conforms to the {@link ColorInformation} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);\n }\n ColorInformation.is = is;\n })(ColorInformation || (exports.ColorInformation = ColorInformation = {}));\n /**\n * The Color namespace provides helper functions to work with\n * {@link ColorPresentation} literals.\n */\n var ColorPresentation;\n (function (ColorPresentation) {\n /**\n * Creates a new ColorInformation literal.\n */\n function create(label, textEdit, additionalTextEdits) {\n return {\n label: label,\n textEdit: textEdit,\n additionalTextEdits: additionalTextEdits,\n };\n }\n ColorPresentation.create = create;\n /**\n * Checks whether the given literal conforms to the {@link ColorInformation} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.label)\n && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))\n && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));\n }\n ColorPresentation.is = is;\n })(ColorPresentation || (exports.ColorPresentation = ColorPresentation = {}));\n /**\n * A set of predefined range kinds.\n */\n var FoldingRangeKind;\n (function (FoldingRangeKind) {\n /**\n * Folding range for a comment\n */\n FoldingRangeKind.Comment = 'comment';\n /**\n * Folding range for an import or include\n */\n FoldingRangeKind.Imports = 'imports';\n /**\n * Folding range for a region (e.g. `#region`)\n */\n FoldingRangeKind.Region = 'region';\n })(FoldingRangeKind || (exports.FoldingRangeKind = FoldingRangeKind = {}));\n /**\n * The folding range namespace provides helper functions to work with\n * {@link FoldingRange} literals.\n */\n var FoldingRange;\n (function (FoldingRange) {\n /**\n * Creates a new FoldingRange literal.\n */\n function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {\n var result = {\n startLine: startLine,\n endLine: endLine\n };\n if (Is.defined(startCharacter)) {\n result.startCharacter = startCharacter;\n }\n if (Is.defined(endCharacter)) {\n result.endCharacter = endCharacter;\n }\n if (Is.defined(kind)) {\n result.kind = kind;\n }\n if (Is.defined(collapsedText)) {\n result.collapsedText = collapsedText;\n }\n return result;\n }\n FoldingRange.create = create;\n /**\n * Checks whether the given literal conforms to the {@link FoldingRange} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine)\n && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))\n && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))\n && (Is.undefined(candidate.kind) || Is.string(candidate.kind));\n }\n FoldingRange.is = is;\n })(FoldingRange || (exports.FoldingRange = FoldingRange = {}));\n /**\n * The DiagnosticRelatedInformation namespace provides helper functions to work with\n * {@link DiagnosticRelatedInformation} literals.\n */\n var DiagnosticRelatedInformation;\n (function (DiagnosticRelatedInformation) {\n /**\n * Creates a new DiagnosticRelatedInformation literal.\n */\n function create(location, message) {\n return {\n location: location,\n message: message\n };\n }\n DiagnosticRelatedInformation.create = create;\n /**\n * Checks whether the given literal conforms to the {@link DiagnosticRelatedInformation} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);\n }\n DiagnosticRelatedInformation.is = is;\n })(DiagnosticRelatedInformation || (exports.DiagnosticRelatedInformation = DiagnosticRelatedInformation = {}));\n /**\n * The diagnostic's severity.\n */\n var DiagnosticSeverity;\n (function (DiagnosticSeverity) {\n /**\n * Reports an error.\n */\n DiagnosticSeverity.Error = 1;\n /**\n * Reports a warning.\n */\n DiagnosticSeverity.Warning = 2;\n /**\n * Reports an information.\n */\n DiagnosticSeverity.Information = 3;\n /**\n * Reports a hint.\n */\n DiagnosticSeverity.Hint = 4;\n })(DiagnosticSeverity || (exports.DiagnosticSeverity = DiagnosticSeverity = {}));\n /**\n * The diagnostic tags.\n *\n * @since 3.15.0\n */\n var DiagnosticTag;\n (function (DiagnosticTag) {\n /**\n * Unused or unnecessary code.\n *\n * Clients are allowed to render diagnostics with this tag faded out instead of having\n * an error squiggle.\n */\n DiagnosticTag.Unnecessary = 1;\n /**\n * Deprecated or obsolete code.\n *\n * Clients are allowed to rendered diagnostics with this tag strike through.\n */\n DiagnosticTag.Deprecated = 2;\n })(DiagnosticTag || (exports.DiagnosticTag = DiagnosticTag = {}));\n /**\n * The CodeDescription namespace provides functions to deal with descriptions for diagnostic codes.\n *\n * @since 3.16.0\n */\n var CodeDescription;\n (function (CodeDescription) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.href);\n }\n CodeDescription.is = is;\n })(CodeDescription || (exports.CodeDescription = CodeDescription = {}));\n /**\n * The Diagnostic namespace provides helper functions to work with\n * {@link Diagnostic} literals.\n */\n var Diagnostic;\n (function (Diagnostic) {\n /**\n * Creates a new Diagnostic literal.\n */\n function create(range, message, severity, code, source, relatedInformation) {\n var result = { range: range, message: message };\n if (Is.defined(severity)) {\n result.severity = severity;\n }\n if (Is.defined(code)) {\n result.code = code;\n }\n if (Is.defined(source)) {\n result.source = source;\n }\n if (Is.defined(relatedInformation)) {\n result.relatedInformation = relatedInformation;\n }\n return result;\n }\n Diagnostic.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Diagnostic} interface.\n */\n function is(value) {\n var _a;\n var candidate = value;\n return Is.defined(candidate)\n && Range.is(candidate.range)\n && Is.string(candidate.message)\n && (Is.number(candidate.severity) || Is.undefined(candidate.severity))\n && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))\n && (Is.undefined(candidate.codeDescription) || (Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)))\n && (Is.string(candidate.source) || Is.undefined(candidate.source))\n && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));\n }\n Diagnostic.is = is;\n })(Diagnostic || (exports.Diagnostic = Diagnostic = {}));\n /**\n * The Command namespace provides helper functions to work with\n * {@link Command} literals.\n */\n var Command;\n (function (Command) {\n /**\n * Creates a new Command literal.\n */\n function create(title, command) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var result = { title: title, command: command };\n if (Is.defined(args) && args.length > 0) {\n result.arguments = args;\n }\n return result;\n }\n Command.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Command} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);\n }\n Command.is = is;\n })(Command || (exports.Command = Command = {}));\n /**\n * The TextEdit namespace provides helper function to create replace,\n * insert and delete edits more easily.\n */\n var TextEdit;\n (function (TextEdit) {\n /**\n * Creates a replace text edit.\n * @param range The range of text to be replaced.\n * @param newText The new text.\n */\n function replace(range, newText) {\n return { range: range, newText: newText };\n }\n TextEdit.replace = replace;\n /**\n * Creates an insert text edit.\n * @param position The position to insert the text at.\n * @param newText The text to be inserted.\n */\n function insert(position, newText) {\n return { range: { start: position, end: position }, newText: newText };\n }\n TextEdit.insert = insert;\n /**\n * Creates a delete text edit.\n * @param range The range of text to be deleted.\n */\n function del(range) {\n return { range: range, newText: '' };\n }\n TextEdit.del = del;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate)\n && Is.string(candidate.newText)\n && Range.is(candidate.range);\n }\n TextEdit.is = is;\n })(TextEdit || (exports.TextEdit = TextEdit = {}));\n var ChangeAnnotation;\n (function (ChangeAnnotation) {\n function create(label, needsConfirmation, description) {\n var result = { label: label };\n if (needsConfirmation !== undefined) {\n result.needsConfirmation = needsConfirmation;\n }\n if (description !== undefined) {\n result.description = description;\n }\n return result;\n }\n ChangeAnnotation.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.label) &&\n (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) &&\n (Is.string(candidate.description) || candidate.description === undefined);\n }\n ChangeAnnotation.is = is;\n })(ChangeAnnotation || (exports.ChangeAnnotation = ChangeAnnotation = {}));\n var ChangeAnnotationIdentifier;\n (function (ChangeAnnotationIdentifier) {\n function is(value) {\n var candidate = value;\n return Is.string(candidate);\n }\n ChangeAnnotationIdentifier.is = is;\n })(ChangeAnnotationIdentifier || (exports.ChangeAnnotationIdentifier = ChangeAnnotationIdentifier = {}));\n var AnnotatedTextEdit;\n (function (AnnotatedTextEdit) {\n /**\n * Creates an annotated replace text edit.\n *\n * @param range The range of text to be replaced.\n * @param newText The new text.\n * @param annotation The annotation.\n */\n function replace(range, newText, annotation) {\n return { range: range, newText: newText, annotationId: annotation };\n }\n AnnotatedTextEdit.replace = replace;\n /**\n * Creates an annotated insert text edit.\n *\n * @param position The position to insert the text at.\n * @param newText The text to be inserted.\n * @param annotation The annotation.\n */\n function insert(position, newText, annotation) {\n return { range: { start: position, end: position }, newText: newText, annotationId: annotation };\n }\n AnnotatedTextEdit.insert = insert;\n /**\n * Creates an annotated delete text edit.\n *\n * @param range The range of text to be deleted.\n * @param annotation The annotation.\n */\n function del(range, annotation) {\n return { range: range, newText: '', annotationId: annotation };\n }\n AnnotatedTextEdit.del = del;\n function is(value) {\n var candidate = value;\n return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n AnnotatedTextEdit.is = is;\n })(AnnotatedTextEdit || (exports.AnnotatedTextEdit = AnnotatedTextEdit = {}));\n /**\n * The TextDocumentEdit namespace provides helper function to create\n * an edit that manipulates a text document.\n */\n var TextDocumentEdit;\n (function (TextDocumentEdit) {\n /**\n * Creates a new `TextDocumentEdit`\n */\n function create(textDocument, edits) {\n return { textDocument: textDocument, edits: edits };\n }\n TextDocumentEdit.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate)\n && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument)\n && Array.isArray(candidate.edits);\n }\n TextDocumentEdit.is = is;\n })(TextDocumentEdit || (exports.TextDocumentEdit = TextDocumentEdit = {}));\n var CreateFile;\n (function (CreateFile) {\n function create(uri, options, annotation) {\n var result = {\n kind: 'create',\n uri: uri\n };\n if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n CreateFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined ||\n ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n CreateFile.is = is;\n })(CreateFile || (exports.CreateFile = CreateFile = {}));\n var RenameFile;\n (function (RenameFile) {\n function create(oldUri, newUri, options, annotation) {\n var result = {\n kind: 'rename',\n oldUri: oldUri,\n newUri: newUri\n };\n if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n RenameFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined ||\n ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n RenameFile.is = is;\n })(RenameFile || (exports.RenameFile = RenameFile = {}));\n var DeleteFile;\n (function (DeleteFile) {\n function create(uri, options, annotation) {\n var result = {\n kind: 'delete',\n uri: uri\n };\n if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n DeleteFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined ||\n ((candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n DeleteFile.is = is;\n })(DeleteFile || (exports.DeleteFile = DeleteFile = {}));\n var WorkspaceEdit;\n (function (WorkspaceEdit) {\n function is(value) {\n var candidate = value;\n return candidate &&\n (candidate.changes !== undefined || candidate.documentChanges !== undefined) &&\n (candidate.documentChanges === undefined || candidate.documentChanges.every(function (change) {\n if (Is.string(change.kind)) {\n return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);\n }\n else {\n return TextDocumentEdit.is(change);\n }\n }));\n }\n WorkspaceEdit.is = is;\n })(WorkspaceEdit || (exports.WorkspaceEdit = WorkspaceEdit = {}));\n var TextEditChangeImpl = /** @class */ (function () {\n function TextEditChangeImpl(edits, changeAnnotations) {\n this.edits = edits;\n this.changeAnnotations = changeAnnotations;\n }\n TextEditChangeImpl.prototype.insert = function (position, newText, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.insert(position, newText);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.insert(position, newText, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.insert(position, newText, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.replace = function (range, newText, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.replace(range, newText);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.replace(range, newText, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.replace(range, newText, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.delete = function (range, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.del(range);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.del(range, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.del(range, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.add = function (edit) {\n this.edits.push(edit);\n };\n TextEditChangeImpl.prototype.all = function () {\n return this.edits;\n };\n TextEditChangeImpl.prototype.clear = function () {\n this.edits.splice(0, this.edits.length);\n };\n TextEditChangeImpl.prototype.assertChangeAnnotations = function (value) {\n if (value === undefined) {\n throw new Error(\"Text edit change is not configured to manage change annotations.\");\n }\n };\n return TextEditChangeImpl;\n }());\n /**\n * A helper class\n */\n var ChangeAnnotations = /** @class */ (function () {\n function ChangeAnnotations(annotations) {\n this._annotations = annotations === undefined ? Object.create(null) : annotations;\n this._counter = 0;\n this._size = 0;\n }\n ChangeAnnotations.prototype.all = function () {\n return this._annotations;\n };\n Object.defineProperty(ChangeAnnotations.prototype, \"size\", {\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) {\n var id;\n if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {\n id = idOrAnnotation;\n }\n else {\n id = this.nextId();\n annotation = idOrAnnotation;\n }\n if (this._annotations[id] !== undefined) {\n throw new Error(\"Id \".concat(id, \" is already in use.\"));\n }\n if (annotation === undefined) {\n throw new Error(\"No annotation provided for id \".concat(id));\n }\n this._annotations[id] = annotation;\n this._size++;\n return id;\n };\n ChangeAnnotations.prototype.nextId = function () {\n this._counter++;\n return this._counter.toString();\n };\n return ChangeAnnotations;\n }());\n /**\n * A workspace change helps constructing changes to a workspace.\n */\n var WorkspaceChange = /** @class */ (function () {\n function WorkspaceChange(workspaceEdit) {\n var _this = this;\n this._textEditChanges = Object.create(null);\n if (workspaceEdit !== undefined) {\n this._workspaceEdit = workspaceEdit;\n if (workspaceEdit.documentChanges) {\n this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);\n workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n workspaceEdit.documentChanges.forEach(function (change) {\n if (TextDocumentEdit.is(change)) {\n var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);\n _this._textEditChanges[change.textDocument.uri] = textEditChange;\n }\n });\n }\n else if (workspaceEdit.changes) {\n Object.keys(workspaceEdit.changes).forEach(function (key) {\n var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);\n _this._textEditChanges[key] = textEditChange;\n });\n }\n }\n else {\n this._workspaceEdit = {};\n }\n }\n Object.defineProperty(WorkspaceChange.prototype, \"edit\", {\n /**\n * Returns the underlying {@link WorkspaceEdit} literal\n * use to be returned from a workspace edit operation like rename.\n */\n get: function () {\n this.initDocumentChanges();\n if (this._changeAnnotations !== undefined) {\n if (this._changeAnnotations.size === 0) {\n this._workspaceEdit.changeAnnotations = undefined;\n }\n else {\n this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n }\n }\n return this._workspaceEdit;\n },\n enumerable: false,\n configurable: true\n });\n WorkspaceChange.prototype.getTextEditChange = function (key) {\n if (OptionalVersionedTextDocumentIdentifier.is(key)) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var textDocument = { uri: key.uri, version: key.version };\n var result = this._textEditChanges[textDocument.uri];\n if (!result) {\n var edits = [];\n var textDocumentEdit = {\n textDocument: textDocument,\n edits: edits\n };\n this._workspaceEdit.documentChanges.push(textDocumentEdit);\n result = new TextEditChangeImpl(edits, this._changeAnnotations);\n this._textEditChanges[textDocument.uri] = result;\n }\n return result;\n }\n else {\n this.initChanges();\n if (this._workspaceEdit.changes === undefined) {\n throw new Error('Workspace edit is not configured for normal text edit changes.');\n }\n var result = this._textEditChanges[key];\n if (!result) {\n var edits = [];\n this._workspaceEdit.changes[key] = edits;\n result = new TextEditChangeImpl(edits);\n this._textEditChanges[key] = result;\n }\n return result;\n }\n };\n WorkspaceChange.prototype.initDocumentChanges = function () {\n if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {\n this._changeAnnotations = new ChangeAnnotations();\n this._workspaceEdit.documentChanges = [];\n this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n }\n };\n WorkspaceChange.prototype.initChanges = function () {\n if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {\n this._workspaceEdit.changes = Object.create(null);\n }\n };\n WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = CreateFile.create(uri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = CreateFile.create(uri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = RenameFile.create(oldUri, newUri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = RenameFile.create(oldUri, newUri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = DeleteFile.create(uri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = DeleteFile.create(uri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n return WorkspaceChange;\n }());\n exports.WorkspaceChange = WorkspaceChange;\n /**\n * The TextDocumentIdentifier namespace provides helper functions to work with\n * {@link TextDocumentIdentifier} literals.\n */\n var TextDocumentIdentifier;\n (function (TextDocumentIdentifier) {\n /**\n * Creates a new TextDocumentIdentifier literal.\n * @param uri The document's uri.\n */\n function create(uri) {\n return { uri: uri };\n }\n TextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the {@link TextDocumentIdentifier} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri);\n }\n TextDocumentIdentifier.is = is;\n })(TextDocumentIdentifier || (exports.TextDocumentIdentifier = TextDocumentIdentifier = {}));\n /**\n * The VersionedTextDocumentIdentifier namespace provides helper functions to work with\n * {@link VersionedTextDocumentIdentifier} literals.\n */\n var VersionedTextDocumentIdentifier;\n (function (VersionedTextDocumentIdentifier) {\n /**\n * Creates a new VersionedTextDocumentIdentifier literal.\n * @param uri The document's uri.\n * @param version The document's version.\n */\n function create(uri, version) {\n return { uri: uri, version: version };\n }\n VersionedTextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the {@link VersionedTextDocumentIdentifier} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);\n }\n VersionedTextDocumentIdentifier.is = is;\n })(VersionedTextDocumentIdentifier || (exports.VersionedTextDocumentIdentifier = VersionedTextDocumentIdentifier = {}));\n /**\n * The OptionalVersionedTextDocumentIdentifier namespace provides helper functions to work with\n * {@link OptionalVersionedTextDocumentIdentifier} literals.\n */\n var OptionalVersionedTextDocumentIdentifier;\n (function (OptionalVersionedTextDocumentIdentifier) {\n /**\n * Creates a new OptionalVersionedTextDocumentIdentifier literal.\n * @param uri The document's uri.\n * @param version The document's version.\n */\n function create(uri, version) {\n return { uri: uri, version: version };\n }\n OptionalVersionedTextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the {@link OptionalVersionedTextDocumentIdentifier} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));\n }\n OptionalVersionedTextDocumentIdentifier.is = is;\n })(OptionalVersionedTextDocumentIdentifier || (exports.OptionalVersionedTextDocumentIdentifier = OptionalVersionedTextDocumentIdentifier = {}));\n /**\n * The TextDocumentItem namespace provides helper functions to work with\n * {@link TextDocumentItem} literals.\n */\n var TextDocumentItem;\n (function (TextDocumentItem) {\n /**\n * Creates a new TextDocumentItem literal.\n * @param uri The document's uri.\n * @param languageId The document's language identifier.\n * @param version The document's version number.\n * @param text The document's text.\n */\n function create(uri, languageId, version, text) {\n return { uri: uri, languageId: languageId, version: version, text: text };\n }\n TextDocumentItem.create = create;\n /**\n * Checks whether the given literal conforms to the {@link TextDocumentItem} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);\n }\n TextDocumentItem.is = is;\n })(TextDocumentItem || (exports.TextDocumentItem = TextDocumentItem = {}));\n /**\n * Describes the content type that a client supports in various\n * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.\n *\n * Please note that `MarkupKinds` must not start with a `$`. This kinds\n * are reserved for internal usage.\n */\n var MarkupKind;\n (function (MarkupKind) {\n /**\n * Plain text is supported as a content format\n */\n MarkupKind.PlainText = 'plaintext';\n /**\n * Markdown is supported as a content format\n */\n MarkupKind.Markdown = 'markdown';\n /**\n * Checks whether the given value is a value of the {@link MarkupKind} type.\n */\n function is(value) {\n var candidate = value;\n return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;\n }\n MarkupKind.is = is;\n })(MarkupKind || (exports.MarkupKind = MarkupKind = {}));\n var MarkupContent;\n (function (MarkupContent) {\n /**\n * Checks whether the given value conforms to the {@link MarkupContent} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\n }\n MarkupContent.is = is;\n })(MarkupContent || (exports.MarkupContent = MarkupContent = {}));\n /**\n * The kind of a completion entry.\n */\n var CompletionItemKind;\n (function (CompletionItemKind) {\n CompletionItemKind.Text = 1;\n CompletionItemKind.Method = 2;\n CompletionItemKind.Function = 3;\n CompletionItemKind.Constructor = 4;\n CompletionItemKind.Field = 5;\n CompletionItemKind.Variable = 6;\n CompletionItemKind.Class = 7;\n CompletionItemKind.Interface = 8;\n CompletionItemKind.Module = 9;\n CompletionItemKind.Property = 10;\n CompletionItemKind.Unit = 11;\n CompletionItemKind.Value = 12;\n CompletionItemKind.Enum = 13;\n CompletionItemKind.Keyword = 14;\n CompletionItemKind.Snippet = 15;\n CompletionItemKind.Color = 16;\n CompletionItemKind.File = 17;\n CompletionItemKind.Reference = 18;\n CompletionItemKind.Folder = 19;\n CompletionItemKind.EnumMember = 20;\n CompletionItemKind.Constant = 21;\n CompletionItemKind.Struct = 22;\n CompletionItemKind.Event = 23;\n CompletionItemKind.Operator = 24;\n CompletionItemKind.TypeParameter = 25;\n })(CompletionItemKind || (exports.CompletionItemKind = CompletionItemKind = {}));\n /**\n * Defines whether the insert text in a completion item should be interpreted as\n * plain text or a snippet.\n */\n var InsertTextFormat;\n (function (InsertTextFormat) {\n /**\n * The primary text to be inserted is treated as a plain string.\n */\n InsertTextFormat.PlainText = 1;\n /**\n * The primary text to be inserted is treated as a snippet.\n *\n * A snippet can define tab stops and placeholders with `$1`, `$2`\n * and `${3:foo}`. `$0` defines the final tab stop, it defaults to\n * the end of the snippet. Placeholders with equal identifiers are linked,\n * that is typing in one will update others too.\n *\n * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax\n */\n InsertTextFormat.Snippet = 2;\n })(InsertTextFormat || (exports.InsertTextFormat = InsertTextFormat = {}));\n /**\n * Completion item tags are extra annotations that tweak the rendering of a completion\n * item.\n *\n * @since 3.15.0\n */\n var CompletionItemTag;\n (function (CompletionItemTag) {\n /**\n * Render a completion as obsolete, usually using a strike-out.\n */\n CompletionItemTag.Deprecated = 1;\n })(CompletionItemTag || (exports.CompletionItemTag = CompletionItemTag = {}));\n /**\n * The InsertReplaceEdit namespace provides functions to deal with insert / replace edits.\n *\n * @since 3.16.0\n */\n var InsertReplaceEdit;\n (function (InsertReplaceEdit) {\n /**\n * Creates a new insert / replace edit\n */\n function create(newText, insert, replace) {\n return { newText: newText, insert: insert, replace: replace };\n }\n InsertReplaceEdit.create = create;\n /**\n * Checks whether the given literal conforms to the {@link InsertReplaceEdit} interface.\n */\n function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);\n }\n InsertReplaceEdit.is = is;\n })(InsertReplaceEdit || (exports.InsertReplaceEdit = InsertReplaceEdit = {}));\n /**\n * How whitespace and indentation is handled during completion\n * item insertion.\n *\n * @since 3.16.0\n */\n var InsertTextMode;\n (function (InsertTextMode) {\n /**\n * The insertion or replace strings is taken as it is. If the\n * value is multi line the lines below the cursor will be\n * inserted using the indentation defined in the string value.\n * The client will not apply any kind of adjustments to the\n * string.\n */\n InsertTextMode.asIs = 1;\n /**\n * The editor adjusts leading whitespace of new lines so that\n * they match the indentation up to the cursor of the line for\n * which the item is accepted.\n *\n * Consider a line like this: <2tabs><3tabs>foo. Accepting a\n * multi line completion item is indented using 2 tabs and all\n * following lines inserted will be indented using 2 tabs as well.\n */\n InsertTextMode.adjustIndentation = 2;\n })(InsertTextMode || (exports.InsertTextMode = InsertTextMode = {}));\n var CompletionItemLabelDetails;\n (function (CompletionItemLabelDetails) {\n function is(value) {\n var candidate = value;\n return candidate && (Is.string(candidate.detail) || candidate.detail === undefined) &&\n (Is.string(candidate.description) || candidate.description === undefined);\n }\n CompletionItemLabelDetails.is = is;\n })(CompletionItemLabelDetails || (exports.CompletionItemLabelDetails = CompletionItemLabelDetails = {}));\n /**\n * The CompletionItem namespace provides functions to deal with\n * completion items.\n */\n var CompletionItem;\n (function (CompletionItem) {\n /**\n * Create a completion item and seed it with a label.\n * @param label The completion item's label\n */\n function create(label) {\n return { label: label };\n }\n CompletionItem.create = create;\n })(CompletionItem || (exports.CompletionItem = CompletionItem = {}));\n /**\n * The CompletionList namespace provides functions to deal with\n * completion lists.\n */\n var CompletionList;\n (function (CompletionList) {\n /**\n * Creates a new completion list.\n *\n * @param items The completion items.\n * @param isIncomplete The list is not complete.\n */\n function create(items, isIncomplete) {\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\n }\n CompletionList.create = create;\n })(CompletionList || (exports.CompletionList = CompletionList = {}));\n var MarkedString;\n (function (MarkedString) {\n /**\n * Creates a marked string from plain text.\n *\n * @param plainText The plain text.\n */\n function fromPlainText(plainText) {\n return plainText.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, '\\\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\n }\n MarkedString.fromPlainText = fromPlainText;\n /**\n * Checks whether the given value conforms to the {@link MarkedString} type.\n */\n function is(value) {\n var candidate = value;\n return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\n }\n MarkedString.is = is;\n })(MarkedString || (exports.MarkedString = MarkedString = {}));\n var Hover;\n (function (Hover) {\n /**\n * Checks whether the given value conforms to the {@link Hover} interface.\n */\n function is(value) {\n var candidate = value;\n return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||\n MarkedString.is(candidate.contents) ||\n Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range));\n }\n Hover.is = is;\n })(Hover || (exports.Hover = Hover = {}));\n /**\n * The ParameterInformation namespace provides helper functions to work with\n * {@link ParameterInformation} literals.\n */\n var ParameterInformation;\n (function (ParameterInformation) {\n /**\n * Creates a new parameter information literal.\n *\n * @param label A label string.\n * @param documentation A doc string.\n */\n function create(label, documentation) {\n return documentation ? { label: label, documentation: documentation } : { label: label };\n }\n ParameterInformation.create = create;\n })(ParameterInformation || (exports.ParameterInformation = ParameterInformation = {}));\n /**\n * The SignatureInformation namespace provides helper functions to work with\n * {@link SignatureInformation} literals.\n */\n var SignatureInformation;\n (function (SignatureInformation) {\n function create(label, documentation) {\n var parameters = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n parameters[_i - 2] = arguments[_i];\n }\n var result = { label: label };\n if (Is.defined(documentation)) {\n result.documentation = documentation;\n }\n if (Is.defined(parameters)) {\n result.parameters = parameters;\n }\n else {\n result.parameters = [];\n }\n return result;\n }\n SignatureInformation.create = create;\n })(SignatureInformation || (exports.SignatureInformation = SignatureInformation = {}));\n /**\n * A document highlight kind.\n */\n var DocumentHighlightKind;\n (function (DocumentHighlightKind) {\n /**\n * A textual occurrence.\n */\n DocumentHighlightKind.Text = 1;\n /**\n * Read-access of a symbol, like reading a variable.\n */\n DocumentHighlightKind.Read = 2;\n /**\n * Write-access of a symbol, like writing to a variable.\n */\n DocumentHighlightKind.Write = 3;\n })(DocumentHighlightKind || (exports.DocumentHighlightKind = DocumentHighlightKind = {}));\n /**\n * DocumentHighlight namespace to provide helper functions to work with\n * {@link DocumentHighlight} literals.\n */\n var DocumentHighlight;\n (function (DocumentHighlight) {\n /**\n * Create a DocumentHighlight object.\n * @param range The range the highlight applies to.\n * @param kind The highlight kind\n */\n function create(range, kind) {\n var result = { range: range };\n if (Is.number(kind)) {\n result.kind = kind;\n }\n return result;\n }\n DocumentHighlight.create = create;\n })(DocumentHighlight || (exports.DocumentHighlight = DocumentHighlight = {}));\n /**\n * A symbol kind.\n */\n var SymbolKind;\n (function (SymbolKind) {\n SymbolKind.File = 1;\n SymbolKind.Module = 2;\n SymbolKind.Namespace = 3;\n SymbolKind.Package = 4;\n SymbolKind.Class = 5;\n SymbolKind.Method = 6;\n SymbolKind.Property = 7;\n SymbolKind.Field = 8;\n SymbolKind.Constructor = 9;\n SymbolKind.Enum = 10;\n SymbolKind.Interface = 11;\n SymbolKind.Function = 12;\n SymbolKind.Variable = 13;\n SymbolKind.Constant = 14;\n SymbolKind.String = 15;\n SymbolKind.Number = 16;\n SymbolKind.Boolean = 17;\n SymbolKind.Array = 18;\n SymbolKind.Object = 19;\n SymbolKind.Key = 20;\n SymbolKind.Null = 21;\n SymbolKind.EnumMember = 22;\n SymbolKind.Struct = 23;\n SymbolKind.Event = 24;\n SymbolKind.Operator = 25;\n SymbolKind.TypeParameter = 26;\n })(SymbolKind || (exports.SymbolKind = SymbolKind = {}));\n /**\n * Symbol tags are extra annotations that tweak the rendering of a symbol.\n *\n * @since 3.16\n */\n var SymbolTag;\n (function (SymbolTag) {\n /**\n * Render a symbol as obsolete, usually using a strike-out.\n */\n SymbolTag.Deprecated = 1;\n })(SymbolTag || (exports.SymbolTag = SymbolTag = {}));\n var SymbolInformation;\n (function (SymbolInformation) {\n /**\n * Creates a new symbol information literal.\n *\n * @param name The name of the symbol.\n * @param kind The kind of the symbol.\n * @param range The range of the location of the symbol.\n * @param uri The resource of the location of symbol.\n * @param containerName The name of the symbol containing the symbol.\n */\n function create(name, kind, range, uri, containerName) {\n var result = {\n name: name,\n kind: kind,\n location: { uri: uri, range: range }\n };\n if (containerName) {\n result.containerName = containerName;\n }\n return result;\n }\n SymbolInformation.create = create;\n })(SymbolInformation || (exports.SymbolInformation = SymbolInformation = {}));\n var WorkspaceSymbol;\n (function (WorkspaceSymbol) {\n /**\n * Create a new workspace symbol.\n *\n * @param name The name of the symbol.\n * @param kind The kind of the symbol.\n * @param uri The resource of the location of the symbol.\n * @param range An options range of the location.\n * @returns A WorkspaceSymbol.\n */\n function create(name, kind, uri, range) {\n return range !== undefined\n ? { name: name, kind: kind, location: { uri: uri, range: range } }\n : { name: name, kind: kind, location: { uri: uri } };\n }\n WorkspaceSymbol.create = create;\n })(WorkspaceSymbol || (exports.WorkspaceSymbol = WorkspaceSymbol = {}));\n var DocumentSymbol;\n (function (DocumentSymbol) {\n /**\n * Creates a new symbol information literal.\n *\n * @param name The name of the symbol.\n * @param detail The detail of the symbol.\n * @param kind The kind of the symbol.\n * @param range The range of the symbol.\n * @param selectionRange The selectionRange of the symbol.\n * @param children Children of the symbol.\n */\n function create(name, detail, kind, range, selectionRange, children) {\n var result = {\n name: name,\n detail: detail,\n kind: kind,\n range: range,\n selectionRange: selectionRange\n };\n if (children !== undefined) {\n result.children = children;\n }\n return result;\n }\n DocumentSymbol.create = create;\n /**\n * Checks whether the given literal conforms to the {@link DocumentSymbol} interface.\n */\n function is(value) {\n var candidate = value;\n return candidate &&\n Is.string(candidate.name) && Is.number(candidate.kind) &&\n Range.is(candidate.range) && Range.is(candidate.selectionRange) &&\n (candidate.detail === undefined || Is.string(candidate.detail)) &&\n (candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) &&\n (candidate.children === undefined || Array.isArray(candidate.children)) &&\n (candidate.tags === undefined || Array.isArray(candidate.tags));\n }\n DocumentSymbol.is = is;\n })(DocumentSymbol || (exports.DocumentSymbol = DocumentSymbol = {}));\n /**\n * A set of predefined code action kinds\n */\n var CodeActionKind;\n (function (CodeActionKind) {\n /**\n * Empty kind.\n */\n CodeActionKind.Empty = '';\n /**\n * Base kind for quickfix actions: 'quickfix'\n */\n CodeActionKind.QuickFix = 'quickfix';\n /**\n * Base kind for refactoring actions: 'refactor'\n */\n CodeActionKind.Refactor = 'refactor';\n /**\n * Base kind for refactoring extraction actions: 'refactor.extract'\n *\n * Example extract actions:\n *\n * - Extract method\n * - Extract function\n * - Extract variable\n * - Extract interface from class\n * - ...\n */\n CodeActionKind.RefactorExtract = 'refactor.extract';\n /**\n * Base kind for refactoring inline actions: 'refactor.inline'\n *\n * Example inline actions:\n *\n * - Inline function\n * - Inline variable\n * - Inline constant\n * - ...\n */\n CodeActionKind.RefactorInline = 'refactor.inline';\n /**\n * Base kind for refactoring rewrite actions: 'refactor.rewrite'\n *\n * Example rewrite actions:\n *\n * - Convert JavaScript function to class\n * - Add or remove parameter\n * - Encapsulate field\n * - Make method static\n * - Move method to base class\n * - ...\n */\n CodeActionKind.RefactorRewrite = 'refactor.rewrite';\n /**\n * Base kind for source actions: `source`\n *\n * Source code actions apply to the entire file.\n */\n CodeActionKind.Source = 'source';\n /**\n * Base kind for an organize imports source action: `source.organizeImports`\n */\n CodeActionKind.SourceOrganizeImports = 'source.organizeImports';\n /**\n * Base kind for auto-fix source actions: `source.fixAll`.\n *\n * Fix all actions automatically fix errors that have a clear fix that do not require user input.\n * They should not suppress errors or perform unsafe fixes such as generating new types or classes.\n *\n * @since 3.15.0\n */\n CodeActionKind.SourceFixAll = 'source.fixAll';\n })(CodeActionKind || (exports.CodeActionKind = CodeActionKind = {}));\n /**\n * The reason why code actions were requested.\n *\n * @since 3.17.0\n */\n var CodeActionTriggerKind;\n (function (CodeActionTriggerKind) {\n /**\n * Code actions were explicitly requested by the user or by an extension.\n */\n CodeActionTriggerKind.Invoked = 1;\n /**\n * Code actions were requested automatically.\n *\n * This typically happens when current selection in a file changes, but can\n * also be triggered when file content changes.\n */\n CodeActionTriggerKind.Automatic = 2;\n })(CodeActionTriggerKind || (exports.CodeActionTriggerKind = CodeActionTriggerKind = {}));\n /**\n * The CodeActionContext namespace provides helper functions to work with\n * {@link CodeActionContext} literals.\n */\n var CodeActionContext;\n (function (CodeActionContext) {\n /**\n * Creates a new CodeActionContext literal.\n */\n function create(diagnostics, only, triggerKind) {\n var result = { diagnostics: diagnostics };\n if (only !== undefined && only !== null) {\n result.only = only;\n }\n if (triggerKind !== undefined && triggerKind !== null) {\n result.triggerKind = triggerKind;\n }\n return result;\n }\n CodeActionContext.create = create;\n /**\n * Checks whether the given literal conforms to the {@link CodeActionContext} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is)\n && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string))\n && (candidate.triggerKind === undefined || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);\n }\n CodeActionContext.is = is;\n })(CodeActionContext || (exports.CodeActionContext = CodeActionContext = {}));\n var CodeAction;\n (function (CodeAction) {\n function create(title, kindOrCommandOrEdit, kind) {\n var result = { title: title };\n var checkKind = true;\n if (typeof kindOrCommandOrEdit === 'string') {\n checkKind = false;\n result.kind = kindOrCommandOrEdit;\n }\n else if (Command.is(kindOrCommandOrEdit)) {\n result.command = kindOrCommandOrEdit;\n }\n else {\n result.edit = kindOrCommandOrEdit;\n }\n if (checkKind && kind !== undefined) {\n result.kind = kind;\n }\n return result;\n }\n CodeAction.create = create;\n function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.title) &&\n (candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&\n (candidate.kind === undefined || Is.string(candidate.kind)) &&\n (candidate.edit !== undefined || candidate.command !== undefined) &&\n (candidate.command === undefined || Command.is(candidate.command)) &&\n (candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) &&\n (candidate.edit === undefined || WorkspaceEdit.is(candidate.edit));\n }\n CodeAction.is = is;\n })(CodeAction || (exports.CodeAction = CodeAction = {}));\n /**\n * The CodeLens namespace provides helper functions to work with\n * {@link CodeLens} literals.\n */\n var CodeLens;\n (function (CodeLens) {\n /**\n * Creates a new CodeLens literal.\n */\n function create(range, data) {\n var result = { range: range };\n if (Is.defined(data)) {\n result.data = data;\n }\n return result;\n }\n CodeLens.create = create;\n /**\n * Checks whether the given literal conforms to the {@link CodeLens} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));\n }\n CodeLens.is = is;\n })(CodeLens || (exports.CodeLens = CodeLens = {}));\n /**\n * The FormattingOptions namespace provides helper functions to work with\n * {@link FormattingOptions} literals.\n */\n var FormattingOptions;\n (function (FormattingOptions) {\n /**\n * Creates a new FormattingOptions literal.\n */\n function create(tabSize, insertSpaces) {\n return { tabSize: tabSize, insertSpaces: insertSpaces };\n }\n FormattingOptions.create = create;\n /**\n * Checks whether the given literal conforms to the {@link FormattingOptions} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);\n }\n FormattingOptions.is = is;\n })(FormattingOptions || (exports.FormattingOptions = FormattingOptions = {}));\n /**\n * The DocumentLink namespace provides helper functions to work with\n * {@link DocumentLink} literals.\n */\n var DocumentLink;\n (function (DocumentLink) {\n /**\n * Creates a new DocumentLink literal.\n */\n function create(range, target, data) {\n return { range: range, target: target, data: data };\n }\n DocumentLink.create = create;\n /**\n * Checks whether the given literal conforms to the {@link DocumentLink} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));\n }\n DocumentLink.is = is;\n })(DocumentLink || (exports.DocumentLink = DocumentLink = {}));\n /**\n * The SelectionRange namespace provides helper function to work with\n * SelectionRange literals.\n */\n var SelectionRange;\n (function (SelectionRange) {\n /**\n * Creates a new SelectionRange\n * @param range the range.\n * @param parent an optional parent.\n */\n function create(range, parent) {\n return { range: range, parent: parent };\n }\n SelectionRange.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));\n }\n SelectionRange.is = is;\n })(SelectionRange || (exports.SelectionRange = SelectionRange = {}));\n /**\n * A set of predefined token types. This set is not fixed\n * an clients can specify additional token types via the\n * corresponding client capabilities.\n *\n * @since 3.16.0\n */\n var SemanticTokenTypes;\n (function (SemanticTokenTypes) {\n SemanticTokenTypes[\"namespace\"] = \"namespace\";\n /**\n * Represents a generic type. Acts as a fallback for types which can't be mapped to\n * a specific type like class or enum.\n */\n SemanticTokenTypes[\"type\"] = \"type\";\n SemanticTokenTypes[\"class\"] = \"class\";\n SemanticTokenTypes[\"enum\"] = \"enum\";\n SemanticTokenTypes[\"interface\"] = \"interface\";\n SemanticTokenTypes[\"struct\"] = \"struct\";\n SemanticTokenTypes[\"typeParameter\"] = \"typeParameter\";\n SemanticTokenTypes[\"parameter\"] = \"parameter\";\n SemanticTokenTypes[\"variable\"] = \"variable\";\n SemanticTokenTypes[\"property\"] = \"property\";\n SemanticTokenTypes[\"enumMember\"] = \"enumMember\";\n SemanticTokenTypes[\"event\"] = \"event\";\n SemanticTokenTypes[\"function\"] = \"function\";\n SemanticTokenTypes[\"method\"] = \"method\";\n SemanticTokenTypes[\"macro\"] = \"macro\";\n SemanticTokenTypes[\"keyword\"] = \"keyword\";\n SemanticTokenTypes[\"modifier\"] = \"modifier\";\n SemanticTokenTypes[\"comment\"] = \"comment\";\n SemanticTokenTypes[\"string\"] = \"string\";\n SemanticTokenTypes[\"number\"] = \"number\";\n SemanticTokenTypes[\"regexp\"] = \"regexp\";\n SemanticTokenTypes[\"operator\"] = \"operator\";\n /**\n * @since 3.17.0\n */\n SemanticTokenTypes[\"decorator\"] = \"decorator\";\n })(SemanticTokenTypes || (exports.SemanticTokenTypes = SemanticTokenTypes = {}));\n /**\n * A set of predefined token modifiers. This set is not fixed\n * an clients can specify additional token types via the\n * corresponding client capabilities.\n *\n * @since 3.16.0\n */\n var SemanticTokenModifiers;\n (function (SemanticTokenModifiers) {\n SemanticTokenModifiers[\"declaration\"] = \"declaration\";\n SemanticTokenModifiers[\"definition\"] = \"definition\";\n SemanticTokenModifiers[\"readonly\"] = \"readonly\";\n SemanticTokenModifiers[\"static\"] = \"static\";\n SemanticTokenModifiers[\"deprecated\"] = \"deprecated\";\n SemanticTokenModifiers[\"abstract\"] = \"abstract\";\n SemanticTokenModifiers[\"async\"] = \"async\";\n SemanticTokenModifiers[\"modification\"] = \"modification\";\n SemanticTokenModifiers[\"documentation\"] = \"documentation\";\n SemanticTokenModifiers[\"defaultLibrary\"] = \"defaultLibrary\";\n })(SemanticTokenModifiers || (exports.SemanticTokenModifiers = SemanticTokenModifiers = {}));\n /**\n * @since 3.16.0\n */\n var SemanticTokens;\n (function (SemanticTokens) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && (candidate.resultId === undefined || typeof candidate.resultId === 'string') &&\n Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');\n }\n SemanticTokens.is = is;\n })(SemanticTokens || (exports.SemanticTokens = SemanticTokens = {}));\n /**\n * The InlineValueText namespace provides functions to deal with InlineValueTexts.\n *\n * @since 3.17.0\n */\n var InlineValueText;\n (function (InlineValueText) {\n /**\n * Creates a new InlineValueText literal.\n */\n function create(range, text) {\n return { range: range, text: text };\n }\n InlineValueText.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);\n }\n InlineValueText.is = is;\n })(InlineValueText || (exports.InlineValueText = InlineValueText = {}));\n /**\n * The InlineValueVariableLookup namespace provides functions to deal with InlineValueVariableLookups.\n *\n * @since 3.17.0\n */\n var InlineValueVariableLookup;\n (function (InlineValueVariableLookup) {\n /**\n * Creates a new InlineValueText literal.\n */\n function create(range, variableName, caseSensitiveLookup) {\n return { range: range, variableName: variableName, caseSensitiveLookup: caseSensitiveLookup };\n }\n InlineValueVariableLookup.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup)\n && (Is.string(candidate.variableName) || candidate.variableName === undefined);\n }\n InlineValueVariableLookup.is = is;\n })(InlineValueVariableLookup || (exports.InlineValueVariableLookup = InlineValueVariableLookup = {}));\n /**\n * The InlineValueEvaluatableExpression namespace provides functions to deal with InlineValueEvaluatableExpression.\n *\n * @since 3.17.0\n */\n var InlineValueEvaluatableExpression;\n (function (InlineValueEvaluatableExpression) {\n /**\n * Creates a new InlineValueEvaluatableExpression literal.\n */\n function create(range, expression) {\n return { range: range, expression: expression };\n }\n InlineValueEvaluatableExpression.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Range.is(candidate.range)\n && (Is.string(candidate.expression) || candidate.expression === undefined);\n }\n InlineValueEvaluatableExpression.is = is;\n })(InlineValueEvaluatableExpression || (exports.InlineValueEvaluatableExpression = InlineValueEvaluatableExpression = {}));\n /**\n * The InlineValueContext namespace provides helper functions to work with\n * {@link InlineValueContext} literals.\n *\n * @since 3.17.0\n */\n var InlineValueContext;\n (function (InlineValueContext) {\n /**\n * Creates a new InlineValueContext literal.\n */\n function create(frameId, stoppedLocation) {\n return { frameId: frameId, stoppedLocation: stoppedLocation };\n }\n InlineValueContext.create = create;\n /**\n * Checks whether the given literal conforms to the {@link InlineValueContext} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(value.stoppedLocation);\n }\n InlineValueContext.is = is;\n })(InlineValueContext || (exports.InlineValueContext = InlineValueContext = {}));\n /**\n * Inlay hint kinds.\n *\n * @since 3.17.0\n */\n var InlayHintKind;\n (function (InlayHintKind) {\n /**\n * An inlay hint that for a type annotation.\n */\n InlayHintKind.Type = 1;\n /**\n * An inlay hint that is for a parameter.\n */\n InlayHintKind.Parameter = 2;\n function is(value) {\n return value === 1 || value === 2;\n }\n InlayHintKind.is = is;\n })(InlayHintKind || (exports.InlayHintKind = InlayHintKind = {}));\n var InlayHintLabelPart;\n (function (InlayHintLabelPart) {\n function create(value) {\n return { value: value };\n }\n InlayHintLabelPart.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate)\n && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))\n && (candidate.location === undefined || Location.is(candidate.location))\n && (candidate.command === undefined || Command.is(candidate.command));\n }\n InlayHintLabelPart.is = is;\n })(InlayHintLabelPart || (exports.InlayHintLabelPart = InlayHintLabelPart = {}));\n var InlayHint;\n (function (InlayHint) {\n function create(position, label, kind) {\n var result = { position: position, label: label };\n if (kind !== undefined) {\n result.kind = kind;\n }\n return result;\n }\n InlayHint.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.position)\n && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is))\n && (candidate.kind === undefined || InlayHintKind.is(candidate.kind))\n && (candidate.textEdits === undefined) || Is.typedArray(candidate.textEdits, TextEdit.is)\n && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))\n && (candidate.paddingLeft === undefined || Is.boolean(candidate.paddingLeft))\n && (candidate.paddingRight === undefined || Is.boolean(candidate.paddingRight));\n }\n InlayHint.is = is;\n })(InlayHint || (exports.InlayHint = InlayHint = {}));\n var StringValue;\n (function (StringValue) {\n function createSnippet(value) {\n return { kind: 'snippet', value: value };\n }\n StringValue.createSnippet = createSnippet;\n })(StringValue || (exports.StringValue = StringValue = {}));\n var InlineCompletionItem;\n (function (InlineCompletionItem) {\n function create(insertText, filterText, range, command) {\n return { insertText: insertText, filterText: filterText, range: range, command: command };\n }\n InlineCompletionItem.create = create;\n })(InlineCompletionItem || (exports.InlineCompletionItem = InlineCompletionItem = {}));\n var InlineCompletionList;\n (function (InlineCompletionList) {\n function create(items) {\n return { items: items };\n }\n InlineCompletionList.create = create;\n })(InlineCompletionList || (exports.InlineCompletionList = InlineCompletionList = {}));\n /**\n * Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.\n *\n * @since 3.18.0\n * @proposed\n */\n var InlineCompletionTriggerKind;\n (function (InlineCompletionTriggerKind) {\n /**\n * Completion was triggered explicitly by a user gesture.\n */\n InlineCompletionTriggerKind.Invoked = 0;\n /**\n * Completion was triggered automatically while editing.\n */\n InlineCompletionTriggerKind.Automatic = 1;\n })(InlineCompletionTriggerKind || (exports.InlineCompletionTriggerKind = InlineCompletionTriggerKind = {}));\n var SelectedCompletionInfo;\n (function (SelectedCompletionInfo) {\n function create(range, text) {\n return { range: range, text: text };\n }\n SelectedCompletionInfo.create = create;\n })(SelectedCompletionInfo || (exports.SelectedCompletionInfo = SelectedCompletionInfo = {}));\n var InlineCompletionContext;\n (function (InlineCompletionContext) {\n function create(triggerKind, selectedCompletionInfo) {\n return { triggerKind: triggerKind, selectedCompletionInfo: selectedCompletionInfo };\n }\n InlineCompletionContext.create = create;\n })(InlineCompletionContext || (exports.InlineCompletionContext = InlineCompletionContext = {}));\n var WorkspaceFolder;\n (function (WorkspaceFolder) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);\n }\n WorkspaceFolder.is = is;\n })(WorkspaceFolder || (exports.WorkspaceFolder = WorkspaceFolder = {}));\n exports.EOL = ['\\n', '\\r\\n', '\\r'];\n /**\n * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\n */\n var TextDocument;\n (function (TextDocument) {\n /**\n * Creates a new ITextDocument literal from the given uri and content.\n * @param uri The document's uri.\n * @param languageId The document's language Id.\n * @param version The document's version.\n * @param content The document's content.\n */\n function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }\n TextDocument.create = create;\n /**\n * Checks whether the given literal conforms to the {@link ITextDocument} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount)\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }\n TextDocument.is = is;\n function applyEdits(document, edits) {\n var text = document.getText();\n var sortedEdits = mergeSort(edits, function (a, b) {\n var diff = a.range.start.line - b.range.start.line;\n if (diff === 0) {\n return a.range.start.character - b.range.start.character;\n }\n return diff;\n });\n var lastModifiedOffset = text.length;\n for (var i = sortedEdits.length - 1; i >= 0; i--) {\n var e = sortedEdits[i];\n var startOffset = document.offsetAt(e.range.start);\n var endOffset = document.offsetAt(e.range.end);\n if (endOffset <= lastModifiedOffset) {\n text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);\n }\n else {\n throw new Error('Overlapping edit');\n }\n lastModifiedOffset = startOffset;\n }\n return text;\n }\n TextDocument.applyEdits = applyEdits;\n function mergeSort(data, compare) {\n if (data.length <= 1) {\n // sorted\n return data;\n }\n var p = (data.length / 2) | 0;\n var left = data.slice(0, p);\n var right = data.slice(p);\n mergeSort(left, compare);\n mergeSort(right, compare);\n var leftIdx = 0;\n var rightIdx = 0;\n var i = 0;\n while (leftIdx < left.length && rightIdx < right.length) {\n var ret = compare(left[leftIdx], right[rightIdx]);\n if (ret <= 0) {\n // smaller_equal -> take left to preserve order\n data[i++] = left[leftIdx++];\n }\n else {\n // greater -> take right\n data[i++] = right[rightIdx++];\n }\n }\n while (leftIdx < left.length) {\n data[i++] = left[leftIdx++];\n }\n while (rightIdx < right.length) {\n data[i++] = right[rightIdx++];\n }\n return data;\n }\n })(TextDocument || (exports.TextDocument = TextDocument = {}));\n /**\n * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\n */\n var FullTextDocument = /** @class */ (function () {\n function FullTextDocument(uri, languageId, version, content) {\n this._uri = uri;\n this._languageId = languageId;\n this._version = version;\n this._content = content;\n this._lineOffsets = undefined;\n }\n Object.defineProperty(FullTextDocument.prototype, \"uri\", {\n get: function () {\n return this._uri;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FullTextDocument.prototype, \"languageId\", {\n get: function () {\n return this._languageId;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FullTextDocument.prototype, \"version\", {\n get: function () {\n return this._version;\n },\n enumerable: false,\n configurable: true\n });\n FullTextDocument.prototype.getText = function (range) {\n if (range) {\n var start = this.offsetAt(range.start);\n var end = this.offsetAt(range.end);\n return this._content.substring(start, end);\n }\n return this._content;\n };\n FullTextDocument.prototype.update = function (event, version) {\n this._content = event.text;\n this._version = version;\n this._lineOffsets = undefined;\n };\n FullTextDocument.prototype.getLineOffsets = function () {\n if (this._lineOffsets === undefined) {\n var lineOffsets = [];\n var text = this._content;\n var isLineStart = true;\n for (var i = 0; i < text.length; i++) {\n if (isLineStart) {\n lineOffsets.push(i);\n isLineStart = false;\n }\n var ch = text.charAt(i);\n isLineStart = (ch === '\\r' || ch === '\\n');\n if (ch === '\\r' && i + 1 < text.length && text.charAt(i + 1) === '\\n') {\n i++;\n }\n }\n if (isLineStart && text.length > 0) {\n lineOffsets.push(text.length);\n }\n this._lineOffsets = lineOffsets;\n }\n return this._lineOffsets;\n };\n FullTextDocument.prototype.positionAt = function (offset) {\n offset = Math.max(Math.min(offset, this._content.length), 0);\n var lineOffsets = this.getLineOffsets();\n var low = 0, high = lineOffsets.length;\n if (high === 0) {\n return Position.create(0, offset);\n }\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (lineOffsets[mid] > offset) {\n high = mid;\n }\n else {\n low = mid + 1;\n }\n }\n // low is the least x for which the line offset is larger than the current offset\n // or array.length if no line offset is larger than the current offset\n var line = low - 1;\n return Position.create(line, offset - lineOffsets[line]);\n };\n FullTextDocument.prototype.offsetAt = function (position) {\n var lineOffsets = this.getLineOffsets();\n if (position.line >= lineOffsets.length) {\n return this._content.length;\n }\n else if (position.line < 0) {\n return 0;\n }\n var lineOffset = lineOffsets[position.line];\n var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\n return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\n };\n Object.defineProperty(FullTextDocument.prototype, \"lineCount\", {\n get: function () {\n return this.getLineOffsets().length;\n },\n enumerable: false,\n configurable: true\n });\n return FullTextDocument;\n }());\n var Is;\n (function (Is) {\n var toString = Object.prototype.toString;\n function defined(value) {\n return typeof value !== 'undefined';\n }\n Is.defined = defined;\n function undefined(value) {\n return typeof value === 'undefined';\n }\n Is.undefined = undefined;\n function boolean(value) {\n return value === true || value === false;\n }\n Is.boolean = boolean;\n function string(value) {\n return toString.call(value) === '[object String]';\n }\n Is.string = string;\n function number(value) {\n return toString.call(value) === '[object Number]';\n }\n Is.number = number;\n function numberRange(value, min, max) {\n return toString.call(value) === '[object Number]' && min <= value && value <= max;\n }\n Is.numberRange = numberRange;\n function integer(value) {\n return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647;\n }\n Is.integer = integer;\n function uinteger(value) {\n return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647;\n }\n Is.uinteger = uinteger;\n function func(value) {\n return toString.call(value) === '[object Function]';\n }\n Is.func = func;\n function objectLiteral(value) {\n // Strictly speaking class instances pass this check as well. Since the LSP\n // doesn't use classes we ignore this for now. If we do we need to add something\n // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\n return value !== null && typeof value === 'object';\n }\n Is.objectLiteral = objectLiteral;\n function typedArray(value, check) {\n return Array.isArray(value) && value.every(check);\n }\n Is.typedArray = typedArray;\n })(Is || (Is = {}));\n});\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProtocolNotificationType = exports.ProtocolNotificationType0 = exports.ProtocolRequestType = exports.ProtocolRequestType0 = exports.RegistrationType = exports.MessageDirection = void 0;\nconst vscode_jsonrpc_1 = require(\"vscode-jsonrpc\");\nvar MessageDirection;\n(function (MessageDirection) {\n MessageDirection[\"clientToServer\"] = \"clientToServer\";\n MessageDirection[\"serverToClient\"] = \"serverToClient\";\n MessageDirection[\"both\"] = \"both\";\n})(MessageDirection || (exports.MessageDirection = MessageDirection = {}));\nclass RegistrationType {\n constructor(method) {\n this.method = method;\n }\n}\nexports.RegistrationType = RegistrationType;\nclass ProtocolRequestType0 extends vscode_jsonrpc_1.RequestType0 {\n constructor(method) {\n super(method);\n }\n}\nexports.ProtocolRequestType0 = ProtocolRequestType0;\nclass ProtocolRequestType extends vscode_jsonrpc_1.RequestType {\n constructor(method) {\n super(method, vscode_jsonrpc_1.ParameterStructures.byName);\n }\n}\nexports.ProtocolRequestType = ProtocolRequestType;\nclass ProtocolNotificationType0 extends vscode_jsonrpc_1.NotificationType0 {\n constructor(method) {\n super(method);\n }\n}\nexports.ProtocolNotificationType0 = ProtocolNotificationType0;\nclass ProtocolNotificationType extends vscode_jsonrpc_1.NotificationType {\n constructor(method) {\n super(method, vscode_jsonrpc_1.ParameterStructures.byName);\n }\n}\nexports.ProtocolNotificationType = ProtocolNotificationType;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.objectLiteral = exports.typedArray = exports.stringArray = exports.array = exports.func = exports.error = exports.number = exports.string = exports.boolean = void 0;\nfunction boolean(value) {\n return value === true || value === false;\n}\nexports.boolean = boolean;\nfunction string(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexports.string = string;\nfunction number(value) {\n return typeof value === 'number' || value instanceof Number;\n}\nexports.number = number;\nfunction error(value) {\n return value instanceof Error;\n}\nexports.error = error;\nfunction func(value) {\n return typeof value === 'function';\n}\nexports.func = func;\nfunction array(value) {\n return Array.isArray(value);\n}\nexports.array = array;\nfunction stringArray(value) {\n return array(value) && value.every(elem => string(elem));\n}\nexports.stringArray = stringArray;\nfunction typedArray(value, check) {\n return Array.isArray(value) && value.every(check);\n}\nexports.typedArray = typedArray;\nfunction objectLiteral(value) {\n // Strictly speaking class instances pass this check as well. Since the LSP\n // doesn't use classes we ignore this for now. If we do we need to add something\n // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\n return value !== null && typeof value === 'object';\n}\nexports.objectLiteral = objectLiteral;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ImplementationRequest = void 0;\nconst messages_1 = require(\"./messages\");\n// @ts-ignore: to avoid inlining LocationLink as dynamic import\nlet __noDynamicImport;\n/**\n * A request to resolve the implementation locations of a symbol at a given text\n * document position. The request's parameter is of type {@link TextDocumentPositionParams}\n * the response is of type {@link Definition} or a Thenable that resolves to such.\n */\nvar ImplementationRequest;\n(function (ImplementationRequest) {\n ImplementationRequest.method = 'textDocument/implementation';\n ImplementationRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n ImplementationRequest.type = new messages_1.ProtocolRequestType(ImplementationRequest.method);\n})(ImplementationRequest || (exports.ImplementationRequest = ImplementationRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TypeDefinitionRequest = void 0;\nconst messages_1 = require(\"./messages\");\n// @ts-ignore: to avoid inlining LocatioLink as dynamic import\nlet __noDynamicImport;\n/**\n * A request to resolve the type definition locations of a symbol at a given text\n * document position. The request's parameter is of type {@link TextDocumentPositionParams}\n * the response is of type {@link Definition} or a Thenable that resolves to such.\n */\nvar TypeDefinitionRequest;\n(function (TypeDefinitionRequest) {\n TypeDefinitionRequest.method = 'textDocument/typeDefinition';\n TypeDefinitionRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n TypeDefinitionRequest.type = new messages_1.ProtocolRequestType(TypeDefinitionRequest.method);\n})(TypeDefinitionRequest || (exports.TypeDefinitionRequest = TypeDefinitionRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DidChangeWorkspaceFoldersNotification = exports.WorkspaceFoldersRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.\n */\nvar WorkspaceFoldersRequest;\n(function (WorkspaceFoldersRequest) {\n WorkspaceFoldersRequest.method = 'workspace/workspaceFolders';\n WorkspaceFoldersRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n WorkspaceFoldersRequest.type = new messages_1.ProtocolRequestType0(WorkspaceFoldersRequest.method);\n})(WorkspaceFoldersRequest || (exports.WorkspaceFoldersRequest = WorkspaceFoldersRequest = {}));\n/**\n * The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace\n * folder configuration changes.\n */\nvar DidChangeWorkspaceFoldersNotification;\n(function (DidChangeWorkspaceFoldersNotification) {\n DidChangeWorkspaceFoldersNotification.method = 'workspace/didChangeWorkspaceFolders';\n DidChangeWorkspaceFoldersNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidChangeWorkspaceFoldersNotification.type = new messages_1.ProtocolNotificationType(DidChangeWorkspaceFoldersNotification.method);\n})(DidChangeWorkspaceFoldersNotification || (exports.DidChangeWorkspaceFoldersNotification = DidChangeWorkspaceFoldersNotification = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConfigurationRequest = void 0;\nconst messages_1 = require(\"./messages\");\n//---- Get Configuration request ----\n/**\n * The 'workspace/configuration' request is sent from the server to the client to fetch a certain\n * configuration setting.\n *\n * This pull model replaces the old push model were the client signaled configuration change via an\n * event. If the server still needs to react to configuration changes (since the server caches the\n * result of `workspace/configuration` requests) the server should register for an empty configuration\n * change event and empty the cache if such an event is received.\n */\nvar ConfigurationRequest;\n(function (ConfigurationRequest) {\n ConfigurationRequest.method = 'workspace/configuration';\n ConfigurationRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n ConfigurationRequest.type = new messages_1.ProtocolRequestType(ConfigurationRequest.method);\n})(ConfigurationRequest || (exports.ConfigurationRequest = ConfigurationRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ColorPresentationRequest = exports.DocumentColorRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to list all color symbols found in a given text document. The request's\n * parameter is of type {@link DocumentColorParams} the\n * response is of type {@link ColorInformation ColorInformation[]} or a Thenable\n * that resolves to such.\n */\nvar DocumentColorRequest;\n(function (DocumentColorRequest) {\n DocumentColorRequest.method = 'textDocument/documentColor';\n DocumentColorRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentColorRequest.type = new messages_1.ProtocolRequestType(DocumentColorRequest.method);\n})(DocumentColorRequest || (exports.DocumentColorRequest = DocumentColorRequest = {}));\n/**\n * A request to list all presentation for a color. The request's\n * parameter is of type {@link ColorPresentationParams} the\n * response is of type {@link ColorInformation ColorInformation[]} or a Thenable\n * that resolves to such.\n */\nvar ColorPresentationRequest;\n(function (ColorPresentationRequest) {\n ColorPresentationRequest.method = 'textDocument/colorPresentation';\n ColorPresentationRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n ColorPresentationRequest.type = new messages_1.ProtocolRequestType(ColorPresentationRequest.method);\n})(ColorPresentationRequest || (exports.ColorPresentationRequest = ColorPresentationRequest = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FoldingRangeRefreshRequest = exports.FoldingRangeRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide folding ranges in a document. The request's\n * parameter is of type {@link FoldingRangeParams}, the\n * response is of type {@link FoldingRangeList} or a Thenable\n * that resolves to such.\n */\nvar FoldingRangeRequest;\n(function (FoldingRangeRequest) {\n FoldingRangeRequest.method = 'textDocument/foldingRange';\n FoldingRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n FoldingRangeRequest.type = new messages_1.ProtocolRequestType(FoldingRangeRequest.method);\n})(FoldingRangeRequest || (exports.FoldingRangeRequest = FoldingRangeRequest = {}));\n/**\n * @since 3.18.0\n * @proposed\n */\nvar FoldingRangeRefreshRequest;\n(function (FoldingRangeRefreshRequest) {\n FoldingRangeRefreshRequest.method = `workspace/foldingRange/refresh`;\n FoldingRangeRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n FoldingRangeRefreshRequest.type = new messages_1.ProtocolRequestType0(FoldingRangeRefreshRequest.method);\n})(FoldingRangeRefreshRequest || (exports.FoldingRangeRefreshRequest = FoldingRangeRefreshRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DeclarationRequest = void 0;\nconst messages_1 = require(\"./messages\");\n// @ts-ignore: to avoid inlining LocationLink as dynamic import\nlet __noDynamicImport;\n/**\n * A request to resolve the type definition locations of a symbol at a given text\n * document position. The request's parameter is of type {@link TextDocumentPositionParams}\n * the response is of type {@link Declaration} or a typed array of {@link DeclarationLink}\n * or a Thenable that resolves to such.\n */\nvar DeclarationRequest;\n(function (DeclarationRequest) {\n DeclarationRequest.method = 'textDocument/declaration';\n DeclarationRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DeclarationRequest.type = new messages_1.ProtocolRequestType(DeclarationRequest.method);\n})(DeclarationRequest || (exports.DeclarationRequest = DeclarationRequest = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SelectionRangeRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide selection ranges in a document. The request's\n * parameter is of type {@link SelectionRangeParams}, the\n * response is of type {@link SelectionRange SelectionRange[]} or a Thenable\n * that resolves to such.\n */\nvar SelectionRangeRequest;\n(function (SelectionRangeRequest) {\n SelectionRangeRequest.method = 'textDocument/selectionRange';\n SelectionRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n SelectionRangeRequest.type = new messages_1.ProtocolRequestType(SelectionRangeRequest.method);\n})(SelectionRangeRequest || (exports.SelectionRangeRequest = SelectionRangeRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkDoneProgressCancelNotification = exports.WorkDoneProgressCreateRequest = exports.WorkDoneProgress = void 0;\nconst vscode_jsonrpc_1 = require(\"vscode-jsonrpc\");\nconst messages_1 = require(\"./messages\");\nvar WorkDoneProgress;\n(function (WorkDoneProgress) {\n WorkDoneProgress.type = new vscode_jsonrpc_1.ProgressType();\n function is(value) {\n return value === WorkDoneProgress.type;\n }\n WorkDoneProgress.is = is;\n})(WorkDoneProgress || (exports.WorkDoneProgress = WorkDoneProgress = {}));\n/**\n * The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress\n * reporting from the server.\n */\nvar WorkDoneProgressCreateRequest;\n(function (WorkDoneProgressCreateRequest) {\n WorkDoneProgressCreateRequest.method = 'window/workDoneProgress/create';\n WorkDoneProgressCreateRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n WorkDoneProgressCreateRequest.type = new messages_1.ProtocolRequestType(WorkDoneProgressCreateRequest.method);\n})(WorkDoneProgressCreateRequest || (exports.WorkDoneProgressCreateRequest = WorkDoneProgressCreateRequest = {}));\n/**\n * The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress\n * initiated on the server side.\n */\nvar WorkDoneProgressCancelNotification;\n(function (WorkDoneProgressCancelNotification) {\n WorkDoneProgressCancelNotification.method = 'window/workDoneProgress/cancel';\n WorkDoneProgressCancelNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n WorkDoneProgressCancelNotification.type = new messages_1.ProtocolNotificationType(WorkDoneProgressCancelNotification.method);\n})(WorkDoneProgressCancelNotification || (exports.WorkDoneProgressCancelNotification = WorkDoneProgressCancelNotification = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) TypeFox, Microsoft and others. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CallHierarchyOutgoingCallsRequest = exports.CallHierarchyIncomingCallsRequest = exports.CallHierarchyPrepareRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to result a `CallHierarchyItem` in a document at a given position.\n * Can be used as an input to an incoming or outgoing call hierarchy.\n *\n * @since 3.16.0\n */\nvar CallHierarchyPrepareRequest;\n(function (CallHierarchyPrepareRequest) {\n CallHierarchyPrepareRequest.method = 'textDocument/prepareCallHierarchy';\n CallHierarchyPrepareRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CallHierarchyPrepareRequest.type = new messages_1.ProtocolRequestType(CallHierarchyPrepareRequest.method);\n})(CallHierarchyPrepareRequest || (exports.CallHierarchyPrepareRequest = CallHierarchyPrepareRequest = {}));\n/**\n * A request to resolve the incoming calls for a given `CallHierarchyItem`.\n *\n * @since 3.16.0\n */\nvar CallHierarchyIncomingCallsRequest;\n(function (CallHierarchyIncomingCallsRequest) {\n CallHierarchyIncomingCallsRequest.method = 'callHierarchy/incomingCalls';\n CallHierarchyIncomingCallsRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CallHierarchyIncomingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyIncomingCallsRequest.method);\n})(CallHierarchyIncomingCallsRequest || (exports.CallHierarchyIncomingCallsRequest = CallHierarchyIncomingCallsRequest = {}));\n/**\n * A request to resolve the outgoing calls for a given `CallHierarchyItem`.\n *\n * @since 3.16.0\n */\nvar CallHierarchyOutgoingCallsRequest;\n(function (CallHierarchyOutgoingCallsRequest) {\n CallHierarchyOutgoingCallsRequest.method = 'callHierarchy/outgoingCalls';\n CallHierarchyOutgoingCallsRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CallHierarchyOutgoingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyOutgoingCallsRequest.method);\n})(CallHierarchyOutgoingCallsRequest || (exports.CallHierarchyOutgoingCallsRequest = CallHierarchyOutgoingCallsRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SemanticTokensRefreshRequest = exports.SemanticTokensRangeRequest = exports.SemanticTokensDeltaRequest = exports.SemanticTokensRequest = exports.SemanticTokensRegistrationType = exports.TokenFormat = void 0;\nconst messages_1 = require(\"./messages\");\n//------- 'textDocument/semanticTokens' -----\nvar TokenFormat;\n(function (TokenFormat) {\n TokenFormat.Relative = 'relative';\n})(TokenFormat || (exports.TokenFormat = TokenFormat = {}));\nvar SemanticTokensRegistrationType;\n(function (SemanticTokensRegistrationType) {\n SemanticTokensRegistrationType.method = 'textDocument/semanticTokens';\n SemanticTokensRegistrationType.type = new messages_1.RegistrationType(SemanticTokensRegistrationType.method);\n})(SemanticTokensRegistrationType || (exports.SemanticTokensRegistrationType = SemanticTokensRegistrationType = {}));\n/**\n * @since 3.16.0\n */\nvar SemanticTokensRequest;\n(function (SemanticTokensRequest) {\n SemanticTokensRequest.method = 'textDocument/semanticTokens/full';\n SemanticTokensRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n SemanticTokensRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRequest.method);\n SemanticTokensRequest.registrationMethod = SemanticTokensRegistrationType.method;\n})(SemanticTokensRequest || (exports.SemanticTokensRequest = SemanticTokensRequest = {}));\n/**\n * @since 3.16.0\n */\nvar SemanticTokensDeltaRequest;\n(function (SemanticTokensDeltaRequest) {\n SemanticTokensDeltaRequest.method = 'textDocument/semanticTokens/full/delta';\n SemanticTokensDeltaRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n SemanticTokensDeltaRequest.type = new messages_1.ProtocolRequestType(SemanticTokensDeltaRequest.method);\n SemanticTokensDeltaRequest.registrationMethod = SemanticTokensRegistrationType.method;\n})(SemanticTokensDeltaRequest || (exports.SemanticTokensDeltaRequest = SemanticTokensDeltaRequest = {}));\n/**\n * @since 3.16.0\n */\nvar SemanticTokensRangeRequest;\n(function (SemanticTokensRangeRequest) {\n SemanticTokensRangeRequest.method = 'textDocument/semanticTokens/range';\n SemanticTokensRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n SemanticTokensRangeRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRangeRequest.method);\n SemanticTokensRangeRequest.registrationMethod = SemanticTokensRegistrationType.method;\n})(SemanticTokensRangeRequest || (exports.SemanticTokensRangeRequest = SemanticTokensRangeRequest = {}));\n/**\n * @since 3.16.0\n */\nvar SemanticTokensRefreshRequest;\n(function (SemanticTokensRefreshRequest) {\n SemanticTokensRefreshRequest.method = `workspace/semanticTokens/refresh`;\n SemanticTokensRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n SemanticTokensRefreshRequest.type = new messages_1.ProtocolRequestType0(SemanticTokensRefreshRequest.method);\n})(SemanticTokensRefreshRequest || (exports.SemanticTokensRefreshRequest = SemanticTokensRefreshRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShowDocumentRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to show a document. This request might open an\n * external program depending on the value of the URI to open.\n * For example a request to open `https://code.visualstudio.com/`\n * will very likely open the URI in a WEB browser.\n *\n * @since 3.16.0\n*/\nvar ShowDocumentRequest;\n(function (ShowDocumentRequest) {\n ShowDocumentRequest.method = 'window/showDocument';\n ShowDocumentRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n ShowDocumentRequest.type = new messages_1.ProtocolRequestType(ShowDocumentRequest.method);\n})(ShowDocumentRequest || (exports.ShowDocumentRequest = ShowDocumentRequest = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LinkedEditingRangeRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide ranges that can be edited together.\n *\n * @since 3.16.0\n */\nvar LinkedEditingRangeRequest;\n(function (LinkedEditingRangeRequest) {\n LinkedEditingRangeRequest.method = 'textDocument/linkedEditingRange';\n LinkedEditingRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n LinkedEditingRangeRequest.type = new messages_1.ProtocolRequestType(LinkedEditingRangeRequest.method);\n})(LinkedEditingRangeRequest || (exports.LinkedEditingRangeRequest = LinkedEditingRangeRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WillDeleteFilesRequest = exports.DidDeleteFilesNotification = exports.DidRenameFilesNotification = exports.WillRenameFilesRequest = exports.DidCreateFilesNotification = exports.WillCreateFilesRequest = exports.FileOperationPatternKind = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A pattern kind describing if a glob pattern matches a file a folder or\n * both.\n *\n * @since 3.16.0\n */\nvar FileOperationPatternKind;\n(function (FileOperationPatternKind) {\n /**\n * The pattern matches a file only.\n */\n FileOperationPatternKind.file = 'file';\n /**\n * The pattern matches a folder only.\n */\n FileOperationPatternKind.folder = 'folder';\n})(FileOperationPatternKind || (exports.FileOperationPatternKind = FileOperationPatternKind = {}));\n/**\n * The will create files request is sent from the client to the server before files are actually\n * created as long as the creation is triggered from within the client.\n *\n * The request can return a `WorkspaceEdit` which will be applied to workspace before the\n * files are created. Hence the `WorkspaceEdit` can not manipulate the content of the file\n * to be created.\n *\n * @since 3.16.0\n */\nvar WillCreateFilesRequest;\n(function (WillCreateFilesRequest) {\n WillCreateFilesRequest.method = 'workspace/willCreateFiles';\n WillCreateFilesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WillCreateFilesRequest.type = new messages_1.ProtocolRequestType(WillCreateFilesRequest.method);\n})(WillCreateFilesRequest || (exports.WillCreateFilesRequest = WillCreateFilesRequest = {}));\n/**\n * The did create files notification is sent from the client to the server when\n * files were created from within the client.\n *\n * @since 3.16.0\n */\nvar DidCreateFilesNotification;\n(function (DidCreateFilesNotification) {\n DidCreateFilesNotification.method = 'workspace/didCreateFiles';\n DidCreateFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidCreateFilesNotification.type = new messages_1.ProtocolNotificationType(DidCreateFilesNotification.method);\n})(DidCreateFilesNotification || (exports.DidCreateFilesNotification = DidCreateFilesNotification = {}));\n/**\n * The will rename files request is sent from the client to the server before files are actually\n * renamed as long as the rename is triggered from within the client.\n *\n * @since 3.16.0\n */\nvar WillRenameFilesRequest;\n(function (WillRenameFilesRequest) {\n WillRenameFilesRequest.method = 'workspace/willRenameFiles';\n WillRenameFilesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WillRenameFilesRequest.type = new messages_1.ProtocolRequestType(WillRenameFilesRequest.method);\n})(WillRenameFilesRequest || (exports.WillRenameFilesRequest = WillRenameFilesRequest = {}));\n/**\n * The did rename files notification is sent from the client to the server when\n * files were renamed from within the client.\n *\n * @since 3.16.0\n */\nvar DidRenameFilesNotification;\n(function (DidRenameFilesNotification) {\n DidRenameFilesNotification.method = 'workspace/didRenameFiles';\n DidRenameFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidRenameFilesNotification.type = new messages_1.ProtocolNotificationType(DidRenameFilesNotification.method);\n})(DidRenameFilesNotification || (exports.DidRenameFilesNotification = DidRenameFilesNotification = {}));\n/**\n * The will delete files request is sent from the client to the server before files are actually\n * deleted as long as the deletion is triggered from within the client.\n *\n * @since 3.16.0\n */\nvar DidDeleteFilesNotification;\n(function (DidDeleteFilesNotification) {\n DidDeleteFilesNotification.method = 'workspace/didDeleteFiles';\n DidDeleteFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidDeleteFilesNotification.type = new messages_1.ProtocolNotificationType(DidDeleteFilesNotification.method);\n})(DidDeleteFilesNotification || (exports.DidDeleteFilesNotification = DidDeleteFilesNotification = {}));\n/**\n * The did delete files notification is sent from the client to the server when\n * files were deleted from within the client.\n *\n * @since 3.16.0\n */\nvar WillDeleteFilesRequest;\n(function (WillDeleteFilesRequest) {\n WillDeleteFilesRequest.method = 'workspace/willDeleteFiles';\n WillDeleteFilesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WillDeleteFilesRequest.type = new messages_1.ProtocolRequestType(WillDeleteFilesRequest.method);\n})(WillDeleteFilesRequest || (exports.WillDeleteFilesRequest = WillDeleteFilesRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MonikerRequest = exports.MonikerKind = exports.UniquenessLevel = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * Moniker uniqueness level to define scope of the moniker.\n *\n * @since 3.16.0\n */\nvar UniquenessLevel;\n(function (UniquenessLevel) {\n /**\n * The moniker is only unique inside a document\n */\n UniquenessLevel.document = 'document';\n /**\n * The moniker is unique inside a project for which a dump got created\n */\n UniquenessLevel.project = 'project';\n /**\n * The moniker is unique inside the group to which a project belongs\n */\n UniquenessLevel.group = 'group';\n /**\n * The moniker is unique inside the moniker scheme.\n */\n UniquenessLevel.scheme = 'scheme';\n /**\n * The moniker is globally unique\n */\n UniquenessLevel.global = 'global';\n})(UniquenessLevel || (exports.UniquenessLevel = UniquenessLevel = {}));\n/**\n * The moniker kind.\n *\n * @since 3.16.0\n */\nvar MonikerKind;\n(function (MonikerKind) {\n /**\n * The moniker represent a symbol that is imported into a project\n */\n MonikerKind.$import = 'import';\n /**\n * The moniker represents a symbol that is exported from a project\n */\n MonikerKind.$export = 'export';\n /**\n * The moniker represents a symbol that is local to a project (e.g. a local\n * variable of a function, a class not visible outside the project, ...)\n */\n MonikerKind.local = 'local';\n})(MonikerKind || (exports.MonikerKind = MonikerKind = {}));\n/**\n * A request to get the moniker of a symbol at a given text document position.\n * The request parameter is of type {@link TextDocumentPositionParams}.\n * The response is of type {@link Moniker Moniker[]} or `null`.\n */\nvar MonikerRequest;\n(function (MonikerRequest) {\n MonikerRequest.method = 'textDocument/moniker';\n MonikerRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n MonikerRequest.type = new messages_1.ProtocolRequestType(MonikerRequest.method);\n})(MonikerRequest || (exports.MonikerRequest = MonikerRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) TypeFox, Microsoft and others. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TypeHierarchySubtypesRequest = exports.TypeHierarchySupertypesRequest = exports.TypeHierarchyPrepareRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to result a `TypeHierarchyItem` in a document at a given position.\n * Can be used as an input to a subtypes or supertypes type hierarchy.\n *\n * @since 3.17.0\n */\nvar TypeHierarchyPrepareRequest;\n(function (TypeHierarchyPrepareRequest) {\n TypeHierarchyPrepareRequest.method = 'textDocument/prepareTypeHierarchy';\n TypeHierarchyPrepareRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n TypeHierarchyPrepareRequest.type = new messages_1.ProtocolRequestType(TypeHierarchyPrepareRequest.method);\n})(TypeHierarchyPrepareRequest || (exports.TypeHierarchyPrepareRequest = TypeHierarchyPrepareRequest = {}));\n/**\n * A request to resolve the supertypes for a given `TypeHierarchyItem`.\n *\n * @since 3.17.0\n */\nvar TypeHierarchySupertypesRequest;\n(function (TypeHierarchySupertypesRequest) {\n TypeHierarchySupertypesRequest.method = 'typeHierarchy/supertypes';\n TypeHierarchySupertypesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n TypeHierarchySupertypesRequest.type = new messages_1.ProtocolRequestType(TypeHierarchySupertypesRequest.method);\n})(TypeHierarchySupertypesRequest || (exports.TypeHierarchySupertypesRequest = TypeHierarchySupertypesRequest = {}));\n/**\n * A request to resolve the subtypes for a given `TypeHierarchyItem`.\n *\n * @since 3.17.0\n */\nvar TypeHierarchySubtypesRequest;\n(function (TypeHierarchySubtypesRequest) {\n TypeHierarchySubtypesRequest.method = 'typeHierarchy/subtypes';\n TypeHierarchySubtypesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n TypeHierarchySubtypesRequest.type = new messages_1.ProtocolRequestType(TypeHierarchySubtypesRequest.method);\n})(TypeHierarchySubtypesRequest || (exports.TypeHierarchySubtypesRequest = TypeHierarchySubtypesRequest = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlineValueRefreshRequest = exports.InlineValueRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide inline values in a document. The request's parameter is of\n * type {@link InlineValueParams}, the response is of type\n * {@link InlineValue InlineValue[]} or a Thenable that resolves to such.\n *\n * @since 3.17.0\n */\nvar InlineValueRequest;\n(function (InlineValueRequest) {\n InlineValueRequest.method = 'textDocument/inlineValue';\n InlineValueRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n InlineValueRequest.type = new messages_1.ProtocolRequestType(InlineValueRequest.method);\n})(InlineValueRequest || (exports.InlineValueRequest = InlineValueRequest = {}));\n/**\n * @since 3.17.0\n */\nvar InlineValueRefreshRequest;\n(function (InlineValueRefreshRequest) {\n InlineValueRefreshRequest.method = `workspace/inlineValue/refresh`;\n InlineValueRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n InlineValueRefreshRequest.type = new messages_1.ProtocolRequestType0(InlineValueRefreshRequest.method);\n})(InlineValueRefreshRequest || (exports.InlineValueRefreshRequest = InlineValueRefreshRequest = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlayHintRefreshRequest = exports.InlayHintResolveRequest = exports.InlayHintRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide inlay hints in a document. The request's parameter is of\n * type {@link InlayHintsParams}, the response is of type\n * {@link InlayHint InlayHint[]} or a Thenable that resolves to such.\n *\n * @since 3.17.0\n */\nvar InlayHintRequest;\n(function (InlayHintRequest) {\n InlayHintRequest.method = 'textDocument/inlayHint';\n InlayHintRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n InlayHintRequest.type = new messages_1.ProtocolRequestType(InlayHintRequest.method);\n})(InlayHintRequest || (exports.InlayHintRequest = InlayHintRequest = {}));\n/**\n * A request to resolve additional properties for an inlay hint.\n * The request's parameter is of type {@link InlayHint}, the response is\n * of type {@link InlayHint} or a Thenable that resolves to such.\n *\n * @since 3.17.0\n */\nvar InlayHintResolveRequest;\n(function (InlayHintResolveRequest) {\n InlayHintResolveRequest.method = 'inlayHint/resolve';\n InlayHintResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n InlayHintResolveRequest.type = new messages_1.ProtocolRequestType(InlayHintResolveRequest.method);\n})(InlayHintResolveRequest || (exports.InlayHintResolveRequest = InlayHintResolveRequest = {}));\n/**\n * @since 3.17.0\n */\nvar InlayHintRefreshRequest;\n(function (InlayHintRefreshRequest) {\n InlayHintRefreshRequest.method = `workspace/inlayHint/refresh`;\n InlayHintRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n InlayHintRefreshRequest.type = new messages_1.ProtocolRequestType0(InlayHintRefreshRequest.method);\n})(InlayHintRefreshRequest || (exports.InlayHintRefreshRequest = InlayHintRefreshRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagnosticRefreshRequest = exports.WorkspaceDiagnosticRequest = exports.DocumentDiagnosticRequest = exports.DocumentDiagnosticReportKind = exports.DiagnosticServerCancellationData = void 0;\nconst vscode_jsonrpc_1 = require(\"vscode-jsonrpc\");\nconst Is = require(\"./utils/is\");\nconst messages_1 = require(\"./messages\");\n/**\n * @since 3.17.0\n */\nvar DiagnosticServerCancellationData;\n(function (DiagnosticServerCancellationData) {\n function is(value) {\n const candidate = value;\n return candidate && Is.boolean(candidate.retriggerRequest);\n }\n DiagnosticServerCancellationData.is = is;\n})(DiagnosticServerCancellationData || (exports.DiagnosticServerCancellationData = DiagnosticServerCancellationData = {}));\n/**\n * The document diagnostic report kinds.\n *\n * @since 3.17.0\n */\nvar DocumentDiagnosticReportKind;\n(function (DocumentDiagnosticReportKind) {\n /**\n * A diagnostic report with a full\n * set of problems.\n */\n DocumentDiagnosticReportKind.Full = 'full';\n /**\n * A report indicating that the last\n * returned report is still accurate.\n */\n DocumentDiagnosticReportKind.Unchanged = 'unchanged';\n})(DocumentDiagnosticReportKind || (exports.DocumentDiagnosticReportKind = DocumentDiagnosticReportKind = {}));\n/**\n * The document diagnostic request definition.\n *\n * @since 3.17.0\n */\nvar DocumentDiagnosticRequest;\n(function (DocumentDiagnosticRequest) {\n DocumentDiagnosticRequest.method = 'textDocument/diagnostic';\n DocumentDiagnosticRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentDiagnosticRequest.type = new messages_1.ProtocolRequestType(DocumentDiagnosticRequest.method);\n DocumentDiagnosticRequest.partialResult = new vscode_jsonrpc_1.ProgressType();\n})(DocumentDiagnosticRequest || (exports.DocumentDiagnosticRequest = DocumentDiagnosticRequest = {}));\n/**\n * The workspace diagnostic request definition.\n *\n * @since 3.17.0\n */\nvar WorkspaceDiagnosticRequest;\n(function (WorkspaceDiagnosticRequest) {\n WorkspaceDiagnosticRequest.method = 'workspace/diagnostic';\n WorkspaceDiagnosticRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WorkspaceDiagnosticRequest.type = new messages_1.ProtocolRequestType(WorkspaceDiagnosticRequest.method);\n WorkspaceDiagnosticRequest.partialResult = new vscode_jsonrpc_1.ProgressType();\n})(WorkspaceDiagnosticRequest || (exports.WorkspaceDiagnosticRequest = WorkspaceDiagnosticRequest = {}));\n/**\n * The diagnostic refresh request definition.\n *\n * @since 3.17.0\n */\nvar DiagnosticRefreshRequest;\n(function (DiagnosticRefreshRequest) {\n DiagnosticRefreshRequest.method = `workspace/diagnostic/refresh`;\n DiagnosticRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n DiagnosticRefreshRequest.type = new messages_1.ProtocolRequestType0(DiagnosticRefreshRequest.method);\n})(DiagnosticRefreshRequest || (exports.DiagnosticRefreshRequest = DiagnosticRefreshRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.ExecutionSummary = exports.NotebookCellKind = void 0;\nconst vscode_languageserver_types_1 = require(\"vscode-languageserver-types\");\nconst Is = require(\"./utils/is\");\nconst messages_1 = require(\"./messages\");\n/**\n * A notebook cell kind.\n *\n * @since 3.17.0\n */\nvar NotebookCellKind;\n(function (NotebookCellKind) {\n /**\n * A markup-cell is formatted source that is used for display.\n */\n NotebookCellKind.Markup = 1;\n /**\n * A code-cell is source code.\n */\n NotebookCellKind.Code = 2;\n function is(value) {\n return value === 1 || value === 2;\n }\n NotebookCellKind.is = is;\n})(NotebookCellKind || (exports.NotebookCellKind = NotebookCellKind = {}));\nvar ExecutionSummary;\n(function (ExecutionSummary) {\n function create(executionOrder, success) {\n const result = { executionOrder };\n if (success === true || success === false) {\n result.success = success;\n }\n return result;\n }\n ExecutionSummary.create = create;\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.executionOrder) && (candidate.success === undefined || Is.boolean(candidate.success));\n }\n ExecutionSummary.is = is;\n function equals(one, other) {\n if (one === other) {\n return true;\n }\n if (one === null || one === undefined || other === null || other === undefined) {\n return false;\n }\n return one.executionOrder === other.executionOrder && one.success === other.success;\n }\n ExecutionSummary.equals = equals;\n})(ExecutionSummary || (exports.ExecutionSummary = ExecutionSummary = {}));\nvar NotebookCell;\n(function (NotebookCell) {\n function create(kind, document) {\n return { kind, document };\n }\n NotebookCell.create = create;\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && NotebookCellKind.is(candidate.kind) && vscode_languageserver_types_1.DocumentUri.is(candidate.document) &&\n (candidate.metadata === undefined || Is.objectLiteral(candidate.metadata));\n }\n NotebookCell.is = is;\n function diff(one, two) {\n const result = new Set();\n if (one.document !== two.document) {\n result.add('document');\n }\n if (one.kind !== two.kind) {\n result.add('kind');\n }\n if (one.executionSummary !== two.executionSummary) {\n result.add('executionSummary');\n }\n if ((one.metadata !== undefined || two.metadata !== undefined) && !equalsMetadata(one.metadata, two.metadata)) {\n result.add('metadata');\n }\n if ((one.executionSummary !== undefined || two.executionSummary !== undefined) && !ExecutionSummary.equals(one.executionSummary, two.executionSummary)) {\n result.add('executionSummary');\n }\n return result;\n }\n NotebookCell.diff = diff;\n function equalsMetadata(one, other) {\n if (one === other) {\n return true;\n }\n if (one === null || one === undefined || other === null || other === undefined) {\n return false;\n }\n if (typeof one !== typeof other) {\n return false;\n }\n if (typeof one !== 'object') {\n return false;\n }\n const oneArray = Array.isArray(one);\n const otherArray = Array.isArray(other);\n if (oneArray !== otherArray) {\n return false;\n }\n if (oneArray && otherArray) {\n if (one.length !== other.length) {\n return false;\n }\n for (let i = 0; i < one.length; i++) {\n if (!equalsMetadata(one[i], other[i])) {\n return false;\n }\n }\n }\n if (Is.objectLiteral(one) && Is.objectLiteral(other)) {\n const oneKeys = Object.keys(one);\n const otherKeys = Object.keys(other);\n if (oneKeys.length !== otherKeys.length) {\n return false;\n }\n oneKeys.sort();\n otherKeys.sort();\n if (!equalsMetadata(oneKeys, otherKeys)) {\n return false;\n }\n for (let i = 0; i < oneKeys.length; i++) {\n const prop = oneKeys[i];\n if (!equalsMetadata(one[prop], other[prop])) {\n return false;\n }\n }\n }\n return true;\n }\n})(NotebookCell || (exports.NotebookCell = NotebookCell = {}));\nvar NotebookDocument;\n(function (NotebookDocument) {\n function create(uri, notebookType, version, cells) {\n return { uri, notebookType, version, cells };\n }\n NotebookDocument.create = create;\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.uri) && vscode_languageserver_types_1.integer.is(candidate.version) && Is.typedArray(candidate.cells, NotebookCell.is);\n }\n NotebookDocument.is = is;\n})(NotebookDocument || (exports.NotebookDocument = NotebookDocument = {}));\nvar NotebookDocumentSyncRegistrationType;\n(function (NotebookDocumentSyncRegistrationType) {\n NotebookDocumentSyncRegistrationType.method = 'notebookDocument/sync';\n NotebookDocumentSyncRegistrationType.messageDirection = messages_1.MessageDirection.clientToServer;\n NotebookDocumentSyncRegistrationType.type = new messages_1.RegistrationType(NotebookDocumentSyncRegistrationType.method);\n})(NotebookDocumentSyncRegistrationType || (exports.NotebookDocumentSyncRegistrationType = NotebookDocumentSyncRegistrationType = {}));\n/**\n * A notification sent when a notebook opens.\n *\n * @since 3.17.0\n */\nvar DidOpenNotebookDocumentNotification;\n(function (DidOpenNotebookDocumentNotification) {\n DidOpenNotebookDocumentNotification.method = 'notebookDocument/didOpen';\n DidOpenNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidOpenNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenNotebookDocumentNotification.method);\n DidOpenNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;\n})(DidOpenNotebookDocumentNotification || (exports.DidOpenNotebookDocumentNotification = DidOpenNotebookDocumentNotification = {}));\nvar NotebookCellArrayChange;\n(function (NotebookCellArrayChange) {\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.start) && vscode_languageserver_types_1.uinteger.is(candidate.deleteCount) && (candidate.cells === undefined || Is.typedArray(candidate.cells, NotebookCell.is));\n }\n NotebookCellArrayChange.is = is;\n function create(start, deleteCount, cells) {\n const result = { start, deleteCount };\n if (cells !== undefined) {\n result.cells = cells;\n }\n return result;\n }\n NotebookCellArrayChange.create = create;\n})(NotebookCellArrayChange || (exports.NotebookCellArrayChange = NotebookCellArrayChange = {}));\nvar DidChangeNotebookDocumentNotification;\n(function (DidChangeNotebookDocumentNotification) {\n DidChangeNotebookDocumentNotification.method = 'notebookDocument/didChange';\n DidChangeNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidChangeNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeNotebookDocumentNotification.method);\n DidChangeNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;\n})(DidChangeNotebookDocumentNotification || (exports.DidChangeNotebookDocumentNotification = DidChangeNotebookDocumentNotification = {}));\n/**\n * A notification sent when a notebook document is saved.\n *\n * @since 3.17.0\n */\nvar DidSaveNotebookDocumentNotification;\n(function (DidSaveNotebookDocumentNotification) {\n DidSaveNotebookDocumentNotification.method = 'notebookDocument/didSave';\n DidSaveNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidSaveNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveNotebookDocumentNotification.method);\n DidSaveNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;\n})(DidSaveNotebookDocumentNotification || (exports.DidSaveNotebookDocumentNotification = DidSaveNotebookDocumentNotification = {}));\n/**\n * A notification sent when a notebook closes.\n *\n * @since 3.17.0\n */\nvar DidCloseNotebookDocumentNotification;\n(function (DidCloseNotebookDocumentNotification) {\n DidCloseNotebookDocumentNotification.method = 'notebookDocument/didClose';\n DidCloseNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidCloseNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidCloseNotebookDocumentNotification.method);\n DidCloseNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;\n})(DidCloseNotebookDocumentNotification || (exports.DidCloseNotebookDocumentNotification = DidCloseNotebookDocumentNotification = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlineCompletionRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide inline completions in a document. The request's parameter is of\n * type {@link InlineCompletionParams}, the response is of type\n * {@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such.\n *\n * @since 3.18.0\n * @proposed\n */\nvar InlineCompletionRequest;\n(function (InlineCompletionRequest) {\n InlineCompletionRequest.method = 'textDocument/inlineCompletion';\n InlineCompletionRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n InlineCompletionRequest.type = new messages_1.ProtocolRequestType(InlineCompletionRequest.method);\n})(InlineCompletionRequest || (exports.InlineCompletionRequest = InlineCompletionRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkspaceSymbolRequest = exports.CodeActionResolveRequest = exports.CodeActionRequest = exports.DocumentSymbolRequest = exports.DocumentHighlightRequest = exports.ReferencesRequest = exports.DefinitionRequest = exports.SignatureHelpRequest = exports.SignatureHelpTriggerKind = exports.HoverRequest = exports.CompletionResolveRequest = exports.CompletionRequest = exports.CompletionTriggerKind = exports.PublishDiagnosticsNotification = exports.WatchKind = exports.RelativePattern = exports.FileChangeType = exports.DidChangeWatchedFilesNotification = exports.WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentNotification = exports.TextDocumentSaveReason = exports.DidSaveTextDocumentNotification = exports.DidCloseTextDocumentNotification = exports.DidChangeTextDocumentNotification = exports.TextDocumentContentChangeEvent = exports.DidOpenTextDocumentNotification = exports.TextDocumentSyncKind = exports.TelemetryEventNotification = exports.LogMessageNotification = exports.ShowMessageRequest = exports.ShowMessageNotification = exports.MessageType = exports.DidChangeConfigurationNotification = exports.ExitNotification = exports.ShutdownRequest = exports.InitializedNotification = exports.InitializeErrorCodes = exports.InitializeRequest = exports.WorkDoneProgressOptions = exports.TextDocumentRegistrationOptions = exports.StaticRegistrationOptions = exports.PositionEncodingKind = exports.FailureHandlingKind = exports.ResourceOperationKind = exports.UnregistrationRequest = exports.RegistrationRequest = exports.DocumentSelector = exports.NotebookCellTextDocumentFilter = exports.NotebookDocumentFilter = exports.TextDocumentFilter = void 0;\nexports.MonikerRequest = exports.MonikerKind = exports.UniquenessLevel = exports.WillDeleteFilesRequest = exports.DidDeleteFilesNotification = exports.WillRenameFilesRequest = exports.DidRenameFilesNotification = exports.WillCreateFilesRequest = exports.DidCreateFilesNotification = exports.FileOperationPatternKind = exports.LinkedEditingRangeRequest = exports.ShowDocumentRequest = exports.SemanticTokensRegistrationType = exports.SemanticTokensRefreshRequest = exports.SemanticTokensRangeRequest = exports.SemanticTokensDeltaRequest = exports.SemanticTokensRequest = exports.TokenFormat = exports.CallHierarchyPrepareRequest = exports.CallHierarchyOutgoingCallsRequest = exports.CallHierarchyIncomingCallsRequest = exports.WorkDoneProgressCancelNotification = exports.WorkDoneProgressCreateRequest = exports.WorkDoneProgress = exports.SelectionRangeRequest = exports.DeclarationRequest = exports.FoldingRangeRefreshRequest = exports.FoldingRangeRequest = exports.ColorPresentationRequest = exports.DocumentColorRequest = exports.ConfigurationRequest = exports.DidChangeWorkspaceFoldersNotification = exports.WorkspaceFoldersRequest = exports.TypeDefinitionRequest = exports.ImplementationRequest = exports.ApplyWorkspaceEditRequest = exports.ExecuteCommandRequest = exports.PrepareRenameRequest = exports.RenameRequest = exports.PrepareSupportDefaultBehavior = exports.DocumentOnTypeFormattingRequest = exports.DocumentRangesFormattingRequest = exports.DocumentRangeFormattingRequest = exports.DocumentFormattingRequest = exports.DocumentLinkResolveRequest = exports.DocumentLinkRequest = exports.CodeLensRefreshRequest = exports.CodeLensResolveRequest = exports.CodeLensRequest = exports.WorkspaceSymbolResolveRequest = void 0;\nexports.InlineCompletionRequest = exports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.ExecutionSummary = exports.NotebookCellKind = exports.DiagnosticRefreshRequest = exports.WorkspaceDiagnosticRequest = exports.DocumentDiagnosticRequest = exports.DocumentDiagnosticReportKind = exports.DiagnosticServerCancellationData = exports.InlayHintRefreshRequest = exports.InlayHintResolveRequest = exports.InlayHintRequest = exports.InlineValueRefreshRequest = exports.InlineValueRequest = exports.TypeHierarchySupertypesRequest = exports.TypeHierarchySubtypesRequest = exports.TypeHierarchyPrepareRequest = void 0;\nconst messages_1 = require(\"./messages\");\nconst vscode_languageserver_types_1 = require(\"vscode-languageserver-types\");\nconst Is = require(\"./utils/is\");\nconst protocol_implementation_1 = require(\"./protocol.implementation\");\nObject.defineProperty(exports, \"ImplementationRequest\", { enumerable: true, get: function () { return protocol_implementation_1.ImplementationRequest; } });\nconst protocol_typeDefinition_1 = require(\"./protocol.typeDefinition\");\nObject.defineProperty(exports, \"TypeDefinitionRequest\", { enumerable: true, get: function () { return protocol_typeDefinition_1.TypeDefinitionRequest; } });\nconst protocol_workspaceFolder_1 = require(\"./protocol.workspaceFolder\");\nObject.defineProperty(exports, \"WorkspaceFoldersRequest\", { enumerable: true, get: function () { return protocol_workspaceFolder_1.WorkspaceFoldersRequest; } });\nObject.defineProperty(exports, \"DidChangeWorkspaceFoldersNotification\", { enumerable: true, get: function () { return protocol_workspaceFolder_1.DidChangeWorkspaceFoldersNotification; } });\nconst protocol_configuration_1 = require(\"./protocol.configuration\");\nObject.defineProperty(exports, \"ConfigurationRequest\", { enumerable: true, get: function () { return protocol_configuration_1.ConfigurationRequest; } });\nconst protocol_colorProvider_1 = require(\"./protocol.colorProvider\");\nObject.defineProperty(exports, \"DocumentColorRequest\", { enumerable: true, get: function () { return protocol_colorProvider_1.DocumentColorRequest; } });\nObject.defineProperty(exports, \"ColorPresentationRequest\", { enumerable: true, get: function () { return protocol_colorProvider_1.ColorPresentationRequest; } });\nconst protocol_foldingRange_1 = require(\"./protocol.foldingRange\");\nObject.defineProperty(exports, \"FoldingRangeRequest\", { enumerable: true, get: function () { return protocol_foldingRange_1.FoldingRangeRequest; } });\nObject.defineProperty(exports, \"FoldingRangeRefreshRequest\", { enumerable: true, get: function () { return protocol_foldingRange_1.FoldingRangeRefreshRequest; } });\nconst protocol_declaration_1 = require(\"./protocol.declaration\");\nObject.defineProperty(exports, \"DeclarationRequest\", { enumerable: true, get: function () { return protocol_declaration_1.DeclarationRequest; } });\nconst protocol_selectionRange_1 = require(\"./protocol.selectionRange\");\nObject.defineProperty(exports, \"SelectionRangeRequest\", { enumerable: true, get: function () { return protocol_selectionRange_1.SelectionRangeRequest; } });\nconst protocol_progress_1 = require(\"./protocol.progress\");\nObject.defineProperty(exports, \"WorkDoneProgress\", { enumerable: true, get: function () { return protocol_progress_1.WorkDoneProgress; } });\nObject.defineProperty(exports, \"WorkDoneProgressCreateRequest\", { enumerable: true, get: function () { return protocol_progress_1.WorkDoneProgressCreateRequest; } });\nObject.defineProperty(exports, \"WorkDoneProgressCancelNotification\", { enumerable: true, get: function () { return protocol_progress_1.WorkDoneProgressCancelNotification; } });\nconst protocol_callHierarchy_1 = require(\"./protocol.callHierarchy\");\nObject.defineProperty(exports, \"CallHierarchyIncomingCallsRequest\", { enumerable: true, get: function () { return protocol_callHierarchy_1.CallHierarchyIncomingCallsRequest; } });\nObject.defineProperty(exports, \"CallHierarchyOutgoingCallsRequest\", { enumerable: true, get: function () { return protocol_callHierarchy_1.CallHierarchyOutgoingCallsRequest; } });\nObject.defineProperty(exports, \"CallHierarchyPrepareRequest\", { enumerable: true, get: function () { return protocol_callHierarchy_1.CallHierarchyPrepareRequest; } });\nconst protocol_semanticTokens_1 = require(\"./protocol.semanticTokens\");\nObject.defineProperty(exports, \"TokenFormat\", { enumerable: true, get: function () { return protocol_semanticTokens_1.TokenFormat; } });\nObject.defineProperty(exports, \"SemanticTokensRequest\", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRequest; } });\nObject.defineProperty(exports, \"SemanticTokensDeltaRequest\", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensDeltaRequest; } });\nObject.defineProperty(exports, \"SemanticTokensRangeRequest\", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRangeRequest; } });\nObject.defineProperty(exports, \"SemanticTokensRefreshRequest\", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRefreshRequest; } });\nObject.defineProperty(exports, \"SemanticTokensRegistrationType\", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRegistrationType; } });\nconst protocol_showDocument_1 = require(\"./protocol.showDocument\");\nObject.defineProperty(exports, \"ShowDocumentRequest\", { enumerable: true, get: function () { return protocol_showDocument_1.ShowDocumentRequest; } });\nconst protocol_linkedEditingRange_1 = require(\"./protocol.linkedEditingRange\");\nObject.defineProperty(exports, \"LinkedEditingRangeRequest\", { enumerable: true, get: function () { return protocol_linkedEditingRange_1.LinkedEditingRangeRequest; } });\nconst protocol_fileOperations_1 = require(\"./protocol.fileOperations\");\nObject.defineProperty(exports, \"FileOperationPatternKind\", { enumerable: true, get: function () { return protocol_fileOperations_1.FileOperationPatternKind; } });\nObject.defineProperty(exports, \"DidCreateFilesNotification\", { enumerable: true, get: function () { return protocol_fileOperations_1.DidCreateFilesNotification; } });\nObject.defineProperty(exports, \"WillCreateFilesRequest\", { enumerable: true, get: function () { return protocol_fileOperations_1.WillCreateFilesRequest; } });\nObject.defineProperty(exports, \"DidRenameFilesNotification\", { enumerable: true, get: function () { return protocol_fileOperations_1.DidRenameFilesNotification; } });\nObject.defineProperty(exports, \"WillRenameFilesRequest\", { enumerable: true, get: function () { return protocol_fileOperations_1.WillRenameFilesRequest; } });\nObject.defineProperty(exports, \"DidDeleteFilesNotification\", { enumerable: true, get: function () { return protocol_fileOperations_1.DidDeleteFilesNotification; } });\nObject.defineProperty(exports, \"WillDeleteFilesRequest\", { enumerable: true, get: function () { return protocol_fileOperations_1.WillDeleteFilesRequest; } });\nconst protocol_moniker_1 = require(\"./protocol.moniker\");\nObject.defineProperty(exports, \"UniquenessLevel\", { enumerable: true, get: function () { return protocol_moniker_1.UniquenessLevel; } });\nObject.defineProperty(exports, \"MonikerKind\", { enumerable: true, get: function () { return protocol_moniker_1.MonikerKind; } });\nObject.defineProperty(exports, \"MonikerRequest\", { enumerable: true, get: function () { return protocol_moniker_1.MonikerRequest; } });\nconst protocol_typeHierarchy_1 = require(\"./protocol.typeHierarchy\");\nObject.defineProperty(exports, \"TypeHierarchyPrepareRequest\", { enumerable: true, get: function () { return protocol_typeHierarchy_1.TypeHierarchyPrepareRequest; } });\nObject.defineProperty(exports, \"TypeHierarchySubtypesRequest\", { enumerable: true, get: function () { return protocol_typeHierarchy_1.TypeHierarchySubtypesRequest; } });\nObject.defineProperty(exports, \"TypeHierarchySupertypesRequest\", { enumerable: true, get: function () { return protocol_typeHierarchy_1.TypeHierarchySupertypesRequest; } });\nconst protocol_inlineValue_1 = require(\"./protocol.inlineValue\");\nObject.defineProperty(exports, \"InlineValueRequest\", { enumerable: true, get: function () { return protocol_inlineValue_1.InlineValueRequest; } });\nObject.defineProperty(exports, \"InlineValueRefreshRequest\", { enumerable: true, get: function () { return protocol_inlineValue_1.InlineValueRefreshRequest; } });\nconst protocol_inlayHint_1 = require(\"./protocol.inlayHint\");\nObject.defineProperty(exports, \"InlayHintRequest\", { enumerable: true, get: function () { return protocol_inlayHint_1.InlayHintRequest; } });\nObject.defineProperty(exports, \"InlayHintResolveRequest\", { enumerable: true, get: function () { return protocol_inlayHint_1.InlayHintResolveRequest; } });\nObject.defineProperty(exports, \"InlayHintRefreshRequest\", { enumerable: true, get: function () { return protocol_inlayHint_1.InlayHintRefreshRequest; } });\nconst protocol_diagnostic_1 = require(\"./protocol.diagnostic\");\nObject.defineProperty(exports, \"DiagnosticServerCancellationData\", { enumerable: true, get: function () { return protocol_diagnostic_1.DiagnosticServerCancellationData; } });\nObject.defineProperty(exports, \"DocumentDiagnosticReportKind\", { enumerable: true, get: function () { return protocol_diagnostic_1.DocumentDiagnosticReportKind; } });\nObject.defineProperty(exports, \"DocumentDiagnosticRequest\", { enumerable: true, get: function () { return protocol_diagnostic_1.DocumentDiagnosticRequest; } });\nObject.defineProperty(exports, \"WorkspaceDiagnosticRequest\", { enumerable: true, get: function () { return protocol_diagnostic_1.WorkspaceDiagnosticRequest; } });\nObject.defineProperty(exports, \"DiagnosticRefreshRequest\", { enumerable: true, get: function () { return protocol_diagnostic_1.DiagnosticRefreshRequest; } });\nconst protocol_notebook_1 = require(\"./protocol.notebook\");\nObject.defineProperty(exports, \"NotebookCellKind\", { enumerable: true, get: function () { return protocol_notebook_1.NotebookCellKind; } });\nObject.defineProperty(exports, \"ExecutionSummary\", { enumerable: true, get: function () { return protocol_notebook_1.ExecutionSummary; } });\nObject.defineProperty(exports, \"NotebookCell\", { enumerable: true, get: function () { return protocol_notebook_1.NotebookCell; } });\nObject.defineProperty(exports, \"NotebookDocument\", { enumerable: true, get: function () { return protocol_notebook_1.NotebookDocument; } });\nObject.defineProperty(exports, \"NotebookDocumentSyncRegistrationType\", { enumerable: true, get: function () { return protocol_notebook_1.NotebookDocumentSyncRegistrationType; } });\nObject.defineProperty(exports, \"DidOpenNotebookDocumentNotification\", { enumerable: true, get: function () { return protocol_notebook_1.DidOpenNotebookDocumentNotification; } });\nObject.defineProperty(exports, \"NotebookCellArrayChange\", { enumerable: true, get: function () { return protocol_notebook_1.NotebookCellArrayChange; } });\nObject.defineProperty(exports, \"DidChangeNotebookDocumentNotification\", { enumerable: true, get: function () { return protocol_notebook_1.DidChangeNotebookDocumentNotification; } });\nObject.defineProperty(exports, \"DidSaveNotebookDocumentNotification\", { enumerable: true, get: function () { return protocol_notebook_1.DidSaveNotebookDocumentNotification; } });\nObject.defineProperty(exports, \"DidCloseNotebookDocumentNotification\", { enumerable: true, get: function () { return protocol_notebook_1.DidCloseNotebookDocumentNotification; } });\nconst protocol_inlineCompletion_1 = require(\"./protocol.inlineCompletion\");\nObject.defineProperty(exports, \"InlineCompletionRequest\", { enumerable: true, get: function () { return protocol_inlineCompletion_1.InlineCompletionRequest; } });\n// @ts-ignore: to avoid inlining LocationLink as dynamic import\nlet __noDynamicImport;\n/**\n * The TextDocumentFilter namespace provides helper functions to work with\n * {@link TextDocumentFilter} literals.\n *\n * @since 3.17.0\n */\nvar TextDocumentFilter;\n(function (TextDocumentFilter) {\n function is(value) {\n const candidate = value;\n return Is.string(candidate) || (Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern));\n }\n TextDocumentFilter.is = is;\n})(TextDocumentFilter || (exports.TextDocumentFilter = TextDocumentFilter = {}));\n/**\n * The NotebookDocumentFilter namespace provides helper functions to work with\n * {@link NotebookDocumentFilter} literals.\n *\n * @since 3.17.0\n */\nvar NotebookDocumentFilter;\n(function (NotebookDocumentFilter) {\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && (Is.string(candidate.notebookType) || Is.string(candidate.scheme) || Is.string(candidate.pattern));\n }\n NotebookDocumentFilter.is = is;\n})(NotebookDocumentFilter || (exports.NotebookDocumentFilter = NotebookDocumentFilter = {}));\n/**\n * The NotebookCellTextDocumentFilter namespace provides helper functions to work with\n * {@link NotebookCellTextDocumentFilter} literals.\n *\n * @since 3.17.0\n */\nvar NotebookCellTextDocumentFilter;\n(function (NotebookCellTextDocumentFilter) {\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate)\n && (Is.string(candidate.notebook) || NotebookDocumentFilter.is(candidate.notebook))\n && (candidate.language === undefined || Is.string(candidate.language));\n }\n NotebookCellTextDocumentFilter.is = is;\n})(NotebookCellTextDocumentFilter || (exports.NotebookCellTextDocumentFilter = NotebookCellTextDocumentFilter = {}));\n/**\n * The DocumentSelector namespace provides helper functions to work with\n * {@link DocumentSelector}s.\n */\nvar DocumentSelector;\n(function (DocumentSelector) {\n function is(value) {\n if (!Array.isArray(value)) {\n return false;\n }\n for (let elem of value) {\n if (!Is.string(elem) && !TextDocumentFilter.is(elem) && !NotebookCellTextDocumentFilter.is(elem)) {\n return false;\n }\n }\n return true;\n }\n DocumentSelector.is = is;\n})(DocumentSelector || (exports.DocumentSelector = DocumentSelector = {}));\n/**\n * The `client/registerCapability` request is sent from the server to the client to register a new capability\n * handler on the client side.\n */\nvar RegistrationRequest;\n(function (RegistrationRequest) {\n RegistrationRequest.method = 'client/registerCapability';\n RegistrationRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n RegistrationRequest.type = new messages_1.ProtocolRequestType(RegistrationRequest.method);\n})(RegistrationRequest || (exports.RegistrationRequest = RegistrationRequest = {}));\n/**\n * The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability\n * handler on the client side.\n */\nvar UnregistrationRequest;\n(function (UnregistrationRequest) {\n UnregistrationRequest.method = 'client/unregisterCapability';\n UnregistrationRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n UnregistrationRequest.type = new messages_1.ProtocolRequestType(UnregistrationRequest.method);\n})(UnregistrationRequest || (exports.UnregistrationRequest = UnregistrationRequest = {}));\nvar ResourceOperationKind;\n(function (ResourceOperationKind) {\n /**\n * Supports creating new files and folders.\n */\n ResourceOperationKind.Create = 'create';\n /**\n * Supports renaming existing files and folders.\n */\n ResourceOperationKind.Rename = 'rename';\n /**\n * Supports deleting existing files and folders.\n */\n ResourceOperationKind.Delete = 'delete';\n})(ResourceOperationKind || (exports.ResourceOperationKind = ResourceOperationKind = {}));\nvar FailureHandlingKind;\n(function (FailureHandlingKind) {\n /**\n * Applying the workspace change is simply aborted if one of the changes provided\n * fails. All operations executed before the failing operation stay executed.\n */\n FailureHandlingKind.Abort = 'abort';\n /**\n * All operations are executed transactional. That means they either all\n * succeed or no changes at all are applied to the workspace.\n */\n FailureHandlingKind.Transactional = 'transactional';\n /**\n * If the workspace edit contains only textual file changes they are executed transactional.\n * If resource changes (create, rename or delete file) are part of the change the failure\n * handling strategy is abort.\n */\n FailureHandlingKind.TextOnlyTransactional = 'textOnlyTransactional';\n /**\n * The client tries to undo the operations already executed. But there is no\n * guarantee that this is succeeding.\n */\n FailureHandlingKind.Undo = 'undo';\n})(FailureHandlingKind || (exports.FailureHandlingKind = FailureHandlingKind = {}));\n/**\n * A set of predefined position encoding kinds.\n *\n * @since 3.17.0\n */\nvar PositionEncodingKind;\n(function (PositionEncodingKind) {\n /**\n * Character offsets count UTF-8 code units (e.g. bytes).\n */\n PositionEncodingKind.UTF8 = 'utf-8';\n /**\n * Character offsets count UTF-16 code units.\n *\n * This is the default and must always be supported\n * by servers\n */\n PositionEncodingKind.UTF16 = 'utf-16';\n /**\n * Character offsets count UTF-32 code units.\n *\n * Implementation note: these are the same as Unicode codepoints,\n * so this `PositionEncodingKind` may also be used for an\n * encoding-agnostic representation of character offsets.\n */\n PositionEncodingKind.UTF32 = 'utf-32';\n})(PositionEncodingKind || (exports.PositionEncodingKind = PositionEncodingKind = {}));\n/**\n * The StaticRegistrationOptions namespace provides helper functions to work with\n * {@link StaticRegistrationOptions} literals.\n */\nvar StaticRegistrationOptions;\n(function (StaticRegistrationOptions) {\n function hasId(value) {\n const candidate = value;\n return candidate && Is.string(candidate.id) && candidate.id.length > 0;\n }\n StaticRegistrationOptions.hasId = hasId;\n})(StaticRegistrationOptions || (exports.StaticRegistrationOptions = StaticRegistrationOptions = {}));\n/**\n * The TextDocumentRegistrationOptions namespace provides helper functions to work with\n * {@link TextDocumentRegistrationOptions} literals.\n */\nvar TextDocumentRegistrationOptions;\n(function (TextDocumentRegistrationOptions) {\n function is(value) {\n const candidate = value;\n return candidate && (candidate.documentSelector === null || DocumentSelector.is(candidate.documentSelector));\n }\n TextDocumentRegistrationOptions.is = is;\n})(TextDocumentRegistrationOptions || (exports.TextDocumentRegistrationOptions = TextDocumentRegistrationOptions = {}));\n/**\n * The WorkDoneProgressOptions namespace provides helper functions to work with\n * {@link WorkDoneProgressOptions} literals.\n */\nvar WorkDoneProgressOptions;\n(function (WorkDoneProgressOptions) {\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && (candidate.workDoneProgress === undefined || Is.boolean(candidate.workDoneProgress));\n }\n WorkDoneProgressOptions.is = is;\n function hasWorkDoneProgress(value) {\n const candidate = value;\n return candidate && Is.boolean(candidate.workDoneProgress);\n }\n WorkDoneProgressOptions.hasWorkDoneProgress = hasWorkDoneProgress;\n})(WorkDoneProgressOptions || (exports.WorkDoneProgressOptions = WorkDoneProgressOptions = {}));\n/**\n * The initialize request is sent from the client to the server.\n * It is sent once as the request after starting up the server.\n * The requests parameter is of type {@link InitializeParams}\n * the response if of type {@link InitializeResult} of a Thenable that\n * resolves to such.\n */\nvar InitializeRequest;\n(function (InitializeRequest) {\n InitializeRequest.method = 'initialize';\n InitializeRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n InitializeRequest.type = new messages_1.ProtocolRequestType(InitializeRequest.method);\n})(InitializeRequest || (exports.InitializeRequest = InitializeRequest = {}));\n/**\n * Known error codes for an `InitializeErrorCodes`;\n */\nvar InitializeErrorCodes;\n(function (InitializeErrorCodes) {\n /**\n * If the protocol version provided by the client can't be handled by the server.\n *\n * @deprecated This initialize error got replaced by client capabilities. There is\n * no version handshake in version 3.0x\n */\n InitializeErrorCodes.unknownProtocolVersion = 1;\n})(InitializeErrorCodes || (exports.InitializeErrorCodes = InitializeErrorCodes = {}));\n/**\n * The initialized notification is sent from the client to the\n * server after the client is fully initialized and the server\n * is allowed to send requests from the server to the client.\n */\nvar InitializedNotification;\n(function (InitializedNotification) {\n InitializedNotification.method = 'initialized';\n InitializedNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n InitializedNotification.type = new messages_1.ProtocolNotificationType(InitializedNotification.method);\n})(InitializedNotification || (exports.InitializedNotification = InitializedNotification = {}));\n//---- Shutdown Method ----\n/**\n * A shutdown request is sent from the client to the server.\n * It is sent once when the client decides to shutdown the\n * server. The only notification that is sent after a shutdown request\n * is the exit event.\n */\nvar ShutdownRequest;\n(function (ShutdownRequest) {\n ShutdownRequest.method = 'shutdown';\n ShutdownRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n ShutdownRequest.type = new messages_1.ProtocolRequestType0(ShutdownRequest.method);\n})(ShutdownRequest || (exports.ShutdownRequest = ShutdownRequest = {}));\n//---- Exit Notification ----\n/**\n * The exit event is sent from the client to the server to\n * ask the server to exit its process.\n */\nvar ExitNotification;\n(function (ExitNotification) {\n ExitNotification.method = 'exit';\n ExitNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n ExitNotification.type = new messages_1.ProtocolNotificationType0(ExitNotification.method);\n})(ExitNotification || (exports.ExitNotification = ExitNotification = {}));\n/**\n * The configuration change notification is sent from the client to the server\n * when the client's configuration has changed. The notification contains\n * the changed configuration as defined by the language client.\n */\nvar DidChangeConfigurationNotification;\n(function (DidChangeConfigurationNotification) {\n DidChangeConfigurationNotification.method = 'workspace/didChangeConfiguration';\n DidChangeConfigurationNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidChangeConfigurationNotification.type = new messages_1.ProtocolNotificationType(DidChangeConfigurationNotification.method);\n})(DidChangeConfigurationNotification || (exports.DidChangeConfigurationNotification = DidChangeConfigurationNotification = {}));\n//---- Message show and log notifications ----\n/**\n * The message type\n */\nvar MessageType;\n(function (MessageType) {\n /**\n * An error message.\n */\n MessageType.Error = 1;\n /**\n * A warning message.\n */\n MessageType.Warning = 2;\n /**\n * An information message.\n */\n MessageType.Info = 3;\n /**\n * A log message.\n */\n MessageType.Log = 4;\n /**\n * A debug message.\n *\n * @since 3.18.0\n */\n MessageType.Debug = 5;\n})(MessageType || (exports.MessageType = MessageType = {}));\n/**\n * The show message notification is sent from a server to a client to ask\n * the client to display a particular message in the user interface.\n */\nvar ShowMessageNotification;\n(function (ShowMessageNotification) {\n ShowMessageNotification.method = 'window/showMessage';\n ShowMessageNotification.messageDirection = messages_1.MessageDirection.serverToClient;\n ShowMessageNotification.type = new messages_1.ProtocolNotificationType(ShowMessageNotification.method);\n})(ShowMessageNotification || (exports.ShowMessageNotification = ShowMessageNotification = {}));\n/**\n * The show message request is sent from the server to the client to show a message\n * and a set of options actions to the user.\n */\nvar ShowMessageRequest;\n(function (ShowMessageRequest) {\n ShowMessageRequest.method = 'window/showMessageRequest';\n ShowMessageRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n ShowMessageRequest.type = new messages_1.ProtocolRequestType(ShowMessageRequest.method);\n})(ShowMessageRequest || (exports.ShowMessageRequest = ShowMessageRequest = {}));\n/**\n * The log message notification is sent from the server to the client to ask\n * the client to log a particular message.\n */\nvar LogMessageNotification;\n(function (LogMessageNotification) {\n LogMessageNotification.method = 'window/logMessage';\n LogMessageNotification.messageDirection = messages_1.MessageDirection.serverToClient;\n LogMessageNotification.type = new messages_1.ProtocolNotificationType(LogMessageNotification.method);\n})(LogMessageNotification || (exports.LogMessageNotification = LogMessageNotification = {}));\n//---- Telemetry notification\n/**\n * The telemetry event notification is sent from the server to the client to ask\n * the client to log telemetry data.\n */\nvar TelemetryEventNotification;\n(function (TelemetryEventNotification) {\n TelemetryEventNotification.method = 'telemetry/event';\n TelemetryEventNotification.messageDirection = messages_1.MessageDirection.serverToClient;\n TelemetryEventNotification.type = new messages_1.ProtocolNotificationType(TelemetryEventNotification.method);\n})(TelemetryEventNotification || (exports.TelemetryEventNotification = TelemetryEventNotification = {}));\n/**\n * Defines how the host (editor) should sync\n * document changes to the language server.\n */\nvar TextDocumentSyncKind;\n(function (TextDocumentSyncKind) {\n /**\n * Documents should not be synced at all.\n */\n TextDocumentSyncKind.None = 0;\n /**\n * Documents are synced by always sending the full content\n * of the document.\n */\n TextDocumentSyncKind.Full = 1;\n /**\n * Documents are synced by sending the full content on open.\n * After that only incremental updates to the document are\n * send.\n */\n TextDocumentSyncKind.Incremental = 2;\n})(TextDocumentSyncKind || (exports.TextDocumentSyncKind = TextDocumentSyncKind = {}));\n/**\n * The document open notification is sent from the client to the server to signal\n * newly opened text documents. The document's truth is now managed by the client\n * and the server must not try to read the document's truth using the document's\n * uri. Open in this sense means it is managed by the client. It doesn't necessarily\n * mean that its content is presented in an editor. An open notification must not\n * be sent more than once without a corresponding close notification send before.\n * This means open and close notification must be balanced and the max open count\n * is one.\n */\nvar DidOpenTextDocumentNotification;\n(function (DidOpenTextDocumentNotification) {\n DidOpenTextDocumentNotification.method = 'textDocument/didOpen';\n DidOpenTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidOpenTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenTextDocumentNotification.method);\n})(DidOpenTextDocumentNotification || (exports.DidOpenTextDocumentNotification = DidOpenTextDocumentNotification = {}));\nvar TextDocumentContentChangeEvent;\n(function (TextDocumentContentChangeEvent) {\n /**\n * Checks whether the information describes a delta event.\n */\n function isIncremental(event) {\n let candidate = event;\n return candidate !== undefined && candidate !== null &&\n typeof candidate.text === 'string' && candidate.range !== undefined &&\n (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number');\n }\n TextDocumentContentChangeEvent.isIncremental = isIncremental;\n /**\n * Checks whether the information describes a full replacement event.\n */\n function isFull(event) {\n let candidate = event;\n return candidate !== undefined && candidate !== null &&\n typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined;\n }\n TextDocumentContentChangeEvent.isFull = isFull;\n})(TextDocumentContentChangeEvent || (exports.TextDocumentContentChangeEvent = TextDocumentContentChangeEvent = {}));\n/**\n * The document change notification is sent from the client to the server to signal\n * changes to a text document.\n */\nvar DidChangeTextDocumentNotification;\n(function (DidChangeTextDocumentNotification) {\n DidChangeTextDocumentNotification.method = 'textDocument/didChange';\n DidChangeTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidChangeTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeTextDocumentNotification.method);\n})(DidChangeTextDocumentNotification || (exports.DidChangeTextDocumentNotification = DidChangeTextDocumentNotification = {}));\n/**\n * The document close notification is sent from the client to the server when\n * the document got closed in the client. The document's truth now exists where\n * the document's uri points to (e.g. if the document's uri is a file uri the\n * truth now exists on disk). As with the open notification the close notification\n * is about managing the document's content. Receiving a close notification\n * doesn't mean that the document was open in an editor before. A close\n * notification requires a previous open notification to be sent.\n */\nvar DidCloseTextDocumentNotification;\n(function (DidCloseTextDocumentNotification) {\n DidCloseTextDocumentNotification.method = 'textDocument/didClose';\n DidCloseTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidCloseTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidCloseTextDocumentNotification.method);\n})(DidCloseTextDocumentNotification || (exports.DidCloseTextDocumentNotification = DidCloseTextDocumentNotification = {}));\n/**\n * The document save notification is sent from the client to the server when\n * the document got saved in the client.\n */\nvar DidSaveTextDocumentNotification;\n(function (DidSaveTextDocumentNotification) {\n DidSaveTextDocumentNotification.method = 'textDocument/didSave';\n DidSaveTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveTextDocumentNotification.method);\n})(DidSaveTextDocumentNotification || (exports.DidSaveTextDocumentNotification = DidSaveTextDocumentNotification = {}));\n/**\n * Represents reasons why a text document is saved.\n */\nvar TextDocumentSaveReason;\n(function (TextDocumentSaveReason) {\n /**\n * Manually triggered, e.g. by the user pressing save, by starting debugging,\n * or by an API call.\n */\n TextDocumentSaveReason.Manual = 1;\n /**\n * Automatic after a delay.\n */\n TextDocumentSaveReason.AfterDelay = 2;\n /**\n * When the editor lost focus.\n */\n TextDocumentSaveReason.FocusOut = 3;\n})(TextDocumentSaveReason || (exports.TextDocumentSaveReason = TextDocumentSaveReason = {}));\n/**\n * A document will save notification is sent from the client to the server before\n * the document is actually saved.\n */\nvar WillSaveTextDocumentNotification;\n(function (WillSaveTextDocumentNotification) {\n WillSaveTextDocumentNotification.method = 'textDocument/willSave';\n WillSaveTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n WillSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(WillSaveTextDocumentNotification.method);\n})(WillSaveTextDocumentNotification || (exports.WillSaveTextDocumentNotification = WillSaveTextDocumentNotification = {}));\n/**\n * A document will save request is sent from the client to the server before\n * the document is actually saved. The request can return an array of TextEdits\n * which will be applied to the text document before it is saved. Please note that\n * clients might drop results if computing the text edits took too long or if a\n * server constantly fails on this request. This is done to keep the save fast and\n * reliable.\n */\nvar WillSaveTextDocumentWaitUntilRequest;\n(function (WillSaveTextDocumentWaitUntilRequest) {\n WillSaveTextDocumentWaitUntilRequest.method = 'textDocument/willSaveWaitUntil';\n WillSaveTextDocumentWaitUntilRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WillSaveTextDocumentWaitUntilRequest.type = new messages_1.ProtocolRequestType(WillSaveTextDocumentWaitUntilRequest.method);\n})(WillSaveTextDocumentWaitUntilRequest || (exports.WillSaveTextDocumentWaitUntilRequest = WillSaveTextDocumentWaitUntilRequest = {}));\n/**\n * The watched files notification is sent from the client to the server when\n * the client detects changes to file watched by the language client.\n */\nvar DidChangeWatchedFilesNotification;\n(function (DidChangeWatchedFilesNotification) {\n DidChangeWatchedFilesNotification.method = 'workspace/didChangeWatchedFiles';\n DidChangeWatchedFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidChangeWatchedFilesNotification.type = new messages_1.ProtocolNotificationType(DidChangeWatchedFilesNotification.method);\n})(DidChangeWatchedFilesNotification || (exports.DidChangeWatchedFilesNotification = DidChangeWatchedFilesNotification = {}));\n/**\n * The file event type\n */\nvar FileChangeType;\n(function (FileChangeType) {\n /**\n * The file got created.\n */\n FileChangeType.Created = 1;\n /**\n * The file got changed.\n */\n FileChangeType.Changed = 2;\n /**\n * The file got deleted.\n */\n FileChangeType.Deleted = 3;\n})(FileChangeType || (exports.FileChangeType = FileChangeType = {}));\nvar RelativePattern;\n(function (RelativePattern) {\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && (vscode_languageserver_types_1.URI.is(candidate.baseUri) || vscode_languageserver_types_1.WorkspaceFolder.is(candidate.baseUri)) && Is.string(candidate.pattern);\n }\n RelativePattern.is = is;\n})(RelativePattern || (exports.RelativePattern = RelativePattern = {}));\nvar WatchKind;\n(function (WatchKind) {\n /**\n * Interested in create events.\n */\n WatchKind.Create = 1;\n /**\n * Interested in change events\n */\n WatchKind.Change = 2;\n /**\n * Interested in delete events\n */\n WatchKind.Delete = 4;\n})(WatchKind || (exports.WatchKind = WatchKind = {}));\n/**\n * Diagnostics notification are sent from the server to the client to signal\n * results of validation runs.\n */\nvar PublishDiagnosticsNotification;\n(function (PublishDiagnosticsNotification) {\n PublishDiagnosticsNotification.method = 'textDocument/publishDiagnostics';\n PublishDiagnosticsNotification.messageDirection = messages_1.MessageDirection.serverToClient;\n PublishDiagnosticsNotification.type = new messages_1.ProtocolNotificationType(PublishDiagnosticsNotification.method);\n})(PublishDiagnosticsNotification || (exports.PublishDiagnosticsNotification = PublishDiagnosticsNotification = {}));\n/**\n * How a completion was triggered\n */\nvar CompletionTriggerKind;\n(function (CompletionTriggerKind) {\n /**\n * Completion was triggered by typing an identifier (24x7 code\n * complete), manual invocation (e.g Ctrl+Space) or via API.\n */\n CompletionTriggerKind.Invoked = 1;\n /**\n * Completion was triggered by a trigger character specified by\n * the `triggerCharacters` properties of the `CompletionRegistrationOptions`.\n */\n CompletionTriggerKind.TriggerCharacter = 2;\n /**\n * Completion was re-triggered as current completion list is incomplete\n */\n CompletionTriggerKind.TriggerForIncompleteCompletions = 3;\n})(CompletionTriggerKind || (exports.CompletionTriggerKind = CompletionTriggerKind = {}));\n/**\n * Request to request completion at a given text document position. The request's\n * parameter is of type {@link TextDocumentPosition} the response\n * is of type {@link CompletionItem CompletionItem[]} or {@link CompletionList}\n * or a Thenable that resolves to such.\n *\n * The request can delay the computation of the {@link CompletionItem.detail `detail`}\n * and {@link CompletionItem.documentation `documentation`} properties to the `completionItem/resolve`\n * request. However, properties that are needed for the initial sorting and filtering, like `sortText`,\n * `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.\n */\nvar CompletionRequest;\n(function (CompletionRequest) {\n CompletionRequest.method = 'textDocument/completion';\n CompletionRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CompletionRequest.type = new messages_1.ProtocolRequestType(CompletionRequest.method);\n})(CompletionRequest || (exports.CompletionRequest = CompletionRequest = {}));\n/**\n * Request to resolve additional information for a given completion item.The request's\n * parameter is of type {@link CompletionItem} the response\n * is of type {@link CompletionItem} or a Thenable that resolves to such.\n */\nvar CompletionResolveRequest;\n(function (CompletionResolveRequest) {\n CompletionResolveRequest.method = 'completionItem/resolve';\n CompletionResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CompletionResolveRequest.type = new messages_1.ProtocolRequestType(CompletionResolveRequest.method);\n})(CompletionResolveRequest || (exports.CompletionResolveRequest = CompletionResolveRequest = {}));\n/**\n * Request to request hover information at a given text document position. The request's\n * parameter is of type {@link TextDocumentPosition} the response is of\n * type {@link Hover} or a Thenable that resolves to such.\n */\nvar HoverRequest;\n(function (HoverRequest) {\n HoverRequest.method = 'textDocument/hover';\n HoverRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n HoverRequest.type = new messages_1.ProtocolRequestType(HoverRequest.method);\n})(HoverRequest || (exports.HoverRequest = HoverRequest = {}));\n/**\n * How a signature help was triggered.\n *\n * @since 3.15.0\n */\nvar SignatureHelpTriggerKind;\n(function (SignatureHelpTriggerKind) {\n /**\n * Signature help was invoked manually by the user or by a command.\n */\n SignatureHelpTriggerKind.Invoked = 1;\n /**\n * Signature help was triggered by a trigger character.\n */\n SignatureHelpTriggerKind.TriggerCharacter = 2;\n /**\n * Signature help was triggered by the cursor moving or by the document content changing.\n */\n SignatureHelpTriggerKind.ContentChange = 3;\n})(SignatureHelpTriggerKind || (exports.SignatureHelpTriggerKind = SignatureHelpTriggerKind = {}));\nvar SignatureHelpRequest;\n(function (SignatureHelpRequest) {\n SignatureHelpRequest.method = 'textDocument/signatureHelp';\n SignatureHelpRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n SignatureHelpRequest.type = new messages_1.ProtocolRequestType(SignatureHelpRequest.method);\n})(SignatureHelpRequest || (exports.SignatureHelpRequest = SignatureHelpRequest = {}));\n/**\n * A request to resolve the definition location of a symbol at a given text\n * document position. The request's parameter is of type {@link TextDocumentPosition}\n * the response is of either type {@link Definition} or a typed array of\n * {@link DefinitionLink} or a Thenable that resolves to such.\n */\nvar DefinitionRequest;\n(function (DefinitionRequest) {\n DefinitionRequest.method = 'textDocument/definition';\n DefinitionRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DefinitionRequest.type = new messages_1.ProtocolRequestType(DefinitionRequest.method);\n})(DefinitionRequest || (exports.DefinitionRequest = DefinitionRequest = {}));\n/**\n * A request to resolve project-wide references for the symbol denoted\n * by the given text document position. The request's parameter is of\n * type {@link ReferenceParams} the response is of type\n * {@link Location Location[]} or a Thenable that resolves to such.\n */\nvar ReferencesRequest;\n(function (ReferencesRequest) {\n ReferencesRequest.method = 'textDocument/references';\n ReferencesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n ReferencesRequest.type = new messages_1.ProtocolRequestType(ReferencesRequest.method);\n})(ReferencesRequest || (exports.ReferencesRequest = ReferencesRequest = {}));\n/**\n * Request to resolve a {@link DocumentHighlight} for a given\n * text document position. The request's parameter is of type {@link TextDocumentPosition}\n * the request response is an array of type {@link DocumentHighlight}\n * or a Thenable that resolves to such.\n */\nvar DocumentHighlightRequest;\n(function (DocumentHighlightRequest) {\n DocumentHighlightRequest.method = 'textDocument/documentHighlight';\n DocumentHighlightRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentHighlightRequest.type = new messages_1.ProtocolRequestType(DocumentHighlightRequest.method);\n})(DocumentHighlightRequest || (exports.DocumentHighlightRequest = DocumentHighlightRequest = {}));\n/**\n * A request to list all symbols found in a given text document. The request's\n * parameter is of type {@link TextDocumentIdentifier} the\n * response is of type {@link SymbolInformation SymbolInformation[]} or a Thenable\n * that resolves to such.\n */\nvar DocumentSymbolRequest;\n(function (DocumentSymbolRequest) {\n DocumentSymbolRequest.method = 'textDocument/documentSymbol';\n DocumentSymbolRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentSymbolRequest.type = new messages_1.ProtocolRequestType(DocumentSymbolRequest.method);\n})(DocumentSymbolRequest || (exports.DocumentSymbolRequest = DocumentSymbolRequest = {}));\n/**\n * A request to provide commands for the given text document and range.\n */\nvar CodeActionRequest;\n(function (CodeActionRequest) {\n CodeActionRequest.method = 'textDocument/codeAction';\n CodeActionRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CodeActionRequest.type = new messages_1.ProtocolRequestType(CodeActionRequest.method);\n})(CodeActionRequest || (exports.CodeActionRequest = CodeActionRequest = {}));\n/**\n * Request to resolve additional information for a given code action.The request's\n * parameter is of type {@link CodeAction} the response\n * is of type {@link CodeAction} or a Thenable that resolves to such.\n */\nvar CodeActionResolveRequest;\n(function (CodeActionResolveRequest) {\n CodeActionResolveRequest.method = 'codeAction/resolve';\n CodeActionResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CodeActionResolveRequest.type = new messages_1.ProtocolRequestType(CodeActionResolveRequest.method);\n})(CodeActionResolveRequest || (exports.CodeActionResolveRequest = CodeActionResolveRequest = {}));\n/**\n * A request to list project-wide symbols matching the query string given\n * by the {@link WorkspaceSymbolParams}. The response is\n * of type {@link SymbolInformation SymbolInformation[]} or a Thenable that\n * resolves to such.\n *\n * @since 3.17.0 - support for WorkspaceSymbol in the returned data. Clients\n * need to advertise support for WorkspaceSymbols via the client capability\n * `workspace.symbol.resolveSupport`.\n *\n */\nvar WorkspaceSymbolRequest;\n(function (WorkspaceSymbolRequest) {\n WorkspaceSymbolRequest.method = 'workspace/symbol';\n WorkspaceSymbolRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WorkspaceSymbolRequest.type = new messages_1.ProtocolRequestType(WorkspaceSymbolRequest.method);\n})(WorkspaceSymbolRequest || (exports.WorkspaceSymbolRequest = WorkspaceSymbolRequest = {}));\n/**\n * A request to resolve the range inside the workspace\n * symbol's location.\n *\n * @since 3.17.0\n */\nvar WorkspaceSymbolResolveRequest;\n(function (WorkspaceSymbolResolveRequest) {\n WorkspaceSymbolResolveRequest.method = 'workspaceSymbol/resolve';\n WorkspaceSymbolResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WorkspaceSymbolResolveRequest.type = new messages_1.ProtocolRequestType(WorkspaceSymbolResolveRequest.method);\n})(WorkspaceSymbolResolveRequest || (exports.WorkspaceSymbolResolveRequest = WorkspaceSymbolResolveRequest = {}));\n/**\n * A request to provide code lens for the given text document.\n */\nvar CodeLensRequest;\n(function (CodeLensRequest) {\n CodeLensRequest.method = 'textDocument/codeLens';\n CodeLensRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CodeLensRequest.type = new messages_1.ProtocolRequestType(CodeLensRequest.method);\n})(CodeLensRequest || (exports.CodeLensRequest = CodeLensRequest = {}));\n/**\n * A request to resolve a command for a given code lens.\n */\nvar CodeLensResolveRequest;\n(function (CodeLensResolveRequest) {\n CodeLensResolveRequest.method = 'codeLens/resolve';\n CodeLensResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CodeLensResolveRequest.type = new messages_1.ProtocolRequestType(CodeLensResolveRequest.method);\n})(CodeLensResolveRequest || (exports.CodeLensResolveRequest = CodeLensResolveRequest = {}));\n/**\n * A request to refresh all code actions\n *\n * @since 3.16.0\n */\nvar CodeLensRefreshRequest;\n(function (CodeLensRefreshRequest) {\n CodeLensRefreshRequest.method = `workspace/codeLens/refresh`;\n CodeLensRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n CodeLensRefreshRequest.type = new messages_1.ProtocolRequestType0(CodeLensRefreshRequest.method);\n})(CodeLensRefreshRequest || (exports.CodeLensRefreshRequest = CodeLensRefreshRequest = {}));\n/**\n * A request to provide document links\n */\nvar DocumentLinkRequest;\n(function (DocumentLinkRequest) {\n DocumentLinkRequest.method = 'textDocument/documentLink';\n DocumentLinkRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentLinkRequest.type = new messages_1.ProtocolRequestType(DocumentLinkRequest.method);\n})(DocumentLinkRequest || (exports.DocumentLinkRequest = DocumentLinkRequest = {}));\n/**\n * Request to resolve additional information for a given document link. The request's\n * parameter is of type {@link DocumentLink} the response\n * is of type {@link DocumentLink} or a Thenable that resolves to such.\n */\nvar DocumentLinkResolveRequest;\n(function (DocumentLinkResolveRequest) {\n DocumentLinkResolveRequest.method = 'documentLink/resolve';\n DocumentLinkResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentLinkResolveRequest.type = new messages_1.ProtocolRequestType(DocumentLinkResolveRequest.method);\n})(DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = DocumentLinkResolveRequest = {}));\n/**\n * A request to format a whole document.\n */\nvar DocumentFormattingRequest;\n(function (DocumentFormattingRequest) {\n DocumentFormattingRequest.method = 'textDocument/formatting';\n DocumentFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentFormattingRequest.method);\n})(DocumentFormattingRequest || (exports.DocumentFormattingRequest = DocumentFormattingRequest = {}));\n/**\n * A request to format a range in a document.\n */\nvar DocumentRangeFormattingRequest;\n(function (DocumentRangeFormattingRequest) {\n DocumentRangeFormattingRequest.method = 'textDocument/rangeFormatting';\n DocumentRangeFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentRangeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentRangeFormattingRequest.method);\n})(DocumentRangeFormattingRequest || (exports.DocumentRangeFormattingRequest = DocumentRangeFormattingRequest = {}));\n/**\n * A request to format ranges in a document.\n *\n * @since 3.18.0\n * @proposed\n */\nvar DocumentRangesFormattingRequest;\n(function (DocumentRangesFormattingRequest) {\n DocumentRangesFormattingRequest.method = 'textDocument/rangesFormatting';\n DocumentRangesFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentRangesFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentRangesFormattingRequest.method);\n})(DocumentRangesFormattingRequest || (exports.DocumentRangesFormattingRequest = DocumentRangesFormattingRequest = {}));\n/**\n * A request to format a document on type.\n */\nvar DocumentOnTypeFormattingRequest;\n(function (DocumentOnTypeFormattingRequest) {\n DocumentOnTypeFormattingRequest.method = 'textDocument/onTypeFormatting';\n DocumentOnTypeFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentOnTypeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentOnTypeFormattingRequest.method);\n})(DocumentOnTypeFormattingRequest || (exports.DocumentOnTypeFormattingRequest = DocumentOnTypeFormattingRequest = {}));\n//---- Rename ----------------------------------------------\nvar PrepareSupportDefaultBehavior;\n(function (PrepareSupportDefaultBehavior) {\n /**\n * The client's default behavior is to select the identifier\n * according the to language's syntax rule.\n */\n PrepareSupportDefaultBehavior.Identifier = 1;\n})(PrepareSupportDefaultBehavior || (exports.PrepareSupportDefaultBehavior = PrepareSupportDefaultBehavior = {}));\n/**\n * A request to rename a symbol.\n */\nvar RenameRequest;\n(function (RenameRequest) {\n RenameRequest.method = 'textDocument/rename';\n RenameRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n RenameRequest.type = new messages_1.ProtocolRequestType(RenameRequest.method);\n})(RenameRequest || (exports.RenameRequest = RenameRequest = {}));\n/**\n * A request to test and perform the setup necessary for a rename.\n *\n * @since 3.16 - support for default behavior\n */\nvar PrepareRenameRequest;\n(function (PrepareRenameRequest) {\n PrepareRenameRequest.method = 'textDocument/prepareRename';\n PrepareRenameRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n PrepareRenameRequest.type = new messages_1.ProtocolRequestType(PrepareRenameRequest.method);\n})(PrepareRenameRequest || (exports.PrepareRenameRequest = PrepareRenameRequest = {}));\n/**\n * A request send from the client to the server to execute a command. The request might return\n * a workspace edit which the client will apply to the workspace.\n */\nvar ExecuteCommandRequest;\n(function (ExecuteCommandRequest) {\n ExecuteCommandRequest.method = 'workspace/executeCommand';\n ExecuteCommandRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n ExecuteCommandRequest.type = new messages_1.ProtocolRequestType(ExecuteCommandRequest.method);\n})(ExecuteCommandRequest || (exports.ExecuteCommandRequest = ExecuteCommandRequest = {}));\n/**\n * A request sent from the server to the client to modified certain resources.\n */\nvar ApplyWorkspaceEditRequest;\n(function (ApplyWorkspaceEditRequest) {\n ApplyWorkspaceEditRequest.method = 'workspace/applyEdit';\n ApplyWorkspaceEditRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n ApplyWorkspaceEditRequest.type = new messages_1.ProtocolRequestType('workspace/applyEdit');\n})(ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = ApplyWorkspaceEditRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createProtocolConnection = void 0;\nconst vscode_jsonrpc_1 = require(\"vscode-jsonrpc\");\nfunction createProtocolConnection(input, output, logger, options) {\n if (vscode_jsonrpc_1.ConnectionStrategy.is(options)) {\n options = { connectionStrategy: options };\n }\n return (0, vscode_jsonrpc_1.createMessageConnection)(input, output, logger, options);\n}\nexports.createProtocolConnection = createProtocolConnection;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LSPErrorCodes = exports.createProtocolConnection = void 0;\n__exportStar(require(\"vscode-jsonrpc\"), exports);\n__exportStar(require(\"vscode-languageserver-types\"), exports);\n__exportStar(require(\"./messages\"), exports);\n__exportStar(require(\"./protocol\"), exports);\nvar connection_1 = require(\"./connection\");\nObject.defineProperty(exports, \"createProtocolConnection\", { enumerable: true, get: function () { return connection_1.createProtocolConnection; } });\nvar LSPErrorCodes;\n(function (LSPErrorCodes) {\n /**\n * This is the start range of LSP reserved error codes.\n * It doesn't denote a real error code.\n *\n * @since 3.16.0\n */\n LSPErrorCodes.lspReservedErrorRangeStart = -32899;\n /**\n * A request failed but it was syntactically correct, e.g the\n * method name was known and the parameters were valid. The error\n * message should contain human readable information about why\n * the request failed.\n *\n * @since 3.17.0\n */\n LSPErrorCodes.RequestFailed = -32803;\n /**\n * The server cancelled the request. This error code should\n * only be used for requests that explicitly support being\n * server cancellable.\n *\n * @since 3.17.0\n */\n LSPErrorCodes.ServerCancelled = -32802;\n /**\n * The server detected that the content of a document got\n * modified outside normal conditions. A server should\n * NOT send this error code if it detects a content change\n * in it unprocessed messages. The result even computed\n * on an older state might still be useful for the client.\n *\n * If a client decides that a result is not of any use anymore\n * the client should cancel the request.\n */\n LSPErrorCodes.ContentModified = -32801;\n /**\n * The client has canceled a request and a server as detected\n * the cancel.\n */\n LSPErrorCodes.RequestCancelled = -32800;\n /**\n * This is the end range of LSP reserved error codes.\n * It doesn't denote a real error code.\n *\n * @since 3.16.0\n */\n LSPErrorCodes.lspReservedErrorRangeEnd = -32800;\n})(LSPErrorCodes || (exports.LSPErrorCodes = LSPErrorCodes = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createProtocolConnection = void 0;\nconst node_1 = require(\"vscode-jsonrpc/node\");\n__exportStar(require(\"vscode-jsonrpc/node\"), exports);\n__exportStar(require(\"../common/api\"), exports);\nfunction createProtocolConnection(input, output, logger, options) {\n return (0, node_1.createMessageConnection)(input, output, logger, options);\n}\nexports.createProtocolConnection = createProtocolConnection;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.forEach = exports.mapAsync = exports.map = exports.clearTestMode = exports.setTestMode = exports.Semaphore = exports.Delayer = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nclass Delayer {\n constructor(defaultDelay) {\n this.defaultDelay = defaultDelay;\n this.timeout = undefined;\n this.completionPromise = undefined;\n this.onSuccess = undefined;\n this.task = undefined;\n }\n trigger(task, delay = this.defaultDelay) {\n this.task = task;\n if (delay >= 0) {\n this.cancelTimeout();\n }\n if (!this.completionPromise) {\n this.completionPromise = new Promise((resolve) => {\n this.onSuccess = resolve;\n }).then(() => {\n this.completionPromise = undefined;\n this.onSuccess = undefined;\n var result = this.task();\n this.task = undefined;\n return result;\n });\n }\n if (delay >= 0 || this.timeout === void 0) {\n this.timeout = (0, vscode_languageserver_protocol_1.RAL)().timer.setTimeout(() => {\n this.timeout = undefined;\n this.onSuccess(undefined);\n }, delay >= 0 ? delay : this.defaultDelay);\n }\n return this.completionPromise;\n }\n forceDelivery() {\n if (!this.completionPromise) {\n return undefined;\n }\n this.cancelTimeout();\n let result = this.task();\n this.completionPromise = undefined;\n this.onSuccess = undefined;\n this.task = undefined;\n return result;\n }\n isTriggered() {\n return this.timeout !== undefined;\n }\n cancel() {\n this.cancelTimeout();\n this.completionPromise = undefined;\n }\n cancelTimeout() {\n if (this.timeout !== undefined) {\n this.timeout.dispose();\n this.timeout = undefined;\n }\n }\n}\nexports.Delayer = Delayer;\nclass Semaphore {\n constructor(capacity = 1) {\n if (capacity <= 0) {\n throw new Error('Capacity must be greater than 0');\n }\n this._capacity = capacity;\n this._active = 0;\n this._waiting = [];\n }\n lock(thunk) {\n return new Promise((resolve, reject) => {\n this._waiting.push({ thunk, resolve, reject });\n this.runNext();\n });\n }\n get active() {\n return this._active;\n }\n runNext() {\n if (this._waiting.length === 0 || this._active === this._capacity) {\n return;\n }\n (0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => this.doRunNext());\n }\n doRunNext() {\n if (this._waiting.length === 0 || this._active === this._capacity) {\n return;\n }\n const next = this._waiting.shift();\n this._active++;\n if (this._active > this._capacity) {\n throw new Error(`To many thunks active`);\n }\n try {\n const result = next.thunk();\n if (result instanceof Promise) {\n result.then((value) => {\n this._active--;\n next.resolve(value);\n this.runNext();\n }, (err) => {\n this._active--;\n next.reject(err);\n this.runNext();\n });\n }\n else {\n this._active--;\n next.resolve(result);\n this.runNext();\n }\n }\n catch (err) {\n this._active--;\n next.reject(err);\n this.runNext();\n }\n }\n}\nexports.Semaphore = Semaphore;\nlet $test = false;\nfunction setTestMode() {\n $test = true;\n}\nexports.setTestMode = setTestMode;\nfunction clearTestMode() {\n $test = false;\n}\nexports.clearTestMode = clearTestMode;\nconst defaultYieldTimeout = 15 /*ms*/;\nclass Timer {\n constructor(yieldAfter = defaultYieldTimeout) {\n this.yieldAfter = $test === true ? Math.max(yieldAfter, 2) : Math.max(yieldAfter, defaultYieldTimeout);\n this.startTime = Date.now();\n this.counter = 0;\n this.total = 0;\n // start with a counter interval of 1.\n this.counterInterval = 1;\n }\n start() {\n this.counter = 0;\n this.total = 0;\n this.counterInterval = 1;\n this.startTime = Date.now();\n }\n shouldYield() {\n if (++this.counter >= this.counterInterval) {\n const timeTaken = Date.now() - this.startTime;\n const timeLeft = Math.max(0, this.yieldAfter - timeTaken);\n this.total += this.counter;\n this.counter = 0;\n if (timeTaken >= this.yieldAfter || timeLeft <= 1) {\n // Yield also if time left <= 1 since we compute the counter\n // for max < 2 ms.\n // Start with interval 1 again. We could do some calculation\n // with using 80% of the last counter however other things (GC)\n // affect the timing heavily since we have small timings (1 - 15ms).\n this.counterInterval = 1;\n this.total = 0;\n return true;\n }\n else {\n // Only increase the counter until we have spent <= 2 ms. Increasing\n // the counter further is very fragile since timing is influenced\n // by other things and can increase the counter too much. This will result\n // that we yield in average after [14 - 16]ms.\n switch (timeTaken) {\n case 0:\n case 1:\n this.counterInterval = this.total * 2;\n break;\n }\n }\n }\n return false;\n }\n}\nasync function map(items, func, token, options) {\n if (items.length === 0) {\n return [];\n }\n const result = new Array(items.length);\n const timer = new Timer(options?.yieldAfter);\n function convertBatch(start) {\n timer.start();\n for (let i = start; i < items.length; i++) {\n result[i] = func(items[i]);\n if (timer.shouldYield()) {\n options?.yieldCallback && options.yieldCallback();\n return i + 1;\n }\n }\n return -1;\n }\n // Convert the first batch sync on the same frame.\n let index = convertBatch(0);\n while (index !== -1) {\n if (token !== undefined && token.isCancellationRequested) {\n break;\n }\n index = await new Promise((resolve) => {\n (0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => {\n resolve(convertBatch(index));\n });\n });\n }\n return result;\n}\nexports.map = map;\nasync function mapAsync(items, func, token, options) {\n if (items.length === 0) {\n return [];\n }\n const result = new Array(items.length);\n const timer = new Timer(options?.yieldAfter);\n async function convertBatch(start) {\n timer.start();\n for (let i = start; i < items.length; i++) {\n result[i] = await func(items[i], token);\n if (timer.shouldYield()) {\n options?.yieldCallback && options.yieldCallback();\n return i + 1;\n }\n }\n return -1;\n }\n let index = await convertBatch(0);\n while (index !== -1) {\n if (token !== undefined && token.isCancellationRequested) {\n break;\n }\n index = await new Promise((resolve) => {\n (0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => {\n resolve(convertBatch(index));\n });\n });\n }\n return result;\n}\nexports.mapAsync = mapAsync;\nasync function forEach(items, func, token, options) {\n if (items.length === 0) {\n return;\n }\n const timer = new Timer(options?.yieldAfter);\n function runBatch(start) {\n timer.start();\n for (let i = start; i < items.length; i++) {\n func(items[i]);\n if (timer.shouldYield()) {\n options?.yieldCallback && options.yieldCallback();\n return i + 1;\n }\n }\n return -1;\n }\n // Convert the first batch sync on the same frame.\n let index = runBatch(0);\n while (index !== -1) {\n if (token !== undefined && token.isCancellationRequested) {\n break;\n }\n index = await new Promise((resolve) => {\n (0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => {\n resolve(runBatch(index));\n });\n });\n }\n}\nexports.forEach = forEach;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code = require(\"vscode\");\nclass ProtocolCompletionItem extends code.CompletionItem {\n constructor(label) {\n super(label);\n }\n}\nexports.default = ProtocolCompletionItem;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code = require(\"vscode\");\nclass ProtocolCodeLens extends code.CodeLens {\n constructor(range) {\n super(range);\n }\n}\nexports.default = ProtocolCodeLens;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code = require(\"vscode\");\nclass ProtocolDocumentLink extends code.DocumentLink {\n constructor(range, target) {\n super(range, target);\n }\n}\nexports.default = ProtocolDocumentLink;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst vscode = require(\"vscode\");\nclass ProtocolCodeAction extends vscode.CodeAction {\n constructor(title, data) {\n super(title);\n this.data = data;\n }\n}\nexports.default = ProtocolCodeAction;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProtocolDiagnostic = exports.DiagnosticCode = void 0;\nconst vscode = require(\"vscode\");\nconst Is = require(\"./utils/is\");\nvar DiagnosticCode;\n(function (DiagnosticCode) {\n function is(value) {\n const candidate = value;\n return candidate !== undefined && candidate !== null && (Is.number(candidate.value) || Is.string(candidate.value)) && Is.string(candidate.target);\n }\n DiagnosticCode.is = is;\n})(DiagnosticCode || (exports.DiagnosticCode = DiagnosticCode = {}));\nclass ProtocolDiagnostic extends vscode.Diagnostic {\n constructor(range, message, severity, data) {\n super(range, message, severity);\n this.data = data;\n this.hasDiagnosticCode = false;\n }\n}\nexports.ProtocolDiagnostic = ProtocolDiagnostic;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code = require(\"vscode\");\nclass ProtocolCallHierarchyItem extends code.CallHierarchyItem {\n constructor(kind, name, detail, uri, range, selectionRange, data) {\n super(kind, name, detail, uri, range, selectionRange);\n if (data !== undefined) {\n this.data = data;\n }\n }\n}\nexports.default = ProtocolCallHierarchyItem;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code = require(\"vscode\");\nclass ProtocolTypeHierarchyItem extends code.TypeHierarchyItem {\n constructor(kind, name, detail, uri, range, selectionRange, data) {\n super(kind, name, detail, uri, range, selectionRange);\n if (data !== undefined) {\n this.data = data;\n }\n }\n}\nexports.default = ProtocolTypeHierarchyItem;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code = require(\"vscode\");\nclass WorkspaceSymbol extends code.SymbolInformation {\n constructor(name, kind, containerName, locationOrUri, data) {\n const hasRange = !(locationOrUri instanceof code.Uri);\n super(name, kind, containerName, hasRange ? locationOrUri : new code.Location(locationOrUri, new code.Range(0, 0, 0, 0)));\n this.hasRange = hasRange;\n if (data !== undefined) {\n this.data = data;\n }\n }\n}\nexports.default = WorkspaceSymbol;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code = require(\"vscode\");\nclass ProtocolInlayHint extends code.InlayHint {\n constructor(position, label, kind) {\n super(position, label, kind);\n }\n}\nexports.default = ProtocolInlayHint;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createConverter = void 0;\nconst code = require(\"vscode\");\nconst proto = require(\"vscode-languageserver-protocol\");\nconst Is = require(\"./utils/is\");\nconst async = require(\"./utils/async\");\nconst protocolCompletionItem_1 = require(\"./protocolCompletionItem\");\nconst protocolCodeLens_1 = require(\"./protocolCodeLens\");\nconst protocolDocumentLink_1 = require(\"./protocolDocumentLink\");\nconst protocolCodeAction_1 = require(\"./protocolCodeAction\");\nconst protocolDiagnostic_1 = require(\"./protocolDiagnostic\");\nconst protocolCallHierarchyItem_1 = require(\"./protocolCallHierarchyItem\");\nconst protocolTypeHierarchyItem_1 = require(\"./protocolTypeHierarchyItem\");\nconst protocolWorkspaceSymbol_1 = require(\"./protocolWorkspaceSymbol\");\nconst protocolInlayHint_1 = require(\"./protocolInlayHint\");\nvar InsertReplaceRange;\n(function (InsertReplaceRange) {\n function is(value) {\n const candidate = value;\n return candidate && !!candidate.inserting && !!candidate.replacing;\n }\n InsertReplaceRange.is = is;\n})(InsertReplaceRange || (InsertReplaceRange = {}));\nfunction createConverter(uriConverter) {\n const nullConverter = (value) => value.toString();\n const _uriConverter = uriConverter || nullConverter;\n function asUri(value) {\n return _uriConverter(value);\n }\n function asTextDocumentIdentifier(textDocument) {\n return {\n uri: _uriConverter(textDocument.uri)\n };\n }\n function asTextDocumentItem(textDocument) {\n return {\n uri: _uriConverter(textDocument.uri),\n languageId: textDocument.languageId,\n version: textDocument.version,\n text: textDocument.getText()\n };\n }\n function asVersionedTextDocumentIdentifier(textDocument) {\n return {\n uri: _uriConverter(textDocument.uri),\n version: textDocument.version\n };\n }\n function asOpenTextDocumentParams(textDocument) {\n return {\n textDocument: asTextDocumentItem(textDocument)\n };\n }\n function isTextDocumentChangeEvent(value) {\n const candidate = value;\n return !!candidate.document && !!candidate.contentChanges;\n }\n function isTextDocument(value) {\n const candidate = value;\n return !!candidate.uri && !!candidate.version;\n }\n function asChangeTextDocumentParams(arg0, arg1, arg2) {\n if (isTextDocument(arg0)) {\n const result = {\n textDocument: {\n uri: _uriConverter(arg0.uri),\n version: arg0.version\n },\n contentChanges: [{ text: arg0.getText() }]\n };\n return result;\n }\n else if (isTextDocumentChangeEvent(arg0)) {\n const uri = arg1;\n const version = arg2;\n const result = {\n textDocument: {\n uri: _uriConverter(uri),\n version: version\n },\n contentChanges: arg0.contentChanges.map((change) => {\n const range = change.range;\n return {\n range: {\n start: { line: range.start.line, character: range.start.character },\n end: { line: range.end.line, character: range.end.character }\n },\n rangeLength: change.rangeLength,\n text: change.text\n };\n })\n };\n return result;\n }\n else {\n throw Error('Unsupported text document change parameter');\n }\n }\n function asCloseTextDocumentParams(textDocument) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument)\n };\n }\n function asSaveTextDocumentParams(textDocument, includeContent = false) {\n let result = {\n textDocument: asTextDocumentIdentifier(textDocument)\n };\n if (includeContent) {\n result.text = textDocument.getText();\n }\n return result;\n }\n function asTextDocumentSaveReason(reason) {\n switch (reason) {\n case code.TextDocumentSaveReason.Manual:\n return proto.TextDocumentSaveReason.Manual;\n case code.TextDocumentSaveReason.AfterDelay:\n return proto.TextDocumentSaveReason.AfterDelay;\n case code.TextDocumentSaveReason.FocusOut:\n return proto.TextDocumentSaveReason.FocusOut;\n }\n return proto.TextDocumentSaveReason.Manual;\n }\n function asWillSaveTextDocumentParams(event) {\n return {\n textDocument: asTextDocumentIdentifier(event.document),\n reason: asTextDocumentSaveReason(event.reason)\n };\n }\n function asDidCreateFilesParams(event) {\n return {\n files: event.files.map((fileUri) => ({\n uri: _uriConverter(fileUri),\n })),\n };\n }\n function asDidRenameFilesParams(event) {\n return {\n files: event.files.map((file) => ({\n oldUri: _uriConverter(file.oldUri),\n newUri: _uriConverter(file.newUri),\n })),\n };\n }\n function asDidDeleteFilesParams(event) {\n return {\n files: event.files.map((fileUri) => ({\n uri: _uriConverter(fileUri),\n })),\n };\n }\n function asWillCreateFilesParams(event) {\n return {\n files: event.files.map((fileUri) => ({\n uri: _uriConverter(fileUri),\n })),\n };\n }\n function asWillRenameFilesParams(event) {\n return {\n files: event.files.map((file) => ({\n oldUri: _uriConverter(file.oldUri),\n newUri: _uriConverter(file.newUri),\n })),\n };\n }\n function asWillDeleteFilesParams(event) {\n return {\n files: event.files.map((fileUri) => ({\n uri: _uriConverter(fileUri),\n })),\n };\n }\n function asTextDocumentPositionParams(textDocument, position) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument),\n position: asWorkerPosition(position)\n };\n }\n function asCompletionTriggerKind(triggerKind) {\n switch (triggerKind) {\n case code.CompletionTriggerKind.TriggerCharacter:\n return proto.CompletionTriggerKind.TriggerCharacter;\n case code.CompletionTriggerKind.TriggerForIncompleteCompletions:\n return proto.CompletionTriggerKind.TriggerForIncompleteCompletions;\n default:\n return proto.CompletionTriggerKind.Invoked;\n }\n }\n function asCompletionParams(textDocument, position, context) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument),\n position: asWorkerPosition(position),\n context: {\n triggerKind: asCompletionTriggerKind(context.triggerKind),\n triggerCharacter: context.triggerCharacter\n }\n };\n }\n function asSignatureHelpTriggerKind(triggerKind) {\n switch (triggerKind) {\n case code.SignatureHelpTriggerKind.Invoke:\n return proto.SignatureHelpTriggerKind.Invoked;\n case code.SignatureHelpTriggerKind.TriggerCharacter:\n return proto.SignatureHelpTriggerKind.TriggerCharacter;\n case code.SignatureHelpTriggerKind.ContentChange:\n return proto.SignatureHelpTriggerKind.ContentChange;\n }\n }\n function asParameterInformation(value) {\n // We leave the documentation out on purpose since it usually adds no\n // value for the server.\n return {\n label: value.label\n };\n }\n function asParameterInformations(values) {\n return values.map(asParameterInformation);\n }\n function asSignatureInformation(value) {\n // We leave the documentation out on purpose since it usually adds no\n // value for the server.\n return {\n label: value.label,\n parameters: asParameterInformations(value.parameters)\n };\n }\n function asSignatureInformations(values) {\n return values.map(asSignatureInformation);\n }\n function asSignatureHelp(value) {\n if (value === undefined) {\n return value;\n }\n return {\n signatures: asSignatureInformations(value.signatures),\n activeSignature: value.activeSignature,\n activeParameter: value.activeParameter\n };\n }\n function asSignatureHelpParams(textDocument, position, context) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument),\n position: asWorkerPosition(position),\n context: {\n isRetrigger: context.isRetrigger,\n triggerCharacter: context.triggerCharacter,\n triggerKind: asSignatureHelpTriggerKind(context.triggerKind),\n activeSignatureHelp: asSignatureHelp(context.activeSignatureHelp)\n }\n };\n }\n function asWorkerPosition(position) {\n return { line: position.line, character: position.character };\n }\n function asPosition(value) {\n if (value === undefined || value === null) {\n return value;\n }\n return { line: value.line > proto.uinteger.MAX_VALUE ? proto.uinteger.MAX_VALUE : value.line, character: value.character > proto.uinteger.MAX_VALUE ? proto.uinteger.MAX_VALUE : value.character };\n }\n function asPositions(values, token) {\n return async.map(values, asPosition, token);\n }\n function asPositionsSync(values) {\n return values.map(asPosition);\n }\n function asRange(value) {\n if (value === undefined || value === null) {\n return value;\n }\n return { start: asPosition(value.start), end: asPosition(value.end) };\n }\n function asRanges(values) {\n return values.map(asRange);\n }\n function asLocation(value) {\n if (value === undefined || value === null) {\n return value;\n }\n return proto.Location.create(asUri(value.uri), asRange(value.range));\n }\n function asDiagnosticSeverity(value) {\n switch (value) {\n case code.DiagnosticSeverity.Error:\n return proto.DiagnosticSeverity.Error;\n case code.DiagnosticSeverity.Warning:\n return proto.DiagnosticSeverity.Warning;\n case code.DiagnosticSeverity.Information:\n return proto.DiagnosticSeverity.Information;\n case code.DiagnosticSeverity.Hint:\n return proto.DiagnosticSeverity.Hint;\n }\n }\n function asDiagnosticTags(tags) {\n if (!tags) {\n return undefined;\n }\n let result = [];\n for (let tag of tags) {\n let converted = asDiagnosticTag(tag);\n if (converted !== undefined) {\n result.push(converted);\n }\n }\n return result.length > 0 ? result : undefined;\n }\n function asDiagnosticTag(tag) {\n switch (tag) {\n case code.DiagnosticTag.Unnecessary:\n return proto.DiagnosticTag.Unnecessary;\n case code.DiagnosticTag.Deprecated:\n return proto.DiagnosticTag.Deprecated;\n default:\n return undefined;\n }\n }\n function asRelatedInformation(item) {\n return {\n message: item.message,\n location: asLocation(item.location)\n };\n }\n function asRelatedInformations(items) {\n return items.map(asRelatedInformation);\n }\n function asDiagnosticCode(value) {\n if (value === undefined || value === null) {\n return undefined;\n }\n if (Is.number(value) || Is.string(value)) {\n return value;\n }\n return { value: value.value, target: asUri(value.target) };\n }\n function asDiagnostic(item) {\n const result = proto.Diagnostic.create(asRange(item.range), item.message);\n const protocolDiagnostic = item instanceof protocolDiagnostic_1.ProtocolDiagnostic ? item : undefined;\n if (protocolDiagnostic !== undefined && protocolDiagnostic.data !== undefined) {\n result.data = protocolDiagnostic.data;\n }\n const code = asDiagnosticCode(item.code);\n if (protocolDiagnostic_1.DiagnosticCode.is(code)) {\n if (protocolDiagnostic !== undefined && protocolDiagnostic.hasDiagnosticCode) {\n result.code = code;\n }\n else {\n result.code = code.value;\n result.codeDescription = { href: code.target };\n }\n }\n else {\n result.code = code;\n }\n if (Is.number(item.severity)) {\n result.severity = asDiagnosticSeverity(item.severity);\n }\n if (Array.isArray(item.tags)) {\n result.tags = asDiagnosticTags(item.tags);\n }\n if (item.relatedInformation) {\n result.relatedInformation = asRelatedInformations(item.relatedInformation);\n }\n if (item.source) {\n result.source = item.source;\n }\n return result;\n }\n function asDiagnostics(items, token) {\n if (items === undefined || items === null) {\n return items;\n }\n return async.map(items, asDiagnostic, token);\n }\n function asDiagnosticsSync(items) {\n if (items === undefined || items === null) {\n return items;\n }\n return items.map(asDiagnostic);\n }\n function asDocumentation(format, documentation) {\n switch (format) {\n case '$string':\n return documentation;\n case proto.MarkupKind.PlainText:\n return { kind: format, value: documentation };\n case proto.MarkupKind.Markdown:\n return { kind: format, value: documentation.value };\n default:\n return `Unsupported Markup content received. Kind is: ${format}`;\n }\n }\n function asCompletionItemTag(tag) {\n switch (tag) {\n case code.CompletionItemTag.Deprecated:\n return proto.CompletionItemTag.Deprecated;\n }\n return undefined;\n }\n function asCompletionItemTags(tags) {\n if (tags === undefined) {\n return tags;\n }\n const result = [];\n for (let tag of tags) {\n const converted = asCompletionItemTag(tag);\n if (converted !== undefined) {\n result.push(converted);\n }\n }\n return result;\n }\n function asCompletionItemKind(value, original) {\n if (original !== undefined) {\n return original;\n }\n return value + 1;\n }\n function asCompletionItem(item, labelDetailsSupport = false) {\n let label;\n let labelDetails;\n if (Is.string(item.label)) {\n label = item.label;\n }\n else {\n label = item.label.label;\n if (labelDetailsSupport && (item.label.detail !== undefined || item.label.description !== undefined)) {\n labelDetails = { detail: item.label.detail, description: item.label.description };\n }\n }\n let result = { label: label };\n if (labelDetails !== undefined) {\n result.labelDetails = labelDetails;\n }\n let protocolItem = item instanceof protocolCompletionItem_1.default ? item : undefined;\n if (item.detail) {\n result.detail = item.detail;\n }\n // We only send items back we created. So this can't be something else than\n // a string right now.\n if (item.documentation) {\n if (!protocolItem || protocolItem.documentationFormat === '$string') {\n result.documentation = item.documentation;\n }\n else {\n result.documentation = asDocumentation(protocolItem.documentationFormat, item.documentation);\n }\n }\n if (item.filterText) {\n result.filterText = item.filterText;\n }\n fillPrimaryInsertText(result, item);\n if (Is.number(item.kind)) {\n result.kind = asCompletionItemKind(item.kind, protocolItem && protocolItem.originalItemKind);\n }\n if (item.sortText) {\n result.sortText = item.sortText;\n }\n if (item.additionalTextEdits) {\n result.additionalTextEdits = asTextEdits(item.additionalTextEdits);\n }\n if (item.commitCharacters) {\n result.commitCharacters = item.commitCharacters.slice();\n }\n if (item.command) {\n result.command = asCommand(item.command);\n }\n if (item.preselect === true || item.preselect === false) {\n result.preselect = item.preselect;\n }\n const tags = asCompletionItemTags(item.tags);\n if (protocolItem) {\n if (protocolItem.data !== undefined) {\n result.data = protocolItem.data;\n }\n if (protocolItem.deprecated === true || protocolItem.deprecated === false) {\n if (protocolItem.deprecated === true && tags !== undefined && tags.length > 0) {\n const index = tags.indexOf(code.CompletionItemTag.Deprecated);\n if (index !== -1) {\n tags.splice(index, 1);\n }\n }\n result.deprecated = protocolItem.deprecated;\n }\n if (protocolItem.insertTextMode !== undefined) {\n result.insertTextMode = protocolItem.insertTextMode;\n }\n }\n if (tags !== undefined && tags.length > 0) {\n result.tags = tags;\n }\n if (result.insertTextMode === undefined && item.keepWhitespace === true) {\n result.insertTextMode = proto.InsertTextMode.adjustIndentation;\n }\n return result;\n }\n function fillPrimaryInsertText(target, source) {\n let format = proto.InsertTextFormat.PlainText;\n let text = undefined;\n let range = undefined;\n if (source.textEdit) {\n text = source.textEdit.newText;\n range = source.textEdit.range;\n }\n else if (source.insertText instanceof code.SnippetString) {\n format = proto.InsertTextFormat.Snippet;\n text = source.insertText.value;\n }\n else {\n text = source.insertText;\n }\n if (source.range) {\n range = source.range;\n }\n target.insertTextFormat = format;\n if (source.fromEdit && text !== undefined && range !== undefined) {\n target.textEdit = asCompletionTextEdit(text, range);\n }\n else {\n target.insertText = text;\n }\n }\n function asCompletionTextEdit(newText, range) {\n if (InsertReplaceRange.is(range)) {\n return proto.InsertReplaceEdit.create(newText, asRange(range.inserting), asRange(range.replacing));\n }\n else {\n return { newText, range: asRange(range) };\n }\n }\n function asTextEdit(edit) {\n return { range: asRange(edit.range), newText: edit.newText };\n }\n function asTextEdits(edits) {\n if (edits === undefined || edits === null) {\n return edits;\n }\n return edits.map(asTextEdit);\n }\n function asSymbolKind(item) {\n if (item <= code.SymbolKind.TypeParameter) {\n // Symbol kind is one based in the protocol and zero based in code.\n return (item + 1);\n }\n return proto.SymbolKind.Property;\n }\n function asSymbolTag(item) {\n return item;\n }\n function asSymbolTags(items) {\n return items.map(asSymbolTag);\n }\n function asReferenceParams(textDocument, position, options) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument),\n position: asWorkerPosition(position),\n context: { includeDeclaration: options.includeDeclaration }\n };\n }\n async function asCodeAction(item, token) {\n let result = proto.CodeAction.create(item.title);\n if (item instanceof protocolCodeAction_1.default && item.data !== undefined) {\n result.data = item.data;\n }\n if (item.kind !== undefined) {\n result.kind = asCodeActionKind(item.kind);\n }\n if (item.diagnostics !== undefined) {\n result.diagnostics = await asDiagnostics(item.diagnostics, token);\n }\n if (item.edit !== undefined) {\n throw new Error(`VS Code code actions can only be converted to a protocol code action without an edit.`);\n }\n if (item.command !== undefined) {\n result.command = asCommand(item.command);\n }\n if (item.isPreferred !== undefined) {\n result.isPreferred = item.isPreferred;\n }\n if (item.disabled !== undefined) {\n result.disabled = { reason: item.disabled.reason };\n }\n return result;\n }\n function asCodeActionSync(item) {\n let result = proto.CodeAction.create(item.title);\n if (item instanceof protocolCodeAction_1.default && item.data !== undefined) {\n result.data = item.data;\n }\n if (item.kind !== undefined) {\n result.kind = asCodeActionKind(item.kind);\n }\n if (item.diagnostics !== undefined) {\n result.diagnostics = asDiagnosticsSync(item.diagnostics);\n }\n if (item.edit !== undefined) {\n throw new Error(`VS Code code actions can only be converted to a protocol code action without an edit.`);\n }\n if (item.command !== undefined) {\n result.command = asCommand(item.command);\n }\n if (item.isPreferred !== undefined) {\n result.isPreferred = item.isPreferred;\n }\n if (item.disabled !== undefined) {\n result.disabled = { reason: item.disabled.reason };\n }\n return result;\n }\n async function asCodeActionContext(context, token) {\n if (context === undefined || context === null) {\n return context;\n }\n let only;\n if (context.only && Is.string(context.only.value)) {\n only = [context.only.value];\n }\n return proto.CodeActionContext.create(await asDiagnostics(context.diagnostics, token), only, asCodeActionTriggerKind(context.triggerKind));\n }\n function asCodeActionContextSync(context) {\n if (context === undefined || context === null) {\n return context;\n }\n let only;\n if (context.only && Is.string(context.only.value)) {\n only = [context.only.value];\n }\n return proto.CodeActionContext.create(asDiagnosticsSync(context.diagnostics), only, asCodeActionTriggerKind(context.triggerKind));\n }\n function asCodeActionTriggerKind(kind) {\n switch (kind) {\n case code.CodeActionTriggerKind.Invoke:\n return proto.CodeActionTriggerKind.Invoked;\n case code.CodeActionTriggerKind.Automatic:\n return proto.CodeActionTriggerKind.Automatic;\n default:\n return undefined;\n }\n }\n function asCodeActionKind(item) {\n if (item === undefined || item === null) {\n return undefined;\n }\n return item.value;\n }\n function asInlineValueContext(context) {\n if (context === undefined || context === null) {\n return context;\n }\n return proto.InlineValueContext.create(context.frameId, asRange(context.stoppedLocation));\n }\n function asInlineCompletionParams(document, position, context) {\n return { context: proto.InlineCompletionContext.create(context.triggerKind, context.selectedCompletionInfo),\n textDocument: asTextDocumentIdentifier(document), position: asPosition(position) };\n }\n function asCommand(item) {\n let result = proto.Command.create(item.title, item.command);\n if (item.arguments) {\n result.arguments = item.arguments;\n }\n return result;\n }\n function asCodeLens(item) {\n let result = proto.CodeLens.create(asRange(item.range));\n if (item.command) {\n result.command = asCommand(item.command);\n }\n if (item instanceof protocolCodeLens_1.default) {\n if (item.data) {\n result.data = item.data;\n }\n }\n return result;\n }\n function asFormattingOptions(options, fileOptions) {\n const result = { tabSize: options.tabSize, insertSpaces: options.insertSpaces };\n if (fileOptions.trimTrailingWhitespace) {\n result.trimTrailingWhitespace = true;\n }\n if (fileOptions.trimFinalNewlines) {\n result.trimFinalNewlines = true;\n }\n if (fileOptions.insertFinalNewline) {\n result.insertFinalNewline = true;\n }\n return result;\n }\n function asDocumentSymbolParams(textDocument) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument)\n };\n }\n function asCodeLensParams(textDocument) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument)\n };\n }\n function asDocumentLink(item) {\n let result = proto.DocumentLink.create(asRange(item.range));\n if (item.target) {\n result.target = asUri(item.target);\n }\n if (item.tooltip !== undefined) {\n result.tooltip = item.tooltip;\n }\n let protocolItem = item instanceof protocolDocumentLink_1.default ? item : undefined;\n if (protocolItem && protocolItem.data) {\n result.data = protocolItem.data;\n }\n return result;\n }\n function asDocumentLinkParams(textDocument) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument)\n };\n }\n function asCallHierarchyItem(value) {\n const result = {\n name: value.name,\n kind: asSymbolKind(value.kind),\n uri: asUri(value.uri),\n range: asRange(value.range),\n selectionRange: asRange(value.selectionRange)\n };\n if (value.detail !== undefined && value.detail.length > 0) {\n result.detail = value.detail;\n }\n if (value.tags !== undefined) {\n result.tags = asSymbolTags(value.tags);\n }\n if (value instanceof protocolCallHierarchyItem_1.default && value.data !== undefined) {\n result.data = value.data;\n }\n return result;\n }\n function asTypeHierarchyItem(value) {\n const result = {\n name: value.name,\n kind: asSymbolKind(value.kind),\n uri: asUri(value.uri),\n range: asRange(value.range),\n selectionRange: asRange(value.selectionRange),\n };\n if (value.detail !== undefined && value.detail.length > 0) {\n result.detail = value.detail;\n }\n if (value.tags !== undefined) {\n result.tags = asSymbolTags(value.tags);\n }\n if (value instanceof protocolTypeHierarchyItem_1.default && value.data !== undefined) {\n result.data = value.data;\n }\n return result;\n }\n function asWorkspaceSymbol(item) {\n const result = item instanceof protocolWorkspaceSymbol_1.default\n ? { name: item.name, kind: asSymbolKind(item.kind), location: item.hasRange ? asLocation(item.location) : { uri: _uriConverter(item.location.uri) }, data: item.data }\n : { name: item.name, kind: asSymbolKind(item.kind), location: asLocation(item.location) };\n if (item.tags !== undefined) {\n result.tags = asSymbolTags(item.tags);\n }\n if (item.containerName !== '') {\n result.containerName = item.containerName;\n }\n return result;\n }\n function asInlayHint(item) {\n const label = typeof item.label === 'string'\n ? item.label\n : item.label.map(asInlayHintLabelPart);\n const result = proto.InlayHint.create(asPosition(item.position), label);\n if (item.kind !== undefined) {\n result.kind = item.kind;\n }\n if (item.textEdits !== undefined) {\n result.textEdits = asTextEdits(item.textEdits);\n }\n if (item.tooltip !== undefined) {\n result.tooltip = asTooltip(item.tooltip);\n }\n if (item.paddingLeft !== undefined) {\n result.paddingLeft = item.paddingLeft;\n }\n if (item.paddingRight !== undefined) {\n result.paddingRight = item.paddingRight;\n }\n if (item instanceof protocolInlayHint_1.default && item.data !== undefined) {\n result.data = item.data;\n }\n return result;\n }\n function asInlayHintLabelPart(item) {\n const result = proto.InlayHintLabelPart.create(item.value);\n if (item.location !== undefined) {\n result.location = asLocation(item.location);\n }\n if (item.command !== undefined) {\n result.command = asCommand(item.command);\n }\n if (item.tooltip !== undefined) {\n result.tooltip = asTooltip(item.tooltip);\n }\n return result;\n }\n function asTooltip(value) {\n if (typeof value === 'string') {\n return value;\n }\n const result = {\n kind: proto.MarkupKind.Markdown,\n value: value.value\n };\n return result;\n }\n return {\n asUri,\n asTextDocumentIdentifier,\n asTextDocumentItem,\n asVersionedTextDocumentIdentifier,\n asOpenTextDocumentParams,\n asChangeTextDocumentParams,\n asCloseTextDocumentParams,\n asSaveTextDocumentParams,\n asWillSaveTextDocumentParams,\n asDidCreateFilesParams,\n asDidRenameFilesParams,\n asDidDeleteFilesParams,\n asWillCreateFilesParams,\n asWillRenameFilesParams,\n asWillDeleteFilesParams,\n asTextDocumentPositionParams,\n asCompletionParams,\n asSignatureHelpParams,\n asWorkerPosition,\n asRange,\n asRanges,\n asPosition,\n asPositions,\n asPositionsSync,\n asLocation,\n asDiagnosticSeverity,\n asDiagnosticTag,\n asDiagnostic,\n asDiagnostics,\n asDiagnosticsSync,\n asCompletionItem,\n asTextEdit,\n asSymbolKind,\n asSymbolTag,\n asSymbolTags,\n asReferenceParams,\n asCodeAction,\n asCodeActionSync,\n asCodeActionContext,\n asCodeActionContextSync,\n asInlineValueContext,\n asCommand,\n asCodeLens,\n asFormattingOptions,\n asDocumentSymbolParams,\n asCodeLensParams,\n asDocumentLink,\n asDocumentLinkParams,\n asCallHierarchyItem,\n asTypeHierarchyItem,\n asInlayHint,\n asWorkspaceSymbol,\n asInlineCompletionParams\n };\n}\nexports.createConverter = createConverter;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createConverter = void 0;\nconst code = require(\"vscode\");\nconst ls = require(\"vscode-languageserver-protocol\");\nconst Is = require(\"./utils/is\");\nconst async = require(\"./utils/async\");\nconst protocolCompletionItem_1 = require(\"./protocolCompletionItem\");\nconst protocolCodeLens_1 = require(\"./protocolCodeLens\");\nconst protocolDocumentLink_1 = require(\"./protocolDocumentLink\");\nconst protocolCodeAction_1 = require(\"./protocolCodeAction\");\nconst protocolDiagnostic_1 = require(\"./protocolDiagnostic\");\nconst protocolCallHierarchyItem_1 = require(\"./protocolCallHierarchyItem\");\nconst protocolTypeHierarchyItem_1 = require(\"./protocolTypeHierarchyItem\");\nconst protocolWorkspaceSymbol_1 = require(\"./protocolWorkspaceSymbol\");\nconst protocolInlayHint_1 = require(\"./protocolInlayHint\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nvar CodeBlock;\n(function (CodeBlock) {\n function is(value) {\n let candidate = value;\n return candidate && Is.string(candidate.language) && Is.string(candidate.value);\n }\n CodeBlock.is = is;\n})(CodeBlock || (CodeBlock = {}));\nfunction createConverter(uriConverter, trustMarkdown, supportHtml) {\n const nullConverter = (value) => code.Uri.parse(value);\n const _uriConverter = uriConverter || nullConverter;\n function asUri(value) {\n return _uriConverter(value);\n }\n function asDocumentSelector(selector) {\n const result = [];\n for (const filter of selector) {\n if (typeof filter === 'string') {\n result.push(filter);\n }\n else if (vscode_languageserver_protocol_1.NotebookCellTextDocumentFilter.is(filter)) {\n // We first need to check for the notebook cell filter since a TextDocumentFilter would\n // match both (e.g. the notebook is optional).\n if (typeof filter.notebook === 'string') {\n result.push({ notebookType: filter.notebook, language: filter.language });\n }\n else {\n const notebookType = filter.notebook.notebookType ?? '*';\n result.push({ notebookType: notebookType, scheme: filter.notebook.scheme, pattern: filter.notebook.pattern, language: filter.language });\n }\n }\n else if (vscode_languageserver_protocol_1.TextDocumentFilter.is(filter)) {\n result.push({ language: filter.language, scheme: filter.scheme, pattern: filter.pattern });\n }\n }\n return result;\n }\n async function asDiagnostics(diagnostics, token) {\n return async.map(diagnostics, asDiagnostic, token);\n }\n function asDiagnosticsSync(diagnostics) {\n const result = new Array(diagnostics.length);\n for (let i = 0; i < diagnostics.length; i++) {\n result[i] = asDiagnostic(diagnostics[i]);\n }\n return result;\n }\n function asDiagnostic(diagnostic) {\n let result = new protocolDiagnostic_1.ProtocolDiagnostic(asRange(diagnostic.range), diagnostic.message, asDiagnosticSeverity(diagnostic.severity), diagnostic.data);\n if (diagnostic.code !== undefined) {\n if (typeof diagnostic.code === 'string' || typeof diagnostic.code === 'number') {\n if (ls.CodeDescription.is(diagnostic.codeDescription)) {\n result.code = {\n value: diagnostic.code,\n target: asUri(diagnostic.codeDescription.href)\n };\n }\n else {\n result.code = diagnostic.code;\n }\n }\n else if (protocolDiagnostic_1.DiagnosticCode.is(diagnostic.code)) {\n // This is for backwards compatibility of a proposed API.\n // We should remove this at some point.\n result.hasDiagnosticCode = true;\n const diagnosticCode = diagnostic.code;\n result.code = {\n value: diagnosticCode.value,\n target: asUri(diagnosticCode.target)\n };\n }\n }\n if (diagnostic.source) {\n result.source = diagnostic.source;\n }\n if (diagnostic.relatedInformation) {\n result.relatedInformation = asRelatedInformation(diagnostic.relatedInformation);\n }\n if (Array.isArray(diagnostic.tags)) {\n result.tags = asDiagnosticTags(diagnostic.tags);\n }\n return result;\n }\n function asRelatedInformation(relatedInformation) {\n const result = new Array(relatedInformation.length);\n for (let i = 0; i < relatedInformation.length; i++) {\n const info = relatedInformation[i];\n result[i] = new code.DiagnosticRelatedInformation(asLocation(info.location), info.message);\n }\n return result;\n }\n function asDiagnosticTags(tags) {\n if (!tags) {\n return undefined;\n }\n let result = [];\n for (let tag of tags) {\n let converted = asDiagnosticTag(tag);\n if (converted !== undefined) {\n result.push(converted);\n }\n }\n return result.length > 0 ? result : undefined;\n }\n function asDiagnosticTag(tag) {\n switch (tag) {\n case ls.DiagnosticTag.Unnecessary:\n return code.DiagnosticTag.Unnecessary;\n case ls.DiagnosticTag.Deprecated:\n return code.DiagnosticTag.Deprecated;\n default:\n return undefined;\n }\n }\n function asPosition(value) {\n return value ? new code.Position(value.line, value.character) : undefined;\n }\n function asRange(value) {\n return value ? new code.Range(value.start.line, value.start.character, value.end.line, value.end.character) : undefined;\n }\n async function asRanges(items, token) {\n return async.map(items, (range) => {\n return new code.Range(range.start.line, range.start.character, range.end.line, range.end.character);\n }, token);\n }\n function asDiagnosticSeverity(value) {\n if (value === undefined || value === null) {\n return code.DiagnosticSeverity.Error;\n }\n switch (value) {\n case ls.DiagnosticSeverity.Error:\n return code.DiagnosticSeverity.Error;\n case ls.DiagnosticSeverity.Warning:\n return code.DiagnosticSeverity.Warning;\n case ls.DiagnosticSeverity.Information:\n return code.DiagnosticSeverity.Information;\n case ls.DiagnosticSeverity.Hint:\n return code.DiagnosticSeverity.Hint;\n }\n return code.DiagnosticSeverity.Error;\n }\n function asHoverContent(value) {\n if (Is.string(value)) {\n return asMarkdownString(value);\n }\n else if (CodeBlock.is(value)) {\n let result = asMarkdownString();\n return result.appendCodeblock(value.value, value.language);\n }\n else if (Array.isArray(value)) {\n let result = [];\n for (let element of value) {\n let item = asMarkdownString();\n if (CodeBlock.is(element)) {\n item.appendCodeblock(element.value, element.language);\n }\n else {\n item.appendMarkdown(element);\n }\n result.push(item);\n }\n return result;\n }\n else {\n return asMarkdownString(value);\n }\n }\n function asDocumentation(value) {\n if (Is.string(value)) {\n return value;\n }\n else {\n switch (value.kind) {\n case ls.MarkupKind.Markdown:\n return asMarkdownString(value.value);\n case ls.MarkupKind.PlainText:\n return value.value;\n default:\n return `Unsupported Markup content received. Kind is: ${value.kind}`;\n }\n }\n }\n function asMarkdownString(value) {\n let result;\n if (value === undefined || typeof value === 'string') {\n result = new code.MarkdownString(value);\n }\n else {\n switch (value.kind) {\n case ls.MarkupKind.Markdown:\n result = new code.MarkdownString(value.value);\n break;\n case ls.MarkupKind.PlainText:\n result = new code.MarkdownString();\n result.appendText(value.value);\n break;\n default:\n result = new code.MarkdownString();\n result.appendText(`Unsupported Markup content received. Kind is: ${value.kind}`);\n break;\n }\n }\n result.isTrusted = trustMarkdown;\n result.supportHtml = supportHtml;\n return result;\n }\n function asHover(hover) {\n if (!hover) {\n return undefined;\n }\n return new code.Hover(asHoverContent(hover.contents), asRange(hover.range));\n }\n async function asCompletionResult(value, allCommitCharacters, token) {\n if (!value) {\n return undefined;\n }\n if (Array.isArray(value)) {\n return async.map(value, (item) => asCompletionItem(item, allCommitCharacters), token);\n }\n const list = value;\n const { defaultRange, commitCharacters } = getCompletionItemDefaults(list, allCommitCharacters);\n const converted = await async.map(list.items, (item) => {\n return asCompletionItem(item, commitCharacters, defaultRange, list.itemDefaults?.insertTextMode, list.itemDefaults?.insertTextFormat, list.itemDefaults?.data);\n }, token);\n return new code.CompletionList(converted, list.isIncomplete);\n }\n function getCompletionItemDefaults(list, allCommitCharacters) {\n const rangeDefaults = list.itemDefaults?.editRange;\n const commitCharacters = list.itemDefaults?.commitCharacters ?? allCommitCharacters;\n return ls.Range.is(rangeDefaults)\n ? { defaultRange: asRange(rangeDefaults), commitCharacters }\n : rangeDefaults !== undefined\n ? { defaultRange: { inserting: asRange(rangeDefaults.insert), replacing: asRange(rangeDefaults.replace) }, commitCharacters }\n : { defaultRange: undefined, commitCharacters };\n }\n function asCompletionItemKind(value) {\n // Protocol item kind is 1 based, codes item kind is zero based.\n if (ls.CompletionItemKind.Text <= value && value <= ls.CompletionItemKind.TypeParameter) {\n return [value - 1, undefined];\n }\n return [code.CompletionItemKind.Text, value];\n }\n function asCompletionItemTag(tag) {\n switch (tag) {\n case ls.CompletionItemTag.Deprecated:\n return code.CompletionItemTag.Deprecated;\n }\n return undefined;\n }\n function asCompletionItemTags(tags) {\n if (tags === undefined || tags === null) {\n return [];\n }\n const result = [];\n for (const tag of tags) {\n const converted = asCompletionItemTag(tag);\n if (converted !== undefined) {\n result.push(converted);\n }\n }\n return result;\n }\n function asCompletionItem(item, defaultCommitCharacters, defaultRange, defaultInsertTextMode, defaultInsertTextFormat, defaultData) {\n const tags = asCompletionItemTags(item.tags);\n const label = asCompletionItemLabel(item);\n const result = new protocolCompletionItem_1.default(label);\n if (item.detail) {\n result.detail = item.detail;\n }\n if (item.documentation) {\n result.documentation = asDocumentation(item.documentation);\n result.documentationFormat = Is.string(item.documentation) ? '$string' : item.documentation.kind;\n }\n if (item.filterText) {\n result.filterText = item.filterText;\n }\n const insertText = asCompletionInsertText(item, defaultRange, defaultInsertTextFormat);\n if (insertText) {\n result.insertText = insertText.text;\n result.range = insertText.range;\n result.fromEdit = insertText.fromEdit;\n }\n if (Is.number(item.kind)) {\n let [itemKind, original] = asCompletionItemKind(item.kind);\n result.kind = itemKind;\n if (original) {\n result.originalItemKind = original;\n }\n }\n if (item.sortText) {\n result.sortText = item.sortText;\n }\n if (item.additionalTextEdits) {\n result.additionalTextEdits = asTextEditsSync(item.additionalTextEdits);\n }\n const commitCharacters = item.commitCharacters !== undefined\n ? Is.stringArray(item.commitCharacters) ? item.commitCharacters : undefined\n : defaultCommitCharacters;\n if (commitCharacters) {\n result.commitCharacters = commitCharacters.slice();\n }\n if (item.command) {\n result.command = asCommand(item.command);\n }\n if (item.deprecated === true || item.deprecated === false) {\n result.deprecated = item.deprecated;\n if (item.deprecated === true) {\n tags.push(code.CompletionItemTag.Deprecated);\n }\n }\n if (item.preselect === true || item.preselect === false) {\n result.preselect = item.preselect;\n }\n const data = item.data ?? defaultData;\n if (data !== undefined) {\n result.data = data;\n }\n if (tags.length > 0) {\n result.tags = tags;\n }\n const insertTextMode = item.insertTextMode ?? defaultInsertTextMode;\n if (insertTextMode !== undefined) {\n result.insertTextMode = insertTextMode;\n if (insertTextMode === ls.InsertTextMode.asIs) {\n result.keepWhitespace = true;\n }\n }\n return result;\n }\n function asCompletionItemLabel(item) {\n if (ls.CompletionItemLabelDetails.is(item.labelDetails)) {\n return {\n label: item.label,\n detail: item.labelDetails.detail,\n description: item.labelDetails.description\n };\n }\n else {\n return item.label;\n }\n }\n function asCompletionInsertText(item, defaultRange, defaultInsertTextFormat) {\n const insertTextFormat = item.insertTextFormat ?? defaultInsertTextFormat;\n if (item.textEdit !== undefined || defaultRange !== undefined) {\n const [range, newText] = item.textEdit !== undefined\n ? getCompletionRangeAndText(item.textEdit)\n : [defaultRange, item.textEditText ?? item.label];\n if (insertTextFormat === ls.InsertTextFormat.Snippet) {\n return { text: new code.SnippetString(newText), range: range, fromEdit: true };\n }\n else {\n return { text: newText, range: range, fromEdit: true };\n }\n }\n else if (item.insertText) {\n if (insertTextFormat === ls.InsertTextFormat.Snippet) {\n return { text: new code.SnippetString(item.insertText), fromEdit: false };\n }\n else {\n return { text: item.insertText, fromEdit: false };\n }\n }\n else {\n return undefined;\n }\n }\n function getCompletionRangeAndText(value) {\n if (ls.InsertReplaceEdit.is(value)) {\n return [{ inserting: asRange(value.insert), replacing: asRange(value.replace) }, value.newText];\n }\n else {\n return [asRange(value.range), value.newText];\n }\n }\n function asTextEdit(edit) {\n if (!edit) {\n return undefined;\n }\n return new code.TextEdit(asRange(edit.range), edit.newText);\n }\n async function asTextEdits(items, token) {\n if (!items) {\n return undefined;\n }\n return async.map(items, asTextEdit, token);\n }\n function asTextEditsSync(items) {\n if (!items) {\n return undefined;\n }\n const result = new Array(items.length);\n for (let i = 0; i < items.length; i++) {\n result[i] = asTextEdit(items[i]);\n }\n return result;\n }\n async function asSignatureHelp(item, token) {\n if (!item) {\n return undefined;\n }\n let result = new code.SignatureHelp();\n if (Is.number(item.activeSignature)) {\n result.activeSignature = item.activeSignature;\n }\n else {\n // activeSignature was optional in the past\n result.activeSignature = 0;\n }\n if (Is.number(item.activeParameter)) {\n result.activeParameter = item.activeParameter;\n }\n else {\n // activeParameter was optional in the past\n result.activeParameter = 0;\n }\n if (item.signatures) {\n result.signatures = await asSignatureInformations(item.signatures, token);\n }\n return result;\n }\n async function asSignatureInformations(items, token) {\n return async.mapAsync(items, asSignatureInformation, token);\n }\n async function asSignatureInformation(item, token) {\n let result = new code.SignatureInformation(item.label);\n if (item.documentation !== undefined) {\n result.documentation = asDocumentation(item.documentation);\n }\n if (item.parameters !== undefined) {\n result.parameters = await asParameterInformations(item.parameters, token);\n }\n if (item.activeParameter !== undefined) {\n result.activeParameter = item.activeParameter;\n }\n {\n return result;\n }\n }\n function asParameterInformations(items, token) {\n return async.map(items, asParameterInformation, token);\n }\n function asParameterInformation(item) {\n let result = new code.ParameterInformation(item.label);\n if (item.documentation) {\n result.documentation = asDocumentation(item.documentation);\n }\n return result;\n }\n function asLocation(item) {\n return item ? new code.Location(_uriConverter(item.uri), asRange(item.range)) : undefined;\n }\n async function asDeclarationResult(item, token) {\n if (!item) {\n return undefined;\n }\n return asLocationResult(item, token);\n }\n async function asDefinitionResult(item, token) {\n if (!item) {\n return undefined;\n }\n return asLocationResult(item, token);\n }\n function asLocationLink(item) {\n if (!item) {\n return undefined;\n }\n let result = {\n targetUri: _uriConverter(item.targetUri),\n targetRange: asRange(item.targetRange),\n originSelectionRange: asRange(item.originSelectionRange),\n targetSelectionRange: asRange(item.targetSelectionRange)\n };\n if (!result.targetSelectionRange) {\n throw new Error(`targetSelectionRange must not be undefined or null`);\n }\n return result;\n }\n async function asLocationResult(item, token) {\n if (!item) {\n return undefined;\n }\n if (Is.array(item)) {\n if (item.length === 0) {\n return [];\n }\n else if (ls.LocationLink.is(item[0])) {\n const links = item;\n return async.map(links, asLocationLink, token);\n }\n else {\n const locations = item;\n return async.map(locations, asLocation, token);\n }\n }\n else if (ls.LocationLink.is(item)) {\n return [asLocationLink(item)];\n }\n else {\n return asLocation(item);\n }\n }\n async function asReferences(values, token) {\n if (!values) {\n return undefined;\n }\n return async.map(values, asLocation, token);\n }\n async function asDocumentHighlights(values, token) {\n if (!values) {\n return undefined;\n }\n return async.map(values, asDocumentHighlight, token);\n }\n function asDocumentHighlight(item) {\n let result = new code.DocumentHighlight(asRange(item.range));\n if (Is.number(item.kind)) {\n result.kind = asDocumentHighlightKind(item.kind);\n }\n return result;\n }\n function asDocumentHighlightKind(item) {\n switch (item) {\n case ls.DocumentHighlightKind.Text:\n return code.DocumentHighlightKind.Text;\n case ls.DocumentHighlightKind.Read:\n return code.DocumentHighlightKind.Read;\n case ls.DocumentHighlightKind.Write:\n return code.DocumentHighlightKind.Write;\n }\n return code.DocumentHighlightKind.Text;\n }\n async function asSymbolInformations(values, token) {\n if (!values) {\n return undefined;\n }\n return async.map(values, asSymbolInformation, token);\n }\n function asSymbolKind(item) {\n if (item <= ls.SymbolKind.TypeParameter) {\n // Symbol kind is one based in the protocol and zero based in code.\n return item - 1;\n }\n return code.SymbolKind.Property;\n }\n function asSymbolTag(value) {\n switch (value) {\n case ls.SymbolTag.Deprecated:\n return code.SymbolTag.Deprecated;\n default:\n return undefined;\n }\n }\n function asSymbolTags(items) {\n if (items === undefined || items === null) {\n return undefined;\n }\n const result = [];\n for (const item of items) {\n const converted = asSymbolTag(item);\n if (converted !== undefined) {\n result.push(converted);\n }\n }\n return result.length === 0 ? undefined : result;\n }\n function asSymbolInformation(item) {\n const data = item.data;\n const location = item.location;\n const result = location.range === undefined || data !== undefined\n ? new protocolWorkspaceSymbol_1.default(item.name, asSymbolKind(item.kind), item.containerName ?? '', location.range === undefined ? _uriConverter(location.uri) : new code.Location(_uriConverter(item.location.uri), asRange(location.range)), data)\n : new code.SymbolInformation(item.name, asSymbolKind(item.kind), item.containerName ?? '', new code.Location(_uriConverter(item.location.uri), asRange(location.range)));\n fillTags(result, item);\n return result;\n }\n async function asDocumentSymbols(values, token) {\n if (values === undefined || values === null) {\n return undefined;\n }\n return async.map(values, asDocumentSymbol, token);\n }\n function asDocumentSymbol(value) {\n let result = new code.DocumentSymbol(value.name, value.detail || '', asSymbolKind(value.kind), asRange(value.range), asRange(value.selectionRange));\n fillTags(result, value);\n if (value.children !== undefined && value.children.length > 0) {\n let children = [];\n for (let child of value.children) {\n children.push(asDocumentSymbol(child));\n }\n result.children = children;\n }\n return result;\n }\n function fillTags(result, value) {\n result.tags = asSymbolTags(value.tags);\n if (value.deprecated) {\n if (!result.tags) {\n result.tags = [code.SymbolTag.Deprecated];\n }\n else {\n if (!result.tags.includes(code.SymbolTag.Deprecated)) {\n result.tags = result.tags.concat(code.SymbolTag.Deprecated);\n }\n }\n }\n }\n function asCommand(item) {\n let result = { title: item.title, command: item.command };\n if (item.arguments) {\n result.arguments = item.arguments;\n }\n return result;\n }\n async function asCommands(items, token) {\n if (!items) {\n return undefined;\n }\n return async.map(items, asCommand, token);\n }\n const kindMapping = new Map();\n kindMapping.set(ls.CodeActionKind.Empty, code.CodeActionKind.Empty);\n kindMapping.set(ls.CodeActionKind.QuickFix, code.CodeActionKind.QuickFix);\n kindMapping.set(ls.CodeActionKind.Refactor, code.CodeActionKind.Refactor);\n kindMapping.set(ls.CodeActionKind.RefactorExtract, code.CodeActionKind.RefactorExtract);\n kindMapping.set(ls.CodeActionKind.RefactorInline, code.CodeActionKind.RefactorInline);\n kindMapping.set(ls.CodeActionKind.RefactorRewrite, code.CodeActionKind.RefactorRewrite);\n kindMapping.set(ls.CodeActionKind.Source, code.CodeActionKind.Source);\n kindMapping.set(ls.CodeActionKind.SourceOrganizeImports, code.CodeActionKind.SourceOrganizeImports);\n function asCodeActionKind(item) {\n if (item === undefined || item === null) {\n return undefined;\n }\n let result = kindMapping.get(item);\n if (result) {\n return result;\n }\n let parts = item.split('.');\n result = code.CodeActionKind.Empty;\n for (let part of parts) {\n result = result.append(part);\n }\n return result;\n }\n function asCodeActionKinds(items) {\n if (items === undefined || items === null) {\n return undefined;\n }\n return items.map(kind => asCodeActionKind(kind));\n }\n async function asCodeAction(item, token) {\n if (item === undefined || item === null) {\n return undefined;\n }\n let result = new protocolCodeAction_1.default(item.title, item.data);\n if (item.kind !== undefined) {\n result.kind = asCodeActionKind(item.kind);\n }\n if (item.diagnostics !== undefined) {\n result.diagnostics = asDiagnosticsSync(item.diagnostics);\n }\n if (item.edit !== undefined) {\n result.edit = await asWorkspaceEdit(item.edit, token);\n }\n if (item.command !== undefined) {\n result.command = asCommand(item.command);\n }\n if (item.isPreferred !== undefined) {\n result.isPreferred = item.isPreferred;\n }\n if (item.disabled !== undefined) {\n result.disabled = { reason: item.disabled.reason };\n }\n return result;\n }\n function asCodeActionResult(items, token) {\n return async.mapAsync(items, async (item) => {\n if (ls.Command.is(item)) {\n return asCommand(item);\n }\n else {\n return asCodeAction(item, token);\n }\n }, token);\n }\n function asCodeLens(item) {\n if (!item) {\n return undefined;\n }\n let result = new protocolCodeLens_1.default(asRange(item.range));\n if (item.command) {\n result.command = asCommand(item.command);\n }\n if (item.data !== undefined && item.data !== null) {\n result.data = item.data;\n }\n return result;\n }\n async function asCodeLenses(items, token) {\n if (!items) {\n return undefined;\n }\n return async.map(items, asCodeLens, token);\n }\n async function asWorkspaceEdit(item, token) {\n if (!item) {\n return undefined;\n }\n const sharedMetadata = new Map();\n if (item.changeAnnotations !== undefined) {\n const changeAnnotations = item.changeAnnotations;\n await async.forEach(Object.keys(changeAnnotations), (key) => {\n const metaData = asWorkspaceEditEntryMetadata(changeAnnotations[key]);\n sharedMetadata.set(key, metaData);\n }, token);\n }\n const asMetadata = (annotation) => {\n if (annotation === undefined) {\n return undefined;\n }\n else {\n return sharedMetadata.get(annotation);\n }\n };\n const result = new code.WorkspaceEdit();\n if (item.documentChanges) {\n const documentChanges = item.documentChanges;\n await async.forEach(documentChanges, (change) => {\n if (ls.CreateFile.is(change)) {\n result.createFile(_uriConverter(change.uri), change.options, asMetadata(change.annotationId));\n }\n else if (ls.RenameFile.is(change)) {\n result.renameFile(_uriConverter(change.oldUri), _uriConverter(change.newUri), change.options, asMetadata(change.annotationId));\n }\n else if (ls.DeleteFile.is(change)) {\n result.deleteFile(_uriConverter(change.uri), change.options, asMetadata(change.annotationId));\n }\n else if (ls.TextDocumentEdit.is(change)) {\n const uri = _uriConverter(change.textDocument.uri);\n for (const edit of change.edits) {\n if (ls.AnnotatedTextEdit.is(edit)) {\n result.replace(uri, asRange(edit.range), edit.newText, asMetadata(edit.annotationId));\n }\n else {\n result.replace(uri, asRange(edit.range), edit.newText);\n }\n }\n }\n else {\n throw new Error(`Unknown workspace edit change received:\\n${JSON.stringify(change, undefined, 4)}`);\n }\n }, token);\n }\n else if (item.changes) {\n const changes = item.changes;\n await async.forEach(Object.keys(changes), (key) => {\n result.set(_uriConverter(key), asTextEditsSync(changes[key]));\n }, token);\n }\n return result;\n }\n function asWorkspaceEditEntryMetadata(annotation) {\n if (annotation === undefined) {\n return undefined;\n }\n return { label: annotation.label, needsConfirmation: !!annotation.needsConfirmation, description: annotation.description };\n }\n function asDocumentLink(item) {\n let range = asRange(item.range);\n let target = item.target ? asUri(item.target) : undefined;\n // target must be optional in DocumentLink\n let link = new protocolDocumentLink_1.default(range, target);\n if (item.tooltip !== undefined) {\n link.tooltip = item.tooltip;\n }\n if (item.data !== undefined && item.data !== null) {\n link.data = item.data;\n }\n return link;\n }\n async function asDocumentLinks(items, token) {\n if (!items) {\n return undefined;\n }\n return async.map(items, asDocumentLink, token);\n }\n function asColor(color) {\n return new code.Color(color.red, color.green, color.blue, color.alpha);\n }\n function asColorInformation(ci) {\n return new code.ColorInformation(asRange(ci.range), asColor(ci.color));\n }\n async function asColorInformations(colorInformation, token) {\n if (!colorInformation) {\n return undefined;\n }\n return async.map(colorInformation, asColorInformation, token);\n }\n function asColorPresentation(cp) {\n let presentation = new code.ColorPresentation(cp.label);\n presentation.additionalTextEdits = asTextEditsSync(cp.additionalTextEdits);\n if (cp.textEdit) {\n presentation.textEdit = asTextEdit(cp.textEdit);\n }\n return presentation;\n }\n async function asColorPresentations(colorPresentations, token) {\n if (!colorPresentations) {\n return undefined;\n }\n return async.map(colorPresentations, asColorPresentation, token);\n }\n function asFoldingRangeKind(kind) {\n if (kind) {\n switch (kind) {\n case ls.FoldingRangeKind.Comment:\n return code.FoldingRangeKind.Comment;\n case ls.FoldingRangeKind.Imports:\n return code.FoldingRangeKind.Imports;\n case ls.FoldingRangeKind.Region:\n return code.FoldingRangeKind.Region;\n }\n }\n return undefined;\n }\n function asFoldingRange(r) {\n return new code.FoldingRange(r.startLine, r.endLine, asFoldingRangeKind(r.kind));\n }\n async function asFoldingRanges(foldingRanges, token) {\n if (!foldingRanges) {\n return undefined;\n }\n return async.map(foldingRanges, asFoldingRange, token);\n }\n function asSelectionRange(selectionRange) {\n return new code.SelectionRange(asRange(selectionRange.range), selectionRange.parent ? asSelectionRange(selectionRange.parent) : undefined);\n }\n async function asSelectionRanges(selectionRanges, token) {\n if (!Array.isArray(selectionRanges)) {\n return [];\n }\n return async.map(selectionRanges, asSelectionRange, token);\n }\n function asInlineValue(inlineValue) {\n if (ls.InlineValueText.is(inlineValue)) {\n return new code.InlineValueText(asRange(inlineValue.range), inlineValue.text);\n }\n else if (ls.InlineValueVariableLookup.is(inlineValue)) {\n return new code.InlineValueVariableLookup(asRange(inlineValue.range), inlineValue.variableName, inlineValue.caseSensitiveLookup);\n }\n else {\n return new code.InlineValueEvaluatableExpression(asRange(inlineValue.range), inlineValue.expression);\n }\n }\n async function asInlineValues(inlineValues, token) {\n if (!Array.isArray(inlineValues)) {\n return [];\n }\n return async.map(inlineValues, asInlineValue, token);\n }\n async function asInlayHint(value, token) {\n const label = typeof value.label === 'string'\n ? value.label\n : await async.map(value.label, asInlayHintLabelPart, token);\n const result = new protocolInlayHint_1.default(asPosition(value.position), label);\n if (value.kind !== undefined) {\n result.kind = value.kind;\n }\n if (value.textEdits !== undefined) {\n result.textEdits = await asTextEdits(value.textEdits, token);\n }\n if (value.tooltip !== undefined) {\n result.tooltip = asTooltip(value.tooltip);\n }\n if (value.paddingLeft !== undefined) {\n result.paddingLeft = value.paddingLeft;\n }\n if (value.paddingRight !== undefined) {\n result.paddingRight = value.paddingRight;\n }\n if (value.data !== undefined) {\n result.data = value.data;\n }\n return result;\n }\n function asInlayHintLabelPart(part) {\n const result = new code.InlayHintLabelPart(part.value);\n if (part.location !== undefined) {\n result.location = asLocation(part.location);\n }\n if (part.tooltip !== undefined) {\n result.tooltip = asTooltip(part.tooltip);\n }\n if (part.command !== undefined) {\n result.command = asCommand(part.command);\n }\n return result;\n }\n function asTooltip(value) {\n if (typeof value === 'string') {\n return value;\n }\n return asMarkdownString(value);\n }\n async function asInlayHints(values, token) {\n if (!Array.isArray(values)) {\n return undefined;\n }\n return async.mapAsync(values, asInlayHint, token);\n }\n function asCallHierarchyItem(item) {\n if (item === null) {\n return undefined;\n }\n const result = new protocolCallHierarchyItem_1.default(asSymbolKind(item.kind), item.name, item.detail || '', asUri(item.uri), asRange(item.range), asRange(item.selectionRange), item.data);\n if (item.tags !== undefined) {\n result.tags = asSymbolTags(item.tags);\n }\n return result;\n }\n async function asCallHierarchyItems(items, token) {\n if (items === null) {\n return undefined;\n }\n return async.map(items, asCallHierarchyItem, token);\n }\n async function asCallHierarchyIncomingCall(item, token) {\n return new code.CallHierarchyIncomingCall(asCallHierarchyItem(item.from), await asRanges(item.fromRanges, token));\n }\n async function asCallHierarchyIncomingCalls(items, token) {\n if (items === null) {\n return undefined;\n }\n return async.mapAsync(items, asCallHierarchyIncomingCall, token);\n }\n async function asCallHierarchyOutgoingCall(item, token) {\n return new code.CallHierarchyOutgoingCall(asCallHierarchyItem(item.to), await asRanges(item.fromRanges, token));\n }\n async function asCallHierarchyOutgoingCalls(items, token) {\n if (items === null) {\n return undefined;\n }\n return async.mapAsync(items, asCallHierarchyOutgoingCall, token);\n }\n async function asSemanticTokens(value, _token) {\n if (value === undefined || value === null) {\n return undefined;\n }\n return new code.SemanticTokens(new Uint32Array(value.data), value.resultId);\n }\n function asSemanticTokensEdit(value) {\n return new code.SemanticTokensEdit(value.start, value.deleteCount, value.data !== undefined ? new Uint32Array(value.data) : undefined);\n }\n async function asSemanticTokensEdits(value, _token) {\n if (value === undefined || value === null) {\n return undefined;\n }\n return new code.SemanticTokensEdits(value.edits.map(asSemanticTokensEdit), value.resultId);\n }\n function asSemanticTokensLegend(value) {\n return value;\n }\n async function asLinkedEditingRanges(value, token) {\n if (value === null || value === undefined) {\n return undefined;\n }\n return new code.LinkedEditingRanges(await asRanges(value.ranges, token), asRegularExpression(value.wordPattern));\n }\n function asRegularExpression(value) {\n if (value === null || value === undefined) {\n return undefined;\n }\n return new RegExp(value);\n }\n function asTypeHierarchyItem(item) {\n if (item === null) {\n return undefined;\n }\n let result = new protocolTypeHierarchyItem_1.default(asSymbolKind(item.kind), item.name, item.detail || '', asUri(item.uri), asRange(item.range), asRange(item.selectionRange), item.data);\n if (item.tags !== undefined) {\n result.tags = asSymbolTags(item.tags);\n }\n return result;\n }\n async function asTypeHierarchyItems(items, token) {\n if (items === null) {\n return undefined;\n }\n return async.map(items, asTypeHierarchyItem, token);\n }\n function asGlobPattern(pattern) {\n if (Is.string(pattern)) {\n return pattern;\n }\n if (ls.RelativePattern.is(pattern)) {\n if (ls.URI.is(pattern.baseUri)) {\n return new code.RelativePattern(asUri(pattern.baseUri), pattern.pattern);\n }\n else if (ls.WorkspaceFolder.is(pattern.baseUri)) {\n const workspaceFolder = code.workspace.getWorkspaceFolder(asUri(pattern.baseUri.uri));\n return workspaceFolder !== undefined ? new code.RelativePattern(workspaceFolder, pattern.pattern) : undefined;\n }\n }\n return undefined;\n }\n async function asInlineCompletionResult(value, token) {\n if (!value) {\n return undefined;\n }\n if (Array.isArray(value)) {\n return async.map(value, (item) => asInlineCompletionItem(item), token);\n }\n const list = value;\n const converted = await async.map(list.items, (item) => {\n return asInlineCompletionItem(item);\n }, token);\n return new code.InlineCompletionList(converted);\n }\n function asInlineCompletionItem(item) {\n let insertText;\n if (typeof item.insertText === 'string') {\n insertText = item.insertText;\n }\n else {\n insertText = new code.SnippetString(item.insertText.value);\n }\n let command = undefined;\n if (item.command) {\n command = asCommand(item.command);\n }\n const inlineCompletionItem = new code.InlineCompletionItem(insertText, asRange(item.range), command);\n if (item.filterText) {\n inlineCompletionItem.filterText = item.filterText;\n }\n return inlineCompletionItem;\n }\n return {\n asUri,\n asDocumentSelector,\n asDiagnostics,\n asDiagnostic,\n asRange,\n asRanges,\n asPosition,\n asDiagnosticSeverity,\n asDiagnosticTag,\n asHover,\n asCompletionResult,\n asCompletionItem,\n asTextEdit,\n asTextEdits,\n asSignatureHelp,\n asSignatureInformations,\n asSignatureInformation,\n asParameterInformations,\n asParameterInformation,\n asDeclarationResult,\n asDefinitionResult,\n asLocation,\n asReferences,\n asDocumentHighlights,\n asDocumentHighlight,\n asDocumentHighlightKind,\n asSymbolKind,\n asSymbolTag,\n asSymbolTags,\n asSymbolInformations,\n asSymbolInformation,\n asDocumentSymbols,\n asDocumentSymbol,\n asCommand,\n asCommands,\n asCodeAction,\n asCodeActionKind,\n asCodeActionKinds,\n asCodeActionResult,\n asCodeLens,\n asCodeLenses,\n asWorkspaceEdit,\n asDocumentLink,\n asDocumentLinks,\n asFoldingRangeKind,\n asFoldingRange,\n asFoldingRanges,\n asColor,\n asColorInformation,\n asColorInformations,\n asColorPresentation,\n asColorPresentations,\n asSelectionRange,\n asSelectionRanges,\n asInlineValue,\n asInlineValues,\n asInlayHint,\n asInlayHints,\n asSemanticTokensLegend,\n asSemanticTokens,\n asSemanticTokensEdit,\n asSemanticTokensEdits,\n asCallHierarchyItem,\n asCallHierarchyItems,\n asCallHierarchyIncomingCall,\n asCallHierarchyIncomingCalls,\n asCallHierarchyOutgoingCall,\n asCallHierarchyOutgoingCalls,\n asLinkedEditingRanges: asLinkedEditingRanges,\n asTypeHierarchyItem,\n asTypeHierarchyItems,\n asGlobPattern,\n asInlineCompletionResult,\n asInlineCompletionItem\n };\n}\nexports.createConverter = createConverter;\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateUuid = exports.parse = exports.isUUID = exports.v4 = exports.empty = void 0;\nclass ValueUUID {\n constructor(_value) {\n this._value = _value;\n // empty\n }\n asHex() {\n return this._value;\n }\n equals(other) {\n return this.asHex() === other.asHex();\n }\n}\nclass V4UUID extends ValueUUID {\n static _oneOf(array) {\n return array[Math.floor(array.length * Math.random())];\n }\n static _randomHex() {\n return V4UUID._oneOf(V4UUID._chars);\n }\n constructor() {\n super([\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n '-',\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n '-',\n '4',\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n '-',\n V4UUID._oneOf(V4UUID._timeHighBits),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n '-',\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n ].join(''));\n }\n}\nV4UUID._chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];\nV4UUID._timeHighBits = ['8', '9', 'a', 'b'];\n/**\n * An empty UUID that contains only zeros.\n */\nexports.empty = new ValueUUID('00000000-0000-0000-0000-000000000000');\nfunction v4() {\n return new V4UUID();\n}\nexports.v4 = v4;\nconst _UUIDPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\nfunction isUUID(value) {\n return _UUIDPattern.test(value);\n}\nexports.isUUID = isUUID;\n/**\n * Parses a UUID that is of the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.\n * @param value A uuid string.\n */\nfunction parse(value) {\n if (!isUUID(value)) {\n throw new Error('invalid uuid');\n }\n return new ValueUUID(value);\n}\nexports.parse = parse;\nfunction generateUuid() {\n return v4().asHex();\n}\nexports.generateUuid = generateUuid;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProgressPart = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst Is = require(\"./utils/is\");\nclass ProgressPart {\n constructor(_client, _token, done) {\n this._client = _client;\n this._token = _token;\n this._reported = 0;\n this._infinite = false;\n this._lspProgressDisposable = this._client.onProgress(vscode_languageserver_protocol_1.WorkDoneProgress.type, this._token, (value) => {\n switch (value.kind) {\n case 'begin':\n this.begin(value);\n break;\n case 'report':\n this.report(value);\n break;\n case 'end':\n this.done();\n done && done(this);\n break;\n }\n });\n }\n begin(params) {\n this._infinite = params.percentage === undefined;\n // the progress as already been marked as done / canceled. Ignore begin call\n if (this._lspProgressDisposable === undefined) {\n return;\n }\n // Since we don't use commands this will be a silent window progress with a hidden notification.\n void vscode_1.window.withProgress({ location: vscode_1.ProgressLocation.Window, cancellable: params.cancellable, title: params.title }, async (progress, cancellationToken) => {\n // the progress as already been marked as done / canceled. Ignore begin call\n if (this._lspProgressDisposable === undefined) {\n return;\n }\n this._progress = progress;\n this._cancellationToken = cancellationToken;\n this._tokenDisposable = this._cancellationToken.onCancellationRequested(() => {\n this._client.sendNotification(vscode_languageserver_protocol_1.WorkDoneProgressCancelNotification.type, { token: this._token });\n });\n this.report(params);\n return new Promise((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n });\n }\n report(params) {\n if (this._infinite && Is.string(params.message)) {\n this._progress !== undefined && this._progress.report({ message: params.message });\n }\n else if (Is.number(params.percentage)) {\n const percentage = Math.max(0, Math.min(params.percentage, 100));\n const delta = Math.max(0, percentage - this._reported);\n this._reported += delta;\n this._progress !== undefined && this._progress.report({ message: params.message, increment: delta });\n }\n }\n cancel() {\n this.cleanup();\n if (this._reject !== undefined) {\n this._reject();\n this._resolve = undefined;\n this._reject = undefined;\n }\n }\n done() {\n this.cleanup();\n if (this._resolve !== undefined) {\n this._resolve();\n this._resolve = undefined;\n this._reject = undefined;\n }\n }\n cleanup() {\n if (this._lspProgressDisposable !== undefined) {\n this._lspProgressDisposable.dispose();\n this._lspProgressDisposable = undefined;\n }\n if (this._tokenDisposable !== undefined) {\n this._tokenDisposable.dispose();\n this._tokenDisposable = undefined;\n }\n this._progress = undefined;\n this._cancellationToken = undefined;\n }\n}\nexports.ProgressPart = ProgressPart;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkspaceFeature = exports.TextDocumentLanguageFeature = exports.TextDocumentEventFeature = exports.DynamicDocumentFeature = exports.DynamicFeature = exports.StaticFeature = exports.ensure = exports.LSPCancellationError = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst Is = require(\"./utils/is\");\nconst UUID = require(\"./utils/uuid\");\nclass LSPCancellationError extends vscode_1.CancellationError {\n constructor(data) {\n super();\n this.data = data;\n }\n}\nexports.LSPCancellationError = LSPCancellationError;\nfunction ensure(target, key) {\n if (target[key] === undefined) {\n target[key] = {};\n }\n return target[key];\n}\nexports.ensure = ensure;\nvar StaticFeature;\n(function (StaticFeature) {\n function is(value) {\n const candidate = value;\n return candidate !== undefined && candidate !== null &&\n Is.func(candidate.fillClientCapabilities) && Is.func(candidate.initialize) && Is.func(candidate.getState) && Is.func(candidate.clear) &&\n (candidate.fillInitializeParams === undefined || Is.func(candidate.fillInitializeParams));\n }\n StaticFeature.is = is;\n})(StaticFeature || (exports.StaticFeature = StaticFeature = {}));\nvar DynamicFeature;\n(function (DynamicFeature) {\n function is(value) {\n const candidate = value;\n return candidate !== undefined && candidate !== null &&\n Is.func(candidate.fillClientCapabilities) && Is.func(candidate.initialize) && Is.func(candidate.getState) && Is.func(candidate.clear) &&\n (candidate.fillInitializeParams === undefined || Is.func(candidate.fillInitializeParams)) && Is.func(candidate.register) &&\n Is.func(candidate.unregister) && candidate.registrationType !== undefined;\n }\n DynamicFeature.is = is;\n})(DynamicFeature || (exports.DynamicFeature = DynamicFeature = {}));\n/**\n * An abstract dynamic feature implementation that operates on documents (e.g. text\n * documents or notebooks).\n */\nclass DynamicDocumentFeature {\n constructor(client) {\n this._client = client;\n }\n /**\n * Returns the state the feature is in.\n */\n getState() {\n const selectors = this.getDocumentSelectors();\n let count = 0;\n for (const selector of selectors) {\n count++;\n for (const document of vscode_1.workspace.textDocuments) {\n if (vscode_1.languages.match(selector, document) > 0) {\n return { kind: 'document', id: this.registrationType.method, registrations: true, matches: true };\n }\n }\n }\n const registrations = count > 0;\n return { kind: 'document', id: this.registrationType.method, registrations, matches: false };\n }\n}\nexports.DynamicDocumentFeature = DynamicDocumentFeature;\n/**\n * An abstract base class to implement features that react to events\n * emitted from text documents.\n */\nclass TextDocumentEventFeature extends DynamicDocumentFeature {\n static textDocumentFilter(selectors, textDocument) {\n for (const selector of selectors) {\n if (vscode_1.languages.match(selector, textDocument) > 0) {\n return true;\n }\n }\n return false;\n }\n constructor(client, event, type, middleware, createParams, textDocument, selectorFilter) {\n super(client);\n this._event = event;\n this._type = type;\n this._middleware = middleware;\n this._createParams = createParams;\n this._textDocument = textDocument;\n this._selectorFilter = selectorFilter;\n this._selectors = new Map();\n this._onNotificationSent = new vscode_1.EventEmitter();\n }\n getStateInfo() {\n return [this._selectors.values(), false];\n }\n getDocumentSelectors() {\n return this._selectors.values();\n }\n register(data) {\n if (!data.registerOptions.documentSelector) {\n return;\n }\n if (!this._listener) {\n this._listener = this._event((data) => {\n this.callback(data).catch((error) => {\n this._client.error(`Sending document notification ${this._type.method} failed.`, error);\n });\n });\n }\n this._selectors.set(data.id, this._client.protocol2CodeConverter.asDocumentSelector(data.registerOptions.documentSelector));\n }\n async callback(data) {\n const doSend = async (data) => {\n const params = this._createParams(data);\n await this._client.sendNotification(this._type, params);\n this.notificationSent(this.getTextDocument(data), this._type, params);\n };\n if (this.matches(data)) {\n const middleware = this._middleware();\n return middleware ? middleware(data, (data) => doSend(data)) : doSend(data);\n }\n }\n matches(data) {\n if (this._client.hasDedicatedTextSynchronizationFeature(this._textDocument(data))) {\n return false;\n }\n return !this._selectorFilter || this._selectorFilter(this._selectors.values(), data);\n }\n get onNotificationSent() {\n return this._onNotificationSent.event;\n }\n notificationSent(textDocument, type, params) {\n this._onNotificationSent.fire({ textDocument, type, params });\n }\n unregister(id) {\n this._selectors.delete(id);\n if (this._selectors.size === 0 && this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n }\n clear() {\n this._selectors.clear();\n this._onNotificationSent.dispose();\n if (this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n }\n getProvider(document) {\n for (const selector of this._selectors.values()) {\n if (vscode_1.languages.match(selector, document) > 0) {\n return {\n send: (data) => {\n return this.callback(data);\n }\n };\n }\n }\n return undefined;\n }\n}\nexports.TextDocumentEventFeature = TextDocumentEventFeature;\n/**\n * A abstract feature implementation that registers language providers\n * for text documents using a given document selector.\n */\nclass TextDocumentLanguageFeature extends DynamicDocumentFeature {\n constructor(client, registrationType) {\n super(client);\n this._registrationType = registrationType;\n this._registrations = new Map();\n }\n *getDocumentSelectors() {\n for (const registration of this._registrations.values()) {\n const selector = registration.data.registerOptions.documentSelector;\n if (selector === null) {\n continue;\n }\n yield this._client.protocol2CodeConverter.asDocumentSelector(selector);\n }\n }\n get registrationType() {\n return this._registrationType;\n }\n register(data) {\n if (!data.registerOptions.documentSelector) {\n return;\n }\n let registration = this.registerLanguageProvider(data.registerOptions, data.id);\n this._registrations.set(data.id, { disposable: registration[0], data, provider: registration[1] });\n }\n unregister(id) {\n let registration = this._registrations.get(id);\n if (registration !== undefined) {\n registration.disposable.dispose();\n }\n }\n clear() {\n this._registrations.forEach((value) => {\n value.disposable.dispose();\n });\n this._registrations.clear();\n }\n getRegistration(documentSelector, capability) {\n if (!capability) {\n return [undefined, undefined];\n }\n else if (vscode_languageserver_protocol_1.TextDocumentRegistrationOptions.is(capability)) {\n const id = vscode_languageserver_protocol_1.StaticRegistrationOptions.hasId(capability) ? capability.id : UUID.generateUuid();\n const selector = capability.documentSelector ?? documentSelector;\n if (selector) {\n return [id, Object.assign({}, capability, { documentSelector: selector })];\n }\n }\n else if (Is.boolean(capability) && capability === true || vscode_languageserver_protocol_1.WorkDoneProgressOptions.is(capability)) {\n if (!documentSelector) {\n return [undefined, undefined];\n }\n const options = (Is.boolean(capability) && capability === true ? { documentSelector } : Object.assign({}, capability, { documentSelector }));\n return [UUID.generateUuid(), options];\n }\n return [undefined, undefined];\n }\n getRegistrationOptions(documentSelector, capability) {\n if (!documentSelector || !capability) {\n return undefined;\n }\n return (Is.boolean(capability) && capability === true ? { documentSelector } : Object.assign({}, capability, { documentSelector }));\n }\n getProvider(textDocument) {\n for (const registration of this._registrations.values()) {\n let selector = registration.data.registerOptions.documentSelector;\n if (selector !== null && vscode_1.languages.match(this._client.protocol2CodeConverter.asDocumentSelector(selector), textDocument) > 0) {\n return registration.provider;\n }\n }\n return undefined;\n }\n getAllProviders() {\n const result = [];\n for (const item of this._registrations.values()) {\n result.push(item.provider);\n }\n return result;\n }\n}\nexports.TextDocumentLanguageFeature = TextDocumentLanguageFeature;\nclass WorkspaceFeature {\n constructor(client, registrationType) {\n this._client = client;\n this._registrationType = registrationType;\n this._registrations = new Map();\n }\n getState() {\n const registrations = this._registrations.size > 0;\n return { kind: 'workspace', id: this._registrationType.method, registrations };\n }\n get registrationType() {\n return this._registrationType;\n }\n register(data) {\n const registration = this.registerLanguageProvider(data.registerOptions);\n this._registrations.set(data.id, { disposable: registration[0], provider: registration[1] });\n }\n unregister(id) {\n let registration = this._registrations.get(id);\n if (registration !== undefined) {\n registration.disposable.dispose();\n }\n }\n clear() {\n this._registrations.forEach((registration) => {\n registration.disposable.dispose();\n });\n this._registrations.clear();\n }\n getProviders() {\n const result = [];\n for (const registration of this._registrations.values()) {\n result.push(registration.provider);\n }\n return result;\n }\n}\nexports.WorkspaceFeature = WorkspaceFeature;\n","const isWindows = typeof process === 'object' &&\n process &&\n process.platform === 'win32'\nmodule.exports = isWindows ? { sep: '\\\\' } : { sep: '/' }\n","'use strict';\nmodule.exports = balanced;\nfunction balanced(a, b, str) {\n if (a instanceof RegExp) a = maybeMatch(a, str);\n if (b instanceof RegExp) b = maybeMatch(b, str);\n\n var r = range(a, b, str);\n\n return r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + a.length, r[1]),\n post: str.slice(r[1] + b.length)\n };\n}\n\nfunction maybeMatch(reg, str) {\n var m = str.match(reg);\n return m ? m[0] : null;\n}\n\nbalanced.range = range;\nfunction range(a, b, str) {\n var begs, beg, left, right, result;\n var ai = str.indexOf(a);\n var bi = str.indexOf(b, ai + 1);\n var i = ai;\n\n if (ai >= 0 && bi > 0) {\n if(a===b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n\n while (i >= 0 && !result) {\n if (i == ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n } else if (begs.length == 1) {\n result = [ begs.pop(), bi ];\n } else {\n beg = begs.pop();\n if (beg < left) {\n left = beg;\n right = bi;\n }\n\n bi = str.indexOf(b, i + 1);\n }\n\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n\n if (begs.length) {\n result = [ left, right ];\n }\n }\n\n return result;\n}\n","var balanced = require('balanced-match');\n\nmodule.exports = expandTop;\n\nvar escSlash = '\\0SLASH'+Math.random()+'\\0';\nvar escOpen = '\\0OPEN'+Math.random()+'\\0';\nvar escClose = '\\0CLOSE'+Math.random()+'\\0';\nvar escComma = '\\0COMMA'+Math.random()+'\\0';\nvar escPeriod = '\\0PERIOD'+Math.random()+'\\0';\n\nfunction numeric(str) {\n return parseInt(str, 10) == str\n ? parseInt(str, 10)\n : str.charCodeAt(0);\n}\n\nfunction escapeBraces(str) {\n return str.split('\\\\\\\\').join(escSlash)\n .split('\\\\{').join(escOpen)\n .split('\\\\}').join(escClose)\n .split('\\\\,').join(escComma)\n .split('\\\\.').join(escPeriod);\n}\n\nfunction unescapeBraces(str) {\n return str.split(escSlash).join('\\\\')\n .split(escOpen).join('{')\n .split(escClose).join('}')\n .split(escComma).join(',')\n .split(escPeriod).join('.');\n}\n\n\n// Basically just str.split(\",\"), but handling cases\n// where we have nested braced sections, which should be\n// treated as individual members, like {a,{b,c},d}\nfunction parseCommaParts(str) {\n if (!str)\n return [''];\n\n var parts = [];\n var m = balanced('{', '}', str);\n\n if (!m)\n return str.split(',');\n\n var pre = m.pre;\n var body = m.body;\n var post = m.post;\n var p = pre.split(',');\n\n p[p.length-1] += '{' + body + '}';\n var postParts = parseCommaParts(post);\n if (post.length) {\n p[p.length-1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n\n parts.push.apply(parts, p);\n\n return parts;\n}\n\nfunction expandTop(str, options) {\n if (!str)\n return [];\n\n options = options || {};\n var max = options.max == null ? Infinity : options.max;\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.substr(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.substr(2);\n }\n\n return expand(escapeBraces(str), max, true).map(unescapeBraces);\n}\n\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\n\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\n\nfunction expand(str, max, isTop) {\n var expansions = [];\n\n var m = balanced('{', '}', str);\n if (!m) return [str];\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n var pre = m.pre;\n var post = m.post.length\n ? expand(m.post, max, false)\n : [''];\n\n if (/\\$$/.test(m.pre)) { \n for (var k = 0; k < post.length && k < max; k++) {\n var expansion = pre+ '{' + m.body + '}' + post[k];\n expansions.push(expansion);\n }\n } else {\n var isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n var isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n var isSequence = isNumericSequence || isAlphaSequence;\n var isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand(str, max, true);\n }\n return [str];\n }\n\n var n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n } else {\n n = parseCommaParts(m.body);\n if (n.length === 1) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand(n[0], max, false).map(embrace);\n if (n.length === 1) {\n return post.map(function(p) {\n return m.pre + n[0] + p;\n });\n }\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n var N;\n\n if (isSequence) {\n var x = numeric(n[0]);\n var y = numeric(n[1]);\n var width = Math.max(n[0].length, n[1].length)\n var incr = n.length == 3\n ? Math.max(Math.abs(numeric(n[2])), 1)\n : 1;\n var test = lte;\n var reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n var pad = n.some(isPadded);\n\n N = [];\n\n for (var i = x; test(i, y); i += incr) {\n var c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\')\n c = '';\n } else {\n c = String(i);\n if (pad) {\n var need = width - c.length;\n if (need > 0) {\n var z = new Array(need + 1).join('0');\n if (i < 0)\n c = '-' + z + c.slice(1);\n else\n c = z + c;\n }\n }\n }\n N.push(c);\n }\n } else {\n N = [];\n\n for (var j = 0; j < n.length; j++) {\n N.push.apply(N, expand(n[j], max, false));\n }\n }\n\n for (var j = 0; j < N.length; j++) {\n for (var k = 0; k < post.length && expansions.length < max; k++) {\n var expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion)\n expansions.push(expansion);\n }\n }\n }\n\n return expansions;\n}\n","const minimatch = module.exports = (p, pattern, options = {}) => {\n assertValidPattern(pattern)\n\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false\n }\n\n return new Minimatch(pattern, options).match(p)\n}\n\nmodule.exports = minimatch\n\nconst path = require('./lib/path.js')\nminimatch.sep = path.sep\n\nconst GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\nconst expand = require('brace-expansion')\n\nconst plTypes = {\n '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},\n '?': { open: '(?:', close: ')?' },\n '+': { open: '(?:', close: ')+' },\n '*': { open: '(?:', close: ')*' },\n '@': { open: '(?:', close: ')' }\n}\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\\\/|^)(?:\\\\.{1,2})($|\\\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\\\/|^)\\\\.).)*?'\n\n// \"abc\" -> { a:true, b:true, c:true }\nconst charSet = s => s.split('').reduce((set, c) => {\n set[c] = true\n return set\n}, {})\n\n// characters that need to be escaped in RegExp.\nconst reSpecials = charSet('().*{}+?[]^$\\\\!')\n\n// characters that indicate we have to add the pattern start\nconst addPatternStartSet = charSet('[.(')\n\n// normalizes slashes.\nconst slashSplit = /\\/+/\n\nminimatch.filter = (pattern, options = {}) =>\n (p, i, list) => minimatch(p, pattern, options)\n\nconst ext = (a, b = {}) => {\n const t = {}\n Object.keys(a).forEach(k => t[k] = a[k])\n Object.keys(b).forEach(k => t[k] = b[k])\n return t\n}\n\nminimatch.defaults = def => {\n if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n return minimatch\n }\n\n const orig = minimatch\n\n const m = (p, pattern, options) => orig(p, pattern, ext(def, options))\n m.Minimatch = class Minimatch extends orig.Minimatch {\n constructor (pattern, options) {\n super(pattern, ext(def, options))\n }\n }\n m.Minimatch.defaults = options => orig.defaults(ext(def, options)).Minimatch\n m.filter = (pattern, options) => orig.filter(pattern, ext(def, options))\n m.defaults = options => orig.defaults(ext(def, options))\n m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options))\n m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options))\n m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options))\n\n return m\n}\n\n\n\n\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nminimatch.braceExpand = (pattern, options) => braceExpand(pattern, options)\n\nconst braceExpand = (pattern, options = {}) => {\n assertValidPattern(pattern)\n\n // Thanks to Yeting Li for\n // improving this regexp to avoid a ReDOS vulnerability.\n if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n // shortcut. no need to expand.\n return [pattern]\n }\n\n return expand(pattern)\n}\n\nconst MAX_PATTERN_LENGTH = 1024 * 64\nconst assertValidPattern = pattern => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nconst SUBPARSE = Symbol('subparse')\n\nminimatch.makeRe = (pattern, options) =>\n new Minimatch(pattern, options || {}).makeRe()\n\nminimatch.match = (list, pattern, options = {}) => {\n const mm = new Minimatch(pattern, options)\n list = list.filter(f => mm.match(f))\n if (mm.options.nonull && !list.length) {\n list.push(pattern)\n }\n return list\n}\n\n// replace stuff like \\* with *\nconst globUnescape = s => s.replace(/\\\\(.)/g, '$1')\nconst charUnescape = s => s.replace(/\\\\([^-\\]])/g, '$1')\nconst regExpEscape = s => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\nconst braExpEscape = s => s.replace(/[[\\]\\\\]/g, '\\\\$&')\n\nclass Minimatch {\n constructor (pattern, options) {\n assertValidPattern(pattern)\n\n if (!options) options = {}\n\n this.options = options\n this.maxGlobstarRecursion = options.maxGlobstarRecursion !== undefined\n ? options.maxGlobstarRecursion : 200\n this.set = []\n this.pattern = pattern\n this.windowsPathsNoEscape = !!options.windowsPathsNoEscape ||\n options.allowWindowsEscape === false\n if (this.windowsPathsNoEscape) {\n this.pattern = this.pattern.replace(/\\\\/g, '/')\n }\n this.regexp = null\n this.negate = false\n this.comment = false\n this.empty = false\n this.partial = !!options.partial\n\n // make the set of regexps etc.\n this.make()\n }\n\n debug () {}\n\n make () {\n const pattern = this.pattern\n const options = this.options\n\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true\n return\n }\n if (!pattern) {\n this.empty = true\n return\n }\n\n // step 1: figure out negation, etc.\n this.parseNegate()\n\n // step 2: expand braces\n let set = this.globSet = this.braceExpand()\n\n if (options.debug) this.debug = (...args) => console.error(...args)\n\n this.debug(this.pattern, set)\n\n // step 3: now we have a set, so turn each one into a series of path-portion\n // matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n set = this.globParts = set.map(s => s.split(slashSplit))\n\n this.debug(this.pattern, set)\n\n // glob --> regexps\n set = set.map((s, si, set) => s.map(this.parse, this))\n\n this.debug(this.pattern, set)\n\n // filter out everything that didn't compile properly.\n set = set.filter(s => s.indexOf(false) === -1)\n\n this.debug(this.pattern, set)\n\n this.set = set\n }\n\n parseNegate () {\n if (this.options.nonegate) return\n\n const pattern = this.pattern\n let negate = false\n let negateOffset = 0\n\n for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n negate = !negate\n negateOffset++\n }\n\n if (negateOffset) this.pattern = pattern.slice(negateOffset)\n this.negate = negate\n }\n\n // set partial to true to test if, for example,\n // \"/a/b\" matches the start of \"/*/b/*/d\"\n // Partial means, if you run out of file before you run\n // out of pattern, then that's fine, as long as all\n // the parts match.\n matchOne (file, pattern, partial) {\n if (pattern.indexOf(GLOBSTAR) !== -1) {\n return this._matchGlobstar(file, pattern, partial, 0, 0)\n }\n return this._matchOne(file, pattern, partial, 0, 0)\n }\n\n _matchGlobstar (file, pattern, partial, fileIndex, patternIndex) {\n // find first globstar from patternIndex\n let firstgs = -1\n for (let i = patternIndex; i < pattern.length; i++) {\n if (pattern[i] === GLOBSTAR) { firstgs = i; break }\n }\n\n // find last globstar\n let lastgs = -1\n for (let i = pattern.length - 1; i >= 0; i--) {\n if (pattern[i] === GLOBSTAR) { lastgs = i; break }\n }\n\n const head = pattern.slice(patternIndex, firstgs)\n const body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs)\n const tail = partial ? [] : pattern.slice(lastgs + 1)\n\n // check the head\n if (head.length) {\n const fileHead = file.slice(fileIndex, fileIndex + head.length)\n if (!this._matchOne(fileHead, head, partial, 0, 0)) {\n return false\n }\n fileIndex += head.length\n }\n\n // check the tail\n let fileTailMatch = 0\n if (tail.length) {\n if (tail.length + fileIndex > file.length) return false\n\n const tailStart = file.length - tail.length\n if (this._matchOne(file, tail, partial, tailStart, 0)) {\n fileTailMatch = tail.length\n } else {\n // affordance for stuff like a/**/* matching a/b/\n if (file[file.length - 1] !== '' ||\n fileIndex + tail.length === file.length) {\n return false\n }\n if (!this._matchOne(file, tail, partial, tailStart - 1, 0)) {\n return false\n }\n fileTailMatch = tail.length + 1\n }\n }\n\n // if body is empty (single ** between head and tail)\n if (!body.length) {\n let sawSome = !!fileTailMatch\n for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n const f = String(file[i])\n sawSome = true\n if (f === '.' || f === '..' ||\n (!this.options.dot && f.charAt(0) === '.')) {\n return false\n }\n }\n return partial || sawSome\n }\n\n // split body into segments at each GLOBSTAR\n const bodySegments = [[[], 0]]\n let currentBody = bodySegments[0]\n let nonGsParts = 0\n const nonGsPartsSums = [0]\n for (const b of body) {\n if (b === GLOBSTAR) {\n nonGsPartsSums.push(nonGsParts)\n currentBody = [[], 0]\n bodySegments.push(currentBody)\n } else {\n currentBody[0].push(b)\n nonGsParts++\n }\n }\n\n let idx = bodySegments.length - 1\n const fileLength = file.length - fileTailMatch\n for (const b of bodySegments) {\n b[1] = fileLength - (nonGsPartsSums[idx--] + b[0].length)\n }\n\n return !!this._matchGlobStarBodySections(\n file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch\n )\n }\n\n // return false for \"nope, not matching\"\n // return null for \"not matching, cannot keep trying\"\n _matchGlobStarBodySections (\n file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail\n ) {\n const bs = bodySegments[bodyIndex]\n if (!bs) {\n // just make sure there are no bad dots\n for (let i = fileIndex; i < file.length; i++) {\n sawTail = true\n const f = file[i]\n if (f === '.' || f === '..' ||\n (!this.options.dot && f.charAt(0) === '.')) {\n return false\n }\n }\n return sawTail\n }\n\n const [body, after] = bs\n while (fileIndex <= after) {\n const m = this._matchOne(\n file.slice(0, fileIndex + body.length),\n body,\n partial,\n fileIndex,\n 0\n )\n // if limit exceeded, no match. intentional false negative,\n // acceptable break in correctness for security.\n if (m && globStarDepth < this.maxGlobstarRecursion) {\n const sub = this._matchGlobStarBodySections(\n file, bodySegments,\n fileIndex + body.length, bodyIndex + 1,\n partial, globStarDepth + 1, sawTail\n )\n if (sub !== false) {\n return sub\n }\n }\n const f = file[fileIndex]\n if (f === '.' || f === '..' ||\n (!this.options.dot && f.charAt(0) === '.')) {\n return false\n }\n fileIndex++\n }\n return partial || null\n }\n\n _matchOne (file, pattern, partial, fileIndex, patternIndex) {\n let fi, pi, fl, pl\n for (\n fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length\n ; (fi < fl) && (pi < pl)\n ; fi++, pi++\n ) {\n this.debug('matchOne loop')\n const p = pattern[pi]\n const f = file[fi]\n\n this.debug(pattern, p, f)\n\n // should be impossible.\n // some invalid regexp stuff in the set.\n /* istanbul ignore if */\n if (p === false || p === GLOBSTAR) return false\n\n // something other than **\n // non-magic patterns just have to match exactly\n // patterns with magic have been turned into regexps.\n let hit\n if (typeof p === 'string') {\n hit = f === p\n this.debug('string match', p, f, hit)\n } else {\n hit = f.match(p)\n this.debug('pattern match', p, f, hit)\n }\n\n if (!hit) return false\n }\n\n // now either we fell off the end of the pattern, or we're done.\n if (fi === fl && pi === pl) {\n // ran out of pattern and filename at the same time.\n // an exact hit!\n return true\n } else if (fi === fl) {\n // ran out of file, but still had pattern left.\n // this is ok if we're doing the match as part of\n // a glob fs traversal.\n return partial\n } else /* istanbul ignore else */ if (pi === pl) {\n // ran out of pattern, still have file left.\n // this is only acceptable if we're on the very last\n // empty segment of a file with a trailing slash.\n // a/* should match a/b/\n return (fi === fl - 1) && (file[fi] === '')\n }\n\n // should be unreachable.\n /* istanbul ignore next */\n throw new Error('wtf?')\n }\n\n braceExpand () {\n return braceExpand(this.pattern, this.options)\n }\n\n parse (pattern, isSub) {\n assertValidPattern(pattern)\n\n const options = this.options\n\n // shortcuts\n if (pattern === '**') {\n if (!options.noglobstar)\n return GLOBSTAR\n else\n pattern = '*'\n }\n if (pattern === '') return ''\n\n let re = ''\n let hasMagic = false\n let escaping = false\n // ? => one single character\n const patternListStack = []\n const negativeLists = []\n let stateChar\n let inClass = false\n let reClassStart = -1\n let classStart = -1\n let cs\n let pl\n let sp\n // . and .. never match anything that doesn't start with .,\n // even when options.dot is set. However, if the pattern\n // starts with ., then traversal patterns can match.\n let dotTravAllowed = pattern.charAt(0) === '.'\n let dotFileAllowed = options.dot || dotTravAllowed\n const patternStart = () =>\n dotTravAllowed\n ? ''\n : dotFileAllowed\n ? '(?!(?:^|\\\\/)\\\\.{1,2}(?:$|\\\\/))'\n : '(?!\\\\.)'\n const subPatternStart = (p) =>\n p.charAt(0) === '.'\n ? ''\n : options.dot\n ? '(?!(?:^|\\\\/)\\\\.{1,2}(?:$|\\\\/))'\n : '(?!\\\\.)'\n\n\n const clearStateChar = () => {\n if (stateChar) {\n // we had some state-tracking character\n // that wasn't consumed by this pass.\n switch (stateChar) {\n case '*':\n re += star\n hasMagic = true\n break\n case '?':\n re += qmark\n hasMagic = true\n break\n default:\n re += '\\\\' + stateChar\n break\n }\n this.debug('clearStateChar %j %j', stateChar, re)\n stateChar = false\n }\n }\n\n for (let i = 0, c; (i < pattern.length) && (c = pattern.charAt(i)); i++) {\n this.debug('%s\\t%s %s %j', pattern, i, re, c)\n\n // skip over any that are escaped.\n if (escaping) {\n /* istanbul ignore next - completely not allowed, even escaped. */\n if (c === '/') {\n return false\n }\n\n if (reSpecials[c]) {\n re += '\\\\'\n }\n re += c\n escaping = false\n continue\n }\n\n switch (c) {\n /* istanbul ignore next */\n case '/': {\n // Should already be path-split by now.\n return false\n }\n\n case '\\\\':\n if (inClass && pattern.charAt(i + 1) === '-') {\n re += c\n continue\n }\n\n clearStateChar()\n escaping = true\n continue\n\n // the various stateChar values\n // for the \"extglob\" stuff.\n case '?':\n case '*':\n case '+':\n case '@':\n case '!':\n this.debug('%s\\t%s %s %j <-- stateChar', pattern, i, re, c)\n\n // all of those are literals inside a class, except that\n // the glob [!a] means [^a] in regexp\n if (inClass) {\n this.debug(' in class')\n if (c === '!' && i === classStart + 1) c = '^'\n re += c\n continue\n }\n\n // coalesce consecutive non-globstar * characters\n if (c === '*' && stateChar === '*') continue\n\n // if we already have a stateChar, then it means\n // that there was something like ** or +? in there.\n // Handle the stateChar, then proceed with this one.\n this.debug('call clearStateChar %j', stateChar)\n clearStateChar()\n stateChar = c\n // if extglob is disabled, then +(asdf|foo) isn't a thing.\n // just clear the statechar *now*, rather than even diving into\n // the patternList stuff.\n if (options.noext) clearStateChar()\n continue\n\n case '(': {\n if (inClass) {\n re += '('\n continue\n }\n\n if (!stateChar) {\n re += '\\\\('\n continue\n }\n\n const plEntry = {\n type: stateChar,\n start: i - 1,\n reStart: re.length,\n open: plTypes[stateChar].open,\n close: plTypes[stateChar].close,\n }\n this.debug(this.pattern, '\\t', plEntry)\n patternListStack.push(plEntry)\n // negation is (?:(?!(?:js)(?:))[^/]*)\n re += plEntry.open\n // next entry starts with a dot maybe?\n if (plEntry.start === 0 && plEntry.type !== '!') {\n dotTravAllowed = true\n re += subPatternStart(pattern.slice(i + 1))\n }\n this.debug('plType %j %j', stateChar, re)\n stateChar = false\n continue\n }\n\n case ')': {\n const plEntry = patternListStack[patternListStack.length - 1]\n if (inClass || !plEntry) {\n re += '\\\\)'\n continue\n }\n patternListStack.pop()\n\n // closing an extglob\n clearStateChar()\n hasMagic = true\n pl = plEntry\n // negation is (?:(?!js)[^/]*)\n // The others are (?:)\n re += pl.close\n if (pl.type === '!') {\n negativeLists.push(Object.assign(pl, { reEnd: re.length }))\n }\n continue\n }\n\n case '|': {\n const plEntry = patternListStack[patternListStack.length - 1]\n if (inClass || !plEntry) {\n re += '\\\\|'\n continue\n }\n\n clearStateChar()\n re += '|'\n // next subpattern can start with a dot?\n if (plEntry.start === 0 && plEntry.type !== '!') {\n dotTravAllowed = true\n re += subPatternStart(pattern.slice(i + 1))\n }\n continue\n }\n\n // these are mostly the same in regexp and glob\n case '[':\n // swallow any state-tracking char before the [\n clearStateChar()\n\n if (inClass) {\n re += '\\\\' + c\n continue\n }\n\n inClass = true\n classStart = i\n reClassStart = re.length\n re += c\n continue\n\n case ']':\n // a right bracket shall lose its special\n // meaning and represent itself in\n // a bracket expression if it occurs\n // first in the list. -- POSIX.2 2.8.3.2\n if (i === classStart + 1 || !inClass) {\n re += '\\\\' + c\n continue\n }\n\n // split where the last [ was, make sure we don't have\n // an invalid re. if so, re-walk the contents of the\n // would-be class to re-translate any characters that\n // were passed through as-is\n // TODO: It would probably be faster to determine this\n // without a try/catch and a new RegExp, but it's tricky\n // to do safely. For now, this is safe and works.\n cs = pattern.substring(classStart + 1, i)\n try {\n RegExp('[' + braExpEscape(charUnescape(cs)) + ']')\n // looks good, finish up the class.\n re += c\n } catch (er) {\n // out of order ranges in JS are errors, but in glob syntax,\n // they're just a range that matches nothing.\n re = re.substring(0, reClassStart) + '(?:$.)' // match nothing ever\n }\n hasMagic = true\n inClass = false\n continue\n\n default:\n // swallow any state char that wasn't consumed\n clearStateChar()\n\n if (reSpecials[c] && !(c === '^' && inClass)) {\n re += '\\\\'\n }\n\n re += c\n break\n\n } // switch\n } // for\n\n // handle the case where we left a class open.\n // \"[abc\" is valid, equivalent to \"\\[abc\"\n if (inClass) {\n // split where the last [ was, and escape it\n // this is a huge pita. We now have to re-walk\n // the contents of the would-be class to re-translate\n // any characters that were passed through as-is\n cs = pattern.slice(classStart + 1)\n sp = this.parse(cs, SUBPARSE)\n re = re.substring(0, reClassStart) + '\\\\[' + sp[0]\n hasMagic = hasMagic || sp[1]\n }\n\n // handle the case where we had a +( thing at the *end*\n // of the pattern.\n // each pattern list stack adds 3 chars, and we need to go through\n // and escape any | chars that were passed through as-is for the regexp.\n // Go through and escape them, taking care not to double-escape any\n // | chars that were already escaped.\n for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {\n let tail\n tail = re.slice(pl.reStart + pl.open.length)\n this.debug('setting tail', re, pl)\n // maybe some even number of \\, then maybe 1 \\, followed by a |\n tail = tail.replace(/((?:\\\\{2}){0,64})(\\\\?)\\|/g, (_, $1, $2) => {\n /* istanbul ignore else - should already be done */\n if (!$2) {\n // the | isn't already escaped, so escape it.\n $2 = '\\\\'\n }\n\n // need to escape all those slashes *again*, without escaping the\n // one that we need for escaping the | character. As it works out,\n // escaping an even number of slashes can be done by simply repeating\n // it exactly after itself. That's why this trick works.\n //\n // I am sorry that you have to see this.\n return $1 + $1 + $2 + '|'\n })\n\n this.debug('tail=%j\\n %s', tail, tail, pl, re)\n const t = pl.type === '*' ? star\n : pl.type === '?' ? qmark\n : '\\\\' + pl.type\n\n hasMagic = true\n re = re.slice(0, pl.reStart) + t + '\\\\(' + tail\n }\n\n // handle trailing things that only matter at the very end.\n clearStateChar()\n if (escaping) {\n // trailing \\\\\n re += '\\\\\\\\'\n }\n\n // only need to apply the nodot start if the re starts with\n // something that could conceivably capture a dot\n const addPatternStart = addPatternStartSet[re.charAt(0)]\n\n // Hack to work around lack of negative lookbehind in JS\n // A pattern like: *.!(x).!(y|z) needs to ensure that a name\n // like 'a.xyz.yz' doesn't match. So, the first negative\n // lookahead, has to look ALL the way ahead, to the end of\n // the pattern.\n for (let n = negativeLists.length - 1; n > -1; n--) {\n const nl = negativeLists[n]\n\n const nlBefore = re.slice(0, nl.reStart)\n const nlFirst = re.slice(nl.reStart, nl.reEnd - 8)\n let nlAfter = re.slice(nl.reEnd)\n const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter\n\n // Handle nested stuff like *(*.js|!(*.json)), where open parens\n // mean that we should *not* include the ) in the bit that is considered\n // \"after\" the negated section.\n const closeParensBefore = nlBefore.split(')').length\n const openParensBefore = nlBefore.split('(').length - closeParensBefore\n let cleanAfter = nlAfter\n for (let i = 0; i < openParensBefore; i++) {\n cleanAfter = cleanAfter.replace(/\\)[+*?]?/, '')\n }\n nlAfter = cleanAfter\n\n const dollar = nlAfter === '' && isSub !== SUBPARSE ? '(?:$|\\\\/)' : ''\n\n re = nlBefore + nlFirst + nlAfter + dollar + nlLast\n }\n\n // if the re is not \"\" at this point, then we need to make sure\n // it doesn't match against an empty path part.\n // Otherwise a/* will match a/, which it should not.\n if (re !== '' && hasMagic) {\n re = '(?=.)' + re\n }\n\n if (addPatternStart) {\n re = patternStart() + re\n }\n\n // parsing just a piece of a larger pattern.\n if (isSub === SUBPARSE) {\n return [re, hasMagic]\n }\n\n // if it's nocase, and the lcase/uppercase don't match, it's magic\n if (options.nocase && !hasMagic) {\n hasMagic = pattern.toUpperCase() !== pattern.toLowerCase()\n }\n\n // skip the regexp for non-magical patterns\n // unescape anything in it, though, so that it'll be\n // an exact match against a file etc.\n if (!hasMagic) {\n return globUnescape(pattern)\n }\n\n const flags = options.nocase ? 'i' : ''\n try {\n return Object.assign(new RegExp('^' + re + '$', flags), {\n _glob: pattern,\n _src: re,\n })\n } catch (er) /* istanbul ignore next - should be impossible */ {\n // If it was an invalid regular expression, then it can't match\n // anything. This trick looks for a character after the end of\n // the string, which is of course impossible, except in multi-line\n // mode, but it's not a /m regex.\n return new RegExp('$.')\n }\n }\n\n makeRe () {\n if (this.regexp || this.regexp === false) return this.regexp\n\n // at this point, this.set is a 2d array of partial\n // pattern strings, or \"**\".\n //\n // It's better to use .match(). This function shouldn't\n // be used, really, but it's pretty convenient sometimes,\n // when you just want to work with a regex.\n const set = this.set\n\n if (!set.length) {\n this.regexp = false\n return this.regexp\n }\n const options = this.options\n\n const twoStar = options.noglobstar ? star\n : options.dot ? twoStarDot\n : twoStarNoDot\n const flags = options.nocase ? 'i' : ''\n\n // coalesce globstars and regexpify non-globstar patterns\n // if it's the only item, then we just do one twoStar\n // if it's the first, and there are more, prepend (\\/|twoStar\\/)? to next\n // if it's the last, append (\\/twoStar|) to previous\n // if it's in the middle, append (\\/|\\/twoStar\\/) to previous\n // then filter out GLOBSTAR symbols\n let re = set.map(pattern => {\n pattern = pattern.map(p =>\n typeof p === 'string' ? regExpEscape(p)\n : p === GLOBSTAR ? GLOBSTAR\n : p._src\n ).reduce((set, p) => {\n if (!(set[set.length - 1] === GLOBSTAR && p === GLOBSTAR)) {\n set.push(p)\n }\n return set\n }, [])\n pattern.forEach((p, i) => {\n if (p !== GLOBSTAR || pattern[i-1] === GLOBSTAR) {\n return\n }\n if (i === 0) {\n if (pattern.length > 1) {\n pattern[i+1] = '(?:\\\\\\/|' + twoStar + '\\\\\\/)?' + pattern[i+1]\n } else {\n pattern[i] = twoStar\n }\n } else if (i === pattern.length - 1) {\n pattern[i-1] += '(?:\\\\\\/|' + twoStar + ')?'\n } else {\n pattern[i-1] += '(?:\\\\\\/|\\\\\\/' + twoStar + '\\\\\\/)' + pattern[i+1]\n pattern[i+1] = GLOBSTAR\n }\n })\n return pattern.filter(p => p !== GLOBSTAR).join('/')\n }).join('|')\n\n // must match entire pattern\n // ending in a * or ** will make it less strict.\n re = '^(?:' + re + ')$'\n\n // can match anything, as long as it's not this.\n if (this.negate) re = '^(?!' + re + ').*$'\n\n try {\n this.regexp = new RegExp(re, flags)\n } catch (ex) /* istanbul ignore next - should be impossible */ {\n this.regexp = false\n }\n return this.regexp\n }\n\n match (f, partial = this.partial) {\n this.debug('match', f, this.pattern)\n // short-circuit in the case of busted things.\n // comments, etc.\n if (this.comment) return false\n if (this.empty) return f === ''\n\n if (f === '/' && partial) return true\n\n const options = this.options\n\n // windows: need to use /, not \\\n if (path.sep !== '/') {\n f = f.split(path.sep).join('/')\n }\n\n // treat the test path as a set of pathparts.\n f = f.split(slashSplit)\n this.debug(this.pattern, 'split', f)\n\n // just ONE of the pattern sets in this.set needs to match\n // in order for it to be valid. If negating, then just one\n // match means that we have failed.\n // Either way, return on the first hit.\n\n const set = this.set\n this.debug(this.pattern, 'set', set)\n\n // Find the basename of the path by looking for the last non-empty segment\n let filename\n for (let i = f.length - 1; i >= 0; i--) {\n filename = f[i]\n if (filename) break\n }\n\n for (let i = 0; i < set.length; i++) {\n const pattern = set[i]\n let file = f\n if (options.matchBase && pattern.length === 1) {\n file = [filename]\n }\n const hit = this.matchOne(file, pattern, partial)\n if (hit) {\n if (options.flipNegate) return true\n return !this.negate\n }\n }\n\n // didn't get any hits. this is success if it's a negative\n // pattern, failure otherwise.\n if (options.flipNegate) return false\n return this.negate\n }\n\n static defaults (def) {\n return minimatch.defaults(def).Minimatch\n }\n}\n\nminimatch.Minimatch = Minimatch\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagnosticFeature = exports.DiagnosticPullMode = exports.vsdiag = void 0;\nconst minimatch = require(\"minimatch\");\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst uuid_1 = require(\"./utils/uuid\");\nconst features_1 = require(\"./features\");\nfunction ensure(target, key) {\n if (target[key] === void 0) {\n target[key] = {};\n }\n return target[key];\n}\nvar vsdiag;\n(function (vsdiag) {\n let DocumentDiagnosticReportKind;\n (function (DocumentDiagnosticReportKind) {\n DocumentDiagnosticReportKind[\"full\"] = \"full\";\n DocumentDiagnosticReportKind[\"unChanged\"] = \"unChanged\";\n })(DocumentDiagnosticReportKind = vsdiag.DocumentDiagnosticReportKind || (vsdiag.DocumentDiagnosticReportKind = {}));\n})(vsdiag || (exports.vsdiag = vsdiag = {}));\nvar DiagnosticPullMode;\n(function (DiagnosticPullMode) {\n DiagnosticPullMode[\"onType\"] = \"onType\";\n DiagnosticPullMode[\"onSave\"] = \"onSave\";\n})(DiagnosticPullMode || (exports.DiagnosticPullMode = DiagnosticPullMode = {}));\nvar RequestStateKind;\n(function (RequestStateKind) {\n RequestStateKind[\"active\"] = \"open\";\n RequestStateKind[\"reschedule\"] = \"reschedule\";\n RequestStateKind[\"outDated\"] = \"drop\";\n})(RequestStateKind || (RequestStateKind = {}));\n/**\n * Manages the open tabs. We don't directly use the tab API since for\n * diagnostics we need to de-dupe tabs that show the same resources since\n * we pull on the model not the UI.\n */\nclass Tabs {\n constructor() {\n this.open = new Set();\n this._onOpen = new vscode_1.EventEmitter();\n this._onClose = new vscode_1.EventEmitter();\n Tabs.fillTabResources(this.open);\n const openTabsHandler = (event) => {\n if (event.closed.length === 0 && event.opened.length === 0) {\n return;\n }\n const oldTabs = this.open;\n const currentTabs = new Set();\n Tabs.fillTabResources(currentTabs);\n const closed = new Set();\n const opened = new Set(currentTabs);\n for (const tab of oldTabs.values()) {\n if (currentTabs.has(tab)) {\n opened.delete(tab);\n }\n else {\n closed.add(tab);\n }\n }\n this.open = currentTabs;\n if (closed.size > 0) {\n const toFire = new Set();\n for (const item of closed) {\n toFire.add(vscode_1.Uri.parse(item));\n }\n this._onClose.fire(toFire);\n }\n if (opened.size > 0) {\n const toFire = new Set();\n for (const item of opened) {\n toFire.add(vscode_1.Uri.parse(item));\n }\n this._onOpen.fire(toFire);\n }\n };\n if (vscode_1.window.tabGroups.onDidChangeTabs !== undefined) {\n this.disposable = vscode_1.window.tabGroups.onDidChangeTabs(openTabsHandler);\n }\n else {\n this.disposable = { dispose: () => { } };\n }\n }\n get onClose() {\n return this._onClose.event;\n }\n get onOpen() {\n return this._onOpen.event;\n }\n dispose() {\n this.disposable.dispose();\n }\n isActive(document) {\n return document instanceof vscode_1.Uri\n ? vscode_1.window.activeTextEditor?.document.uri === document\n : vscode_1.window.activeTextEditor?.document === document;\n }\n isVisible(document) {\n const uri = document instanceof vscode_1.Uri ? document : document.uri;\n return this.open.has(uri.toString());\n }\n getTabResources() {\n const result = new Set();\n Tabs.fillTabResources(new Set(), result);\n return result;\n }\n static fillTabResources(strings, uris) {\n const seen = strings ?? new Set();\n for (const group of vscode_1.window.tabGroups.all) {\n for (const tab of group.tabs) {\n const input = tab.input;\n let uri;\n if (input instanceof vscode_1.TabInputText) {\n uri = input.uri;\n }\n else if (input instanceof vscode_1.TabInputTextDiff) {\n uri = input.modified;\n }\n else if (input instanceof vscode_1.TabInputCustom) {\n uri = input.uri;\n }\n if (uri !== undefined && !seen.has(uri.toString())) {\n seen.add(uri.toString());\n uris !== undefined && uris.add(uri);\n }\n }\n }\n }\n}\nvar PullState;\n(function (PullState) {\n PullState[PullState[\"document\"] = 1] = \"document\";\n PullState[PullState[\"workspace\"] = 2] = \"workspace\";\n})(PullState || (PullState = {}));\nvar DocumentOrUri;\n(function (DocumentOrUri) {\n function asKey(document) {\n return document instanceof vscode_1.Uri ? document.toString() : document.uri.toString();\n }\n DocumentOrUri.asKey = asKey;\n})(DocumentOrUri || (DocumentOrUri = {}));\nclass DocumentPullStateTracker {\n constructor() {\n this.documentPullStates = new Map();\n this.workspacePullStates = new Map();\n }\n track(kind, document, arg1) {\n const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;\n const [key, uri, version] = document instanceof vscode_1.Uri\n ? [document.toString(), document, arg1]\n : [document.uri.toString(), document.uri, document.version];\n let state = states.get(key);\n if (state === undefined) {\n state = { document: uri, pulledVersion: version, resultId: undefined };\n states.set(key, state);\n }\n return state;\n }\n update(kind, document, arg1, arg2) {\n const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;\n const [key, uri, version, resultId] = document instanceof vscode_1.Uri\n ? [document.toString(), document, arg1, arg2]\n : [document.uri.toString(), document.uri, document.version, arg1];\n let state = states.get(key);\n if (state === undefined) {\n state = { document: uri, pulledVersion: version, resultId };\n states.set(key, state);\n }\n else {\n state.pulledVersion = version;\n state.resultId = resultId;\n }\n }\n unTrack(kind, document) {\n const key = DocumentOrUri.asKey(document);\n const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;\n states.delete(key);\n }\n tracks(kind, document) {\n const key = DocumentOrUri.asKey(document);\n const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;\n return states.has(key);\n }\n getResultId(kind, document) {\n const key = DocumentOrUri.asKey(document);\n const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;\n return states.get(key)?.resultId;\n }\n getAllResultIds() {\n const result = [];\n for (let [uri, value] of this.workspacePullStates) {\n if (this.documentPullStates.has(uri)) {\n value = this.documentPullStates.get(uri);\n }\n if (value.resultId !== undefined) {\n result.push({ uri, value: value.resultId });\n }\n }\n return result;\n }\n}\nclass DiagnosticRequestor {\n constructor(client, tabs, options) {\n this.client = client;\n this.tabs = tabs;\n this.options = options;\n this.isDisposed = false;\n this.onDidChangeDiagnosticsEmitter = new vscode_1.EventEmitter();\n this.provider = this.createProvider();\n this.diagnostics = vscode_1.languages.createDiagnosticCollection(options.identifier);\n this.openRequests = new Map();\n this.documentStates = new DocumentPullStateTracker();\n this.workspaceErrorCounter = 0;\n }\n knows(kind, document) {\n const uri = document instanceof vscode_1.Uri ? document : document.uri;\n return this.documentStates.tracks(kind, document) || this.openRequests.has(uri.toString());\n }\n forget(kind, document) {\n this.documentStates.unTrack(kind, document);\n }\n pull(document, cb) {\n if (this.isDisposed) {\n return;\n }\n const uri = document instanceof vscode_1.Uri ? document : document.uri;\n this.pullAsync(document).then(() => {\n if (cb) {\n cb();\n }\n }, (error) => {\n this.client.error(`Document pull failed for text document ${uri.toString()}`, error, false);\n });\n }\n async pullAsync(document, version) {\n if (this.isDisposed) {\n return;\n }\n const isUri = document instanceof vscode_1.Uri;\n const uri = isUri ? document : document.uri;\n const key = uri.toString();\n version = isUri ? version : document.version;\n const currentRequestState = this.openRequests.get(key);\n const documentState = isUri\n ? this.documentStates.track(PullState.document, document, version)\n : this.documentStates.track(PullState.document, document);\n if (currentRequestState === undefined) {\n const tokenSource = new vscode_1.CancellationTokenSource();\n this.openRequests.set(key, { state: RequestStateKind.active, document: document, version: version, tokenSource });\n let report;\n let afterState;\n try {\n report = await this.provider.provideDiagnostics(document, documentState.resultId, tokenSource.token) ?? { kind: vsdiag.DocumentDiagnosticReportKind.full, items: [] };\n }\n catch (error) {\n if (error instanceof features_1.LSPCancellationError && vscode_languageserver_protocol_1.DiagnosticServerCancellationData.is(error.data) && error.data.retriggerRequest === false) {\n afterState = { state: RequestStateKind.outDated, document };\n }\n if (afterState === undefined && error instanceof vscode_1.CancellationError) {\n afterState = { state: RequestStateKind.reschedule, document };\n }\n else {\n throw error;\n }\n }\n afterState = afterState ?? this.openRequests.get(key);\n if (afterState === undefined) {\n // This shouldn't happen. Log it\n this.client.error(`Lost request state in diagnostic pull model. Clearing diagnostics for ${key}`);\n this.diagnostics.delete(uri);\n return;\n }\n this.openRequests.delete(key);\n if (!this.tabs.isVisible(document)) {\n this.documentStates.unTrack(PullState.document, document);\n return;\n }\n if (afterState.state === RequestStateKind.outDated) {\n return;\n }\n // report is only undefined if the request has thrown.\n if (report !== undefined) {\n if (report.kind === vsdiag.DocumentDiagnosticReportKind.full) {\n this.diagnostics.set(uri, report.items);\n }\n documentState.pulledVersion = version;\n documentState.resultId = report.resultId;\n }\n if (afterState.state === RequestStateKind.reschedule) {\n this.pull(document);\n }\n }\n else {\n if (currentRequestState.state === RequestStateKind.active) {\n // Cancel the current request and reschedule a new one when the old one returned.\n currentRequestState.tokenSource.cancel();\n this.openRequests.set(key, { state: RequestStateKind.reschedule, document: currentRequestState.document });\n }\n else if (currentRequestState.state === RequestStateKind.outDated) {\n this.openRequests.set(key, { state: RequestStateKind.reschedule, document: currentRequestState.document });\n }\n }\n }\n forgetDocument(document) {\n const uri = document instanceof vscode_1.Uri ? document : document.uri;\n const key = uri.toString();\n const request = this.openRequests.get(key);\n if (this.options.workspaceDiagnostics) {\n // If we run workspace diagnostic pull a last time for the diagnostics\n // and the rely on getting them from the workspace result.\n if (request !== undefined) {\n this.openRequests.set(key, { state: RequestStateKind.reschedule, document: document });\n }\n else {\n this.pull(document, () => {\n this.forget(PullState.document, document);\n });\n }\n }\n else {\n // We have normal pull or inter file dependencies. In this case we\n // clear the diagnostics (to have the same start as after startup).\n // We also cancel outstanding requests.\n if (request !== undefined) {\n if (request.state === RequestStateKind.active) {\n request.tokenSource.cancel();\n }\n this.openRequests.set(key, { state: RequestStateKind.outDated, document: document });\n }\n this.diagnostics.delete(uri);\n this.forget(PullState.document, document);\n }\n }\n pullWorkspace() {\n if (this.isDisposed) {\n return;\n }\n this.pullWorkspaceAsync().then(() => {\n this.workspaceTimeout = (0, vscode_languageserver_protocol_1.RAL)().timer.setTimeout(() => {\n this.pullWorkspace();\n }, 2000);\n }, (error) => {\n if (!(error instanceof features_1.LSPCancellationError) && !vscode_languageserver_protocol_1.DiagnosticServerCancellationData.is(error.data)) {\n this.client.error(`Workspace diagnostic pull failed.`, error, false);\n this.workspaceErrorCounter++;\n }\n if (this.workspaceErrorCounter <= 5) {\n this.workspaceTimeout = (0, vscode_languageserver_protocol_1.RAL)().timer.setTimeout(() => {\n this.pullWorkspace();\n }, 2000);\n }\n });\n }\n async pullWorkspaceAsync() {\n if (!this.provider.provideWorkspaceDiagnostics || this.isDisposed) {\n return;\n }\n if (this.workspaceCancellation !== undefined) {\n this.workspaceCancellation.cancel();\n this.workspaceCancellation = undefined;\n }\n this.workspaceCancellation = new vscode_1.CancellationTokenSource();\n const previousResultIds = this.documentStates.getAllResultIds().map((item) => {\n return {\n uri: this.client.protocol2CodeConverter.asUri(item.uri),\n value: item.value\n };\n });\n await this.provider.provideWorkspaceDiagnostics(previousResultIds, this.workspaceCancellation.token, (chunk) => {\n if (!chunk || this.isDisposed) {\n return;\n }\n for (const item of chunk.items) {\n if (item.kind === vsdiag.DocumentDiagnosticReportKind.full) {\n // Favour document pull result over workspace results. So skip if it is tracked\n // as a document result.\n if (!this.documentStates.tracks(PullState.document, item.uri)) {\n this.diagnostics.set(item.uri, item.items);\n }\n }\n this.documentStates.update(PullState.workspace, item.uri, item.version ?? undefined, item.resultId);\n }\n });\n }\n createProvider() {\n const result = {\n onDidChangeDiagnostics: this.onDidChangeDiagnosticsEmitter.event,\n provideDiagnostics: (document, previousResultId, token) => {\n const provideDiagnostics = (document, previousResultId, token) => {\n const params = {\n identifier: this.options.identifier,\n textDocument: { uri: this.client.code2ProtocolConverter.asUri(document instanceof vscode_1.Uri ? document : document.uri) },\n previousResultId: previousResultId\n };\n if (this.isDisposed === true || !this.client.isRunning()) {\n return { kind: vsdiag.DocumentDiagnosticReportKind.full, items: [] };\n }\n return this.client.sendRequest(vscode_languageserver_protocol_1.DocumentDiagnosticRequest.type, params, token).then(async (result) => {\n if (result === undefined || result === null || this.isDisposed || token.isCancellationRequested) {\n return { kind: vsdiag.DocumentDiagnosticReportKind.full, items: [] };\n }\n if (result.kind === vscode_languageserver_protocol_1.DocumentDiagnosticReportKind.Full) {\n return { kind: vsdiag.DocumentDiagnosticReportKind.full, resultId: result.resultId, items: await this.client.protocol2CodeConverter.asDiagnostics(result.items, token) };\n }\n else {\n return { kind: vsdiag.DocumentDiagnosticReportKind.unChanged, resultId: result.resultId };\n }\n }, (error) => {\n return this.client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentDiagnosticRequest.type, token, error, { kind: vsdiag.DocumentDiagnosticReportKind.full, items: [] });\n });\n };\n const middleware = this.client.middleware;\n return middleware.provideDiagnostics\n ? middleware.provideDiagnostics(document, previousResultId, token, provideDiagnostics)\n : provideDiagnostics(document, previousResultId, token);\n }\n };\n if (this.options.workspaceDiagnostics) {\n result.provideWorkspaceDiagnostics = (resultIds, token, resultReporter) => {\n const convertReport = async (report) => {\n if (report.kind === vscode_languageserver_protocol_1.DocumentDiagnosticReportKind.Full) {\n return {\n kind: vsdiag.DocumentDiagnosticReportKind.full,\n uri: this.client.protocol2CodeConverter.asUri(report.uri),\n resultId: report.resultId,\n version: report.version,\n items: await this.client.protocol2CodeConverter.asDiagnostics(report.items, token)\n };\n }\n else {\n return {\n kind: vsdiag.DocumentDiagnosticReportKind.unChanged,\n uri: this.client.protocol2CodeConverter.asUri(report.uri),\n resultId: report.resultId,\n version: report.version\n };\n }\n };\n const convertPreviousResultIds = (resultIds) => {\n const converted = [];\n for (const item of resultIds) {\n converted.push({ uri: this.client.code2ProtocolConverter.asUri(item.uri), value: item.value });\n }\n return converted;\n };\n const provideDiagnostics = (resultIds, token) => {\n const partialResultToken = (0, uuid_1.generateUuid)();\n const disposable = this.client.onProgress(vscode_languageserver_protocol_1.WorkspaceDiagnosticRequest.partialResult, partialResultToken, async (partialResult) => {\n if (partialResult === undefined || partialResult === null) {\n resultReporter(null);\n return;\n }\n const converted = {\n items: []\n };\n for (const item of partialResult.items) {\n try {\n converted.items.push(await convertReport(item));\n }\n catch (error) {\n this.client.error(`Converting workspace diagnostics failed.`, error);\n }\n }\n resultReporter(converted);\n });\n const params = {\n identifier: this.options.identifier,\n previousResultIds: convertPreviousResultIds(resultIds),\n partialResultToken: partialResultToken\n };\n if (this.isDisposed === true || !this.client.isRunning()) {\n return { items: [] };\n }\n return this.client.sendRequest(vscode_languageserver_protocol_1.WorkspaceDiagnosticRequest.type, params, token).then(async (result) => {\n if (token.isCancellationRequested) {\n return { items: [] };\n }\n const converted = {\n items: []\n };\n for (const item of result.items) {\n converted.items.push(await convertReport(item));\n }\n disposable.dispose();\n resultReporter(converted);\n return { items: [] };\n }, (error) => {\n disposable.dispose();\n return this.client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentDiagnosticRequest.type, token, error, { items: [] });\n });\n };\n const middleware = this.client.middleware;\n return middleware.provideWorkspaceDiagnostics\n ? middleware.provideWorkspaceDiagnostics(resultIds, token, resultReporter, provideDiagnostics)\n : provideDiagnostics(resultIds, token, resultReporter);\n };\n }\n return result;\n }\n dispose() {\n this.isDisposed = true;\n // Cancel and clear workspace pull if present.\n this.workspaceCancellation?.cancel();\n this.workspaceTimeout?.dispose();\n // Cancel all request and mark open requests as outdated.\n for (const [key, request] of this.openRequests) {\n if (request.state === RequestStateKind.active) {\n request.tokenSource.cancel();\n }\n this.openRequests.set(key, { state: RequestStateKind.outDated, document: request.document });\n }\n // cleanup old diagnostics\n this.diagnostics.dispose();\n }\n}\nclass BackgroundScheduler {\n constructor(diagnosticRequestor) {\n this.diagnosticRequestor = diagnosticRequestor;\n this.documents = new vscode_languageserver_protocol_1.LinkedMap();\n this.isDisposed = false;\n }\n add(document) {\n if (this.isDisposed === true) {\n return;\n }\n const key = DocumentOrUri.asKey(document);\n if (this.documents.has(key)) {\n return;\n }\n this.documents.set(key, document, vscode_languageserver_protocol_1.Touch.Last);\n this.trigger();\n }\n remove(document) {\n const key = DocumentOrUri.asKey(document);\n this.documents.delete(key);\n // No more documents. Stop background activity.\n if (this.documents.size === 0) {\n this.stop();\n }\n else if (key === this.endDocumentKey()) {\n // Make sure we have a correct last document. It could have\n this.endDocument = this.documents.last;\n }\n }\n trigger() {\n if (this.isDisposed === true) {\n return;\n }\n // We have a round running. So simply make sure we run up to the\n // last document\n if (this.intervalHandle !== undefined) {\n this.endDocument = this.documents.last;\n return;\n }\n this.endDocument = this.documents.last;\n this.intervalHandle = (0, vscode_languageserver_protocol_1.RAL)().timer.setInterval(() => {\n const document = this.documents.first;\n if (document !== undefined) {\n const key = DocumentOrUri.asKey(document);\n this.diagnosticRequestor.pull(document);\n this.documents.set(key, document, vscode_languageserver_protocol_1.Touch.Last);\n if (key === this.endDocumentKey()) {\n this.stop();\n }\n }\n }, 200);\n }\n dispose() {\n this.isDisposed = true;\n this.stop();\n this.documents.clear();\n }\n stop() {\n this.intervalHandle?.dispose();\n this.intervalHandle = undefined;\n this.endDocument = undefined;\n }\n endDocumentKey() {\n return this.endDocument !== undefined ? DocumentOrUri.asKey(this.endDocument) : undefined;\n }\n}\nclass DiagnosticFeatureProviderImpl {\n constructor(client, tabs, options) {\n const diagnosticPullOptions = client.clientOptions.diagnosticPullOptions ?? { onChange: true, onSave: false };\n const documentSelector = client.protocol2CodeConverter.asDocumentSelector(options.documentSelector);\n const disposables = [];\n const matchResource = (resource) => {\n const selector = options.documentSelector;\n if (diagnosticPullOptions.match !== undefined) {\n return diagnosticPullOptions.match(selector, resource);\n }\n for (const filter of selector) {\n if (!vscode_languageserver_protocol_1.TextDocumentFilter.is(filter)) {\n continue;\n }\n // The filter is a language id. We can't determine if it matches\n // so we return false.\n if (typeof filter === 'string') {\n return false;\n }\n if (filter.language !== undefined && filter.language !== '*') {\n return false;\n }\n if (filter.scheme !== undefined && filter.scheme !== '*' && filter.scheme !== resource.scheme) {\n return false;\n }\n if (filter.pattern !== undefined) {\n const matcher = new minimatch.Minimatch(filter.pattern, { noext: true });\n if (!matcher.makeRe()) {\n return false;\n }\n if (!matcher.match(resource.fsPath)) {\n return false;\n }\n }\n }\n return true;\n };\n const matches = (document) => {\n return document instanceof vscode_1.Uri\n ? matchResource(document)\n : vscode_1.languages.match(documentSelector, document) > 0 && tabs.isVisible(document);\n };\n const isActiveDocument = (document) => {\n return document instanceof vscode_1.Uri\n ? this.activeTextDocument?.uri.toString() === document.toString()\n : this.activeTextDocument === document;\n };\n this.diagnosticRequestor = new DiagnosticRequestor(client, tabs, options);\n this.backgroundScheduler = new BackgroundScheduler(this.diagnosticRequestor);\n const addToBackgroundIfNeeded = (document) => {\n if (!matches(document) || !options.interFileDependencies || isActiveDocument(document)) {\n return;\n }\n this.backgroundScheduler.add(document);\n };\n this.activeTextDocument = vscode_1.window.activeTextEditor?.document;\n vscode_1.window.onDidChangeActiveTextEditor((editor) => {\n const oldActive = this.activeTextDocument;\n this.activeTextDocument = editor?.document;\n if (oldActive !== undefined) {\n addToBackgroundIfNeeded(oldActive);\n }\n if (this.activeTextDocument !== undefined) {\n this.backgroundScheduler.remove(this.activeTextDocument);\n }\n });\n // For pull model diagnostics we pull for documents visible in the UI.\n // From an eventing point of view we still rely on open document events\n // and filter the documents that are not visible in the UI instead of\n // listening to Tab events. Major reason is event timing since we need\n // to ensure that the pull is send after the document open has reached\n // the server.\n // We always pull on open.\n const openFeature = client.getFeature(vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.method);\n disposables.push(openFeature.onNotificationSent((event) => {\n const textDocument = event.textDocument;\n // We already know about this document. This can happen via a tab open.\n if (this.diagnosticRequestor.knows(PullState.document, textDocument)) {\n return;\n }\n if (matches(textDocument)) {\n this.diagnosticRequestor.pull(textDocument, () => { addToBackgroundIfNeeded(textDocument); });\n }\n }));\n disposables.push(tabs.onOpen((opened) => {\n for (const resource of opened) {\n // We already know about this document. This can happen via a document open.\n if (this.diagnosticRequestor.knows(PullState.document, resource)) {\n continue;\n }\n const uriStr = resource.toString();\n let textDocument;\n for (const item of vscode_1.workspace.textDocuments) {\n if (uriStr === item.uri.toString()) {\n textDocument = item;\n break;\n }\n }\n // In VS Code the event timing is as follows:\n // 1. tab events are fired.\n // 2. open document events are fired and internal data structures like\n // workspace.textDocuments and Window.activeTextEditor are updated.\n //\n // This means: for newly created tab/editors we don't find the underlying\n // document yet. So we do nothing an rely on the underlying open document event\n // to be fired.\n if (textDocument !== undefined && matches(textDocument)) {\n this.diagnosticRequestor.pull(textDocument, () => { addToBackgroundIfNeeded(textDocument); });\n }\n }\n }));\n // Pull all diagnostics for documents that are already open\n const pulledTextDocuments = new Set();\n for (const textDocument of vscode_1.workspace.textDocuments) {\n if (matches(textDocument)) {\n this.diagnosticRequestor.pull(textDocument, () => { addToBackgroundIfNeeded(textDocument); });\n pulledTextDocuments.add(textDocument.uri.toString());\n }\n }\n // Pull all tabs if not already pulled as text document\n if (diagnosticPullOptions.onTabs === true) {\n for (const resource of tabs.getTabResources()) {\n if (!pulledTextDocuments.has(resource.toString()) && matches(resource)) {\n this.diagnosticRequestor.pull(resource, () => { addToBackgroundIfNeeded(resource); });\n }\n }\n }\n // We don't need to pull on tab open since we will receive a document open as well later on\n // and that event allows us to use a document for a match check which will have a set\n // language id.\n if (diagnosticPullOptions.onChange === true) {\n const changeFeature = client.getFeature(vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.method);\n disposables.push(changeFeature.onNotificationSent(async (event) => {\n const textDocument = event.textDocument;\n if ((diagnosticPullOptions.filter === undefined || !diagnosticPullOptions.filter(textDocument, DiagnosticPullMode.onType)) && this.diagnosticRequestor.knows(PullState.document, textDocument)) {\n this.diagnosticRequestor.pull(textDocument, () => { this.backgroundScheduler.trigger(); });\n }\n }));\n }\n if (diagnosticPullOptions.onSave === true) {\n const saveFeature = client.getFeature(vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.method);\n disposables.push(saveFeature.onNotificationSent((event) => {\n const textDocument = event.textDocument;\n if ((diagnosticPullOptions.filter === undefined || !diagnosticPullOptions.filter(textDocument, DiagnosticPullMode.onSave)) && this.diagnosticRequestor.knows(PullState.document, textDocument)) {\n this.diagnosticRequestor.pull(event.textDocument, () => { this.backgroundScheduler.trigger(); });\n }\n }));\n }\n // When the document closes clear things up\n const closeFeature = client.getFeature(vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.method);\n disposables.push(closeFeature.onNotificationSent((event) => {\n this.cleanUpDocument(event.textDocument);\n }));\n // Same when a tabs closes.\n tabs.onClose((closed) => {\n for (const document of closed) {\n this.cleanUpDocument(document);\n }\n });\n // We received a did change from the server.\n this.diagnosticRequestor.onDidChangeDiagnosticsEmitter.event(() => {\n for (const textDocument of vscode_1.workspace.textDocuments) {\n if (matches(textDocument)) {\n this.diagnosticRequestor.pull(textDocument);\n }\n }\n });\n // da348dc5-c30a-4515-9d98-31ff3be38d14 is the test UUID to test the middle ware. So don't auto trigger pulls.\n if (options.workspaceDiagnostics === true && options.identifier !== 'da348dc5-c30a-4515-9d98-31ff3be38d14') {\n this.diagnosticRequestor.pullWorkspace();\n }\n this.disposable = vscode_1.Disposable.from(...disposables, this.backgroundScheduler, this.diagnosticRequestor);\n }\n get onDidChangeDiagnosticsEmitter() {\n return this.diagnosticRequestor.onDidChangeDiagnosticsEmitter;\n }\n get diagnostics() {\n return this.diagnosticRequestor.provider;\n }\n cleanUpDocument(document) {\n if (this.diagnosticRequestor.knows(PullState.document, document)) {\n this.diagnosticRequestor.forgetDocument(document);\n this.backgroundScheduler.remove(document);\n }\n }\n}\nclass DiagnosticFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentDiagnosticRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let capability = ensure(ensure(capabilities, 'textDocument'), 'diagnostic');\n capability.dynamicRegistration = true;\n // We first need to decide how a UI will look with related documents.\n // An easy implementation would be to only show related diagnostics for\n // the active editor.\n capability.relatedDocumentSupport = false;\n ensure(ensure(capabilities, 'workspace'), 'diagnostics').refreshSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const client = this._client;\n client.onRequest(vscode_languageserver_protocol_1.DiagnosticRefreshRequest.type, async () => {\n for (const provider of this.getAllProviders()) {\n provider.onDidChangeDiagnosticsEmitter.fire();\n }\n });\n let [id, options] = this.getRegistration(documentSelector, capabilities.diagnosticProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n clear() {\n if (this.tabs !== undefined) {\n this.tabs.dispose();\n this.tabs = undefined;\n }\n super.clear();\n }\n registerLanguageProvider(options) {\n if (this.tabs === undefined) {\n this.tabs = new Tabs();\n }\n const provider = new DiagnosticFeatureProviderImpl(this._client, this.tabs, options);\n return [provider.disposable, provider];\n }\n}\nexports.DiagnosticFeature = DiagnosticFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NotebookDocumentSyncFeature = void 0;\nconst vscode = require(\"vscode\");\nconst minimatch = require(\"minimatch\");\nconst proto = require(\"vscode-languageserver-protocol\");\nconst UUID = require(\"./utils/uuid\");\nconst Is = require(\"./utils/is\");\nfunction ensure(target, key) {\n if (target[key] === void 0) {\n target[key] = {};\n }\n return target[key];\n}\nvar Converter;\n(function (Converter) {\n let c2p;\n (function (c2p) {\n function asVersionedNotebookDocumentIdentifier(notebookDocument, base) {\n return {\n version: notebookDocument.version,\n uri: base.asUri(notebookDocument.uri)\n };\n }\n c2p.asVersionedNotebookDocumentIdentifier = asVersionedNotebookDocumentIdentifier;\n function asNotebookDocument(notebookDocument, cells, base) {\n const result = proto.NotebookDocument.create(base.asUri(notebookDocument.uri), notebookDocument.notebookType, notebookDocument.version, asNotebookCells(cells, base));\n if (Object.keys(notebookDocument.metadata).length > 0) {\n result.metadata = asMetadata(notebookDocument.metadata);\n }\n return result;\n }\n c2p.asNotebookDocument = asNotebookDocument;\n function asNotebookCells(cells, base) {\n return cells.map(cell => asNotebookCell(cell, base));\n }\n c2p.asNotebookCells = asNotebookCells;\n function asMetadata(metadata) {\n const seen = new Set();\n return deepCopy(seen, metadata);\n }\n c2p.asMetadata = asMetadata;\n function asNotebookCell(cell, base) {\n const result = proto.NotebookCell.create(asNotebookCellKind(cell.kind), base.asUri(cell.document.uri));\n if (Object.keys(cell.metadata).length > 0) {\n result.metadata = asMetadata(cell.metadata);\n }\n if (cell.executionSummary !== undefined && (Is.number(cell.executionSummary.executionOrder) && Is.boolean(cell.executionSummary.success))) {\n result.executionSummary = {\n executionOrder: cell.executionSummary.executionOrder,\n success: cell.executionSummary.success\n };\n }\n return result;\n }\n c2p.asNotebookCell = asNotebookCell;\n function asNotebookCellKind(kind) {\n switch (kind) {\n case vscode.NotebookCellKind.Markup:\n return proto.NotebookCellKind.Markup;\n case vscode.NotebookCellKind.Code:\n return proto.NotebookCellKind.Code;\n }\n }\n function deepCopy(seen, value) {\n if (seen.has(value)) {\n throw new Error(`Can't deep copy cyclic structures.`);\n }\n if (Array.isArray(value)) {\n const result = [];\n for (const elem of value) {\n if (elem !== null && typeof elem === 'object' || Array.isArray(elem)) {\n result.push(deepCopy(seen, elem));\n }\n else {\n if (elem instanceof RegExp) {\n throw new Error(`Can't transfer regular expressions to the server`);\n }\n result.push(elem);\n }\n }\n return result;\n }\n else {\n const props = Object.keys(value);\n const result = Object.create(null);\n for (const prop of props) {\n const elem = value[prop];\n if (elem !== null && typeof elem === 'object' || Array.isArray(elem)) {\n result[prop] = deepCopy(seen, elem);\n }\n else {\n if (elem instanceof RegExp) {\n throw new Error(`Can't transfer regular expressions to the server`);\n }\n result[prop] = elem;\n }\n }\n return result;\n }\n }\n function asTextContentChange(event, base) {\n const params = base.asChangeTextDocumentParams(event, event.document.uri, event.document.version);\n return { document: params.textDocument, changes: params.contentChanges };\n }\n c2p.asTextContentChange = asTextContentChange;\n function asNotebookDocumentChangeEvent(event, base) {\n const result = Object.create(null);\n if (event.metadata) {\n result.metadata = Converter.c2p.asMetadata(event.metadata);\n }\n if (event.cells !== undefined) {\n const cells = Object.create(null);\n const changedCells = event.cells;\n if (changedCells.structure) {\n cells.structure = {\n array: {\n start: changedCells.structure.array.start,\n deleteCount: changedCells.structure.array.deleteCount,\n cells: changedCells.structure.array.cells !== undefined ? changedCells.structure.array.cells.map(cell => Converter.c2p.asNotebookCell(cell, base)) : undefined\n },\n didOpen: changedCells.structure.didOpen !== undefined\n ? changedCells.structure.didOpen.map(cell => base.asOpenTextDocumentParams(cell.document).textDocument)\n : undefined,\n didClose: changedCells.structure.didClose !== undefined\n ? changedCells.structure.didClose.map(cell => base.asCloseTextDocumentParams(cell.document).textDocument)\n : undefined\n };\n }\n if (changedCells.data !== undefined) {\n cells.data = changedCells.data.map(cell => Converter.c2p.asNotebookCell(cell, base));\n }\n if (changedCells.textContent !== undefined) {\n cells.textContent = changedCells.textContent.map(event => Converter.c2p.asTextContentChange(event, base));\n }\n if (Object.keys(cells).length > 0) {\n result.cells = cells;\n }\n }\n return result;\n }\n c2p.asNotebookDocumentChangeEvent = asNotebookDocumentChangeEvent;\n })(c2p = Converter.c2p || (Converter.c2p = {}));\n})(Converter || (Converter = {}));\nvar $NotebookCell;\n(function ($NotebookCell) {\n function computeDiff(originalCells, modifiedCells, compareMetadata) {\n const originalLength = originalCells.length;\n const modifiedLength = modifiedCells.length;\n let startIndex = 0;\n while (startIndex < modifiedLength && startIndex < originalLength && equals(originalCells[startIndex], modifiedCells[startIndex], compareMetadata)) {\n startIndex++;\n }\n if (startIndex < modifiedLength && startIndex < originalLength) {\n let originalEndIndex = originalLength - 1;\n let modifiedEndIndex = modifiedLength - 1;\n while (originalEndIndex >= 0 && modifiedEndIndex >= 0 && equals(originalCells[originalEndIndex], modifiedCells[modifiedEndIndex], compareMetadata)) {\n originalEndIndex--;\n modifiedEndIndex--;\n }\n const deleteCount = (originalEndIndex + 1) - startIndex;\n const newCells = startIndex === modifiedEndIndex + 1 ? undefined : modifiedCells.slice(startIndex, modifiedEndIndex + 1);\n return newCells !== undefined ? { start: startIndex, deleteCount, cells: newCells } : { start: startIndex, deleteCount };\n }\n else if (startIndex < modifiedLength) {\n return { start: startIndex, deleteCount: 0, cells: modifiedCells.slice(startIndex) };\n }\n else if (startIndex < originalLength) {\n return { start: startIndex, deleteCount: originalLength - startIndex };\n }\n else {\n // The two arrays are the same.\n return undefined;\n }\n }\n $NotebookCell.computeDiff = computeDiff;\n /**\n * We only sync kind, document, execution and metadata to the server. So we only need to compare those.\n */\n function equals(one, other, compareMetaData = true) {\n if (one.kind !== other.kind || one.document.uri.toString() !== other.document.uri.toString() || one.document.languageId !== other.document.languageId ||\n !equalsExecution(one.executionSummary, other.executionSummary)) {\n return false;\n }\n return !compareMetaData || (compareMetaData && equalsMetadata(one.metadata, other.metadata));\n }\n function equalsExecution(one, other) {\n if (one === other) {\n return true;\n }\n if (one === undefined || other === undefined) {\n return false;\n }\n return one.executionOrder === other.executionOrder && one.success === other.success && equalsTiming(one.timing, other.timing);\n }\n function equalsTiming(one, other) {\n if (one === other) {\n return true;\n }\n if (one === undefined || other === undefined) {\n return false;\n }\n return one.startTime === other.startTime && one.endTime === other.endTime;\n }\n function equalsMetadata(one, other) {\n if (one === other) {\n return true;\n }\n if (one === null || one === undefined || other === null || other === undefined) {\n return false;\n }\n if (typeof one !== typeof other) {\n return false;\n }\n if (typeof one !== 'object') {\n return false;\n }\n const oneArray = Array.isArray(one);\n const otherArray = Array.isArray(other);\n if (oneArray !== otherArray) {\n return false;\n }\n if (oneArray && otherArray) {\n if (one.length !== other.length) {\n return false;\n }\n for (let i = 0; i < one.length; i++) {\n if (!equalsMetadata(one[i], other[i])) {\n return false;\n }\n }\n }\n if (isObjectLiteral(one) && isObjectLiteral(other)) {\n const oneKeys = Object.keys(one);\n const otherKeys = Object.keys(other);\n if (oneKeys.length !== otherKeys.length) {\n return false;\n }\n oneKeys.sort();\n otherKeys.sort();\n if (!equalsMetadata(oneKeys, otherKeys)) {\n return false;\n }\n for (let i = 0; i < oneKeys.length; i++) {\n const prop = oneKeys[i];\n if (!equalsMetadata(one[prop], other[prop])) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n function isObjectLiteral(value) {\n return value !== null && typeof value === 'object';\n }\n $NotebookCell.isObjectLiteral = isObjectLiteral;\n})($NotebookCell || ($NotebookCell = {}));\nvar $NotebookDocumentFilter;\n(function ($NotebookDocumentFilter) {\n function matchNotebook(filter, notebookDocument) {\n if (typeof filter === 'string') {\n return filter === '*' || notebookDocument.notebookType === filter;\n }\n if (filter.notebookType !== undefined && filter.notebookType !== '*' && notebookDocument.notebookType !== filter.notebookType) {\n return false;\n }\n const uri = notebookDocument.uri;\n if (filter.scheme !== undefined && filter.scheme !== '*' && uri.scheme !== filter.scheme) {\n return false;\n }\n if (filter.pattern !== undefined) {\n const matcher = new minimatch.Minimatch(filter.pattern, { noext: true });\n if (!matcher.makeRe()) {\n return false;\n }\n if (!matcher.match(uri.fsPath)) {\n return false;\n }\n }\n return true;\n }\n $NotebookDocumentFilter.matchNotebook = matchNotebook;\n})($NotebookDocumentFilter || ($NotebookDocumentFilter = {}));\nvar $NotebookDocumentSyncOptions;\n(function ($NotebookDocumentSyncOptions) {\n function asDocumentSelector(options) {\n const selector = options.notebookSelector;\n const result = [];\n for (const element of selector) {\n const notebookType = (typeof element.notebook === 'string' ? element.notebook : element.notebook?.notebookType) ?? '*';\n const scheme = (typeof element.notebook === 'string') ? undefined : element.notebook?.scheme;\n const pattern = (typeof element.notebook === 'string') ? undefined : element.notebook?.pattern;\n if (element.cells !== undefined) {\n for (const cell of element.cells) {\n result.push(asDocumentFilter(notebookType, scheme, pattern, cell.language));\n }\n }\n else {\n result.push(asDocumentFilter(notebookType, scheme, pattern, undefined));\n }\n }\n return result;\n }\n $NotebookDocumentSyncOptions.asDocumentSelector = asDocumentSelector;\n function asDocumentFilter(notebookType, scheme, pattern, language) {\n return scheme === undefined && pattern === undefined\n ? { notebook: notebookType, language }\n : { notebook: { notebookType, scheme, pattern }, language };\n }\n})($NotebookDocumentSyncOptions || ($NotebookDocumentSyncOptions = {}));\nvar SyncInfo;\n(function (SyncInfo) {\n function create(cells) {\n return {\n cells,\n uris: new Set(cells.map(cell => cell.document.uri.toString()))\n };\n }\n SyncInfo.create = create;\n})(SyncInfo || (SyncInfo = {}));\nclass NotebookDocumentSyncFeatureProvider {\n constructor(client, options) {\n this.client = client;\n this.options = options;\n this.notebookSyncInfo = new Map();\n this.notebookDidOpen = new Set();\n this.disposables = [];\n this.selector = client.protocol2CodeConverter.asDocumentSelector($NotebookDocumentSyncOptions.asDocumentSelector(options));\n // open\n vscode.workspace.onDidOpenNotebookDocument((notebookDocument) => {\n this.notebookDidOpen.add(notebookDocument.uri.toString());\n this.didOpen(notebookDocument);\n }, undefined, this.disposables);\n for (const notebookDocument of vscode.workspace.notebookDocuments) {\n this.notebookDidOpen.add(notebookDocument.uri.toString());\n this.didOpen(notebookDocument);\n }\n // Notebook document changed.\n vscode.workspace.onDidChangeNotebookDocument(event => this.didChangeNotebookDocument(event), undefined, this.disposables);\n //save\n if (this.options.save === true) {\n vscode.workspace.onDidSaveNotebookDocument(notebookDocument => this.didSave(notebookDocument), undefined, this.disposables);\n }\n // close\n vscode.workspace.onDidCloseNotebookDocument((notebookDocument) => {\n this.didClose(notebookDocument);\n this.notebookDidOpen.delete(notebookDocument.uri.toString());\n }, undefined, this.disposables);\n }\n getState() {\n for (const notebook of vscode.workspace.notebookDocuments) {\n const matchingCells = this.getMatchingCells(notebook);\n if (matchingCells !== undefined) {\n return { kind: 'document', id: '$internal', registrations: true, matches: true };\n }\n }\n return { kind: 'document', id: '$internal', registrations: true, matches: false };\n }\n get mode() {\n return 'notebook';\n }\n handles(textDocument) {\n return vscode.languages.match(this.selector, textDocument) > 0;\n }\n didOpenNotebookCellTextDocument(notebookDocument, cell) {\n if (vscode.languages.match(this.selector, cell.document) === 0) {\n return;\n }\n if (!this.notebookDidOpen.has(notebookDocument.uri.toString())) {\n // We have never received an open notification for the notebook document.\n // VS Code guarantees that we first get cell document open and then\n // notebook open. So simply wait for the notebook open.\n return;\n }\n const syncInfo = this.notebookSyncInfo.get(notebookDocument.uri.toString());\n // In VS Code we receive a notebook open before a cell document open.\n // The document and the cell is synced.\n const cellMatches = this.cellMatches(notebookDocument, cell);\n if (syncInfo !== undefined) {\n const cellIsSynced = syncInfo.uris.has(cell.document.uri.toString());\n if ((cellMatches && cellIsSynced) || (!cellMatches && !cellIsSynced)) {\n // The cell doesn't match and was not synced or it matches and is synced.\n // In both cases nothing to do.\n //\n // Note that if the language mode of a document changes we remove the\n // cell and add it back to update the language mode on the server side.\n return;\n }\n if (cellMatches) {\n // don't use cells from above since there might be more matching cells in the notebook\n // Since we had a matching cell above we will have matching cells now.\n const matchingCells = this.getMatchingCells(notebookDocument);\n if (matchingCells !== undefined) {\n const event = this.asNotebookDocumentChangeEvent(notebookDocument, undefined, syncInfo, matchingCells);\n if (event !== undefined) {\n this.doSendChange(event, matchingCells).catch(() => { });\n }\n }\n }\n }\n else {\n // No sync info. But we have a open event for the notebook document\n // itself. If the cell matches then we need to send an open with\n // exactly that cell.\n if (cellMatches) {\n this.doSendOpen(notebookDocument, [cell]).catch(() => { });\n }\n }\n }\n didChangeNotebookCellTextDocument(notebookDocument, event) {\n // No match with the selector\n if (vscode.languages.match(this.selector, event.document) === 0) {\n return;\n }\n this.doSendChange({\n notebook: notebookDocument,\n cells: { textContent: [event] }\n }, undefined).catch(() => { });\n }\n didCloseNotebookCellTextDocument(notebookDocument, cell) {\n const syncInfo = this.notebookSyncInfo.get(notebookDocument.uri.toString());\n if (syncInfo === undefined) {\n // The notebook document got never synced. So it doesn't matter if a cell\n // document closes.\n return;\n }\n const cellUri = cell.document.uri;\n const index = syncInfo.cells.findIndex((item) => item.document.uri.toString() === cellUri.toString());\n if (index === -1) {\n // The cell never got synced or it got deleted and we now received the document\n // close event.\n return;\n }\n if (index === 0 && syncInfo.cells.length === 1) {\n // The last cell. Close the notebook document in the server.\n this.doSendClose(notebookDocument, syncInfo.cells).catch(() => { });\n }\n else {\n const newCells = syncInfo.cells.slice();\n const deleted = newCells.splice(index, 1);\n this.doSendChange({\n notebook: notebookDocument,\n cells: {\n structure: {\n array: { start: index, deleteCount: 1 },\n didClose: deleted\n }\n }\n }, newCells).catch(() => { });\n }\n }\n dispose() {\n for (const disposable of this.disposables) {\n disposable.dispose();\n }\n }\n didOpen(notebookDocument, matchingCells = this.getMatchingCells(notebookDocument), syncInfo = this.notebookSyncInfo.get(notebookDocument.uri.toString())) {\n if (syncInfo !== undefined) {\n if (matchingCells !== undefined) {\n const event = this.asNotebookDocumentChangeEvent(notebookDocument, undefined, syncInfo, matchingCells);\n if (event !== undefined) {\n this.doSendChange(event, matchingCells).catch(() => { });\n }\n }\n else {\n this.doSendClose(notebookDocument, []).catch(() => { });\n }\n }\n else {\n // Check if we need to sync the notebook document.\n if (matchingCells === undefined) {\n return;\n }\n this.doSendOpen(notebookDocument, matchingCells).catch(() => { });\n }\n }\n didChangeNotebookDocument(event) {\n const notebookDocument = event.notebook;\n const syncInfo = this.notebookSyncInfo.get(notebookDocument.uri.toString());\n if (syncInfo === undefined) {\n // We have no changes to the cells. Since the notebook wasn't synced\n // it will not be synced now.\n if (event.contentChanges.length === 0) {\n return;\n }\n // Check if we have new matching cells.\n const cells = this.getMatchingCells(notebookDocument);\n // No matching cells and the notebook never synced. So still no need\n // to sync it.\n if (cells === undefined) {\n return;\n }\n // Open the notebook document and ignore the rest of the changes\n // this the notebooks will be synced with the correct settings.\n this.didOpen(notebookDocument, cells, syncInfo);\n }\n else {\n // The notebook is synced. First check if we have no matching\n // cells anymore and if so close the notebook\n const cells = this.getMatchingCells(notebookDocument);\n if (cells === undefined) {\n this.didClose(notebookDocument, syncInfo);\n return;\n }\n const newEvent = this.asNotebookDocumentChangeEvent(event.notebook, event, syncInfo, cells);\n if (newEvent !== undefined) {\n this.doSendChange(newEvent, cells).catch(() => { });\n }\n }\n }\n didSave(notebookDocument) {\n const syncInfo = this.notebookSyncInfo.get(notebookDocument.uri.toString());\n if (syncInfo === undefined) {\n return;\n }\n this.doSendSave(notebookDocument).catch(() => { });\n }\n didClose(notebookDocument, syncInfo = this.notebookSyncInfo.get(notebookDocument.uri.toString())) {\n if (syncInfo === undefined) {\n return;\n }\n const syncedCells = notebookDocument.getCells().filter(cell => syncInfo.uris.has(cell.document.uri.toString()));\n this.doSendClose(notebookDocument, syncedCells).catch(() => { });\n }\n async sendDidOpenNotebookDocument(notebookDocument) {\n const cells = this.getMatchingCells(notebookDocument);\n if (cells === undefined) {\n return;\n }\n return this.doSendOpen(notebookDocument, cells);\n }\n async doSendOpen(notebookDocument, cells) {\n const send = async (notebookDocument, cells) => {\n const nb = Converter.c2p.asNotebookDocument(notebookDocument, cells, this.client.code2ProtocolConverter);\n const cellDocuments = cells.map(cell => this.client.code2ProtocolConverter.asTextDocumentItem(cell.document));\n try {\n await this.client.sendNotification(proto.DidOpenNotebookDocumentNotification.type, {\n notebookDocument: nb,\n cellTextDocuments: cellDocuments\n });\n }\n catch (error) {\n this.client.error('Sending DidOpenNotebookDocumentNotification failed', error);\n throw error;\n }\n };\n const middleware = this.client.middleware?.notebooks;\n this.notebookSyncInfo.set(notebookDocument.uri.toString(), SyncInfo.create(cells));\n return middleware?.didOpen !== undefined ? middleware.didOpen(notebookDocument, cells, send) : send(notebookDocument, cells);\n }\n async sendDidChangeNotebookDocument(event) {\n return this.doSendChange(event, undefined);\n }\n async doSendChange(event, cells = this.getMatchingCells(event.notebook)) {\n const send = async (event) => {\n try {\n await this.client.sendNotification(proto.DidChangeNotebookDocumentNotification.type, {\n notebookDocument: Converter.c2p.asVersionedNotebookDocumentIdentifier(event.notebook, this.client.code2ProtocolConverter),\n change: Converter.c2p.asNotebookDocumentChangeEvent(event, this.client.code2ProtocolConverter)\n });\n }\n catch (error) {\n this.client.error('Sending DidChangeNotebookDocumentNotification failed', error);\n throw error;\n }\n };\n const middleware = this.client.middleware?.notebooks;\n if (event.cells?.structure !== undefined) {\n this.notebookSyncInfo.set(event.notebook.uri.toString(), SyncInfo.create(cells ?? []));\n }\n return middleware?.didChange !== undefined ? middleware?.didChange(event, send) : send(event);\n }\n async sendDidSaveNotebookDocument(notebookDocument) {\n return this.doSendSave(notebookDocument);\n }\n async doSendSave(notebookDocument) {\n const send = async (notebookDocument) => {\n try {\n await this.client.sendNotification(proto.DidSaveNotebookDocumentNotification.type, {\n notebookDocument: { uri: this.client.code2ProtocolConverter.asUri(notebookDocument.uri) }\n });\n }\n catch (error) {\n this.client.error('Sending DidSaveNotebookDocumentNotification failed', error);\n throw error;\n }\n };\n const middleware = this.client.middleware?.notebooks;\n return middleware?.didSave !== undefined ? middleware.didSave(notebookDocument, send) : send(notebookDocument);\n }\n async sendDidCloseNotebookDocument(notebookDocument) {\n return this.doSendClose(notebookDocument, this.getMatchingCells(notebookDocument) ?? []);\n }\n async doSendClose(notebookDocument, cells) {\n const send = async (notebookDocument, cells) => {\n try {\n await this.client.sendNotification(proto.DidCloseNotebookDocumentNotification.type, {\n notebookDocument: { uri: this.client.code2ProtocolConverter.asUri(notebookDocument.uri) },\n cellTextDocuments: cells.map(cell => this.client.code2ProtocolConverter.asTextDocumentIdentifier(cell.document))\n });\n }\n catch (error) {\n this.client.error('Sending DidCloseNotebookDocumentNotification failed', error);\n throw error;\n }\n };\n const middleware = this.client.middleware?.notebooks;\n this.notebookSyncInfo.delete(notebookDocument.uri.toString());\n return middleware?.didClose !== undefined ? middleware.didClose(notebookDocument, cells, send) : send(notebookDocument, cells);\n }\n asNotebookDocumentChangeEvent(notebook, event, syncInfo, matchingCells) {\n if (event !== undefined && event.notebook !== notebook) {\n throw new Error('Notebook must be identical');\n }\n const result = {\n notebook: notebook\n };\n if (event?.metadata !== undefined) {\n result.metadata = Converter.c2p.asMetadata(event.metadata);\n }\n let matchingCellsSet;\n if (event?.cellChanges !== undefined && event.cellChanges.length > 0) {\n const data = [];\n // Only consider the new matching cells.\n matchingCellsSet = new Set(matchingCells.map(cell => cell.document.uri.toString()));\n for (const cellChange of event.cellChanges) {\n if (matchingCellsSet.has(cellChange.cell.document.uri.toString()) && (cellChange.executionSummary !== undefined || cellChange.metadata !== undefined)) {\n data.push(cellChange.cell);\n }\n }\n if (data.length > 0) {\n result.cells = result.cells ?? {};\n result.cells.data = data;\n }\n }\n if (((event?.contentChanges !== undefined && event.contentChanges.length > 0) || event === undefined) && syncInfo !== undefined && matchingCells !== undefined) {\n // We still have matching cells. Check if the cell changes\n // affect the notebook on the server side.\n const oldCells = syncInfo.cells;\n const newCells = matchingCells;\n // meta data changes are reported using on the cell itself. So we can ignore comparing\n // it which has a positive effect on performance.\n const diff = $NotebookCell.computeDiff(oldCells, newCells, false);\n let addedCells;\n let removedCells;\n if (diff !== undefined) {\n addedCells = diff.cells === undefined\n ? new Map()\n : new Map(diff.cells.map(cell => [cell.document.uri.toString(), cell]));\n removedCells = diff.deleteCount === 0\n ? new Map()\n : new Map(oldCells.slice(diff.start, diff.start + diff.deleteCount).map(cell => [cell.document.uri.toString(), cell]));\n // Remove the onces that got deleted and inserted again.\n for (const key of Array.from(removedCells.keys())) {\n if (addedCells.has(key)) {\n removedCells.delete(key);\n addedCells.delete(key);\n }\n }\n result.cells = result.cells ?? {};\n const didOpen = [];\n const didClose = [];\n if (addedCells.size > 0 || removedCells.size > 0) {\n for (const cell of addedCells.values()) {\n didOpen.push(cell);\n }\n for (const cell of removedCells.values()) {\n didClose.push(cell);\n }\n }\n result.cells.structure = {\n array: diff,\n didOpen,\n didClose\n };\n }\n }\n // The notebook is a property as well.\n return Object.keys(result).length > 1 ? result : undefined;\n }\n getMatchingCells(notebookDocument, cells = notebookDocument.getCells()) {\n if (this.options.notebookSelector === undefined) {\n return undefined;\n }\n for (const item of this.options.notebookSelector) {\n if (item.notebook === undefined || $NotebookDocumentFilter.matchNotebook(item.notebook, notebookDocument)) {\n const filtered = this.filterCells(notebookDocument, cells, item.cells);\n return filtered.length === 0 ? undefined : filtered;\n }\n }\n return undefined;\n }\n cellMatches(notebookDocument, cell) {\n const cells = this.getMatchingCells(notebookDocument, [cell]);\n return cells !== undefined && cells[0] === cell;\n }\n filterCells(notebookDocument, cells, cellSelector) {\n const filtered = cellSelector !== undefined ? cells.filter((cell) => {\n const cellLanguage = cell.document.languageId;\n return cellSelector.some((filter => (filter.language === '*' || cellLanguage === filter.language)));\n }) : cells;\n return typeof this.client.clientOptions.notebookDocumentOptions?.filterCells === 'function'\n ? this.client.clientOptions.notebookDocumentOptions.filterCells(notebookDocument, filtered)\n : filtered;\n }\n}\nclass NotebookDocumentSyncFeature {\n constructor(client) {\n this.client = client;\n this.registrations = new Map();\n this.registrationType = proto.NotebookDocumentSyncRegistrationType.type;\n // We don't receive an event for cells where the document changes its language mode\n // Since we allow servers to filter on the language mode we fire such an event ourselves.\n vscode.workspace.onDidOpenTextDocument((textDocument) => {\n if (textDocument.uri.scheme !== NotebookDocumentSyncFeature.CellScheme) {\n return;\n }\n const [notebookDocument, notebookCell] = this.findNotebookDocumentAndCell(textDocument);\n if (notebookDocument === undefined || notebookCell === undefined) {\n return;\n }\n for (const provider of this.registrations.values()) {\n if (provider instanceof NotebookDocumentSyncFeatureProvider) {\n provider.didOpenNotebookCellTextDocument(notebookDocument, notebookCell);\n }\n }\n });\n vscode.workspace.onDidChangeTextDocument((event) => {\n if (event.contentChanges.length === 0) {\n return;\n }\n const textDocument = event.document;\n if (textDocument.uri.scheme !== NotebookDocumentSyncFeature.CellScheme) {\n return;\n }\n const [notebookDocument,] = this.findNotebookDocumentAndCell(textDocument);\n if (notebookDocument === undefined) {\n return;\n }\n for (const provider of this.registrations.values()) {\n if (provider instanceof NotebookDocumentSyncFeatureProvider) {\n provider.didChangeNotebookCellTextDocument(notebookDocument, event);\n }\n }\n });\n vscode.workspace.onDidCloseTextDocument((textDocument) => {\n if (textDocument.uri.scheme !== NotebookDocumentSyncFeature.CellScheme) {\n return;\n }\n // There are two cases when we receive a close for a text document\n // 1: the cell got removed. This is handled in `onDidChangeNotebookCells`\n // 2: the language mode of a cell changed. This keeps the URI stable so\n // we will still find the cell and the notebook document.\n const [notebookDocument, notebookCell] = this.findNotebookDocumentAndCell(textDocument);\n if (notebookDocument === undefined || notebookCell === undefined) {\n return;\n }\n for (const provider of this.registrations.values()) {\n if (provider instanceof NotebookDocumentSyncFeatureProvider) {\n provider.didCloseNotebookCellTextDocument(notebookDocument, notebookCell);\n }\n }\n });\n }\n getState() {\n if (this.registrations.size === 0) {\n return { kind: 'document', id: this.registrationType.method, registrations: false, matches: false };\n }\n for (const provider of this.registrations.values()) {\n const state = provider.getState();\n if (state.kind === 'document' && state.registrations === true && state.matches === true) {\n return { kind: 'document', id: this.registrationType.method, registrations: true, matches: true };\n }\n }\n return { kind: 'document', id: this.registrationType.method, registrations: true, matches: false };\n }\n fillClientCapabilities(capabilities) {\n const synchronization = ensure(ensure(capabilities, 'notebookDocument'), 'synchronization');\n synchronization.dynamicRegistration = true;\n synchronization.executionSummarySupport = true;\n }\n preInitialize(capabilities) {\n const options = capabilities.notebookDocumentSync;\n if (options === undefined) {\n return;\n }\n this.dedicatedChannel = this.client.protocol2CodeConverter.asDocumentSelector($NotebookDocumentSyncOptions.asDocumentSelector(options));\n }\n initialize(capabilities) {\n const options = capabilities.notebookDocumentSync;\n if (options === undefined) {\n return;\n }\n const id = options.id ?? UUID.generateUuid();\n this.register({ id, registerOptions: options });\n }\n register(data) {\n const provider = new NotebookDocumentSyncFeatureProvider(this.client, data.registerOptions);\n this.registrations.set(data.id, provider);\n }\n unregister(id) {\n const provider = this.registrations.get(id);\n provider && provider.dispose();\n }\n clear() {\n for (const provider of this.registrations.values()) {\n provider.dispose();\n }\n this.registrations.clear();\n }\n handles(textDocument) {\n if (textDocument.uri.scheme !== NotebookDocumentSyncFeature.CellScheme) {\n return false;\n }\n if (this.dedicatedChannel !== undefined && vscode.languages.match(this.dedicatedChannel, textDocument) > 0) {\n return true;\n }\n for (const provider of this.registrations.values()) {\n if (provider.handles(textDocument)) {\n return true;\n }\n }\n return false;\n }\n getProvider(notebookCell) {\n for (const provider of this.registrations.values()) {\n if (provider.handles(notebookCell.document)) {\n return provider;\n }\n }\n return undefined;\n }\n findNotebookDocumentAndCell(textDocument) {\n const uri = textDocument.uri.toString();\n for (const notebookDocument of vscode.workspace.notebookDocuments) {\n for (const cell of notebookDocument.getCells()) {\n if (cell.document.uri.toString() === uri) {\n return [notebookDocument, cell];\n }\n }\n }\n return [undefined, undefined];\n }\n}\nexports.NotebookDocumentSyncFeature = NotebookDocumentSyncFeature;\nNotebookDocumentSyncFeature.CellScheme = 'vscode-notebook-cell';\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SyncConfigurationFeature = exports.toJSONObject = exports.ConfigurationFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst Is = require(\"./utils/is\");\nconst UUID = require(\"./utils/uuid\");\nconst features_1 = require(\"./features\");\n/**\n * Configuration pull model. From server to client.\n */\nclass ConfigurationFeature {\n constructor(client) {\n this._client = client;\n }\n getState() {\n return { kind: 'static' };\n }\n fillClientCapabilities(capabilities) {\n capabilities.workspace = capabilities.workspace || {};\n capabilities.workspace.configuration = true;\n }\n initialize() {\n let client = this._client;\n client.onRequest(vscode_languageserver_protocol_1.ConfigurationRequest.type, (params, token) => {\n let configuration = (params) => {\n let result = [];\n for (let item of params.items) {\n let resource = item.scopeUri !== void 0 && item.scopeUri !== null ? this._client.protocol2CodeConverter.asUri(item.scopeUri) : undefined;\n result.push(this.getConfiguration(resource, item.section !== null ? item.section : undefined));\n }\n return result;\n };\n let middleware = client.middleware.workspace;\n return middleware && middleware.configuration\n ? middleware.configuration(params, token, configuration)\n : configuration(params, token);\n });\n }\n getConfiguration(resource, section) {\n let result = null;\n if (section) {\n let index = section.lastIndexOf('.');\n if (index === -1) {\n result = toJSONObject(vscode_1.workspace.getConfiguration(undefined, resource).get(section));\n }\n else {\n let config = vscode_1.workspace.getConfiguration(section.substr(0, index), resource);\n if (config) {\n result = toJSONObject(config.get(section.substr(index + 1)));\n }\n }\n }\n else {\n let config = vscode_1.workspace.getConfiguration(undefined, resource);\n result = {};\n for (let key of Object.keys(config)) {\n if (config.has(key)) {\n result[key] = toJSONObject(config.get(key));\n }\n }\n }\n if (result === undefined) {\n result = null;\n }\n return result;\n }\n clear() {\n }\n}\nexports.ConfigurationFeature = ConfigurationFeature;\nfunction toJSONObject(obj) {\n if (obj) {\n if (Array.isArray(obj)) {\n return obj.map(toJSONObject);\n }\n else if (typeof obj === 'object') {\n const res = Object.create(null);\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n res[key] = toJSONObject(obj[key]);\n }\n }\n return res;\n }\n }\n return obj;\n}\nexports.toJSONObject = toJSONObject;\nclass SyncConfigurationFeature {\n constructor(_client) {\n this._client = _client;\n this.isCleared = false;\n this._listeners = new Map();\n }\n getState() {\n return { kind: 'workspace', id: this.registrationType.method, registrations: this._listeners.size > 0 };\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.DidChangeConfigurationNotification.type;\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'didChangeConfiguration').dynamicRegistration = true;\n }\n initialize() {\n this.isCleared = false;\n let section = this._client.clientOptions.synchronize?.configurationSection;\n if (section !== undefined) {\n this.register({\n id: UUID.generateUuid(),\n registerOptions: {\n section: section\n }\n });\n }\n }\n register(data) {\n let disposable = vscode_1.workspace.onDidChangeConfiguration((event) => {\n this.onDidChangeConfiguration(data.registerOptions.section, event);\n });\n this._listeners.set(data.id, disposable);\n if (data.registerOptions.section !== undefined) {\n this.onDidChangeConfiguration(data.registerOptions.section, undefined);\n }\n }\n unregister(id) {\n let disposable = this._listeners.get(id);\n if (disposable) {\n this._listeners.delete(id);\n disposable.dispose();\n }\n }\n clear() {\n for (const disposable of this._listeners.values()) {\n disposable.dispose();\n }\n this._listeners.clear();\n this.isCleared = true;\n }\n onDidChangeConfiguration(configurationSection, event) {\n if (this.isCleared) {\n return;\n }\n let sections;\n if (Is.string(configurationSection)) {\n sections = [configurationSection];\n }\n else {\n sections = configurationSection;\n }\n if (sections !== undefined && event !== undefined) {\n let affected = sections.some((section) => event.affectsConfiguration(section));\n if (!affected) {\n return;\n }\n }\n const didChangeConfiguration = async (sections) => {\n if (sections === undefined) {\n return this._client.sendNotification(vscode_languageserver_protocol_1.DidChangeConfigurationNotification.type, { settings: null });\n }\n else {\n return this._client.sendNotification(vscode_languageserver_protocol_1.DidChangeConfigurationNotification.type, { settings: this.extractSettingsInformation(sections) });\n }\n };\n let middleware = this._client.middleware.workspace?.didChangeConfiguration;\n (middleware ? middleware(sections, didChangeConfiguration) : didChangeConfiguration(sections)).catch((error) => {\n this._client.error(`Sending notification ${vscode_languageserver_protocol_1.DidChangeConfigurationNotification.type.method} failed`, error);\n });\n }\n extractSettingsInformation(keys) {\n function ensurePath(config, path) {\n let current = config;\n for (let i = 0; i < path.length - 1; i++) {\n let obj = current[path[i]];\n if (!obj) {\n obj = Object.create(null);\n current[path[i]] = obj;\n }\n current = obj;\n }\n return current;\n }\n let resource = this._client.clientOptions.workspaceFolder\n ? this._client.clientOptions.workspaceFolder.uri\n : undefined;\n let result = Object.create(null);\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i];\n let index = key.indexOf('.');\n let config = null;\n if (index >= 0) {\n config = vscode_1.workspace.getConfiguration(key.substr(0, index), resource).get(key.substr(index + 1));\n }\n else {\n config = vscode_1.workspace.getConfiguration(undefined, resource).get(key);\n }\n if (config) {\n let path = keys[i].split('.');\n ensurePath(result, path)[path[path.length - 1]] = toJSONObject(config);\n }\n }\n return result;\n }\n}\nexports.SyncConfigurationFeature = SyncConfigurationFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DidSaveTextDocumentFeature = exports.WillSaveWaitUntilFeature = exports.WillSaveFeature = exports.DidChangeTextDocumentFeature = exports.DidCloseTextDocumentFeature = exports.DidOpenTextDocumentFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass DidOpenTextDocumentFeature extends features_1.TextDocumentEventFeature {\n constructor(client, syncedDocuments) {\n super(client, vscode_1.workspace.onDidOpenTextDocument, vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.type, () => client.middleware.didOpen, (textDocument) => client.code2ProtocolConverter.asOpenTextDocumentParams(textDocument), (data) => data, features_1.TextDocumentEventFeature.textDocumentFilter);\n this._syncedDocuments = syncedDocuments;\n }\n get openDocuments() {\n return this._syncedDocuments.values();\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'synchronization').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const textDocumentSyncOptions = capabilities.resolvedTextDocumentSync;\n if (documentSelector && textDocumentSyncOptions && textDocumentSyncOptions.openClose) {\n this.register({ id: UUID.generateUuid(), registerOptions: { documentSelector: documentSelector } });\n }\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.type;\n }\n register(data) {\n super.register(data);\n if (!data.registerOptions.documentSelector) {\n return;\n }\n const documentSelector = this._client.protocol2CodeConverter.asDocumentSelector(data.registerOptions.documentSelector);\n vscode_1.workspace.textDocuments.forEach((textDocument) => {\n const uri = textDocument.uri.toString();\n if (this._syncedDocuments.has(uri)) {\n return;\n }\n if (vscode_1.languages.match(documentSelector, textDocument) > 0 && !this._client.hasDedicatedTextSynchronizationFeature(textDocument)) {\n const middleware = this._client.middleware;\n const didOpen = (textDocument) => {\n return this._client.sendNotification(this._type, this._createParams(textDocument));\n };\n (middleware.didOpen ? middleware.didOpen(textDocument, didOpen) : didOpen(textDocument)).catch((error) => {\n this._client.error(`Sending document notification ${this._type.method} failed`, error);\n });\n this._syncedDocuments.set(uri, textDocument);\n }\n });\n }\n getTextDocument(data) {\n return data;\n }\n notificationSent(textDocument, type, params) {\n this._syncedDocuments.set(textDocument.uri.toString(), textDocument);\n super.notificationSent(textDocument, type, params);\n }\n}\nexports.DidOpenTextDocumentFeature = DidOpenTextDocumentFeature;\nclass DidCloseTextDocumentFeature extends features_1.TextDocumentEventFeature {\n constructor(client, syncedDocuments, pendingTextDocumentChanges) {\n super(client, vscode_1.workspace.onDidCloseTextDocument, vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.type, () => client.middleware.didClose, (textDocument) => client.code2ProtocolConverter.asCloseTextDocumentParams(textDocument), (data) => data, features_1.TextDocumentEventFeature.textDocumentFilter);\n this._syncedDocuments = syncedDocuments;\n this._pendingTextDocumentChanges = pendingTextDocumentChanges;\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.type;\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'synchronization').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n let textDocumentSyncOptions = capabilities.resolvedTextDocumentSync;\n if (documentSelector && textDocumentSyncOptions && textDocumentSyncOptions.openClose) {\n this.register({ id: UUID.generateUuid(), registerOptions: { documentSelector: documentSelector } });\n }\n }\n async callback(data) {\n await super.callback(data);\n this._pendingTextDocumentChanges.delete(data.uri.toString());\n }\n getTextDocument(data) {\n return data;\n }\n notificationSent(textDocument, type, params) {\n this._syncedDocuments.delete(textDocument.uri.toString());\n super.notificationSent(textDocument, type, params);\n }\n unregister(id) {\n const selector = this._selectors.get(id);\n // The super call removed the selector from the map\n // of selectors.\n super.unregister(id);\n const selectors = this._selectors.values();\n this._syncedDocuments.forEach((textDocument) => {\n if (vscode_1.languages.match(selector, textDocument) > 0 && !this._selectorFilter(selectors, textDocument) && !this._client.hasDedicatedTextSynchronizationFeature(textDocument)) {\n let middleware = this._client.middleware;\n let didClose = (textDocument) => {\n return this._client.sendNotification(this._type, this._createParams(textDocument));\n };\n this._syncedDocuments.delete(textDocument.uri.toString());\n (middleware.didClose ? middleware.didClose(textDocument, didClose) : didClose(textDocument)).catch((error) => {\n this._client.error(`Sending document notification ${this._type.method} failed`, error);\n });\n }\n });\n }\n}\nexports.DidCloseTextDocumentFeature = DidCloseTextDocumentFeature;\nclass DidChangeTextDocumentFeature extends features_1.DynamicDocumentFeature {\n constructor(client, pendingTextDocumentChanges) {\n super(client);\n this._changeData = new Map();\n this._onNotificationSent = new vscode_1.EventEmitter();\n this._onPendingChangeAdded = new vscode_1.EventEmitter();\n this._pendingTextDocumentChanges = pendingTextDocumentChanges;\n this._syncKind = vscode_languageserver_protocol_1.TextDocumentSyncKind.None;\n }\n get onNotificationSent() {\n return this._onNotificationSent.event;\n }\n get onPendingChangeAdded() {\n return this._onPendingChangeAdded.event;\n }\n get syncKind() {\n return this._syncKind;\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type;\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'synchronization').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n let textDocumentSyncOptions = capabilities.resolvedTextDocumentSync;\n if (documentSelector && textDocumentSyncOptions && textDocumentSyncOptions.change !== undefined && textDocumentSyncOptions.change !== vscode_languageserver_protocol_1.TextDocumentSyncKind.None) {\n this.register({\n id: UUID.generateUuid(),\n registerOptions: Object.assign({}, { documentSelector: documentSelector }, { syncKind: textDocumentSyncOptions.change })\n });\n }\n }\n register(data) {\n if (!data.registerOptions.documentSelector) {\n return;\n }\n if (!this._listener) {\n this._listener = vscode_1.workspace.onDidChangeTextDocument(this.callback, this);\n }\n this._changeData.set(data.id, {\n syncKind: data.registerOptions.syncKind,\n documentSelector: this._client.protocol2CodeConverter.asDocumentSelector(data.registerOptions.documentSelector),\n });\n this.updateSyncKind(data.registerOptions.syncKind);\n }\n *getDocumentSelectors() {\n for (const data of this._changeData.values()) {\n yield data.documentSelector;\n }\n }\n async callback(event) {\n // Text document changes are send for dirty changes as well. We don't\n // have dirty / un-dirty events in the LSP so we ignore content changes\n // with length zero.\n if (event.contentChanges.length === 0) {\n return;\n }\n // We need to capture the URI and version here since they might change on the text document\n // until we reach did `didChange` call since the middleware support async execution.\n const uri = event.document.uri;\n const version = event.document.version;\n const promises = [];\n for (const changeData of this._changeData.values()) {\n if (vscode_1.languages.match(changeData.documentSelector, event.document) > 0 && !this._client.hasDedicatedTextSynchronizationFeature(event.document)) {\n const middleware = this._client.middleware;\n if (changeData.syncKind === vscode_languageserver_protocol_1.TextDocumentSyncKind.Incremental) {\n const didChange = async (event) => {\n const params = this._client.code2ProtocolConverter.asChangeTextDocumentParams(event, uri, version);\n await this._client.sendNotification(vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type, params);\n this.notificationSent(event.document, vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type, params);\n };\n promises.push(middleware.didChange ? middleware.didChange(event, event => didChange(event)) : didChange(event));\n }\n else if (changeData.syncKind === vscode_languageserver_protocol_1.TextDocumentSyncKind.Full) {\n const didChange = async (event) => {\n const eventUri = event.document.uri.toString();\n this._pendingTextDocumentChanges.set(eventUri, event.document);\n this._onPendingChangeAdded.fire();\n };\n promises.push(middleware.didChange ? middleware.didChange(event, event => didChange(event)) : didChange(event));\n }\n }\n }\n return Promise.all(promises).then(undefined, (error) => {\n this._client.error(`Sending document notification ${vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type.method} failed`, error);\n throw error;\n });\n }\n notificationSent(textDocument, type, params) {\n this._onNotificationSent.fire({ textDocument, type, params });\n }\n unregister(id) {\n this._changeData.delete(id);\n if (this._changeData.size === 0) {\n if (this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n this._syncKind = vscode_languageserver_protocol_1.TextDocumentSyncKind.None;\n }\n else {\n this._syncKind = vscode_languageserver_protocol_1.TextDocumentSyncKind.None;\n for (const changeData of this._changeData.values()) {\n this.updateSyncKind(changeData.syncKind);\n if (this._syncKind === vscode_languageserver_protocol_1.TextDocumentSyncKind.Full) {\n break;\n }\n }\n }\n }\n clear() {\n this._pendingTextDocumentChanges.clear();\n this._changeData.clear();\n this._syncKind = vscode_languageserver_protocol_1.TextDocumentSyncKind.None;\n if (this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n }\n getPendingDocumentChanges(excludes) {\n if (this._pendingTextDocumentChanges.size === 0) {\n return [];\n }\n let result;\n if (excludes.size === 0) {\n result = Array.from(this._pendingTextDocumentChanges.values());\n this._pendingTextDocumentChanges.clear();\n }\n else {\n result = [];\n for (const entry of this._pendingTextDocumentChanges) {\n if (!excludes.has(entry[0])) {\n result.push(entry[1]);\n this._pendingTextDocumentChanges.delete(entry[0]);\n }\n }\n }\n return result;\n }\n getProvider(document) {\n for (const changeData of this._changeData.values()) {\n if (vscode_1.languages.match(changeData.documentSelector, document) > 0) {\n return {\n send: (event) => {\n return this.callback(event);\n }\n };\n }\n }\n return undefined;\n }\n updateSyncKind(syncKind) {\n if (this._syncKind === vscode_languageserver_protocol_1.TextDocumentSyncKind.Full) {\n return;\n }\n switch (syncKind) {\n case vscode_languageserver_protocol_1.TextDocumentSyncKind.Full:\n this._syncKind = syncKind;\n break;\n case vscode_languageserver_protocol_1.TextDocumentSyncKind.Incremental:\n if (this._syncKind === vscode_languageserver_protocol_1.TextDocumentSyncKind.None) {\n this._syncKind = vscode_languageserver_protocol_1.TextDocumentSyncKind.Incremental;\n }\n break;\n }\n }\n}\nexports.DidChangeTextDocumentFeature = DidChangeTextDocumentFeature;\nclass WillSaveFeature extends features_1.TextDocumentEventFeature {\n constructor(client) {\n super(client, vscode_1.workspace.onWillSaveTextDocument, vscode_languageserver_protocol_1.WillSaveTextDocumentNotification.type, () => client.middleware.willSave, (willSaveEvent) => client.code2ProtocolConverter.asWillSaveTextDocumentParams(willSaveEvent), (event) => event.document, (selectors, willSaveEvent) => features_1.TextDocumentEventFeature.textDocumentFilter(selectors, willSaveEvent.document));\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.WillSaveTextDocumentNotification.type;\n }\n fillClientCapabilities(capabilities) {\n let value = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'synchronization');\n value.willSave = true;\n }\n initialize(capabilities, documentSelector) {\n let textDocumentSyncOptions = capabilities.resolvedTextDocumentSync;\n if (documentSelector && textDocumentSyncOptions && textDocumentSyncOptions.willSave) {\n this.register({\n id: UUID.generateUuid(),\n registerOptions: { documentSelector: documentSelector }\n });\n }\n }\n getTextDocument(data) {\n return data.document;\n }\n}\nexports.WillSaveFeature = WillSaveFeature;\nclass WillSaveWaitUntilFeature extends features_1.DynamicDocumentFeature {\n constructor(client) {\n super(client);\n this._selectors = new Map();\n }\n getDocumentSelectors() {\n return this._selectors.values();\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.WillSaveTextDocumentWaitUntilRequest.type;\n }\n fillClientCapabilities(capabilities) {\n let value = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'synchronization');\n value.willSaveWaitUntil = true;\n }\n initialize(capabilities, documentSelector) {\n let textDocumentSyncOptions = capabilities.resolvedTextDocumentSync;\n if (documentSelector && textDocumentSyncOptions && textDocumentSyncOptions.willSaveWaitUntil) {\n this.register({\n id: UUID.generateUuid(),\n registerOptions: { documentSelector: documentSelector }\n });\n }\n }\n register(data) {\n if (!data.registerOptions.documentSelector) {\n return;\n }\n if (!this._listener) {\n this._listener = vscode_1.workspace.onWillSaveTextDocument(this.callback, this);\n }\n this._selectors.set(data.id, this._client.protocol2CodeConverter.asDocumentSelector(data.registerOptions.documentSelector));\n }\n callback(event) {\n if (features_1.TextDocumentEventFeature.textDocumentFilter(this._selectors.values(), event.document) && !this._client.hasDedicatedTextSynchronizationFeature(event.document)) {\n let middleware = this._client.middleware;\n let willSaveWaitUntil = (event) => {\n return this._client.sendRequest(vscode_languageserver_protocol_1.WillSaveTextDocumentWaitUntilRequest.type, this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(event)).then(async (edits) => {\n let vEdits = await this._client.protocol2CodeConverter.asTextEdits(edits);\n return vEdits === undefined ? [] : vEdits;\n });\n };\n event.waitUntil(middleware.willSaveWaitUntil\n ? middleware.willSaveWaitUntil(event, willSaveWaitUntil)\n : willSaveWaitUntil(event));\n }\n }\n unregister(id) {\n this._selectors.delete(id);\n if (this._selectors.size === 0 && this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n }\n clear() {\n this._selectors.clear();\n if (this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n }\n}\nexports.WillSaveWaitUntilFeature = WillSaveWaitUntilFeature;\nclass DidSaveTextDocumentFeature extends features_1.TextDocumentEventFeature {\n constructor(client) {\n super(client, vscode_1.workspace.onDidSaveTextDocument, vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.type, () => client.middleware.didSave, (textDocument) => client.code2ProtocolConverter.asSaveTextDocumentParams(textDocument, this._includeText), (data) => data, features_1.TextDocumentEventFeature.textDocumentFilter);\n this._includeText = false;\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.type;\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'synchronization').didSave = true;\n }\n initialize(capabilities, documentSelector) {\n const textDocumentSyncOptions = capabilities.resolvedTextDocumentSync;\n if (documentSelector && textDocumentSyncOptions && textDocumentSyncOptions.save) {\n const saveOptions = typeof textDocumentSyncOptions.save === 'boolean'\n ? { includeText: false }\n : { includeText: !!textDocumentSyncOptions.save.includeText };\n this.register({\n id: UUID.generateUuid(),\n registerOptions: Object.assign({}, { documentSelector: documentSelector }, saveOptions)\n });\n }\n }\n register(data) {\n this._includeText = !!data.registerOptions.includeText;\n super.register(data);\n }\n getTextDocument(data) {\n return data;\n }\n}\nexports.DidSaveTextDocumentFeature = DidSaveTextDocumentFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CompletionItemFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nconst SupportedCompletionItemKinds = [\n vscode_languageserver_protocol_1.CompletionItemKind.Text,\n vscode_languageserver_protocol_1.CompletionItemKind.Method,\n vscode_languageserver_protocol_1.CompletionItemKind.Function,\n vscode_languageserver_protocol_1.CompletionItemKind.Constructor,\n vscode_languageserver_protocol_1.CompletionItemKind.Field,\n vscode_languageserver_protocol_1.CompletionItemKind.Variable,\n vscode_languageserver_protocol_1.CompletionItemKind.Class,\n vscode_languageserver_protocol_1.CompletionItemKind.Interface,\n vscode_languageserver_protocol_1.CompletionItemKind.Module,\n vscode_languageserver_protocol_1.CompletionItemKind.Property,\n vscode_languageserver_protocol_1.CompletionItemKind.Unit,\n vscode_languageserver_protocol_1.CompletionItemKind.Value,\n vscode_languageserver_protocol_1.CompletionItemKind.Enum,\n vscode_languageserver_protocol_1.CompletionItemKind.Keyword,\n vscode_languageserver_protocol_1.CompletionItemKind.Snippet,\n vscode_languageserver_protocol_1.CompletionItemKind.Color,\n vscode_languageserver_protocol_1.CompletionItemKind.File,\n vscode_languageserver_protocol_1.CompletionItemKind.Reference,\n vscode_languageserver_protocol_1.CompletionItemKind.Folder,\n vscode_languageserver_protocol_1.CompletionItemKind.EnumMember,\n vscode_languageserver_protocol_1.CompletionItemKind.Constant,\n vscode_languageserver_protocol_1.CompletionItemKind.Struct,\n vscode_languageserver_protocol_1.CompletionItemKind.Event,\n vscode_languageserver_protocol_1.CompletionItemKind.Operator,\n vscode_languageserver_protocol_1.CompletionItemKind.TypeParameter\n];\nclass CompletionItemFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.CompletionRequest.type);\n this.labelDetailsSupport = new Map();\n }\n fillClientCapabilities(capabilities) {\n let completion = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'completion');\n completion.dynamicRegistration = true;\n completion.contextSupport = true;\n completion.completionItem = {\n snippetSupport: true,\n commitCharactersSupport: true,\n documentationFormat: [vscode_languageserver_protocol_1.MarkupKind.Markdown, vscode_languageserver_protocol_1.MarkupKind.PlainText],\n deprecatedSupport: true,\n preselectSupport: true,\n tagSupport: { valueSet: [vscode_languageserver_protocol_1.CompletionItemTag.Deprecated] },\n insertReplaceSupport: true,\n resolveSupport: {\n properties: ['documentation', 'detail', 'additionalTextEdits']\n },\n insertTextModeSupport: { valueSet: [vscode_languageserver_protocol_1.InsertTextMode.asIs, vscode_languageserver_protocol_1.InsertTextMode.adjustIndentation] },\n labelDetailsSupport: true\n };\n completion.insertTextMode = vscode_languageserver_protocol_1.InsertTextMode.adjustIndentation;\n completion.completionItemKind = { valueSet: SupportedCompletionItemKinds };\n completion.completionList = {\n itemDefaults: [\n 'commitCharacters', 'editRange', 'insertTextFormat', 'insertTextMode', 'data'\n ]\n };\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.completionProvider);\n if (!options) {\n return;\n }\n this.register({\n id: UUID.generateUuid(),\n registerOptions: options\n });\n }\n registerLanguageProvider(options, id) {\n this.labelDetailsSupport.set(id, !!options.completionItem?.labelDetailsSupport);\n const triggerCharacters = options.triggerCharacters ?? [];\n const defaultCommitCharacters = options.allCommitCharacters;\n const selector = options.documentSelector;\n const provider = {\n provideCompletionItems: (document, position, token, context) => {\n const client = this._client;\n const middleware = this._client.middleware;\n const provideCompletionItems = (document, position, context, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.CompletionRequest.type, client.code2ProtocolConverter.asCompletionParams(document, position, context), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asCompletionResult(result, defaultCommitCharacters, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CompletionRequest.type, token, error, null);\n });\n };\n return middleware.provideCompletionItem\n ? middleware.provideCompletionItem(document, position, context, token, provideCompletionItems)\n : provideCompletionItems(document, position, context, token);\n },\n resolveCompletionItem: options.resolveProvider\n ? (item, token) => {\n const client = this._client;\n const middleware = this._client.middleware;\n const resolveCompletionItem = (item, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.CompletionResolveRequest.type, client.code2ProtocolConverter.asCompletionItem(item, !!this.labelDetailsSupport.get(id)), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asCompletionItem(result);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CompletionResolveRequest.type, token, error, item);\n });\n };\n return middleware.resolveCompletionItem\n ? middleware.resolveCompletionItem(item, token, resolveCompletionItem)\n : resolveCompletionItem(item, token);\n }\n : undefined\n };\n return [vscode_1.languages.registerCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider, ...triggerCharacters), provider];\n }\n}\nexports.CompletionItemFeature = CompletionItemFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HoverFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass HoverFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.HoverRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const hoverCapability = ((0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'hover'));\n hoverCapability.dynamicRegistration = true;\n hoverCapability.contentFormat = [vscode_languageserver_protocol_1.MarkupKind.Markdown, vscode_languageserver_protocol_1.MarkupKind.PlainText];\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.hoverProvider);\n if (!options) {\n return;\n }\n this.register({\n id: UUID.generateUuid(),\n registerOptions: options\n });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideHover: (document, position, token) => {\n const client = this._client;\n const provideHover = (document, position, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.HoverRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asHover(result);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.HoverRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideHover\n ? middleware.provideHover(document, position, token, provideHover)\n : provideHover(document, position, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerHoverProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.HoverFeature = HoverFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefinitionFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass DefinitionFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DefinitionRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let definitionSupport = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'definition');\n definitionSupport.dynamicRegistration = true;\n definitionSupport.linkSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.definitionProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideDefinition: (document, position, token) => {\n const client = this._client;\n const provideDefinition = (document, position, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.DefinitionRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asDefinitionResult(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DefinitionRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDefinition\n ? middleware.provideDefinition(document, position, token, provideDefinition)\n : provideDefinition(document, position, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.DefinitionFeature = DefinitionFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SignatureHelpFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass SignatureHelpFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.SignatureHelpRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let config = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'signatureHelp');\n config.dynamicRegistration = true;\n config.signatureInformation = { documentationFormat: [vscode_languageserver_protocol_1.MarkupKind.Markdown, vscode_languageserver_protocol_1.MarkupKind.PlainText] };\n config.signatureInformation.parameterInformation = { labelOffsetSupport: true };\n config.signatureInformation.activeParameterSupport = true;\n config.contextSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.signatureHelpProvider);\n if (!options) {\n return;\n }\n this.register({\n id: UUID.generateUuid(),\n registerOptions: options\n });\n }\n registerLanguageProvider(options) {\n const provider = {\n provideSignatureHelp: (document, position, token, context) => {\n const client = this._client;\n const providerSignatureHelp = (document, position, context, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.SignatureHelpRequest.type, client.code2ProtocolConverter.asSignatureHelpParams(document, position, context), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asSignatureHelp(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.SignatureHelpRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideSignatureHelp\n ? middleware.provideSignatureHelp(document, position, context, token, providerSignatureHelp)\n : providerSignatureHelp(document, position, context, token);\n }\n };\n return [this.registerProvider(options, provider), provider];\n }\n registerProvider(options, provider) {\n const selector = this._client.protocol2CodeConverter.asDocumentSelector(options.documentSelector);\n if (options.retriggerCharacters === undefined) {\n const triggerCharacters = options.triggerCharacters || [];\n return vscode_1.languages.registerSignatureHelpProvider(selector, provider, ...triggerCharacters);\n }\n else {\n const metaData = {\n triggerCharacters: options.triggerCharacters || [],\n retriggerCharacters: options.retriggerCharacters || []\n };\n return vscode_1.languages.registerSignatureHelpProvider(selector, provider, metaData);\n }\n }\n}\nexports.SignatureHelpFeature = SignatureHelpFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DocumentHighlightFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass DocumentHighlightFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentHighlightRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'documentHighlight').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.documentHighlightProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideDocumentHighlights: (document, position, token) => {\n const client = this._client;\n const _provideDocumentHighlights = (document, position, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentHighlightRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asDocumentHighlights(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentHighlightRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDocumentHighlights\n ? middleware.provideDocumentHighlights(document, position, token, _provideDocumentHighlights)\n : _provideDocumentHighlights(document, position, token);\n }\n };\n return [vscode_1.languages.registerDocumentHighlightProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), provider];\n }\n}\nexports.DocumentHighlightFeature = DocumentHighlightFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DocumentSymbolFeature = exports.SupportedSymbolTags = exports.SupportedSymbolKinds = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nexports.SupportedSymbolKinds = [\n vscode_languageserver_protocol_1.SymbolKind.File,\n vscode_languageserver_protocol_1.SymbolKind.Module,\n vscode_languageserver_protocol_1.SymbolKind.Namespace,\n vscode_languageserver_protocol_1.SymbolKind.Package,\n vscode_languageserver_protocol_1.SymbolKind.Class,\n vscode_languageserver_protocol_1.SymbolKind.Method,\n vscode_languageserver_protocol_1.SymbolKind.Property,\n vscode_languageserver_protocol_1.SymbolKind.Field,\n vscode_languageserver_protocol_1.SymbolKind.Constructor,\n vscode_languageserver_protocol_1.SymbolKind.Enum,\n vscode_languageserver_protocol_1.SymbolKind.Interface,\n vscode_languageserver_protocol_1.SymbolKind.Function,\n vscode_languageserver_protocol_1.SymbolKind.Variable,\n vscode_languageserver_protocol_1.SymbolKind.Constant,\n vscode_languageserver_protocol_1.SymbolKind.String,\n vscode_languageserver_protocol_1.SymbolKind.Number,\n vscode_languageserver_protocol_1.SymbolKind.Boolean,\n vscode_languageserver_protocol_1.SymbolKind.Array,\n vscode_languageserver_protocol_1.SymbolKind.Object,\n vscode_languageserver_protocol_1.SymbolKind.Key,\n vscode_languageserver_protocol_1.SymbolKind.Null,\n vscode_languageserver_protocol_1.SymbolKind.EnumMember,\n vscode_languageserver_protocol_1.SymbolKind.Struct,\n vscode_languageserver_protocol_1.SymbolKind.Event,\n vscode_languageserver_protocol_1.SymbolKind.Operator,\n vscode_languageserver_protocol_1.SymbolKind.TypeParameter\n];\nexports.SupportedSymbolTags = [\n vscode_languageserver_protocol_1.SymbolTag.Deprecated\n];\nclass DocumentSymbolFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentSymbolRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let symbolCapabilities = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'documentSymbol');\n symbolCapabilities.dynamicRegistration = true;\n symbolCapabilities.symbolKind = {\n valueSet: exports.SupportedSymbolKinds\n };\n symbolCapabilities.hierarchicalDocumentSymbolSupport = true;\n symbolCapabilities.tagSupport = {\n valueSet: exports.SupportedSymbolTags\n };\n symbolCapabilities.labelSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.documentSymbolProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideDocumentSymbols: (document, token) => {\n const client = this._client;\n const _provideDocumentSymbols = async (document, token) => {\n try {\n const data = await client.sendRequest(vscode_languageserver_protocol_1.DocumentSymbolRequest.type, client.code2ProtocolConverter.asDocumentSymbolParams(document), token);\n if (token.isCancellationRequested || data === undefined || data === null) {\n return null;\n }\n if (data.length === 0) {\n return [];\n }\n else {\n const first = data[0];\n if (vscode_languageserver_protocol_1.DocumentSymbol.is(first)) {\n return await client.protocol2CodeConverter.asDocumentSymbols(data, token);\n }\n else {\n return await client.protocol2CodeConverter.asSymbolInformations(data, token);\n }\n }\n }\n catch (error) {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentSymbolRequest.type, token, error, null);\n }\n };\n const middleware = client.middleware;\n return middleware.provideDocumentSymbols\n ? middleware.provideDocumentSymbols(document, token, _provideDocumentSymbols)\n : _provideDocumentSymbols(document, token);\n }\n };\n const metaData = options.label !== undefined ? { label: options.label } : undefined;\n return [vscode_1.languages.registerDocumentSymbolProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider, metaData), provider];\n }\n}\nexports.DocumentSymbolFeature = DocumentSymbolFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkspaceSymbolFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst documentSymbol_1 = require(\"./documentSymbol\");\nconst UUID = require(\"./utils/uuid\");\nclass WorkspaceSymbolFeature extends features_1.WorkspaceFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let symbolCapabilities = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'symbol');\n symbolCapabilities.dynamicRegistration = true;\n symbolCapabilities.symbolKind = {\n valueSet: documentSymbol_1.SupportedSymbolKinds\n };\n symbolCapabilities.tagSupport = {\n valueSet: documentSymbol_1.SupportedSymbolTags\n };\n symbolCapabilities.resolveSupport = { properties: ['location.range'] };\n }\n initialize(capabilities) {\n if (!capabilities.workspaceSymbolProvider) {\n return;\n }\n this.register({\n id: UUID.generateUuid(),\n registerOptions: capabilities.workspaceSymbolProvider === true ? { workDoneProgress: false } : capabilities.workspaceSymbolProvider\n });\n }\n registerLanguageProvider(options) {\n const provider = {\n provideWorkspaceSymbols: (query, token) => {\n const client = this._client;\n const provideWorkspaceSymbols = (query, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type, { query }, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asSymbolInformations(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideWorkspaceSymbols\n ? middleware.provideWorkspaceSymbols(query, token, provideWorkspaceSymbols)\n : provideWorkspaceSymbols(query, token);\n },\n resolveWorkspaceSymbol: options.resolveProvider === true\n ? (item, token) => {\n const client = this._client;\n const resolveWorkspaceSymbol = (item, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.WorkspaceSymbolResolveRequest.type, client.code2ProtocolConverter.asWorkspaceSymbol(item), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asSymbolInformation(result);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.WorkspaceSymbolResolveRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.resolveWorkspaceSymbol\n ? middleware.resolveWorkspaceSymbol(item, token, resolveWorkspaceSymbol)\n : resolveWorkspaceSymbol(item, token);\n }\n : undefined\n };\n return [vscode_1.languages.registerWorkspaceSymbolProvider(provider), provider];\n }\n}\nexports.WorkspaceSymbolFeature = WorkspaceSymbolFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ReferencesFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass ReferencesFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.ReferencesRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'references').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.referencesProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideReferences: (document, position, options, token) => {\n const client = this._client;\n const _providerReferences = (document, position, options, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.ReferencesRequest.type, client.code2ProtocolConverter.asReferenceParams(document, position, options), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asReferences(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.ReferencesRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideReferences\n ? middleware.provideReferences(document, position, options, token, _providerReferences)\n : _providerReferences(document, position, options, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerReferenceProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.ReferencesFeature = ReferencesFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CodeActionFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst UUID = require(\"./utils/uuid\");\nconst features_1 = require(\"./features\");\nclass CodeActionFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.CodeActionRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const cap = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'codeAction');\n cap.dynamicRegistration = true;\n cap.isPreferredSupport = true;\n cap.disabledSupport = true;\n cap.dataSupport = true;\n // We can only resolve the edit property.\n cap.resolveSupport = {\n properties: ['edit']\n };\n cap.codeActionLiteralSupport = {\n codeActionKind: {\n valueSet: [\n vscode_languageserver_protocol_1.CodeActionKind.Empty,\n vscode_languageserver_protocol_1.CodeActionKind.QuickFix,\n vscode_languageserver_protocol_1.CodeActionKind.Refactor,\n vscode_languageserver_protocol_1.CodeActionKind.RefactorExtract,\n vscode_languageserver_protocol_1.CodeActionKind.RefactorInline,\n vscode_languageserver_protocol_1.CodeActionKind.RefactorRewrite,\n vscode_languageserver_protocol_1.CodeActionKind.Source,\n vscode_languageserver_protocol_1.CodeActionKind.SourceOrganizeImports\n ]\n }\n };\n cap.honorsChangeAnnotations = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.codeActionProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideCodeActions: (document, range, context, token) => {\n const client = this._client;\n const _provideCodeActions = async (document, range, context, token) => {\n const params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n range: client.code2ProtocolConverter.asRange(range),\n context: client.code2ProtocolConverter.asCodeActionContextSync(context)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.CodeActionRequest.type, params, token).then((values) => {\n if (token.isCancellationRequested || values === null || values === undefined) {\n return null;\n }\n return client.protocol2CodeConverter.asCodeActionResult(values, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CodeActionRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideCodeActions\n ? middleware.provideCodeActions(document, range, context, token, _provideCodeActions)\n : _provideCodeActions(document, range, context, token);\n },\n resolveCodeAction: options.resolveProvider\n ? (item, token) => {\n const client = this._client;\n const middleware = this._client.middleware;\n const resolveCodeAction = async (item, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.CodeActionResolveRequest.type, client.code2ProtocolConverter.asCodeActionSync(item), token).then((result) => {\n if (token.isCancellationRequested) {\n return item;\n }\n return client.protocol2CodeConverter.asCodeAction(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CodeActionResolveRequest.type, token, error, item);\n });\n };\n return middleware.resolveCodeAction\n ? middleware.resolveCodeAction(item, token, resolveCodeAction)\n : resolveCodeAction(item, token);\n }\n : undefined\n };\n return [vscode_1.languages.registerCodeActionsProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider, (options.codeActionKinds\n ? { providedCodeActionKinds: this._client.protocol2CodeConverter.asCodeActionKinds(options.codeActionKinds) }\n : undefined)), provider];\n }\n}\nexports.CodeActionFeature = CodeActionFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CodeLensFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst UUID = require(\"./utils/uuid\");\nconst features_1 = require(\"./features\");\nclass CodeLensFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.CodeLensRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'codeLens').dynamicRegistration = true;\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'codeLens').refreshSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const client = this._client;\n client.onRequest(vscode_languageserver_protocol_1.CodeLensRefreshRequest.type, async () => {\n for (const provider of this.getAllProviders()) {\n provider.onDidChangeCodeLensEmitter.fire();\n }\n });\n const options = this.getRegistrationOptions(documentSelector, capabilities.codeLensProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const eventEmitter = new vscode_1.EventEmitter();\n const provider = {\n onDidChangeCodeLenses: eventEmitter.event,\n provideCodeLenses: (document, token) => {\n const client = this._client;\n const provideCodeLenses = (document, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.CodeLensRequest.type, client.code2ProtocolConverter.asCodeLensParams(document), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asCodeLenses(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CodeLensRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideCodeLenses\n ? middleware.provideCodeLenses(document, token, provideCodeLenses)\n : provideCodeLenses(document, token);\n },\n resolveCodeLens: (options.resolveProvider)\n ? (codeLens, token) => {\n const client = this._client;\n const resolveCodeLens = (codeLens, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.CodeLensResolveRequest.type, client.code2ProtocolConverter.asCodeLens(codeLens), token).then((result) => {\n if (token.isCancellationRequested) {\n return codeLens;\n }\n return client.protocol2CodeConverter.asCodeLens(result);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CodeLensResolveRequest.type, token, error, codeLens);\n });\n };\n const middleware = client.middleware;\n return middleware.resolveCodeLens\n ? middleware.resolveCodeLens(codeLens, token, resolveCodeLens)\n : resolveCodeLens(codeLens, token);\n }\n : undefined\n };\n return [vscode_1.languages.registerCodeLensProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), { provider, onDidChangeCodeLensEmitter: eventEmitter }];\n }\n}\nexports.CodeLensFeature = CodeLensFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DocumentOnTypeFormattingFeature = exports.DocumentRangeFormattingFeature = exports.DocumentFormattingFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst UUID = require(\"./utils/uuid\");\nconst features_1 = require(\"./features\");\nvar FileFormattingOptions;\n(function (FileFormattingOptions) {\n function fromConfiguration(document) {\n const filesConfig = vscode_1.workspace.getConfiguration('files', document);\n return {\n trimTrailingWhitespace: filesConfig.get('trimTrailingWhitespace'),\n trimFinalNewlines: filesConfig.get('trimFinalNewlines'),\n insertFinalNewline: filesConfig.get('insertFinalNewline'),\n };\n }\n FileFormattingOptions.fromConfiguration = fromConfiguration;\n})(FileFormattingOptions || (FileFormattingOptions = {}));\nclass DocumentFormattingFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentFormattingRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'formatting').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.documentFormattingProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideDocumentFormattingEdits: (document, options, token) => {\n const client = this._client;\n const provideDocumentFormattingEdits = (document, options, token) => {\n const params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n options: client.code2ProtocolConverter.asFormattingOptions(options, FileFormattingOptions.fromConfiguration(document))\n };\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentFormattingRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asTextEdits(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentFormattingRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDocumentFormattingEdits\n ? middleware.provideDocumentFormattingEdits(document, options, token, provideDocumentFormattingEdits)\n : provideDocumentFormattingEdits(document, options, token);\n }\n };\n return [vscode_1.languages.registerDocumentFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), provider];\n }\n}\nexports.DocumentFormattingFeature = DocumentFormattingFeature;\nclass DocumentRangeFormattingFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'rangeFormatting');\n capability.dynamicRegistration = true;\n capability.rangesSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.documentRangeFormattingProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideDocumentRangeFormattingEdits: (document, range, options, token) => {\n const client = this._client;\n const provideDocumentRangeFormattingEdits = (document, range, options, token) => {\n const params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n range: client.code2ProtocolConverter.asRange(range),\n options: client.code2ProtocolConverter.asFormattingOptions(options, FileFormattingOptions.fromConfiguration(document))\n };\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asTextEdits(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDocumentRangeFormattingEdits\n ? middleware.provideDocumentRangeFormattingEdits(document, range, options, token, provideDocumentRangeFormattingEdits)\n : provideDocumentRangeFormattingEdits(document, range, options, token);\n }\n };\n if (options.rangesSupport) {\n provider.provideDocumentRangesFormattingEdits = (document, ranges, options, token) => {\n const client = this._client;\n const provideDocumentRangesFormattingEdits = (document, ranges, options, token) => {\n const params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n ranges: client.code2ProtocolConverter.asRanges(ranges),\n options: client.code2ProtocolConverter.asFormattingOptions(options, FileFormattingOptions.fromConfiguration(document))\n };\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentRangesFormattingRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asTextEdits(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentRangesFormattingRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDocumentRangesFormattingEdits\n ? middleware.provideDocumentRangesFormattingEdits(document, ranges, options, token, provideDocumentRangesFormattingEdits)\n : provideDocumentRangesFormattingEdits(document, ranges, options, token);\n };\n }\n return [vscode_1.languages.registerDocumentRangeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), provider];\n }\n}\nexports.DocumentRangeFormattingFeature = DocumentRangeFormattingFeature;\nclass DocumentOnTypeFormattingFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'onTypeFormatting').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.documentOnTypeFormattingProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideOnTypeFormattingEdits: (document, position, ch, options, token) => {\n const client = this._client;\n const provideOnTypeFormattingEdits = (document, position, ch, options, token) => {\n let params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n position: client.code2ProtocolConverter.asPosition(position),\n ch: ch,\n options: client.code2ProtocolConverter.asFormattingOptions(options, FileFormattingOptions.fromConfiguration(document))\n };\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asTextEdits(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideOnTypeFormattingEdits\n ? middleware.provideOnTypeFormattingEdits(document, position, ch, options, token, provideOnTypeFormattingEdits)\n : provideOnTypeFormattingEdits(document, position, ch, options, token);\n }\n };\n const moreTriggerCharacter = options.moreTriggerCharacter || [];\n return [vscode_1.languages.registerOnTypeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider, options.firstTriggerCharacter, ...moreTriggerCharacter), provider];\n }\n}\nexports.DocumentOnTypeFormattingFeature = DocumentOnTypeFormattingFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RenameFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst UUID = require(\"./utils/uuid\");\nconst Is = require(\"./utils/is\");\nconst features_1 = require(\"./features\");\nclass RenameFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.RenameRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let rename = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'rename');\n rename.dynamicRegistration = true;\n rename.prepareSupport = true;\n rename.prepareSupportDefaultBehavior = vscode_languageserver_protocol_1.PrepareSupportDefaultBehavior.Identifier;\n rename.honorsChangeAnnotations = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.renameProvider);\n if (!options) {\n return;\n }\n if (Is.boolean(capabilities.renameProvider)) {\n options.prepareProvider = false;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideRenameEdits: (document, position, newName, token) => {\n const client = this._client;\n const provideRenameEdits = (document, position, newName, token) => {\n let params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n position: client.code2ProtocolConverter.asPosition(position),\n newName: newName\n };\n return client.sendRequest(vscode_languageserver_protocol_1.RenameRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asWorkspaceEdit(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.RenameRequest.type, token, error, null, false);\n });\n };\n const middleware = client.middleware;\n return middleware.provideRenameEdits\n ? middleware.provideRenameEdits(document, position, newName, token, provideRenameEdits)\n : provideRenameEdits(document, position, newName, token);\n },\n prepareRename: options.prepareProvider\n ? (document, position, token) => {\n const client = this._client;\n const prepareRename = (document, position, token) => {\n let params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n position: client.code2ProtocolConverter.asPosition(position),\n };\n return client.sendRequest(vscode_languageserver_protocol_1.PrepareRenameRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n if (vscode_languageserver_protocol_1.Range.is(result)) {\n return client.protocol2CodeConverter.asRange(result);\n }\n else if (this.isDefaultBehavior(result)) {\n return result.defaultBehavior === true\n ? null\n : Promise.reject(new Error(`The element can't be renamed.`));\n }\n else if (result && vscode_languageserver_protocol_1.Range.is(result.range)) {\n return {\n range: client.protocol2CodeConverter.asRange(result.range),\n placeholder: result.placeholder\n };\n }\n // To cancel the rename vscode API expects a rejected promise.\n return Promise.reject(new Error(`The element can't be renamed.`));\n }, (error) => {\n if (typeof error.message === 'string') {\n throw new Error(error.message);\n }\n else {\n throw new Error(`The element can't be renamed.`);\n }\n });\n };\n const middleware = client.middleware;\n return middleware.prepareRename\n ? middleware.prepareRename(document, position, token, prepareRename)\n : prepareRename(document, position, token);\n }\n : undefined\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerRenameProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n isDefaultBehavior(value) {\n const candidate = value;\n return candidate && Is.boolean(candidate.defaultBehavior);\n }\n}\nexports.RenameFeature = RenameFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DocumentLinkFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass DocumentLinkFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentLinkRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const documentLinkCapabilities = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'documentLink');\n documentLinkCapabilities.dynamicRegistration = true;\n documentLinkCapabilities.tooltipSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.documentLinkProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideDocumentLinks: (document, token) => {\n const client = this._client;\n const provideDocumentLinks = (document, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentLinkRequest.type, client.code2ProtocolConverter.asDocumentLinkParams(document), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asDocumentLinks(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentLinkRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDocumentLinks\n ? middleware.provideDocumentLinks(document, token, provideDocumentLinks)\n : provideDocumentLinks(document, token);\n },\n resolveDocumentLink: options.resolveProvider\n ? (link, token) => {\n const client = this._client;\n let resolveDocumentLink = (link, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentLinkResolveRequest.type, client.code2ProtocolConverter.asDocumentLink(link), token).then((result) => {\n if (token.isCancellationRequested) {\n return link;\n }\n return client.protocol2CodeConverter.asDocumentLink(result);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentLinkResolveRequest.type, token, error, link);\n });\n };\n const middleware = client.middleware;\n return middleware.resolveDocumentLink\n ? middleware.resolveDocumentLink(link, token, resolveDocumentLink)\n : resolveDocumentLink(link, token);\n }\n : undefined\n };\n return [vscode_1.languages.registerDocumentLinkProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), provider];\n }\n}\nexports.DocumentLinkFeature = DocumentLinkFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExecuteCommandFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst UUID = require(\"./utils/uuid\");\nconst features_1 = require(\"./features\");\nclass ExecuteCommandFeature {\n constructor(client) {\n this._client = client;\n this._commands = new Map();\n }\n getState() {\n return { kind: 'workspace', id: this.registrationType.method, registrations: this._commands.size > 0 };\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.ExecuteCommandRequest.type;\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'executeCommand').dynamicRegistration = true;\n }\n initialize(capabilities) {\n if (!capabilities.executeCommandProvider) {\n return;\n }\n this.register({\n id: UUID.generateUuid(),\n registerOptions: Object.assign({}, capabilities.executeCommandProvider)\n });\n }\n register(data) {\n const client = this._client;\n const middleware = client.middleware;\n const executeCommand = (command, args) => {\n let params = {\n command,\n arguments: args\n };\n return client.sendRequest(vscode_languageserver_protocol_1.ExecuteCommandRequest.type, params).then(undefined, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.ExecuteCommandRequest.type, undefined, error, undefined);\n });\n };\n if (data.registerOptions.commands) {\n const disposables = [];\n for (const command of data.registerOptions.commands) {\n disposables.push(vscode_1.commands.registerCommand(command, (...args) => {\n return middleware.executeCommand\n ? middleware.executeCommand(command, args, executeCommand)\n : executeCommand(command, args);\n }));\n }\n this._commands.set(data.id, disposables);\n }\n }\n unregister(id) {\n let disposables = this._commands.get(id);\n if (disposables) {\n disposables.forEach(disposable => disposable.dispose());\n }\n }\n clear() {\n this._commands.forEach((value) => {\n value.forEach(disposable => disposable.dispose());\n });\n this._commands.clear();\n }\n}\nexports.ExecuteCommandFeature = ExecuteCommandFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FileSystemWatcherFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass FileSystemWatcherFeature {\n constructor(client, notifyFileEvent) {\n this._client = client;\n this._notifyFileEvent = notifyFileEvent;\n this._watchers = new Map();\n }\n getState() {\n return { kind: 'workspace', id: this.registrationType.method, registrations: this._watchers.size > 0 };\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.DidChangeWatchedFilesNotification.type;\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'didChangeWatchedFiles').dynamicRegistration = true;\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'didChangeWatchedFiles').relativePatternSupport = true;\n }\n initialize(_capabilities, _documentSelector) {\n }\n register(data) {\n if (!Array.isArray(data.registerOptions.watchers)) {\n return;\n }\n const disposables = [];\n for (const watcher of data.registerOptions.watchers) {\n const globPattern = this._client.protocol2CodeConverter.asGlobPattern(watcher.globPattern);\n if (globPattern === undefined) {\n continue;\n }\n let watchCreate = true, watchChange = true, watchDelete = true;\n if (watcher.kind !== undefined && watcher.kind !== null) {\n watchCreate = (watcher.kind & vscode_languageserver_protocol_1.WatchKind.Create) !== 0;\n watchChange = (watcher.kind & vscode_languageserver_protocol_1.WatchKind.Change) !== 0;\n watchDelete = (watcher.kind & vscode_languageserver_protocol_1.WatchKind.Delete) !== 0;\n }\n const fileSystemWatcher = vscode_1.workspace.createFileSystemWatcher(globPattern, !watchCreate, !watchChange, !watchDelete);\n this.hookListeners(fileSystemWatcher, watchCreate, watchChange, watchDelete, disposables);\n disposables.push(fileSystemWatcher);\n }\n this._watchers.set(data.id, disposables);\n }\n registerRaw(id, fileSystemWatchers) {\n let disposables = [];\n for (let fileSystemWatcher of fileSystemWatchers) {\n this.hookListeners(fileSystemWatcher, true, true, true, disposables);\n }\n this._watchers.set(id, disposables);\n }\n hookListeners(fileSystemWatcher, watchCreate, watchChange, watchDelete, listeners) {\n if (watchCreate) {\n fileSystemWatcher.onDidCreate((resource) => this._notifyFileEvent({\n uri: this._client.code2ProtocolConverter.asUri(resource),\n type: vscode_languageserver_protocol_1.FileChangeType.Created\n }), null, listeners);\n }\n if (watchChange) {\n fileSystemWatcher.onDidChange((resource) => this._notifyFileEvent({\n uri: this._client.code2ProtocolConverter.asUri(resource),\n type: vscode_languageserver_protocol_1.FileChangeType.Changed\n }), null, listeners);\n }\n if (watchDelete) {\n fileSystemWatcher.onDidDelete((resource) => this._notifyFileEvent({\n uri: this._client.code2ProtocolConverter.asUri(resource),\n type: vscode_languageserver_protocol_1.FileChangeType.Deleted\n }), null, listeners);\n }\n }\n unregister(id) {\n let disposables = this._watchers.get(id);\n if (disposables) {\n for (let disposable of disposables) {\n disposable.dispose();\n }\n }\n }\n clear() {\n this._watchers.forEach((disposables) => {\n for (let disposable of disposables) {\n disposable.dispose();\n }\n });\n this._watchers.clear();\n }\n}\nexports.FileSystemWatcherFeature = FileSystemWatcherFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ColorProviderFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass ColorProviderFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentColorRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'colorProvider').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n let [id, options] = this.getRegistration(documentSelector, capabilities.colorProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideColorPresentations: (color, context, token) => {\n const client = this._client;\n const provideColorPresentations = (color, context, token) => {\n const requestParams = {\n color,\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(context.document),\n range: client.code2ProtocolConverter.asRange(context.range)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, requestParams, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return this._client.protocol2CodeConverter.asColorPresentations(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideColorPresentations\n ? middleware.provideColorPresentations(color, context, token, provideColorPresentations)\n : provideColorPresentations(color, context, token);\n },\n provideDocumentColors: (document, token) => {\n const client = this._client;\n const provideDocumentColors = (document, token) => {\n const requestParams = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentColorRequest.type, requestParams, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return this._client.protocol2CodeConverter.asColorInformations(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentColorRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDocumentColors\n ? middleware.provideDocumentColors(document, token, provideDocumentColors)\n : provideDocumentColors(document, token);\n }\n };\n return [vscode_1.languages.registerColorProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), provider];\n }\n}\nexports.ColorProviderFeature = ColorProviderFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ImplementationFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass ImplementationFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.ImplementationRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let implementationSupport = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'implementation');\n implementationSupport.dynamicRegistration = true;\n implementationSupport.linkSupport = true;\n }\n initialize(capabilities, documentSelector) {\n let [id, options] = this.getRegistration(documentSelector, capabilities.implementationProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideImplementation: (document, position, token) => {\n const client = this._client;\n const provideImplementation = (document, position, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asDefinitionResult(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideImplementation\n ? middleware.provideImplementation(document, position, token, provideImplementation)\n : provideImplementation(document, position, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerImplementationProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.ImplementationFeature = ImplementationFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TypeDefinitionFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass TypeDefinitionFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.TypeDefinitionRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'typeDefinition').dynamicRegistration = true;\n let typeDefinitionSupport = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'typeDefinition');\n typeDefinitionSupport.dynamicRegistration = true;\n typeDefinitionSupport.linkSupport = true;\n }\n initialize(capabilities, documentSelector) {\n let [id, options] = this.getRegistration(documentSelector, capabilities.typeDefinitionProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideTypeDefinition: (document, position, token) => {\n const client = this._client;\n const provideTypeDefinition = (document, position, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asDefinitionResult(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideTypeDefinition\n ? middleware.provideTypeDefinition(document, position, token, provideTypeDefinition)\n : provideTypeDefinition(document, position, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerTypeDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.TypeDefinitionFeature = TypeDefinitionFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkspaceFoldersFeature = exports.arrayDiff = void 0;\nconst UUID = require(\"./utils/uuid\");\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nfunction access(target, key) {\n if (target === undefined || target === null) {\n return undefined;\n }\n return target[key];\n}\nfunction arrayDiff(left, right) {\n return left.filter(element => right.indexOf(element) < 0);\n}\nexports.arrayDiff = arrayDiff;\nclass WorkspaceFoldersFeature {\n constructor(client) {\n this._client = client;\n this._listeners = new Map();\n }\n getState() {\n return { kind: 'workspace', id: this.registrationType.method, registrations: this._listeners.size > 0 };\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type;\n }\n fillInitializeParams(params) {\n const folders = vscode_1.workspace.workspaceFolders;\n this.initializeWithFolders(folders);\n if (folders === void 0) {\n params.workspaceFolders = null;\n }\n else {\n params.workspaceFolders = folders.map(folder => this.asProtocol(folder));\n }\n }\n initializeWithFolders(currentWorkspaceFolders) {\n this._initialFolders = currentWorkspaceFolders;\n }\n fillClientCapabilities(capabilities) {\n capabilities.workspace = capabilities.workspace || {};\n capabilities.workspace.workspaceFolders = true;\n }\n initialize(capabilities) {\n const client = this._client;\n client.onRequest(vscode_languageserver_protocol_1.WorkspaceFoldersRequest.type, (token) => {\n const workspaceFolders = () => {\n const folders = vscode_1.workspace.workspaceFolders;\n if (folders === undefined) {\n return null;\n }\n const result = folders.map((folder) => {\n return this.asProtocol(folder);\n });\n return result;\n };\n const middleware = client.middleware.workspace;\n return middleware && middleware.workspaceFolders\n ? middleware.workspaceFolders(token, workspaceFolders)\n : workspaceFolders(token);\n });\n const value = access(access(access(capabilities, 'workspace'), 'workspaceFolders'), 'changeNotifications');\n let id;\n if (typeof value === 'string') {\n id = value;\n }\n else if (value === true) {\n id = UUID.generateUuid();\n }\n if (id) {\n this.register({ id: id, registerOptions: undefined });\n }\n }\n sendInitialEvent(currentWorkspaceFolders) {\n let promise;\n if (this._initialFolders && currentWorkspaceFolders) {\n const removed = arrayDiff(this._initialFolders, currentWorkspaceFolders);\n const added = arrayDiff(currentWorkspaceFolders, this._initialFolders);\n if (added.length > 0 || removed.length > 0) {\n promise = this.doSendEvent(added, removed);\n }\n }\n else if (this._initialFolders) {\n promise = this.doSendEvent([], this._initialFolders);\n }\n else if (currentWorkspaceFolders) {\n promise = this.doSendEvent(currentWorkspaceFolders, []);\n }\n if (promise !== undefined) {\n promise.catch((error) => {\n this._client.error(`Sending notification ${vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type.method} failed`, error);\n });\n }\n }\n doSendEvent(addedFolders, removedFolders) {\n let params = {\n event: {\n added: addedFolders.map(folder => this.asProtocol(folder)),\n removed: removedFolders.map(folder => this.asProtocol(folder))\n }\n };\n return this._client.sendNotification(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type, params);\n }\n register(data) {\n let id = data.id;\n let client = this._client;\n let disposable = vscode_1.workspace.onDidChangeWorkspaceFolders((event) => {\n let didChangeWorkspaceFolders = (event) => {\n return this.doSendEvent(event.added, event.removed);\n };\n let middleware = client.middleware.workspace;\n const promise = middleware && middleware.didChangeWorkspaceFolders\n ? middleware.didChangeWorkspaceFolders(event, didChangeWorkspaceFolders)\n : didChangeWorkspaceFolders(event);\n promise.catch((error) => {\n this._client.error(`Sending notification ${vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type.method} failed`, error);\n });\n });\n this._listeners.set(id, disposable);\n this.sendInitialEvent(vscode_1.workspace.workspaceFolders);\n }\n unregister(id) {\n let disposable = this._listeners.get(id);\n if (disposable === void 0) {\n return;\n }\n this._listeners.delete(id);\n disposable.dispose();\n }\n clear() {\n for (let disposable of this._listeners.values()) {\n disposable.dispose();\n }\n this._listeners.clear();\n }\n asProtocol(workspaceFolder) {\n if (workspaceFolder === void 0) {\n return null;\n }\n return { uri: this._client.code2ProtocolConverter.asUri(workspaceFolder.uri), name: workspaceFolder.name };\n }\n}\nexports.WorkspaceFoldersFeature = WorkspaceFoldersFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FoldingRangeFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass FoldingRangeFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.FoldingRangeRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'foldingRange');\n capability.dynamicRegistration = true;\n capability.rangeLimit = 5000;\n capability.lineFoldingOnly = true;\n capability.foldingRangeKind = { valueSet: [vscode_languageserver_protocol_1.FoldingRangeKind.Comment, vscode_languageserver_protocol_1.FoldingRangeKind.Imports, vscode_languageserver_protocol_1.FoldingRangeKind.Region] };\n capability.foldingRange = { collapsedText: false };\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'foldingRange').refreshSupport = true;\n }\n initialize(capabilities, documentSelector) {\n this._client.onRequest(vscode_languageserver_protocol_1.FoldingRangeRefreshRequest.type, async () => {\n for (const provider of this.getAllProviders()) {\n provider.onDidChangeFoldingRange.fire();\n }\n });\n let [id, options] = this.getRegistration(documentSelector, capabilities.foldingRangeProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const eventEmitter = new vscode_1.EventEmitter();\n const provider = {\n onDidChangeFoldingRanges: eventEmitter.event,\n provideFoldingRanges: (document, context, token) => {\n const client = this._client;\n const provideFoldingRanges = (document, _, token) => {\n const requestParams = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, requestParams, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asFoldingRanges(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideFoldingRanges\n ? middleware.provideFoldingRanges(document, context, token, provideFoldingRanges)\n : provideFoldingRanges(document, context, token);\n }\n };\n return [vscode_1.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), { provider: provider, onDidChangeFoldingRange: eventEmitter }];\n }\n}\nexports.FoldingRangeFeature = FoldingRangeFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DeclarationFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass DeclarationFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DeclarationRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const declarationSupport = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'declaration');\n declarationSupport.dynamicRegistration = true;\n declarationSupport.linkSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const [id, options] = this.getRegistration(documentSelector, capabilities.declarationProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideDeclaration: (document, position, token) => {\n const client = this._client;\n const provideDeclaration = (document, position, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asDeclarationResult(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDeclaration\n ? middleware.provideDeclaration(document, position, token, provideDeclaration)\n : provideDeclaration(document, position, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerDeclarationProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.DeclarationFeature = DeclarationFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SelectionRangeFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass SelectionRangeFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.SelectionRangeRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'selectionRange');\n capability.dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const [id, options] = this.getRegistration(documentSelector, capabilities.selectionRangeProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideSelectionRanges: (document, positions, token) => {\n const client = this._client;\n const provideSelectionRanges = async (document, positions, token) => {\n const requestParams = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n positions: client.code2ProtocolConverter.asPositionsSync(positions, token)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.SelectionRangeRequest.type, requestParams, token).then((ranges) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asSelectionRanges(ranges, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.SelectionRangeRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideSelectionRanges\n ? middleware.provideSelectionRanges(document, positions, token, provideSelectionRanges)\n : provideSelectionRanges(document, positions, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerSelectionRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.SelectionRangeFeature = SelectionRangeFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProgressFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst progressPart_1 = require(\"./progressPart\");\nfunction ensure(target, key) {\n if (target[key] === void 0) {\n target[key] = Object.create(null);\n }\n return target[key];\n}\nclass ProgressFeature {\n constructor(_client) {\n this._client = _client;\n this.activeParts = new Set();\n }\n getState() {\n return { kind: 'window', id: vscode_languageserver_protocol_1.WorkDoneProgressCreateRequest.method, registrations: this.activeParts.size > 0 };\n }\n fillClientCapabilities(capabilities) {\n ensure(capabilities, 'window').workDoneProgress = true;\n }\n initialize() {\n const client = this._client;\n const deleteHandler = (part) => {\n this.activeParts.delete(part);\n };\n const createHandler = (params) => {\n this.activeParts.add(new progressPart_1.ProgressPart(this._client, params.token, deleteHandler));\n };\n client.onRequest(vscode_languageserver_protocol_1.WorkDoneProgressCreateRequest.type, createHandler);\n }\n clear() {\n for (const part of this.activeParts) {\n part.done();\n }\n this.activeParts.clear();\n }\n}\nexports.ProgressFeature = ProgressFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CallHierarchyFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass CallHierarchyProvider {\n constructor(client) {\n this.client = client;\n this.middleware = client.middleware;\n }\n prepareCallHierarchy(document, position, token) {\n const client = this.client;\n const middleware = this.middleware;\n const prepareCallHierarchy = (document, position, token) => {\n const params = client.code2ProtocolConverter.asTextDocumentPositionParams(document, position);\n return client.sendRequest(vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asCallHierarchyItems(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type, token, error, null);\n });\n };\n return middleware.prepareCallHierarchy\n ? middleware.prepareCallHierarchy(document, position, token, prepareCallHierarchy)\n : prepareCallHierarchy(document, position, token);\n }\n provideCallHierarchyIncomingCalls(item, token) {\n const client = this.client;\n const middleware = this.middleware;\n const provideCallHierarchyIncomingCalls = (item, token) => {\n const params = {\n item: client.code2ProtocolConverter.asCallHierarchyItem(item)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.CallHierarchyIncomingCallsRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asCallHierarchyIncomingCalls(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyIncomingCallsRequest.type, token, error, null);\n });\n };\n return middleware.provideCallHierarchyIncomingCalls\n ? middleware.provideCallHierarchyIncomingCalls(item, token, provideCallHierarchyIncomingCalls)\n : provideCallHierarchyIncomingCalls(item, token);\n }\n provideCallHierarchyOutgoingCalls(item, token) {\n const client = this.client;\n const middleware = this.middleware;\n const provideCallHierarchyOutgoingCalls = (item, token) => {\n const params = {\n item: client.code2ProtocolConverter.asCallHierarchyItem(item)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.CallHierarchyOutgoingCallsRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asCallHierarchyOutgoingCalls(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyOutgoingCallsRequest.type, token, error, null);\n });\n };\n return middleware.provideCallHierarchyOutgoingCalls\n ? middleware.provideCallHierarchyOutgoingCalls(item, token, provideCallHierarchyOutgoingCalls)\n : provideCallHierarchyOutgoingCalls(item, token);\n }\n}\nclass CallHierarchyFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type);\n }\n fillClientCapabilities(cap) {\n const capabilities = cap;\n const capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'callHierarchy');\n capability.dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const [id, options] = this.getRegistration(documentSelector, capabilities.callHierarchyProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const client = this._client;\n const provider = new CallHierarchyProvider(client);\n return [vscode_1.languages.registerCallHierarchyProvider(this._client.protocol2CodeConverter.asDocumentSelector(options.documentSelector), provider), provider];\n }\n}\nexports.CallHierarchyFeature = CallHierarchyFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SemanticTokensFeature = void 0;\nconst vscode = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst Is = require(\"./utils/is\");\nclass SemanticTokensFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.SemanticTokensRegistrationType.type);\n }\n fillClientCapabilities(capabilities) {\n const capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'semanticTokens');\n capability.dynamicRegistration = true;\n capability.tokenTypes = [\n vscode_languageserver_protocol_1.SemanticTokenTypes.namespace,\n vscode_languageserver_protocol_1.SemanticTokenTypes.type,\n vscode_languageserver_protocol_1.SemanticTokenTypes.class,\n vscode_languageserver_protocol_1.SemanticTokenTypes.enum,\n vscode_languageserver_protocol_1.SemanticTokenTypes.interface,\n vscode_languageserver_protocol_1.SemanticTokenTypes.struct,\n vscode_languageserver_protocol_1.SemanticTokenTypes.typeParameter,\n vscode_languageserver_protocol_1.SemanticTokenTypes.parameter,\n vscode_languageserver_protocol_1.SemanticTokenTypes.variable,\n vscode_languageserver_protocol_1.SemanticTokenTypes.property,\n vscode_languageserver_protocol_1.SemanticTokenTypes.enumMember,\n vscode_languageserver_protocol_1.SemanticTokenTypes.event,\n vscode_languageserver_protocol_1.SemanticTokenTypes.function,\n vscode_languageserver_protocol_1.SemanticTokenTypes.method,\n vscode_languageserver_protocol_1.SemanticTokenTypes.macro,\n vscode_languageserver_protocol_1.SemanticTokenTypes.keyword,\n vscode_languageserver_protocol_1.SemanticTokenTypes.modifier,\n vscode_languageserver_protocol_1.SemanticTokenTypes.comment,\n vscode_languageserver_protocol_1.SemanticTokenTypes.string,\n vscode_languageserver_protocol_1.SemanticTokenTypes.number,\n vscode_languageserver_protocol_1.SemanticTokenTypes.regexp,\n vscode_languageserver_protocol_1.SemanticTokenTypes.operator,\n vscode_languageserver_protocol_1.SemanticTokenTypes.decorator\n ];\n capability.tokenModifiers = [\n vscode_languageserver_protocol_1.SemanticTokenModifiers.declaration,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.definition,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.readonly,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.static,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.deprecated,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.abstract,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.async,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.modification,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.documentation,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.defaultLibrary\n ];\n capability.formats = [vscode_languageserver_protocol_1.TokenFormat.Relative];\n capability.requests = {\n range: true,\n full: {\n delta: true\n }\n };\n capability.multilineTokenSupport = false;\n capability.overlappingTokenSupport = false;\n capability.serverCancelSupport = true;\n capability.augmentsSyntaxTokens = true;\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'semanticTokens').refreshSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const client = this._client;\n client.onRequest(vscode_languageserver_protocol_1.SemanticTokensRefreshRequest.type, async () => {\n for (const provider of this.getAllProviders()) {\n provider.onDidChangeSemanticTokensEmitter.fire();\n }\n });\n const [id, options] = this.getRegistration(documentSelector, capabilities.semanticTokensProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const fullProvider = Is.boolean(options.full) ? options.full : options.full !== undefined;\n const hasEditProvider = options.full !== undefined && typeof options.full !== 'boolean' && options.full.delta === true;\n const eventEmitter = new vscode.EventEmitter();\n const documentProvider = fullProvider\n ? {\n onDidChangeSemanticTokens: eventEmitter.event,\n provideDocumentSemanticTokens: (document, token) => {\n const client = this._client;\n const middleware = client.middleware;\n const provideDocumentSemanticTokens = (document, token) => {\n const params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.SemanticTokensRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asSemanticTokens(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensRequest.type, token, error, null);\n });\n };\n return middleware.provideDocumentSemanticTokens\n ? middleware.provideDocumentSemanticTokens(document, token, provideDocumentSemanticTokens)\n : provideDocumentSemanticTokens(document, token);\n },\n provideDocumentSemanticTokensEdits: hasEditProvider\n ? (document, previousResultId, token) => {\n const client = this._client;\n const middleware = client.middleware;\n const provideDocumentSemanticTokensEdits = (document, previousResultId, token) => {\n const params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n previousResultId\n };\n return client.sendRequest(vscode_languageserver_protocol_1.SemanticTokensDeltaRequest.type, params, token).then(async (result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n if (vscode_languageserver_protocol_1.SemanticTokens.is(result)) {\n return await client.protocol2CodeConverter.asSemanticTokens(result, token);\n }\n else {\n return await client.protocol2CodeConverter.asSemanticTokensEdits(result, token);\n }\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensDeltaRequest.type, token, error, null);\n });\n };\n return middleware.provideDocumentSemanticTokensEdits\n ? middleware.provideDocumentSemanticTokensEdits(document, previousResultId, token, provideDocumentSemanticTokensEdits)\n : provideDocumentSemanticTokensEdits(document, previousResultId, token);\n }\n : undefined\n }\n : undefined;\n const hasRangeProvider = options.range === true;\n const rangeProvider = hasRangeProvider\n ? {\n provideDocumentRangeSemanticTokens: (document, range, token) => {\n const client = this._client;\n const middleware = client.middleware;\n const provideDocumentRangeSemanticTokens = (document, range, token) => {\n const params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n range: client.code2ProtocolConverter.asRange(range)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.SemanticTokensRangeRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asSemanticTokens(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensRangeRequest.type, token, error, null);\n });\n };\n return middleware.provideDocumentRangeSemanticTokens\n ? middleware.provideDocumentRangeSemanticTokens(document, range, token, provideDocumentRangeSemanticTokens)\n : provideDocumentRangeSemanticTokens(document, range, token);\n }\n }\n : undefined;\n const disposables = [];\n const client = this._client;\n const legend = client.protocol2CodeConverter.asSemanticTokensLegend(options.legend);\n const documentSelector = client.protocol2CodeConverter.asDocumentSelector(selector);\n if (documentProvider !== undefined) {\n disposables.push(vscode.languages.registerDocumentSemanticTokensProvider(documentSelector, documentProvider, legend));\n }\n if (rangeProvider !== undefined) {\n disposables.push(vscode.languages.registerDocumentRangeSemanticTokensProvider(documentSelector, rangeProvider, legend));\n }\n return [new vscode.Disposable(() => disposables.forEach(item => item.dispose())), { range: rangeProvider, full: documentProvider, onDidChangeSemanticTokensEmitter: eventEmitter }];\n }\n}\nexports.SemanticTokensFeature = SemanticTokensFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WillDeleteFilesFeature = exports.WillRenameFilesFeature = exports.WillCreateFilesFeature = exports.DidDeleteFilesFeature = exports.DidRenameFilesFeature = exports.DidCreateFilesFeature = void 0;\nconst code = require(\"vscode\");\nconst minimatch = require(\"minimatch\");\nconst proto = require(\"vscode-languageserver-protocol\");\nconst UUID = require(\"./utils/uuid\");\nfunction ensure(target, key) {\n if (target[key] === void 0) {\n target[key] = {};\n }\n return target[key];\n}\nfunction access(target, key) {\n return target[key];\n}\nfunction assign(target, key, value) {\n target[key] = value;\n}\nclass FileOperationFeature {\n constructor(client, event, registrationType, clientCapability, serverCapability) {\n this._client = client;\n this._event = event;\n this._registrationType = registrationType;\n this._clientCapability = clientCapability;\n this._serverCapability = serverCapability;\n this._filters = new Map();\n }\n getState() {\n return { kind: 'workspace', id: this._registrationType.method, registrations: this._filters.size > 0 };\n }\n filterSize() {\n return this._filters.size;\n }\n get registrationType() {\n return this._registrationType;\n }\n fillClientCapabilities(capabilities) {\n const value = ensure(ensure(capabilities, 'workspace'), 'fileOperations');\n // this happens n times but it is the same value so we tolerate this.\n assign(value, 'dynamicRegistration', true);\n assign(value, this._clientCapability, true);\n }\n initialize(capabilities) {\n const options = capabilities.workspace?.fileOperations;\n const capability = options !== undefined ? access(options, this._serverCapability) : undefined;\n if (capability?.filters !== undefined) {\n try {\n this.register({\n id: UUID.generateUuid(),\n registerOptions: { filters: capability.filters }\n });\n }\n catch (e) {\n this._client.warn(`Ignoring invalid glob pattern for ${this._serverCapability} registration: ${e}`);\n }\n }\n }\n register(data) {\n if (!this._listener) {\n this._listener = this._event(this.send, this);\n }\n const minimatchFilter = data.registerOptions.filters.map((filter) => {\n const matcher = new minimatch.Minimatch(filter.pattern.glob, FileOperationFeature.asMinimatchOptions(filter.pattern.options));\n if (!matcher.makeRe()) {\n throw new Error(`Invalid pattern ${filter.pattern.glob}!`);\n }\n return { scheme: filter.scheme, matcher, kind: filter.pattern.matches };\n });\n this._filters.set(data.id, minimatchFilter);\n }\n unregister(id) {\n this._filters.delete(id);\n if (this._filters.size === 0 && this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n }\n clear() {\n this._filters.clear();\n if (this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n }\n getFileType(uri) {\n return FileOperationFeature.getFileType(uri);\n }\n async filter(event, prop) {\n // (Asynchronously) map each file onto a boolean of whether it matches\n // any of the globs.\n const fileMatches = await Promise.all(event.files.map(async (item) => {\n const uri = prop(item);\n // Use fsPath to make this consistent with file system watchers but help\n // minimatch to use '/' instead of `\\\\` if present.\n const path = uri.fsPath.replace(/\\\\/g, '/');\n for (const filters of this._filters.values()) {\n for (const filter of filters) {\n if (filter.scheme !== undefined && filter.scheme !== uri.scheme) {\n continue;\n }\n if (filter.matcher.match(path)) {\n // The pattern matches. If kind is undefined then everything is ok\n if (filter.kind === undefined) {\n return true;\n }\n const fileType = await this.getFileType(uri);\n // If we can't determine the file type than we treat it as a match.\n // Dropping it would be another alternative.\n if (fileType === undefined) {\n this._client.error(`Failed to determine file type for ${uri.toString()}.`);\n return true;\n }\n if ((fileType === code.FileType.File && filter.kind === proto.FileOperationPatternKind.file) || (fileType === code.FileType.Directory && filter.kind === proto.FileOperationPatternKind.folder)) {\n return true;\n }\n }\n else if (filter.kind === proto.FileOperationPatternKind.folder) {\n const fileType = await FileOperationFeature.getFileType(uri);\n if (fileType === code.FileType.Directory && filter.matcher.match(`${path}/`)) {\n return true;\n }\n }\n }\n }\n return false;\n }));\n // Filter the files to those that matched.\n const files = event.files.filter((_, index) => fileMatches[index]);\n return { ...event, files };\n }\n static async getFileType(uri) {\n try {\n return (await code.workspace.fs.stat(uri)).type;\n }\n catch (e) {\n return undefined;\n }\n }\n static asMinimatchOptions(options) {\n // The spec doesn't state that dot files don't match. So we make\n // matching those the default.\n const result = { dot: true };\n if (options?.ignoreCase === true) {\n result.nocase = true;\n }\n return result;\n }\n}\nclass NotificationFileOperationFeature extends FileOperationFeature {\n constructor(client, event, notificationType, clientCapability, serverCapability, accessUri, createParams) {\n super(client, event, notificationType, clientCapability, serverCapability);\n this._notificationType = notificationType;\n this._accessUri = accessUri;\n this._createParams = createParams;\n }\n async send(originalEvent) {\n // Create a copy of the event that has the files filtered to match what the\n // server wants.\n const filteredEvent = await this.filter(originalEvent, this._accessUri);\n if (filteredEvent.files.length) {\n const next = async (event) => {\n return this._client.sendNotification(this._notificationType, this._createParams(event));\n };\n return this.doSend(filteredEvent, next);\n }\n }\n}\nclass CachingNotificationFileOperationFeature extends NotificationFileOperationFeature {\n constructor() {\n super(...arguments);\n this._fsPathFileTypes = new Map();\n }\n async getFileType(uri) {\n const fsPath = uri.fsPath;\n if (this._fsPathFileTypes.has(fsPath)) {\n return this._fsPathFileTypes.get(fsPath);\n }\n const type = await FileOperationFeature.getFileType(uri);\n if (type) {\n this._fsPathFileTypes.set(fsPath, type);\n }\n return type;\n }\n async cacheFileTypes(event, prop) {\n // Calling filter will force the matching logic to run. For any item\n // that requires a getFileType lookup, the overriden getFileType will\n // be called that will cache the result so that when onDidRename fires,\n // it can still be checked even though the item no longer exists on disk\n // in its original location.\n await this.filter(event, prop);\n }\n clearFileTypeCache() {\n this._fsPathFileTypes.clear();\n }\n unregister(id) {\n super.unregister(id);\n if (this.filterSize() === 0 && this._willListener) {\n this._willListener.dispose();\n this._willListener = undefined;\n }\n }\n clear() {\n super.clear();\n if (this._willListener) {\n this._willListener.dispose();\n this._willListener = undefined;\n }\n }\n}\nclass DidCreateFilesFeature extends NotificationFileOperationFeature {\n constructor(client) {\n super(client, code.workspace.onDidCreateFiles, proto.DidCreateFilesNotification.type, 'didCreate', 'didCreate', (i) => i, client.code2ProtocolConverter.asDidCreateFilesParams);\n }\n doSend(event, next) {\n const middleware = this._client.middleware.workspace;\n return middleware?.didCreateFiles\n ? middleware.didCreateFiles(event, next)\n : next(event);\n }\n}\nexports.DidCreateFilesFeature = DidCreateFilesFeature;\nclass DidRenameFilesFeature extends CachingNotificationFileOperationFeature {\n constructor(client) {\n super(client, code.workspace.onDidRenameFiles, proto.DidRenameFilesNotification.type, 'didRename', 'didRename', (i) => i.oldUri, client.code2ProtocolConverter.asDidRenameFilesParams);\n }\n register(data) {\n if (!this._willListener) {\n this._willListener = code.workspace.onWillRenameFiles(this.willRename, this);\n }\n super.register(data);\n }\n willRename(e) {\n e.waitUntil(this.cacheFileTypes(e, (i) => i.oldUri));\n }\n doSend(event, next) {\n this.clearFileTypeCache();\n const middleware = this._client.middleware.workspace;\n return middleware?.didRenameFiles\n ? middleware.didRenameFiles(event, next)\n : next(event);\n }\n}\nexports.DidRenameFilesFeature = DidRenameFilesFeature;\nclass DidDeleteFilesFeature extends CachingNotificationFileOperationFeature {\n constructor(client) {\n super(client, code.workspace.onDidDeleteFiles, proto.DidDeleteFilesNotification.type, 'didDelete', 'didDelete', (i) => i, client.code2ProtocolConverter.asDidDeleteFilesParams);\n }\n register(data) {\n if (!this._willListener) {\n this._willListener = code.workspace.onWillDeleteFiles(this.willDelete, this);\n }\n super.register(data);\n }\n willDelete(e) {\n e.waitUntil(this.cacheFileTypes(e, (i) => i));\n }\n doSend(event, next) {\n this.clearFileTypeCache();\n const middleware = this._client.middleware.workspace;\n return middleware?.didDeleteFiles\n ? middleware.didDeleteFiles(event, next)\n : next(event);\n }\n}\nexports.DidDeleteFilesFeature = DidDeleteFilesFeature;\nclass RequestFileOperationFeature extends FileOperationFeature {\n constructor(client, event, requestType, clientCapability, serverCapability, accessUri, createParams) {\n super(client, event, requestType, clientCapability, serverCapability);\n this._requestType = requestType;\n this._accessUri = accessUri;\n this._createParams = createParams;\n }\n async send(originalEvent) {\n const waitUntil = this.waitUntil(originalEvent);\n originalEvent.waitUntil(waitUntil);\n }\n async waitUntil(originalEvent) {\n // Create a copy of the event that has the files filtered to match what the\n // server wants.\n const filteredEvent = await this.filter(originalEvent, this._accessUri);\n if (filteredEvent.files.length) {\n const next = (event) => {\n return this._client.sendRequest(this._requestType, this._createParams(event), event.token)\n .then(this._client.protocol2CodeConverter.asWorkspaceEdit);\n };\n return this.doSend(filteredEvent, next);\n }\n else {\n return undefined;\n }\n }\n}\nclass WillCreateFilesFeature extends RequestFileOperationFeature {\n constructor(client) {\n super(client, code.workspace.onWillCreateFiles, proto.WillCreateFilesRequest.type, 'willCreate', 'willCreate', (i) => i, client.code2ProtocolConverter.asWillCreateFilesParams);\n }\n doSend(event, next) {\n const middleware = this._client.middleware.workspace;\n return middleware?.willCreateFiles\n ? middleware.willCreateFiles(event, next)\n : next(event);\n }\n}\nexports.WillCreateFilesFeature = WillCreateFilesFeature;\nclass WillRenameFilesFeature extends RequestFileOperationFeature {\n constructor(client) {\n super(client, code.workspace.onWillRenameFiles, proto.WillRenameFilesRequest.type, 'willRename', 'willRename', (i) => i.oldUri, client.code2ProtocolConverter.asWillRenameFilesParams);\n }\n doSend(event, next) {\n const middleware = this._client.middleware.workspace;\n return middleware?.willRenameFiles\n ? middleware.willRenameFiles(event, next)\n : next(event);\n }\n}\nexports.WillRenameFilesFeature = WillRenameFilesFeature;\nclass WillDeleteFilesFeature extends RequestFileOperationFeature {\n constructor(client) {\n super(client, code.workspace.onWillDeleteFiles, proto.WillDeleteFilesRequest.type, 'willDelete', 'willDelete', (i) => i, client.code2ProtocolConverter.asWillDeleteFilesParams);\n }\n doSend(event, next) {\n const middleware = this._client.middleware.workspace;\n return middleware?.willDeleteFiles\n ? middleware.willDeleteFiles(event, next)\n : next(event);\n }\n}\nexports.WillDeleteFilesFeature = WillDeleteFilesFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LinkedEditingFeature = void 0;\nconst code = require(\"vscode\");\nconst proto = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass LinkedEditingFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, proto.LinkedEditingRangeRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const linkedEditingSupport = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'linkedEditingRange');\n linkedEditingSupport.dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n let [id, options] = this.getRegistration(documentSelector, capabilities.linkedEditingRangeProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideLinkedEditingRanges: (document, position, token) => {\n const client = this._client;\n const provideLinkedEditing = (document, position, token) => {\n return client.sendRequest(proto.LinkedEditingRangeRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asLinkedEditingRanges(result, token);\n }, (error) => {\n return client.handleFailedRequest(proto.LinkedEditingRangeRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideLinkedEditingRange\n ? middleware.provideLinkedEditingRange(document, position, token, provideLinkedEditing)\n : provideLinkedEditing(document, position, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return code.languages.registerLinkedEditingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.LinkedEditingFeature = LinkedEditingFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TypeHierarchyFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass TypeHierarchyProvider {\n constructor(client) {\n this.client = client;\n this.middleware = client.middleware;\n }\n prepareTypeHierarchy(document, position, token) {\n const client = this.client;\n const middleware = this.middleware;\n const prepareTypeHierarchy = (document, position, token) => {\n const params = client.code2ProtocolConverter.asTextDocumentPositionParams(document, position);\n return client.sendRequest(vscode_languageserver_protocol_1.TypeHierarchyPrepareRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asTypeHierarchyItems(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.TypeHierarchyPrepareRequest.type, token, error, null);\n });\n };\n return middleware.prepareTypeHierarchy\n ? middleware.prepareTypeHierarchy(document, position, token, prepareTypeHierarchy)\n : prepareTypeHierarchy(document, position, token);\n }\n provideTypeHierarchySupertypes(item, token) {\n const client = this.client;\n const middleware = this.middleware;\n const provideTypeHierarchySupertypes = (item, token) => {\n const params = {\n item: client.code2ProtocolConverter.asTypeHierarchyItem(item)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.TypeHierarchySupertypesRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asTypeHierarchyItems(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.TypeHierarchySupertypesRequest.type, token, error, null);\n });\n };\n return middleware.provideTypeHierarchySupertypes\n ? middleware.provideTypeHierarchySupertypes(item, token, provideTypeHierarchySupertypes)\n : provideTypeHierarchySupertypes(item, token);\n }\n provideTypeHierarchySubtypes(item, token) {\n const client = this.client;\n const middleware = this.middleware;\n const provideTypeHierarchySubtypes = (item, token) => {\n const params = {\n item: client.code2ProtocolConverter.asTypeHierarchyItem(item)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.TypeHierarchySubtypesRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asTypeHierarchyItems(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.TypeHierarchySubtypesRequest.type, token, error, null);\n });\n };\n return middleware.provideTypeHierarchySubtypes\n ? middleware.provideTypeHierarchySubtypes(item, token, provideTypeHierarchySubtypes)\n : provideTypeHierarchySubtypes(item, token);\n }\n}\nclass TypeHierarchyFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.TypeHierarchyPrepareRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'typeHierarchy');\n capability.dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const [id, options] = this.getRegistration(documentSelector, capabilities.typeHierarchyProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const client = this._client;\n const provider = new TypeHierarchyProvider(client);\n return [vscode_1.languages.registerTypeHierarchyProvider(client.protocol2CodeConverter.asDocumentSelector(options.documentSelector), provider), provider];\n }\n}\nexports.TypeHierarchyFeature = TypeHierarchyFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlineValueFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass InlineValueFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.InlineValueRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'inlineValue').dynamicRegistration = true;\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'inlineValue').refreshSupport = true;\n }\n initialize(capabilities, documentSelector) {\n this._client.onRequest(vscode_languageserver_protocol_1.InlineValueRefreshRequest.type, async () => {\n for (const provider of this.getAllProviders()) {\n provider.onDidChangeInlineValues.fire();\n }\n });\n const [id, options] = this.getRegistration(documentSelector, capabilities.inlineValueProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const eventEmitter = new vscode_1.EventEmitter();\n const provider = {\n onDidChangeInlineValues: eventEmitter.event,\n provideInlineValues: (document, viewPort, context, token) => {\n const client = this._client;\n const provideInlineValues = (document, viewPort, context, token) => {\n const requestParams = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n range: client.code2ProtocolConverter.asRange(viewPort),\n context: client.code2ProtocolConverter.asInlineValueContext(context)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.InlineValueRequest.type, requestParams, token).then((values) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asInlineValues(values, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.InlineValueRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideInlineValues\n ? middleware.provideInlineValues(document, viewPort, context, token, provideInlineValues)\n : provideInlineValues(document, viewPort, context, token);\n }\n };\n return [this.registerProvider(selector, provider), { provider: provider, onDidChangeInlineValues: eventEmitter }];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerInlineValuesProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.InlineValueFeature = InlineValueFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlayHintsFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass InlayHintsFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.InlayHintRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const inlayHint = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'inlayHint');\n inlayHint.dynamicRegistration = true;\n inlayHint.resolveSupport = {\n properties: ['tooltip', 'textEdits', 'label.tooltip', 'label.location', 'label.command']\n };\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'inlayHint').refreshSupport = true;\n }\n initialize(capabilities, documentSelector) {\n this._client.onRequest(vscode_languageserver_protocol_1.InlayHintRefreshRequest.type, async () => {\n for (const provider of this.getAllProviders()) {\n provider.onDidChangeInlayHints.fire();\n }\n });\n const [id, options] = this.getRegistration(documentSelector, capabilities.inlayHintProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const eventEmitter = new vscode_1.EventEmitter();\n const provider = {\n onDidChangeInlayHints: eventEmitter.event,\n provideInlayHints: (document, viewPort, token) => {\n const client = this._client;\n const provideInlayHints = async (document, viewPort, token) => {\n const requestParams = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n range: client.code2ProtocolConverter.asRange(viewPort)\n };\n try {\n const values = await client.sendRequest(vscode_languageserver_protocol_1.InlayHintRequest.type, requestParams, token);\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asInlayHints(values, token);\n }\n catch (error) {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.InlayHintRequest.type, token, error, null);\n }\n };\n const middleware = client.middleware;\n return middleware.provideInlayHints\n ? middleware.provideInlayHints(document, viewPort, token, provideInlayHints)\n : provideInlayHints(document, viewPort, token);\n }\n };\n provider.resolveInlayHint = options.resolveProvider === true\n ? (hint, token) => {\n const client = this._client;\n const resolveInlayHint = async (item, token) => {\n try {\n const value = await client.sendRequest(vscode_languageserver_protocol_1.InlayHintResolveRequest.type, client.code2ProtocolConverter.asInlayHint(item), token);\n if (token.isCancellationRequested) {\n return null;\n }\n const result = client.protocol2CodeConverter.asInlayHint(value, token);\n return token.isCancellationRequested ? null : result;\n }\n catch (error) {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.InlayHintResolveRequest.type, token, error, null);\n }\n };\n const middleware = client.middleware;\n return middleware.resolveInlayHint\n ? middleware.resolveInlayHint(hint, token, resolveInlayHint)\n : resolveInlayHint(hint, token);\n }\n : undefined;\n return [this.registerProvider(selector, provider), { provider: provider, onDidChangeInlayHints: eventEmitter }];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerInlayHintsProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.InlayHintsFeature = InlayHintsFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlineCompletionItemFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass InlineCompletionItemFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.InlineCompletionRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let inlineCompletion = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'inlineCompletion');\n inlineCompletion.dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.inlineCompletionProvider);\n if (!options) {\n return;\n }\n this.register({\n id: UUID.generateUuid(),\n registerOptions: options\n });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideInlineCompletionItems: (document, position, context, token) => {\n const client = this._client;\n const middleware = this._client.middleware;\n const provideInlineCompletionItems = (document, position, context, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.InlineCompletionRequest.type, client.code2ProtocolConverter.asInlineCompletionParams(document, position, context), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asInlineCompletionResult(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.InlineCompletionRequest.type, token, error, null);\n });\n };\n return middleware.provideInlineCompletionItems\n ? middleware.provideInlineCompletionItems(document, position, context, token, provideInlineCompletionItems)\n : provideInlineCompletionItems(document, position, context, token);\n }\n };\n return [vscode_1.languages.registerInlineCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), provider];\n }\n}\nexports.InlineCompletionItemFeature = InlineCompletionItemFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProposedFeatures = exports.BaseLanguageClient = exports.MessageTransports = exports.SuspendMode = exports.State = exports.CloseAction = exports.ErrorAction = exports.RevealOutputChannelOn = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst c2p = require(\"./codeConverter\");\nconst p2c = require(\"./protocolConverter\");\nconst Is = require(\"./utils/is\");\nconst async_1 = require(\"./utils/async\");\nconst UUID = require(\"./utils/uuid\");\nconst progressPart_1 = require(\"./progressPart\");\nconst features_1 = require(\"./features\");\nconst diagnostic_1 = require(\"./diagnostic\");\nconst notebook_1 = require(\"./notebook\");\nconst configuration_1 = require(\"./configuration\");\nconst textSynchronization_1 = require(\"./textSynchronization\");\nconst completion_1 = require(\"./completion\");\nconst hover_1 = require(\"./hover\");\nconst definition_1 = require(\"./definition\");\nconst signatureHelp_1 = require(\"./signatureHelp\");\nconst documentHighlight_1 = require(\"./documentHighlight\");\nconst documentSymbol_1 = require(\"./documentSymbol\");\nconst workspaceSymbol_1 = require(\"./workspaceSymbol\");\nconst reference_1 = require(\"./reference\");\nconst codeAction_1 = require(\"./codeAction\");\nconst codeLens_1 = require(\"./codeLens\");\nconst formatting_1 = require(\"./formatting\");\nconst rename_1 = require(\"./rename\");\nconst documentLink_1 = require(\"./documentLink\");\nconst executeCommand_1 = require(\"./executeCommand\");\nconst fileSystemWatcher_1 = require(\"./fileSystemWatcher\");\nconst colorProvider_1 = require(\"./colorProvider\");\nconst implementation_1 = require(\"./implementation\");\nconst typeDefinition_1 = require(\"./typeDefinition\");\nconst workspaceFolder_1 = require(\"./workspaceFolder\");\nconst foldingRange_1 = require(\"./foldingRange\");\nconst declaration_1 = require(\"./declaration\");\nconst selectionRange_1 = require(\"./selectionRange\");\nconst progress_1 = require(\"./progress\");\nconst callHierarchy_1 = require(\"./callHierarchy\");\nconst semanticTokens_1 = require(\"./semanticTokens\");\nconst fileOperations_1 = require(\"./fileOperations\");\nconst linkedEditingRange_1 = require(\"./linkedEditingRange\");\nconst typeHierarchy_1 = require(\"./typeHierarchy\");\nconst inlineValue_1 = require(\"./inlineValue\");\nconst inlayHint_1 = require(\"./inlayHint\");\nconst inlineCompletion_1 = require(\"./inlineCompletion\");\n/**\n * Controls when the output channel is revealed.\n */\nvar RevealOutputChannelOn;\n(function (RevealOutputChannelOn) {\n RevealOutputChannelOn[RevealOutputChannelOn[\"Debug\"] = 0] = \"Debug\";\n RevealOutputChannelOn[RevealOutputChannelOn[\"Info\"] = 1] = \"Info\";\n RevealOutputChannelOn[RevealOutputChannelOn[\"Warn\"] = 2] = \"Warn\";\n RevealOutputChannelOn[RevealOutputChannelOn[\"Error\"] = 3] = \"Error\";\n RevealOutputChannelOn[RevealOutputChannelOn[\"Never\"] = 4] = \"Never\";\n})(RevealOutputChannelOn || (exports.RevealOutputChannelOn = RevealOutputChannelOn = {}));\n/**\n * An action to be performed when the connection is producing errors.\n */\nvar ErrorAction;\n(function (ErrorAction) {\n /**\n * Continue running the server.\n */\n ErrorAction[ErrorAction[\"Continue\"] = 1] = \"Continue\";\n /**\n * Shutdown the server.\n */\n ErrorAction[ErrorAction[\"Shutdown\"] = 2] = \"Shutdown\";\n})(ErrorAction || (exports.ErrorAction = ErrorAction = {}));\n/**\n * An action to be performed when the connection to a server got closed.\n */\nvar CloseAction;\n(function (CloseAction) {\n /**\n * Don't restart the server. The connection stays closed.\n */\n CloseAction[CloseAction[\"DoNotRestart\"] = 1] = \"DoNotRestart\";\n /**\n * Restart the server.\n */\n CloseAction[CloseAction[\"Restart\"] = 2] = \"Restart\";\n})(CloseAction || (exports.CloseAction = CloseAction = {}));\n/**\n * Signals in which state the language client is in.\n */\nvar State;\n(function (State) {\n /**\n * The client is stopped or got never started.\n */\n State[State[\"Stopped\"] = 1] = \"Stopped\";\n /**\n * The client is starting but not ready yet.\n */\n State[State[\"Starting\"] = 3] = \"Starting\";\n /**\n * The client is running and ready.\n */\n State[State[\"Running\"] = 2] = \"Running\";\n})(State || (exports.State = State = {}));\nvar SuspendMode;\n(function (SuspendMode) {\n /**\n * Don't allow suspend mode.\n */\n SuspendMode[\"off\"] = \"off\";\n /**\n * Support suspend mode even if not all\n * registered providers have a corresponding\n * activation listener.\n */\n SuspendMode[\"on\"] = \"on\";\n})(SuspendMode || (exports.SuspendMode = SuspendMode = {}));\nvar ResolvedClientOptions;\n(function (ResolvedClientOptions) {\n function sanitizeIsTrusted(isTrusted) {\n if (isTrusted === undefined || isTrusted === null) {\n return false;\n }\n if ((typeof isTrusted === 'boolean') || (typeof isTrusted === 'object' && isTrusted !== null && Is.stringArray(isTrusted.enabledCommands))) {\n return isTrusted;\n }\n return false;\n }\n ResolvedClientOptions.sanitizeIsTrusted = sanitizeIsTrusted;\n})(ResolvedClientOptions || (ResolvedClientOptions = {}));\nclass DefaultErrorHandler {\n constructor(client, maxRestartCount) {\n this.client = client;\n this.maxRestartCount = maxRestartCount;\n this.restarts = [];\n }\n error(_error, _message, count) {\n if (count && count <= 3) {\n return { action: ErrorAction.Continue };\n }\n return { action: ErrorAction.Shutdown };\n }\n closed() {\n this.restarts.push(Date.now());\n if (this.restarts.length <= this.maxRestartCount) {\n return { action: CloseAction.Restart };\n }\n else {\n let diff = this.restarts[this.restarts.length - 1] - this.restarts[0];\n if (diff <= 3 * 60 * 1000) {\n return { action: CloseAction.DoNotRestart, message: `The ${this.client.name} server crashed ${this.maxRestartCount + 1} times in the last 3 minutes. The server will not be restarted. See the output for more information.` };\n }\n else {\n this.restarts.shift();\n return { action: CloseAction.Restart };\n }\n }\n }\n}\nvar ClientState;\n(function (ClientState) {\n ClientState[\"Initial\"] = \"initial\";\n ClientState[\"Starting\"] = \"starting\";\n ClientState[\"StartFailed\"] = \"startFailed\";\n ClientState[\"Running\"] = \"running\";\n ClientState[\"Stopping\"] = \"stopping\";\n ClientState[\"Stopped\"] = \"stopped\";\n})(ClientState || (ClientState = {}));\nvar MessageTransports;\n(function (MessageTransports) {\n function is(value) {\n let candidate = value;\n return candidate && vscode_languageserver_protocol_1.MessageReader.is(value.reader) && vscode_languageserver_protocol_1.MessageWriter.is(value.writer);\n }\n MessageTransports.is = is;\n})(MessageTransports || (exports.MessageTransports = MessageTransports = {}));\nclass BaseLanguageClient {\n constructor(id, name, clientOptions) {\n this._traceFormat = vscode_languageserver_protocol_1.TraceFormat.Text;\n this._diagnosticQueue = new Map();\n this._diagnosticQueueState = { state: 'idle' };\n this._features = [];\n this._dynamicFeatures = new Map();\n this.workspaceEditLock = new async_1.Semaphore(1);\n this._id = id;\n this._name = name;\n clientOptions = clientOptions || {};\n const markdown = { isTrusted: false, supportHtml: false };\n if (clientOptions.markdown !== undefined) {\n markdown.isTrusted = ResolvedClientOptions.sanitizeIsTrusted(clientOptions.markdown.isTrusted);\n markdown.supportHtml = clientOptions.markdown.supportHtml === true;\n }\n // const defaultInterval = (clientOptions as TestOptions).$testMode ? 50 : 60000;\n this._clientOptions = {\n documentSelector: clientOptions.documentSelector ?? [],\n synchronize: clientOptions.synchronize ?? {},\n diagnosticCollectionName: clientOptions.diagnosticCollectionName,\n outputChannelName: clientOptions.outputChannelName ?? this._name,\n revealOutputChannelOn: clientOptions.revealOutputChannelOn ?? RevealOutputChannelOn.Error,\n stdioEncoding: clientOptions.stdioEncoding ?? 'utf8',\n initializationOptions: clientOptions.initializationOptions,\n initializationFailedHandler: clientOptions.initializationFailedHandler,\n progressOnInitialization: !!clientOptions.progressOnInitialization,\n errorHandler: clientOptions.errorHandler ?? this.createDefaultErrorHandler(clientOptions.connectionOptions?.maxRestartCount),\n middleware: clientOptions.middleware ?? {},\n uriConverters: clientOptions.uriConverters,\n workspaceFolder: clientOptions.workspaceFolder,\n connectionOptions: clientOptions.connectionOptions,\n markdown,\n // suspend: {\n // \tmode: clientOptions.suspend?.mode ?? SuspendMode.off,\n // \tcallback: clientOptions.suspend?.callback ?? (() => Promise.resolve(true)),\n // \tinterval: clientOptions.suspend?.interval ? Math.max(clientOptions.suspend.interval, defaultInterval) : defaultInterval\n // },\n diagnosticPullOptions: clientOptions.diagnosticPullOptions ?? { onChange: true, onSave: false },\n notebookDocumentOptions: clientOptions.notebookDocumentOptions ?? {}\n };\n this._clientOptions.synchronize = this._clientOptions.synchronize || {};\n this._state = ClientState.Initial;\n this._ignoredRegistrations = new Set();\n this._listeners = [];\n this._notificationHandlers = new Map();\n this._pendingNotificationHandlers = new Map();\n this._notificationDisposables = new Map();\n this._requestHandlers = new Map();\n this._pendingRequestHandlers = new Map();\n this._requestDisposables = new Map();\n this._progressHandlers = new Map();\n this._pendingProgressHandlers = new Map();\n this._progressDisposables = new Map();\n this._connection = undefined;\n // this._idleStart = undefined;\n this._initializeResult = undefined;\n if (clientOptions.outputChannel) {\n this._outputChannel = clientOptions.outputChannel;\n this._disposeOutputChannel = false;\n }\n else {\n this._outputChannel = undefined;\n this._disposeOutputChannel = true;\n }\n this._traceOutputChannel = clientOptions.traceOutputChannel;\n this._diagnostics = undefined;\n this._pendingOpenNotifications = new Set();\n this._pendingChangeSemaphore = new async_1.Semaphore(1);\n this._pendingChangeDelayer = new async_1.Delayer(250);\n this._fileEvents = [];\n this._fileEventDelayer = new async_1.Delayer(250);\n this._onStop = undefined;\n this._telemetryEmitter = new vscode_languageserver_protocol_1.Emitter();\n this._stateChangeEmitter = new vscode_languageserver_protocol_1.Emitter();\n this._trace = vscode_languageserver_protocol_1.Trace.Off;\n this._tracer = {\n log: (messageOrDataObject, data) => {\n if (Is.string(messageOrDataObject)) {\n this.logTrace(messageOrDataObject, data);\n }\n else {\n this.logObjectTrace(messageOrDataObject);\n }\n },\n };\n this._c2p = c2p.createConverter(clientOptions.uriConverters ? clientOptions.uriConverters.code2Protocol : undefined);\n this._p2c = p2c.createConverter(clientOptions.uriConverters ? clientOptions.uriConverters.protocol2Code : undefined, this._clientOptions.markdown.isTrusted, this._clientOptions.markdown.supportHtml);\n this._syncedDocuments = new Map();\n this.registerBuiltinFeatures();\n }\n get name() {\n return this._name;\n }\n get middleware() {\n return this._clientOptions.middleware ?? Object.create(null);\n }\n get clientOptions() {\n return this._clientOptions;\n }\n get protocol2CodeConverter() {\n return this._p2c;\n }\n get code2ProtocolConverter() {\n return this._c2p;\n }\n get onTelemetry() {\n return this._telemetryEmitter.event;\n }\n get onDidChangeState() {\n return this._stateChangeEmitter.event;\n }\n get outputChannel() {\n if (!this._outputChannel) {\n this._outputChannel = vscode_1.window.createOutputChannel(this._clientOptions.outputChannelName ? this._clientOptions.outputChannelName : this._name);\n }\n return this._outputChannel;\n }\n get traceOutputChannel() {\n if (this._traceOutputChannel) {\n return this._traceOutputChannel;\n }\n return this.outputChannel;\n }\n get diagnostics() {\n return this._diagnostics;\n }\n get state() {\n return this.getPublicState();\n }\n get $state() {\n return this._state;\n }\n set $state(value) {\n let oldState = this.getPublicState();\n this._state = value;\n let newState = this.getPublicState();\n if (newState !== oldState) {\n this._stateChangeEmitter.fire({ oldState, newState });\n }\n }\n getPublicState() {\n switch (this.$state) {\n case ClientState.Starting:\n return State.Starting;\n case ClientState.Running:\n return State.Running;\n default:\n return State.Stopped;\n }\n }\n get initializeResult() {\n return this._initializeResult;\n }\n async sendRequest(type, ...params) {\n if (this.$state === ClientState.StartFailed || this.$state === ClientState.Stopping || this.$state === ClientState.Stopped) {\n return Promise.reject(new vscode_languageserver_protocol_1.ResponseError(vscode_languageserver_protocol_1.ErrorCodes.ConnectionInactive, `Client is not running`));\n }\n // Ensure we have a connection before we force the document sync.\n const connection = await this.$start();\n // If any document is synced in full mode make sure we flush any pending\n // full document syncs.\n if (this._didChangeTextDocumentFeature.syncKind === vscode_languageserver_protocol_1.TextDocumentSyncKind.Full) {\n await this.sendPendingFullTextDocumentChanges(connection);\n }\n const _sendRequest = this._clientOptions.middleware?.sendRequest;\n if (_sendRequest !== undefined) {\n let param = undefined;\n let token = undefined;\n // Separate cancellation tokens from other parameters for a better client interface\n if (params.length === 1) {\n // CancellationToken is an interface, so we need to check if the first param complies to it\n if (vscode_languageserver_protocol_1.CancellationToken.is(params[0])) {\n token = params[0];\n }\n else {\n param = params[0];\n }\n }\n else if (params.length === 2) {\n param = params[0];\n token = params[1];\n }\n // Return the general middleware invocation defining `next` as a utility function that reorganizes parameters to\n // pass them to the original sendRequest function.\n return _sendRequest(type, param, token, (type, param, token) => {\n const params = [];\n // Add the parameters if there are any\n if (param !== undefined) {\n params.push(param);\n }\n // Add the cancellation token if there is one\n if (token !== undefined) {\n params.push(token);\n }\n return connection.sendRequest(type, ...params);\n });\n }\n else {\n return connection.sendRequest(type, ...params);\n }\n }\n onRequest(type, handler) {\n const method = typeof type === 'string' ? type : type.method;\n this._requestHandlers.set(method, handler);\n const connection = this.activeConnection();\n let disposable;\n if (connection !== undefined) {\n this._requestDisposables.set(method, connection.onRequest(type, handler));\n disposable = {\n dispose: () => {\n const disposable = this._requestDisposables.get(method);\n if (disposable !== undefined) {\n disposable.dispose();\n this._requestDisposables.delete(method);\n }\n }\n };\n }\n else {\n this._pendingRequestHandlers.set(method, handler);\n disposable = {\n dispose: () => {\n this._pendingRequestHandlers.delete(method);\n const disposable = this._requestDisposables.get(method);\n if (disposable !== undefined) {\n disposable.dispose();\n this._requestDisposables.delete(method);\n }\n }\n };\n }\n return {\n dispose: () => {\n this._requestHandlers.delete(method);\n disposable.dispose();\n }\n };\n }\n async sendNotification(type, params) {\n if (this.$state === ClientState.StartFailed || this.$state === ClientState.Stopping || this.$state === ClientState.Stopped) {\n return Promise.reject(new vscode_languageserver_protocol_1.ResponseError(vscode_languageserver_protocol_1.ErrorCodes.ConnectionInactive, `Client is not running`));\n }\n const needsPendingFullTextDocumentSync = this._didChangeTextDocumentFeature.syncKind === vscode_languageserver_protocol_1.TextDocumentSyncKind.Full;\n let openNotification;\n if (needsPendingFullTextDocumentSync && typeof type !== 'string' && type.method === vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.method) {\n openNotification = params?.textDocument.uri;\n this._pendingOpenNotifications.add(openNotification);\n }\n // Ensure we have a connection before we force the document sync.\n const connection = await this.$start();\n // If any document is synced in full mode make sure we flush any pending\n // full document syncs.\n if (needsPendingFullTextDocumentSync) {\n await this.sendPendingFullTextDocumentChanges(connection);\n }\n // We need to remove the pending open notification before we actually\n // send the notification over the connection. Otherwise there could be\n // a request coming in that although the open notification got already put\n // onto the wire will ignore pending document changes.\n //\n // Since the code path of connection.sendNotification is actually sync\n // until the message is handed of to the writer and the writer as a semaphore\n // lock with a capacity of 1 no additional async scheduling can happen until\n // the message is actually handed of.\n if (openNotification !== undefined) {\n this._pendingOpenNotifications.delete(openNotification);\n }\n const _sendNotification = this._clientOptions.middleware?.sendNotification;\n return _sendNotification\n ? _sendNotification(type, connection.sendNotification.bind(connection), params)\n : connection.sendNotification(type, params);\n }\n onNotification(type, handler) {\n const method = typeof type === 'string' ? type : type.method;\n this._notificationHandlers.set(method, handler);\n const connection = this.activeConnection();\n let disposable;\n if (connection !== undefined) {\n this._notificationDisposables.set(method, connection.onNotification(type, handler));\n disposable = {\n dispose: () => {\n const disposable = this._notificationDisposables.get(method);\n if (disposable !== undefined) {\n disposable.dispose();\n this._notificationDisposables.delete(method);\n }\n }\n };\n }\n else {\n this._pendingNotificationHandlers.set(method, handler);\n disposable = {\n dispose: () => {\n this._pendingNotificationHandlers.delete(method);\n const disposable = this._notificationDisposables.get(method);\n if (disposable !== undefined) {\n disposable.dispose();\n this._notificationDisposables.delete(method);\n }\n }\n };\n }\n return {\n dispose: () => {\n this._notificationHandlers.delete(method);\n disposable.dispose();\n }\n };\n }\n async sendProgress(type, token, value) {\n if (this.$state === ClientState.StartFailed || this.$state === ClientState.Stopping || this.$state === ClientState.Stopped) {\n return Promise.reject(new vscode_languageserver_protocol_1.ResponseError(vscode_languageserver_protocol_1.ErrorCodes.ConnectionInactive, `Client is not running`));\n }\n try {\n // Ensure we have a connection before we force the document sync.\n const connection = await this.$start();\n return connection.sendProgress(type, token, value);\n }\n catch (error) {\n this.error(`Sending progress for token ${token} failed.`, error);\n throw error;\n }\n }\n onProgress(type, token, handler) {\n this._progressHandlers.set(token, { type, handler });\n const connection = this.activeConnection();\n let disposable;\n const handleWorkDoneProgress = this._clientOptions.middleware?.handleWorkDoneProgress;\n const realHandler = vscode_languageserver_protocol_1.WorkDoneProgress.is(type) && handleWorkDoneProgress !== undefined\n ? (params) => {\n handleWorkDoneProgress(token, params, () => handler(params));\n }\n : handler;\n if (connection !== undefined) {\n this._progressDisposables.set(token, connection.onProgress(type, token, realHandler));\n disposable = {\n dispose: () => {\n const disposable = this._progressDisposables.get(token);\n if (disposable !== undefined) {\n disposable.dispose();\n this._progressDisposables.delete(token);\n }\n }\n };\n }\n else {\n this._pendingProgressHandlers.set(token, { type, handler });\n disposable = {\n dispose: () => {\n this._pendingProgressHandlers.delete(token);\n const disposable = this._progressDisposables.get(token);\n if (disposable !== undefined) {\n disposable.dispose();\n this._progressDisposables.delete(token);\n }\n }\n };\n }\n return {\n dispose: () => {\n this._progressHandlers.delete(token);\n disposable.dispose();\n }\n };\n }\n createDefaultErrorHandler(maxRestartCount) {\n if (maxRestartCount !== undefined && maxRestartCount < 0) {\n throw new Error(`Invalid maxRestartCount: ${maxRestartCount}`);\n }\n return new DefaultErrorHandler(this, maxRestartCount ?? 4);\n }\n async setTrace(value) {\n this._trace = value;\n const connection = this.activeConnection();\n if (connection !== undefined) {\n await connection.trace(this._trace, this._tracer, {\n sendNotification: false,\n traceFormat: this._traceFormat\n });\n }\n }\n data2String(data) {\n if (data instanceof vscode_languageserver_protocol_1.ResponseError) {\n const responseError = data;\n return ` Message: ${responseError.message}\\n Code: ${responseError.code} ${responseError.data ? '\\n' + responseError.data.toString() : ''}`;\n }\n if (data instanceof Error) {\n if (Is.string(data.stack)) {\n return data.stack;\n }\n return data.message;\n }\n if (Is.string(data)) {\n return data;\n }\n return data.toString();\n }\n debug(message, data, showNotification = true) {\n this.logOutputMessage(vscode_languageserver_protocol_1.MessageType.Debug, RevealOutputChannelOn.Debug, 'Debug', message, data, showNotification);\n }\n info(message, data, showNotification = true) {\n this.logOutputMessage(vscode_languageserver_protocol_1.MessageType.Info, RevealOutputChannelOn.Info, 'Info', message, data, showNotification);\n }\n warn(message, data, showNotification = true) {\n this.logOutputMessage(vscode_languageserver_protocol_1.MessageType.Warning, RevealOutputChannelOn.Warn, 'Warn', message, data, showNotification);\n }\n error(message, data, showNotification = true) {\n this.logOutputMessage(vscode_languageserver_protocol_1.MessageType.Error, RevealOutputChannelOn.Error, 'Error', message, data, showNotification);\n }\n logOutputMessage(type, reveal, name, message, data, showNotification) {\n this.outputChannel.appendLine(`[${name.padEnd(5)} - ${(new Date().toLocaleTimeString())}] ${message}`);\n if (data !== null && data !== undefined) {\n this.outputChannel.appendLine(this.data2String(data));\n }\n if (showNotification === 'force' || (showNotification && this._clientOptions.revealOutputChannelOn <= reveal)) {\n this.showNotificationMessage(type, message);\n }\n }\n showNotificationMessage(type, message) {\n message = message ?? 'A request has failed. See the output for more information.';\n const messageFunc = type === vscode_languageserver_protocol_1.MessageType.Error\n ? vscode_1.window.showErrorMessage\n : type === vscode_languageserver_protocol_1.MessageType.Warning\n ? vscode_1.window.showWarningMessage\n : vscode_1.window.showInformationMessage;\n void messageFunc(message, 'Go to output').then((selection) => {\n if (selection !== undefined) {\n this.outputChannel.show(true);\n }\n });\n }\n logTrace(message, data) {\n this.traceOutputChannel.appendLine(`[Trace - ${(new Date().toLocaleTimeString())}] ${message}`);\n if (data) {\n this.traceOutputChannel.appendLine(this.data2String(data));\n }\n }\n logObjectTrace(data) {\n if (data.isLSPMessage && data.type) {\n this.traceOutputChannel.append(`[LSP - ${(new Date().toLocaleTimeString())}] `);\n }\n else {\n this.traceOutputChannel.append(`[Trace - ${(new Date().toLocaleTimeString())}] `);\n }\n if (data) {\n this.traceOutputChannel.appendLine(`${JSON.stringify(data)}`);\n }\n }\n needsStart() {\n return this.$state === ClientState.Initial || this.$state === ClientState.Stopping || this.$state === ClientState.Stopped;\n }\n needsStop() {\n return this.$state === ClientState.Starting || this.$state === ClientState.Running;\n }\n activeConnection() {\n return this.$state === ClientState.Running && this._connection !== undefined ? this._connection : undefined;\n }\n isRunning() {\n return this.$state === ClientState.Running;\n }\n async start() {\n if (this._disposed === 'disposing' || this._disposed === 'disposed') {\n throw new Error(`Client got disposed and can't be restarted.`);\n }\n if (this.$state === ClientState.Stopping) {\n throw new Error(`Client is currently stopping. Can only restart a full stopped client`);\n }\n // We are already running or are in the process of getting up\n // to speed.\n if (this._onStart !== undefined) {\n return this._onStart;\n }\n const [promise, resolve, reject] = this.createOnStartPromise();\n this._onStart = promise;\n // If we restart then the diagnostics collection is reused.\n if (this._diagnostics === undefined) {\n this._diagnostics = this._clientOptions.diagnosticCollectionName\n ? vscode_1.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName)\n : vscode_1.languages.createDiagnosticCollection();\n }\n // When we start make all buffer handlers pending so that they\n // get added.\n for (const [method, handler] of this._notificationHandlers) {\n if (!this._pendingNotificationHandlers.has(method)) {\n this._pendingNotificationHandlers.set(method, handler);\n }\n }\n for (const [method, handler] of this._requestHandlers) {\n if (!this._pendingRequestHandlers.has(method)) {\n this._pendingRequestHandlers.set(method, handler);\n }\n }\n for (const [token, data] of this._progressHandlers) {\n if (!this._pendingProgressHandlers.has(token)) {\n this._pendingProgressHandlers.set(token, data);\n }\n }\n this.$state = ClientState.Starting;\n try {\n const connection = await this.createConnection();\n connection.onNotification(vscode_languageserver_protocol_1.LogMessageNotification.type, (message) => {\n switch (message.type) {\n case vscode_languageserver_protocol_1.MessageType.Error:\n this.error(message.message, undefined, false);\n break;\n case vscode_languageserver_protocol_1.MessageType.Warning:\n this.warn(message.message, undefined, false);\n break;\n case vscode_languageserver_protocol_1.MessageType.Info:\n this.info(message.message, undefined, false);\n break;\n case vscode_languageserver_protocol_1.MessageType.Debug:\n this.debug(message.message, undefined, false);\n break;\n default:\n this.outputChannel.appendLine(message.message);\n }\n });\n connection.onNotification(vscode_languageserver_protocol_1.ShowMessageNotification.type, (message) => {\n switch (message.type) {\n case vscode_languageserver_protocol_1.MessageType.Error:\n void vscode_1.window.showErrorMessage(message.message);\n break;\n case vscode_languageserver_protocol_1.MessageType.Warning:\n void vscode_1.window.showWarningMessage(message.message);\n break;\n case vscode_languageserver_protocol_1.MessageType.Info:\n void vscode_1.window.showInformationMessage(message.message);\n break;\n default:\n void vscode_1.window.showInformationMessage(message.message);\n }\n });\n connection.onRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, (params) => {\n let messageFunc;\n switch (params.type) {\n case vscode_languageserver_protocol_1.MessageType.Error:\n messageFunc = vscode_1.window.showErrorMessage;\n break;\n case vscode_languageserver_protocol_1.MessageType.Warning:\n messageFunc = vscode_1.window.showWarningMessage;\n break;\n case vscode_languageserver_protocol_1.MessageType.Info:\n messageFunc = vscode_1.window.showInformationMessage;\n break;\n default:\n messageFunc = vscode_1.window.showInformationMessage;\n }\n let actions = params.actions || [];\n return messageFunc(params.message, ...actions);\n });\n connection.onNotification(vscode_languageserver_protocol_1.TelemetryEventNotification.type, (data) => {\n this._telemetryEmitter.fire(data);\n });\n connection.onRequest(vscode_languageserver_protocol_1.ShowDocumentRequest.type, async (params) => {\n const showDocument = async (params) => {\n const uri = this.protocol2CodeConverter.asUri(params.uri);\n try {\n if (params.external === true) {\n const success = await vscode_1.env.openExternal(uri);\n return { success };\n }\n else {\n const options = {};\n if (params.selection !== undefined) {\n options.selection = this.protocol2CodeConverter.asRange(params.selection);\n }\n if (params.takeFocus === undefined || params.takeFocus === false) {\n options.preserveFocus = true;\n }\n else if (params.takeFocus === true) {\n options.preserveFocus = false;\n }\n await vscode_1.window.showTextDocument(uri, options);\n return { success: true };\n }\n }\n catch (error) {\n return { success: false };\n }\n };\n const middleware = this._clientOptions.middleware.window?.showDocument;\n if (middleware !== undefined) {\n return middleware(params, showDocument);\n }\n else {\n return showDocument(params);\n }\n });\n connection.listen();\n await this.initialize(connection);\n resolve();\n }\n catch (error) {\n this.$state = ClientState.StartFailed;\n this.error(`${this._name} client: couldn't create connection to server.`, error, 'force');\n reject(error);\n }\n return this._onStart;\n }\n createOnStartPromise() {\n let resolve;\n let reject;\n const promise = new Promise((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n return [promise, resolve, reject];\n }\n async initialize(connection) {\n this.refreshTrace(connection, false);\n const initOption = this._clientOptions.initializationOptions;\n // If the client is locked to a workspace folder use it. In this case the workspace folder\n // feature is not registered and we need to initialize the value here.\n const [rootPath, workspaceFolders] = this._clientOptions.workspaceFolder !== undefined\n ? [this._clientOptions.workspaceFolder.uri.fsPath, [{ uri: this._c2p.asUri(this._clientOptions.workspaceFolder.uri), name: this._clientOptions.workspaceFolder.name }]]\n : [this._clientGetRootPath(), null];\n const initParams = {\n processId: null,\n clientInfo: {\n name: vscode_1.env.appName,\n version: vscode_1.version\n },\n locale: this.getLocale(),\n rootPath: rootPath ? rootPath : null,\n rootUri: rootPath ? this._c2p.asUri(vscode_1.Uri.file(rootPath)) : null,\n capabilities: this.computeClientCapabilities(),\n initializationOptions: Is.func(initOption) ? initOption() : initOption,\n trace: vscode_languageserver_protocol_1.Trace.toString(this._trace),\n workspaceFolders: workspaceFolders\n };\n this.fillInitializeParams(initParams);\n if (this._clientOptions.progressOnInitialization) {\n const token = UUID.generateUuid();\n const part = new progressPart_1.ProgressPart(connection, token);\n initParams.workDoneToken = token;\n try {\n const result = await this.doInitialize(connection, initParams);\n part.done();\n return result;\n }\n catch (error) {\n part.cancel();\n throw error;\n }\n }\n else {\n return this.doInitialize(connection, initParams);\n }\n }\n async doInitialize(connection, initParams) {\n try {\n const result = await connection.initialize(initParams);\n if (result.capabilities.positionEncoding !== undefined && result.capabilities.positionEncoding !== vscode_languageserver_protocol_1.PositionEncodingKind.UTF16) {\n throw new Error(`Unsupported position encoding (${result.capabilities.positionEncoding}) received from server ${this.name}`);\n }\n this._initializeResult = result;\n this.$state = ClientState.Running;\n let textDocumentSyncOptions = undefined;\n if (Is.number(result.capabilities.textDocumentSync)) {\n if (result.capabilities.textDocumentSync === vscode_languageserver_protocol_1.TextDocumentSyncKind.None) {\n textDocumentSyncOptions = {\n openClose: false,\n change: vscode_languageserver_protocol_1.TextDocumentSyncKind.None,\n save: undefined\n };\n }\n else {\n textDocumentSyncOptions = {\n openClose: true,\n change: result.capabilities.textDocumentSync,\n save: {\n includeText: false\n }\n };\n }\n }\n else if (result.capabilities.textDocumentSync !== undefined && result.capabilities.textDocumentSync !== null) {\n textDocumentSyncOptions = result.capabilities.textDocumentSync;\n }\n this._capabilities = Object.assign({}, result.capabilities, { resolvedTextDocumentSync: textDocumentSyncOptions });\n connection.onNotification(vscode_languageserver_protocol_1.PublishDiagnosticsNotification.type, params => this.handleDiagnostics(params));\n connection.onRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params => this.handleRegistrationRequest(params));\n // See https://github.com/Microsoft/vscode-languageserver-node/issues/199\n connection.onRequest('client/registerFeature', params => this.handleRegistrationRequest(params));\n connection.onRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params => this.handleUnregistrationRequest(params));\n // See https://github.com/Microsoft/vscode-languageserver-node/issues/199\n connection.onRequest('client/unregisterFeature', params => this.handleUnregistrationRequest(params));\n connection.onRequest(vscode_languageserver_protocol_1.ApplyWorkspaceEditRequest.type, params => this.handleApplyWorkspaceEdit(params));\n // Add pending notification, request and progress handlers.\n for (const [method, handler] of this._pendingNotificationHandlers) {\n this._notificationDisposables.set(method, connection.onNotification(method, handler));\n }\n this._pendingNotificationHandlers.clear();\n for (const [method, handler] of this._pendingRequestHandlers) {\n this._requestDisposables.set(method, connection.onRequest(method, handler));\n }\n this._pendingRequestHandlers.clear();\n for (const [token, data] of this._pendingProgressHandlers) {\n this._progressDisposables.set(token, connection.onProgress(data.type, token, data.handler));\n }\n this._pendingProgressHandlers.clear();\n // if (this._clientOptions.suspend.mode !== SuspendMode.off) {\n // \tthis._idleInterval = RAL().timer.setInterval(() => this.checkSuspend(), this._clientOptions.suspend.interval);\n // }\n await connection.sendNotification(vscode_languageserver_protocol_1.InitializedNotification.type, {});\n this.hookFileEvents(connection);\n this.hookConfigurationChanged(connection);\n this.initializeFeatures(connection);\n return result;\n }\n catch (error) {\n if (this._clientOptions.initializationFailedHandler) {\n if (this._clientOptions.initializationFailedHandler(error)) {\n void this.initialize(connection);\n }\n else {\n void this.stop();\n }\n }\n else if (error instanceof vscode_languageserver_protocol_1.ResponseError && error.data && error.data.retry) {\n void vscode_1.window.showErrorMessage(error.message, { title: 'Retry', id: 'retry' }).then(item => {\n if (item && item.id === 'retry') {\n void this.initialize(connection);\n }\n else {\n void this.stop();\n }\n });\n }\n else {\n if (error && error.message) {\n void vscode_1.window.showErrorMessage(error.message);\n }\n this.error('Server initialization failed.', error);\n void this.stop();\n }\n throw error;\n }\n }\n _clientGetRootPath() {\n let folders = vscode_1.workspace.workspaceFolders;\n if (!folders || folders.length === 0) {\n return undefined;\n }\n let folder = folders[0];\n if (folder.uri.scheme === 'file') {\n return folder.uri.fsPath;\n }\n return undefined;\n }\n stop(timeout = 2000) {\n // Wait 2 seconds on stop\n return this.shutdown('stop', timeout);\n }\n dispose(timeout = 2000) {\n try {\n this._disposed = 'disposing';\n return this.stop(timeout);\n }\n finally {\n this._disposed = 'disposed';\n }\n }\n async shutdown(mode, timeout) {\n // If the client is stopped or in its initial state return.\n if (this.$state === ClientState.Stopped || this.$state === ClientState.Initial) {\n return;\n }\n // If we are stopping the client and have a stop promise return it.\n if (this.$state === ClientState.Stopping) {\n if (this._onStop !== undefined) {\n return this._onStop;\n }\n else {\n throw new Error(`Client is stopping but no stop promise available.`);\n }\n }\n const connection = this.activeConnection();\n // We can't stop a client that is not running (e.g. has no connection). Especially not\n // on that us starting since it can't be correctly synchronized.\n if (connection === undefined || this.$state !== ClientState.Running) {\n throw new Error(`Client is not running and can't be stopped. It's current state is: ${this.$state}`);\n }\n this._initializeResult = undefined;\n this.$state = ClientState.Stopping;\n this.cleanUp(mode);\n const tp = new Promise(c => { (0, vscode_languageserver_protocol_1.RAL)().timer.setTimeout(c, timeout); });\n const shutdown = (async (connection) => {\n await connection.shutdown();\n await connection.exit();\n return connection;\n })(connection);\n return this._onStop = Promise.race([tp, shutdown]).then((connection) => {\n // The connection won the race with the timeout.\n if (connection !== undefined) {\n connection.end();\n connection.dispose();\n }\n else {\n this.error(`Stopping server timed out`, undefined, false);\n throw new Error(`Stopping the server timed out`);\n }\n }, (error) => {\n this.error(`Stopping server failed`, error, false);\n throw error;\n }).finally(() => {\n this.$state = ClientState.Stopped;\n mode === 'stop' && this.cleanUpChannel();\n this._onStart = undefined;\n this._onStop = undefined;\n this._connection = undefined;\n this._ignoredRegistrations.clear();\n });\n }\n cleanUp(mode) {\n // purge outstanding file events.\n this._fileEvents = [];\n this._fileEventDelayer.cancel();\n const disposables = this._listeners.splice(0, this._listeners.length);\n for (const disposable of disposables) {\n disposable.dispose();\n }\n if (this._syncedDocuments) {\n this._syncedDocuments.clear();\n }\n // Clear features in reverse order;\n for (const feature of Array.from(this._features.entries()).map(entry => entry[1]).reverse()) {\n feature.clear();\n }\n if (mode === 'stop' && this._diagnostics !== undefined) {\n this._diagnostics.dispose();\n this._diagnostics = undefined;\n }\n if (this._idleInterval !== undefined) {\n this._idleInterval.dispose();\n this._idleInterval = undefined;\n }\n // this._idleStart = undefined;\n }\n cleanUpChannel() {\n if (this._outputChannel !== undefined && this._disposeOutputChannel) {\n this._outputChannel.dispose();\n this._outputChannel = undefined;\n }\n }\n notifyFileEvent(event) {\n const client = this;\n async function didChangeWatchedFile(event) {\n client._fileEvents.push(event);\n return client._fileEventDelayer.trigger(async () => {\n await client.sendNotification(vscode_languageserver_protocol_1.DidChangeWatchedFilesNotification.type, { changes: client._fileEvents });\n client._fileEvents = [];\n });\n }\n const workSpaceMiddleware = this.clientOptions.middleware?.workspace;\n (workSpaceMiddleware?.didChangeWatchedFile ? workSpaceMiddleware.didChangeWatchedFile(event, didChangeWatchedFile) : didChangeWatchedFile(event)).catch((error) => {\n client.error(`Notify file events failed.`, error);\n });\n }\n async sendPendingFullTextDocumentChanges(connection) {\n return this._pendingChangeSemaphore.lock(async () => {\n try {\n const changes = this._didChangeTextDocumentFeature.getPendingDocumentChanges(this._pendingOpenNotifications);\n if (changes.length === 0) {\n return;\n }\n for (const document of changes) {\n const params = this.code2ProtocolConverter.asChangeTextDocumentParams(document);\n // We await the send and not the delivery since it is more or less the same for\n // notifications.\n await connection.sendNotification(vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type, params);\n this._didChangeTextDocumentFeature.notificationSent(document, vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type, params);\n }\n }\n catch (error) {\n this.error(`Sending pending changes failed`, error, false);\n throw error;\n }\n });\n }\n triggerPendingChangeDelivery() {\n this._pendingChangeDelayer.trigger(async () => {\n const connection = this.activeConnection();\n if (connection === undefined) {\n this.triggerPendingChangeDelivery();\n return;\n }\n await this.sendPendingFullTextDocumentChanges(connection);\n }).catch((error) => this.error(`Delivering pending changes failed`, error, false));\n }\n handleDiagnostics(params) {\n if (!this._diagnostics) {\n return;\n }\n const key = params.uri;\n if (this._diagnosticQueueState.state === 'busy' && this._diagnosticQueueState.document === key) {\n // Cancel the active run;\n this._diagnosticQueueState.tokenSource.cancel();\n }\n this._diagnosticQueue.set(params.uri, params.diagnostics);\n this.triggerDiagnosticQueue();\n }\n triggerDiagnosticQueue() {\n (0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => { this.workDiagnosticQueue(); });\n }\n workDiagnosticQueue() {\n if (this._diagnosticQueueState.state === 'busy') {\n return;\n }\n const next = this._diagnosticQueue.entries().next();\n if (next.done === true) {\n // Nothing in the queue\n return;\n }\n const [document, diagnostics] = next.value;\n this._diagnosticQueue.delete(document);\n const tokenSource = new vscode_1.CancellationTokenSource();\n this._diagnosticQueueState = { state: 'busy', document: document, tokenSource };\n this._p2c.asDiagnostics(diagnostics, tokenSource.token).then((converted) => {\n if (!tokenSource.token.isCancellationRequested) {\n const uri = this._p2c.asUri(document);\n const middleware = this.clientOptions.middleware;\n if (middleware.handleDiagnostics) {\n middleware.handleDiagnostics(uri, converted, (uri, diagnostics) => this.setDiagnostics(uri, diagnostics));\n }\n else {\n this.setDiagnostics(uri, converted);\n }\n }\n }).finally(() => {\n this._diagnosticQueueState = { state: 'idle' };\n this.triggerDiagnosticQueue();\n });\n }\n setDiagnostics(uri, diagnostics) {\n if (!this._diagnostics) {\n return;\n }\n this._diagnostics.set(uri, diagnostics);\n }\n getLocale() {\n return vscode_1.env.language;\n }\n async $start() {\n if (this.$state === ClientState.StartFailed) {\n throw new Error(`Previous start failed. Can't restart server.`);\n }\n await this.start();\n const connection = this.activeConnection();\n if (connection === undefined) {\n throw new Error(`Starting server failed`);\n }\n return connection;\n }\n async createConnection() {\n let errorHandler = (error, message, count) => {\n this.handleConnectionError(error, message, count).catch((error) => this.error(`Handling connection error failed`, error));\n };\n let closeHandler = () => {\n this.handleConnectionClosed().catch((error) => this.error(`Handling connection close failed`, error));\n };\n const transports = await this.createMessageTransports(this._clientOptions.stdioEncoding || 'utf8');\n this._connection = createConnection(transports.reader, transports.writer, errorHandler, closeHandler, this._clientOptions.connectionOptions);\n return this._connection;\n }\n async handleConnectionClosed() {\n // Check whether this is a normal shutdown in progress or the client stopped normally.\n if (this.$state === ClientState.Stopped) {\n return;\n }\n try {\n if (this._connection !== undefined) {\n this._connection.dispose();\n }\n }\n catch (error) {\n // Disposing a connection could fail if error cases.\n }\n let handlerResult = { action: CloseAction.DoNotRestart };\n if (this.$state !== ClientState.Stopping) {\n try {\n handlerResult = await this._clientOptions.errorHandler.closed();\n }\n catch (error) {\n // Ignore errors coming from the error handler.\n }\n }\n this._connection = undefined;\n if (handlerResult.action === CloseAction.DoNotRestart) {\n this.error(handlerResult.message ?? 'Connection to server got closed. Server will not be restarted.', undefined, handlerResult.handled === true ? false : 'force');\n this.cleanUp('stop');\n if (this.$state === ClientState.Starting) {\n this.$state = ClientState.StartFailed;\n }\n else {\n this.$state = ClientState.Stopped;\n }\n this._onStop = Promise.resolve();\n this._onStart = undefined;\n }\n else if (handlerResult.action === CloseAction.Restart) {\n this.info(handlerResult.message ?? 'Connection to server got closed. Server will restart.', !handlerResult.handled);\n this.cleanUp('restart');\n this.$state = ClientState.Initial;\n this._onStop = Promise.resolve();\n this._onStart = undefined;\n this.start().catch((error) => this.error(`Restarting server failed`, error, 'force'));\n }\n }\n async handleConnectionError(error, message, count) {\n const handlerResult = await this._clientOptions.errorHandler.error(error, message, count);\n if (handlerResult.action === ErrorAction.Shutdown) {\n this.error(handlerResult.message ?? `Client ${this._name}: connection to server is erroring.\\n${error.message}\\nShutting down server.`, undefined, handlerResult.handled === true ? false : 'force');\n this.stop().catch((error) => {\n this.error(`Stopping server failed`, error, false);\n });\n }\n else {\n this.error(handlerResult.message ??\n `Client ${this._name}: connection to server is erroring.\\n${error.message}`, undefined, handlerResult.handled === true ? false : 'force');\n }\n }\n hookConfigurationChanged(connection) {\n this._listeners.push(vscode_1.workspace.onDidChangeConfiguration(() => {\n this.refreshTrace(connection, true);\n }));\n }\n refreshTrace(connection, sendNotification = false) {\n const config = vscode_1.workspace.getConfiguration(this._id);\n let trace = vscode_languageserver_protocol_1.Trace.Off;\n let traceFormat = vscode_languageserver_protocol_1.TraceFormat.Text;\n if (config) {\n const traceConfig = config.get('trace.server', 'off');\n if (typeof traceConfig === 'string') {\n trace = vscode_languageserver_protocol_1.Trace.fromString(traceConfig);\n }\n else {\n trace = vscode_languageserver_protocol_1.Trace.fromString(config.get('trace.server.verbosity', 'off'));\n traceFormat = vscode_languageserver_protocol_1.TraceFormat.fromString(config.get('trace.server.format', 'text'));\n }\n }\n this._trace = trace;\n this._traceFormat = traceFormat;\n connection.trace(this._trace, this._tracer, {\n sendNotification,\n traceFormat: this._traceFormat\n }).catch((error) => { this.error(`Updating trace failed with error`, error, false); });\n }\n hookFileEvents(_connection) {\n let fileEvents = this._clientOptions.synchronize.fileEvents;\n if (!fileEvents) {\n return;\n }\n let watchers;\n if (Is.array(fileEvents)) {\n watchers = fileEvents;\n }\n else {\n watchers = [fileEvents];\n }\n if (!watchers) {\n return;\n }\n this._dynamicFeatures.get(vscode_languageserver_protocol_1.DidChangeWatchedFilesNotification.type.method).registerRaw(UUID.generateUuid(), watchers);\n }\n registerFeatures(features) {\n for (let feature of features) {\n this.registerFeature(feature);\n }\n }\n registerFeature(feature) {\n this._features.push(feature);\n if (features_1.DynamicFeature.is(feature)) {\n const registrationType = feature.registrationType;\n this._dynamicFeatures.set(registrationType.method, feature);\n }\n }\n getFeature(request) {\n return this._dynamicFeatures.get(request);\n }\n hasDedicatedTextSynchronizationFeature(textDocument) {\n const feature = this.getFeature(vscode_languageserver_protocol_1.NotebookDocumentSyncRegistrationType.method);\n if (feature === undefined || !(feature instanceof notebook_1.NotebookDocumentSyncFeature)) {\n return false;\n }\n return feature.handles(textDocument);\n }\n registerBuiltinFeatures() {\n const pendingFullTextDocumentChanges = new Map();\n this.registerFeature(new configuration_1.ConfigurationFeature(this));\n this.registerFeature(new textSynchronization_1.DidOpenTextDocumentFeature(this, this._syncedDocuments));\n this._didChangeTextDocumentFeature = new textSynchronization_1.DidChangeTextDocumentFeature(this, pendingFullTextDocumentChanges);\n this._didChangeTextDocumentFeature.onPendingChangeAdded(() => {\n this.triggerPendingChangeDelivery();\n });\n this.registerFeature(this._didChangeTextDocumentFeature);\n this.registerFeature(new textSynchronization_1.WillSaveFeature(this));\n this.registerFeature(new textSynchronization_1.WillSaveWaitUntilFeature(this));\n this.registerFeature(new textSynchronization_1.DidSaveTextDocumentFeature(this));\n this.registerFeature(new textSynchronization_1.DidCloseTextDocumentFeature(this, this._syncedDocuments, pendingFullTextDocumentChanges));\n this.registerFeature(new fileSystemWatcher_1.FileSystemWatcherFeature(this, (event) => this.notifyFileEvent(event)));\n this.registerFeature(new completion_1.CompletionItemFeature(this));\n this.registerFeature(new hover_1.HoverFeature(this));\n this.registerFeature(new signatureHelp_1.SignatureHelpFeature(this));\n this.registerFeature(new definition_1.DefinitionFeature(this));\n this.registerFeature(new reference_1.ReferencesFeature(this));\n this.registerFeature(new documentHighlight_1.DocumentHighlightFeature(this));\n this.registerFeature(new documentSymbol_1.DocumentSymbolFeature(this));\n this.registerFeature(new workspaceSymbol_1.WorkspaceSymbolFeature(this));\n this.registerFeature(new codeAction_1.CodeActionFeature(this));\n this.registerFeature(new codeLens_1.CodeLensFeature(this));\n this.registerFeature(new formatting_1.DocumentFormattingFeature(this));\n this.registerFeature(new formatting_1.DocumentRangeFormattingFeature(this));\n this.registerFeature(new formatting_1.DocumentOnTypeFormattingFeature(this));\n this.registerFeature(new rename_1.RenameFeature(this));\n this.registerFeature(new documentLink_1.DocumentLinkFeature(this));\n this.registerFeature(new executeCommand_1.ExecuteCommandFeature(this));\n this.registerFeature(new configuration_1.SyncConfigurationFeature(this));\n this.registerFeature(new typeDefinition_1.TypeDefinitionFeature(this));\n this.registerFeature(new implementation_1.ImplementationFeature(this));\n this.registerFeature(new colorProvider_1.ColorProviderFeature(this));\n // We only register the workspace folder feature if the client is not locked\n // to a specific workspace folder.\n if (this.clientOptions.workspaceFolder === undefined) {\n this.registerFeature(new workspaceFolder_1.WorkspaceFoldersFeature(this));\n }\n this.registerFeature(new foldingRange_1.FoldingRangeFeature(this));\n this.registerFeature(new declaration_1.DeclarationFeature(this));\n this.registerFeature(new selectionRange_1.SelectionRangeFeature(this));\n this.registerFeature(new progress_1.ProgressFeature(this));\n this.registerFeature(new callHierarchy_1.CallHierarchyFeature(this));\n this.registerFeature(new semanticTokens_1.SemanticTokensFeature(this));\n this.registerFeature(new linkedEditingRange_1.LinkedEditingFeature(this));\n this.registerFeature(new fileOperations_1.DidCreateFilesFeature(this));\n this.registerFeature(new fileOperations_1.DidRenameFilesFeature(this));\n this.registerFeature(new fileOperations_1.DidDeleteFilesFeature(this));\n this.registerFeature(new fileOperations_1.WillCreateFilesFeature(this));\n this.registerFeature(new fileOperations_1.WillRenameFilesFeature(this));\n this.registerFeature(new fileOperations_1.WillDeleteFilesFeature(this));\n this.registerFeature(new typeHierarchy_1.TypeHierarchyFeature(this));\n this.registerFeature(new inlineValue_1.InlineValueFeature(this));\n this.registerFeature(new inlayHint_1.InlayHintsFeature(this));\n this.registerFeature(new diagnostic_1.DiagnosticFeature(this));\n this.registerFeature(new notebook_1.NotebookDocumentSyncFeature(this));\n }\n registerProposedFeatures() {\n this.registerFeatures(ProposedFeatures.createAll(this));\n }\n fillInitializeParams(params) {\n for (let feature of this._features) {\n if (Is.func(feature.fillInitializeParams)) {\n feature.fillInitializeParams(params);\n }\n }\n }\n computeClientCapabilities() {\n const result = {};\n (0, features_1.ensure)(result, 'workspace').applyEdit = true;\n const workspaceEdit = (0, features_1.ensure)((0, features_1.ensure)(result, 'workspace'), 'workspaceEdit');\n workspaceEdit.documentChanges = true;\n workspaceEdit.resourceOperations = [vscode_languageserver_protocol_1.ResourceOperationKind.Create, vscode_languageserver_protocol_1.ResourceOperationKind.Rename, vscode_languageserver_protocol_1.ResourceOperationKind.Delete];\n workspaceEdit.failureHandling = vscode_languageserver_protocol_1.FailureHandlingKind.TextOnlyTransactional;\n workspaceEdit.normalizesLineEndings = true;\n workspaceEdit.changeAnnotationSupport = {\n groupsOnLabel: true\n };\n const diagnostics = (0, features_1.ensure)((0, features_1.ensure)(result, 'textDocument'), 'publishDiagnostics');\n diagnostics.relatedInformation = true;\n diagnostics.versionSupport = false;\n diagnostics.tagSupport = { valueSet: [vscode_languageserver_protocol_1.DiagnosticTag.Unnecessary, vscode_languageserver_protocol_1.DiagnosticTag.Deprecated] };\n diagnostics.codeDescriptionSupport = true;\n diagnostics.dataSupport = true;\n const windowCapabilities = (0, features_1.ensure)(result, 'window');\n const showMessage = (0, features_1.ensure)(windowCapabilities, 'showMessage');\n showMessage.messageActionItem = { additionalPropertiesSupport: true };\n const showDocument = (0, features_1.ensure)(windowCapabilities, 'showDocument');\n showDocument.support = true;\n const generalCapabilities = (0, features_1.ensure)(result, 'general');\n generalCapabilities.staleRequestSupport = {\n cancel: true,\n retryOnContentModified: Array.from(BaseLanguageClient.RequestsToCancelOnContentModified)\n };\n generalCapabilities.regularExpressions = { engine: 'ECMAScript', version: 'ES2020' };\n generalCapabilities.markdown = {\n parser: 'marked',\n version: '1.1.0',\n };\n generalCapabilities.positionEncodings = ['utf-16'];\n if (this._clientOptions.markdown.supportHtml) {\n generalCapabilities.markdown.allowedTags = ['ul', 'li', 'p', 'code', 'blockquote', 'ol', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'em', 'pre', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'div', 'del', 'a', 'strong', 'br', 'img', 'span'];\n }\n for (let feature of this._features) {\n feature.fillClientCapabilities(result);\n }\n return result;\n }\n initializeFeatures(_connection) {\n const documentSelector = this._clientOptions.documentSelector;\n for (const feature of this._features) {\n if (Is.func(feature.preInitialize)) {\n feature.preInitialize(this._capabilities, documentSelector);\n }\n }\n for (const feature of this._features) {\n feature.initialize(this._capabilities, documentSelector);\n }\n }\n async handleRegistrationRequest(params) {\n const middleware = this.clientOptions.middleware?.handleRegisterCapability;\n if (middleware) {\n return middleware(params, nextParams => this.doRegisterCapability(nextParams));\n }\n else {\n return this.doRegisterCapability(params);\n }\n }\n async doRegisterCapability(params) {\n // We will not receive a registration call before a client is running\n // from a server. However if we stop or shutdown we might which might\n // try to restart the server. So ignore registrations if we are not running\n if (!this.isRunning()) {\n for (const registration of params.registrations) {\n this._ignoredRegistrations.add(registration.id);\n }\n return;\n }\n for (const registration of params.registrations) {\n const feature = this._dynamicFeatures.get(registration.method);\n if (feature === undefined) {\n return Promise.reject(new Error(`No feature implementation for ${registration.method} found. Registration failed.`));\n }\n const options = registration.registerOptions ?? {};\n options.documentSelector = options.documentSelector ?? this._clientOptions.documentSelector;\n const data = {\n id: registration.id,\n registerOptions: options\n };\n try {\n feature.register(data);\n }\n catch (err) {\n return Promise.reject(err);\n }\n }\n }\n async handleUnregistrationRequest(params) {\n const middleware = this.clientOptions.middleware?.handleUnregisterCapability;\n if (middleware) {\n return middleware(params, nextParams => this.doUnregisterCapability(nextParams));\n }\n else {\n return this.doUnregisterCapability(params);\n }\n }\n async doUnregisterCapability(params) {\n for (const unregistration of params.unregisterations) {\n if (this._ignoredRegistrations.has(unregistration.id)) {\n continue;\n }\n const feature = this._dynamicFeatures.get(unregistration.method);\n if (!feature) {\n return Promise.reject(new Error(`No feature implementation for ${unregistration.method} found. Unregistration failed.`));\n }\n feature.unregister(unregistration.id);\n }\n }\n async handleApplyWorkspaceEdit(params) {\n const workspaceEdit = params.edit;\n // Make sure we convert workspace edits one after the other. Otherwise\n // we might execute a workspace edit received first after we received another\n // one since the conversion might race.\n const converted = await this.workspaceEditLock.lock(() => {\n return this._p2c.asWorkspaceEdit(workspaceEdit);\n });\n // This is some sort of workaround since the version check should be done by VS Code in the Workspace.applyEdit.\n // However doing it here adds some safety since the server can lag more behind then an extension.\n const openTextDocuments = new Map();\n vscode_1.workspace.textDocuments.forEach((document) => openTextDocuments.set(document.uri.toString(), document));\n let versionMismatch = false;\n if (workspaceEdit.documentChanges) {\n for (const change of workspaceEdit.documentChanges) {\n if (vscode_languageserver_protocol_1.TextDocumentEdit.is(change) && change.textDocument.version && change.textDocument.version >= 0) {\n const changeUri = this._p2c.asUri(change.textDocument.uri).toString();\n const textDocument = openTextDocuments.get(changeUri);\n if (textDocument && textDocument.version !== change.textDocument.version) {\n versionMismatch = true;\n break;\n }\n }\n }\n }\n if (versionMismatch) {\n return Promise.resolve({ applied: false });\n }\n return Is.asPromise(vscode_1.workspace.applyEdit(converted).then((value) => { return { applied: value }; }));\n }\n handleFailedRequest(type, token, error, defaultValue, showNotification = true) {\n // If we get a request cancel or a content modified don't log anything.\n if (error instanceof vscode_languageserver_protocol_1.ResponseError) {\n // The connection got disposed while we were waiting for a response.\n // Simply return the default value. Is the best we can do.\n if (error.code === vscode_languageserver_protocol_1.ErrorCodes.PendingResponseRejected || error.code === vscode_languageserver_protocol_1.ErrorCodes.ConnectionInactive) {\n return defaultValue;\n }\n if (error.code === vscode_languageserver_protocol_1.LSPErrorCodes.RequestCancelled || error.code === vscode_languageserver_protocol_1.LSPErrorCodes.ServerCancelled) {\n if (token !== undefined && token.isCancellationRequested) {\n return defaultValue;\n }\n else {\n if (error.data !== undefined) {\n throw new features_1.LSPCancellationError(error.data);\n }\n else {\n throw new vscode_1.CancellationError();\n }\n }\n }\n else if (error.code === vscode_languageserver_protocol_1.LSPErrorCodes.ContentModified) {\n if (BaseLanguageClient.RequestsToCancelOnContentModified.has(type.method) || BaseLanguageClient.CancellableResolveCalls.has(type.method)) {\n throw new vscode_1.CancellationError();\n }\n else {\n return defaultValue;\n }\n }\n }\n this.error(`Request ${type.method} failed.`, error, showNotification);\n throw error;\n }\n}\nexports.BaseLanguageClient = BaseLanguageClient;\nBaseLanguageClient.RequestsToCancelOnContentModified = new Set([\n vscode_languageserver_protocol_1.SemanticTokensRequest.method,\n vscode_languageserver_protocol_1.SemanticTokensRangeRequest.method,\n vscode_languageserver_protocol_1.SemanticTokensDeltaRequest.method\n]);\nBaseLanguageClient.CancellableResolveCalls = new Set([\n vscode_languageserver_protocol_1.CompletionResolveRequest.method,\n vscode_languageserver_protocol_1.CodeLensResolveRequest.method,\n vscode_languageserver_protocol_1.CodeActionResolveRequest.method,\n vscode_languageserver_protocol_1.InlayHintResolveRequest.method,\n vscode_languageserver_protocol_1.DocumentLinkResolveRequest.method,\n vscode_languageserver_protocol_1.WorkspaceSymbolResolveRequest.method\n]);\nclass ConsoleLogger {\n error(message) {\n (0, vscode_languageserver_protocol_1.RAL)().console.error(message);\n }\n warn(message) {\n (0, vscode_languageserver_protocol_1.RAL)().console.warn(message);\n }\n info(message) {\n (0, vscode_languageserver_protocol_1.RAL)().console.info(message);\n }\n log(message) {\n (0, vscode_languageserver_protocol_1.RAL)().console.log(message);\n }\n}\nfunction createConnection(input, output, errorHandler, closeHandler, options) {\n const logger = new ConsoleLogger();\n const connection = (0, vscode_languageserver_protocol_1.createProtocolConnection)(input, output, logger, options);\n connection.onError((data) => { errorHandler(data[0], data[1], data[2]); });\n connection.onClose(closeHandler);\n const result = {\n listen: () => connection.listen(),\n sendRequest: connection.sendRequest,\n onRequest: connection.onRequest,\n hasPendingResponse: connection.hasPendingResponse,\n sendNotification: connection.sendNotification,\n onNotification: connection.onNotification,\n onProgress: connection.onProgress,\n sendProgress: connection.sendProgress,\n trace: (value, tracer, sendNotificationOrTraceOptions) => {\n const defaultTraceOptions = {\n sendNotification: false,\n traceFormat: vscode_languageserver_protocol_1.TraceFormat.Text\n };\n if (sendNotificationOrTraceOptions === undefined) {\n return connection.trace(value, tracer, defaultTraceOptions);\n }\n else if (Is.boolean(sendNotificationOrTraceOptions)) {\n return connection.trace(value, tracer, sendNotificationOrTraceOptions);\n }\n else {\n return connection.trace(value, tracer, sendNotificationOrTraceOptions);\n }\n },\n initialize: (params) => {\n // This needs to return and MUST not be await to avoid any async\n // scheduling. Otherwise messages might overtake each other.\n return connection.sendRequest(vscode_languageserver_protocol_1.InitializeRequest.type, params);\n },\n shutdown: () => {\n // This needs to return and MUST not be await to avoid any async\n // scheduling. Otherwise messages might overtake each other.\n return connection.sendRequest(vscode_languageserver_protocol_1.ShutdownRequest.type, undefined);\n },\n exit: () => {\n // This needs to return and MUST not be await to avoid any async\n // scheduling. Otherwise messages might overtake each other.\n return connection.sendNotification(vscode_languageserver_protocol_1.ExitNotification.type);\n },\n end: () => connection.end(),\n dispose: () => connection.dispose()\n };\n return result;\n}\n// Exporting proposed protocol.\nvar ProposedFeatures;\n(function (ProposedFeatures) {\n function createAll(_client) {\n let result = [\n new inlineCompletion_1.InlineCompletionItemFeature(_client)\n ];\n return result;\n }\n ProposedFeatures.createAll = createAll;\n})(ProposedFeatures || (exports.ProposedFeatures = ProposedFeatures = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.terminate = void 0;\nconst cp = require(\"child_process\");\nconst path_1 = require(\"path\");\nconst isWindows = (process.platform === 'win32');\nconst isMacintosh = (process.platform === 'darwin');\nconst isLinux = (process.platform === 'linux');\nfunction terminate(process, cwd) {\n if (isWindows) {\n try {\n // This we run in Atom execFileSync is available.\n // Ignore stderr since this is otherwise piped to parent.stderr\n // which might be already closed.\n let options = {\n stdio: ['pipe', 'pipe', 'ignore']\n };\n if (cwd) {\n options.cwd = cwd;\n }\n cp.execFileSync('taskkill', ['/T', '/F', '/PID', process.pid.toString()], options);\n return true;\n }\n catch (err) {\n return false;\n }\n }\n else if (isLinux || isMacintosh) {\n try {\n var cmd = (0, path_1.join)(__dirname, 'terminateProcess.sh');\n var result = cp.spawnSync(cmd, [process.pid.toString()]);\n return result.error ? false : true;\n }\n catch (err) {\n return false;\n }\n }\n else {\n process.kill('SIGKILL');\n return true;\n }\n}\nexports.terminate = terminate;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ----------------------------------------------------------------------------------------- */\n'use strict';\n\nmodule.exports = require('./lib/node/main');","'use strict'\n\nconst debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","'use strict'\n\n// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n/* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\n// Max safe length for a build identifier. The max length minus 6 characters for\n// the shortest version with a build 0.0.0+BUILD.\nconst MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6\n\nconst RELEASE_TYPES = [\n 'major',\n 'premajor',\n 'minor',\n 'preminor',\n 'patch',\n 'prepatch',\n 'prerelease',\n]\n\nmodule.exports = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 0b001,\n FLAG_LOOSE: 0b010,\n}\n","'use strict'\n\nconst {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH,\n} = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst safeRe = exports.safeRe = []\nconst src = exports.src = []\nconst safeSrc = exports.safeSrc = []\nconst t = exports.t = {}\nlet R = 0\n\nconst LETTERDASHNUMBER = '[a-zA-Z0-9-]'\n\n// Replace some greedy regex tokens to prevent regex dos issues. These regex are\n// used internally via the safeRe object since all inputs in this library get\n// normalized first to trim and collapse all extra whitespace. The original\n// regexes are exported for userland consumption and lower level usage. A\n// future breaking change could export the safer regex only with a note that\n// all input should have extra whitespace removed.\nconst safeRegexReplacements = [\n ['\\\\s', 1],\n ['\\\\d', MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],\n]\n\nconst makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value\n .split(`${token}*`).join(`${token}{0,${max}}`)\n .split(`${token}+`).join(`${token}{1,${max}}`)\n }\n return value\n}\n\nconst createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value)\n const index = R++\n debug(name, index, value)\n t[name] = index\n src[index] = value\n safeSrc[index] = safe\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '\\\\d+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n// Non-numeric identifiers include numeric identifiers but can be longer.\n// Therefore non-numeric identifiers must go first.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]\n}|${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]\n}|${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCEPLAIN', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)\ncreateToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\\\d])`)\ncreateToken('COERCEFULL', src[t.COERCEPLAIN] +\n `(?:${src[t.PRERELEASE]})?` +\n `(?:${src[t.BUILD]})?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\ncreateToken('COERCERTLFULL', src[t.COERCEFULL], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$')\n","'use strict'\n\n// parse out just the options we care about\nconst looseOption = Object.freeze({ loose: true })\nconst emptyOpts = Object.freeze({ })\nconst parseOptions = options => {\n if (!options) {\n return emptyOpts\n }\n\n if (typeof options !== 'object') {\n return looseOption\n }\n\n return options\n}\nmodule.exports = parseOptions\n","'use strict'\n\nconst numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n if (typeof a === 'number' && typeof b === 'number') {\n return a === b ? 0 : a < b ? -1 : 1\n }\n\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers,\n}\n","'use strict'\n\nconst debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n if (this.major < other.major) {\n return -1\n }\n if (this.major > other.major) {\n return 1\n }\n if (this.minor < other.minor) {\n return -1\n }\n if (this.minor > other.minor) {\n return 1\n }\n if (this.patch < other.patch) {\n return -1\n }\n if (this.patch > other.patch) {\n return 1\n }\n return 0\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('build compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier, identifierBase) {\n if (release.startsWith('pre')) {\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty')\n }\n // Avoid an invalid semver results\n if (identifier) {\n const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])\n if (!match || match[1] !== identifier) {\n throw new Error(`invalid identifier: ${identifier}`)\n }\n }\n }\n\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier, identifierBase)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier, identifierBase)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier, identifierBase)\n this.inc('pre', identifier, identifierBase)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase)\n }\n this.inc('pre', identifier, identifierBase)\n break\n case 'release':\n if (this.prerelease.length === 0) {\n throw new Error(`version ${this.raw} is not a prerelease`)\n }\n this.prerelease.length = 0\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre': {\n const base = Number(identifierBase) ? 1 : 0\n\n if (this.prerelease.length === 0) {\n this.prerelease = [base]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists')\n }\n this.prerelease.push(base)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base]\n if (identifierBase === false) {\n prerelease = [identifier]\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease\n }\n } else {\n this.prerelease = prerelease\n }\n }\n break\n }\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.raw = this.format()\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`\n }\n return this\n }\n}\n\nmodule.exports = SemVer\n","'use strict'\n\nconst SemVer = require('../classes/semver')\nconst parse = (version, options, throwErrors = false) => {\n if (version instanceof SemVer) {\n return version\n }\n try {\n return new SemVer(version, options)\n } catch (er) {\n if (!throwErrors) {\n return null\n }\n throw er\n }\n}\n\nmodule.exports = parse\n","'use strict'\n\nclass LRUCache {\n constructor () {\n this.max = 1000\n this.map = new Map()\n }\n\n get (key) {\n const value = this.map.get(key)\n if (value === undefined) {\n return undefined\n } else {\n // Remove the key from the map and add it to the end\n this.map.delete(key)\n this.map.set(key, value)\n return value\n }\n }\n\n delete (key) {\n return this.map.delete(key)\n }\n\n set (key, value) {\n const deleted = this.delete(key)\n\n if (!deleted && value !== undefined) {\n // If cache is full, delete the least recently used item\n if (this.map.size >= this.max) {\n const firstKey = this.map.keys().next().value\n this.delete(firstKey)\n }\n\n this.map.set(key, value)\n }\n\n return this\n }\n}\n\nmodule.exports = LRUCache\n","'use strict'\n\nconst SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","'use strict'\n\nconst compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","'use strict'\n\nconst compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","'use strict'\n\nconst compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","'use strict'\n\nconst compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","'use strict'\n\nconst compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","'use strict'\n\nconst compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","'use strict'\n\nconst eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a === b\n\n case '!==':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","'use strict'\n\nconst ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n comp = comp.trim().split(/\\s+/).join(' ')\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n options = parseOptions(options)\n\n // Special cases where nothing can possibly be lower\n if (options.includePrerelease &&\n (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {\n return false\n }\n if (!options.includePrerelease &&\n (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {\n return false\n }\n\n // Same direction increasing (> or >=)\n if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {\n return true\n }\n // Same direction decreasing (< or <=)\n if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {\n return true\n }\n // same SemVer and both sides are inclusive (<= or >=)\n if (\n (this.semver.version === comp.semver.version) &&\n this.operator.includes('=') && comp.operator.includes('=')) {\n return true\n }\n // opposite directions less than\n if (cmp(this.semver, '<', comp.semver, options) &&\n this.operator.startsWith('>') && comp.operator.startsWith('<')) {\n return true\n }\n // opposite directions greater than\n if (cmp(this.semver, '>', comp.semver, options) &&\n this.operator.startsWith('<') && comp.operator.startsWith('>')) {\n return true\n }\n return false\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst { safeRe: re, t } = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","'use strict'\n\nconst SPACE_CHARACTERS = /\\s+/g\n\n// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.formatted = undefined\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First reduce all whitespace as much as possible so we do not have to rely\n // on potentially slow regexes like \\s*. This is then stored and used for\n // future error messages as well.\n this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')\n\n // First, split on ||\n this.set = this.raw\n .split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${this.raw}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0) {\n this.set = [first]\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.formatted = undefined\n }\n\n get range () {\n if (this.formatted === undefined) {\n this.formatted = ''\n for (let i = 0; i < this.set.length; i++) {\n if (i > 0) {\n this.formatted += '||'\n }\n const comps = this.set[i]\n for (let k = 0; k < comps.length; k++) {\n if (k > 0) {\n this.formatted += ' '\n }\n this.formatted += comps[k].toString().trim()\n }\n }\n }\n return this.formatted\n }\n\n format () {\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts =\n (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |\n (this.options.loose && FLAG_LOOSE)\n const memoKey = memoOpts + ':' + range\n const cached = cache.get(memoKey)\n if (cached) {\n return cached\n }\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range)\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n debug('tilde trim', range)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n debug('caret trim', range)\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n let rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options)\n return !!comp.match(re[t.COMPARATORLOOSE])\n })\n }\n debug('range list', rangeList)\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const rangeMap = new Map()\n const comparators = rangeList.map(comp => new Comparator(comp, this.options))\n for (const comp of comparators) {\n if (isNullSet(comp)) {\n return [comp]\n }\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('')\n }\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\n\nmodule.exports = Range\n\nconst LRU = require('../internal/lrucache')\nconst cache = new LRU()\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n safeRe: re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace,\n} = require('../internal/re')\nconst { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n comp = comp.replace(re[t.BUILD], '')\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n// ~0.0.1 --> >=0.0.1 <0.1.0-0\nconst replaceTildes = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceTilde(c, options))\n .join(' ')\n}\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\n// ^0.0.1 --> >=0.0.1 <0.0.2-0\n// ^0.1.0 --> >=0.1.0 <0.2.0-0\nconst replaceCarets = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceCaret(c, options))\n .join(' ')\n}\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp\n .split(/\\s+/)\n .map((c) => replaceXRange(c, options))\n .join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<') {\n pr = '-0'\n }\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp\n .trim()\n .replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp\n .trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n// TODO build?\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return `${from} ${to}`.trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","'use strict'\n\nconst Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagnosticPullMode = exports.vsdiag = void 0;\n__exportStar(require(\"vscode-languageserver-protocol\"), exports);\n__exportStar(require(\"./features\"), exports);\nvar diagnostic_1 = require(\"./diagnostic\");\nObject.defineProperty(exports, \"vsdiag\", { enumerable: true, get: function () { return diagnostic_1.vsdiag; } });\nObject.defineProperty(exports, \"DiagnosticPullMode\", { enumerable: true, get: function () { return diagnostic_1.DiagnosticPullMode; } });\n__exportStar(require(\"./client\"), exports);\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SettingMonitor = exports.LanguageClient = exports.TransportKind = void 0;\nconst cp = require(\"child_process\");\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nconst vscode_1 = require(\"vscode\");\nconst Is = require(\"../common/utils/is\");\nconst client_1 = require(\"../common/client\");\nconst processes_1 = require(\"./processes\");\nconst node_1 = require(\"vscode-languageserver-protocol/node\");\n// Import SemVer functions individually to avoid circular dependencies in SemVer\nconst semverParse = require(\"semver/functions/parse\");\nconst semverSatisfies = require(\"semver/functions/satisfies\");\n__exportStar(require(\"vscode-languageserver-protocol/node\"), exports);\n__exportStar(require(\"../common/api\"), exports);\nconst REQUIRED_VSCODE_VERSION = '^1.82.0'; // do not change format, updated by `updateVSCode` script\nvar TransportKind;\n(function (TransportKind) {\n TransportKind[TransportKind[\"stdio\"] = 0] = \"stdio\";\n TransportKind[TransportKind[\"ipc\"] = 1] = \"ipc\";\n TransportKind[TransportKind[\"pipe\"] = 2] = \"pipe\";\n TransportKind[TransportKind[\"socket\"] = 3] = \"socket\";\n})(TransportKind || (exports.TransportKind = TransportKind = {}));\nvar Transport;\n(function (Transport) {\n function isSocket(value) {\n const candidate = value;\n return candidate && candidate.kind === TransportKind.socket && Is.number(candidate.port);\n }\n Transport.isSocket = isSocket;\n})(Transport || (Transport = {}));\nvar Executable;\n(function (Executable) {\n function is(value) {\n return Is.string(value.command);\n }\n Executable.is = is;\n})(Executable || (Executable = {}));\nvar NodeModule;\n(function (NodeModule) {\n function is(value) {\n return Is.string(value.module);\n }\n NodeModule.is = is;\n})(NodeModule || (NodeModule = {}));\nvar StreamInfo;\n(function (StreamInfo) {\n function is(value) {\n let candidate = value;\n return candidate && candidate.writer !== undefined && candidate.reader !== undefined;\n }\n StreamInfo.is = is;\n})(StreamInfo || (StreamInfo = {}));\nvar ChildProcessInfo;\n(function (ChildProcessInfo) {\n function is(value) {\n let candidate = value;\n return candidate && candidate.process !== undefined && typeof candidate.detached === 'boolean';\n }\n ChildProcessInfo.is = is;\n})(ChildProcessInfo || (ChildProcessInfo = {}));\nclass LanguageClient extends client_1.BaseLanguageClient {\n constructor(arg1, arg2, arg3, arg4, arg5) {\n let id;\n let name;\n let serverOptions;\n let clientOptions;\n let forceDebug;\n if (Is.string(arg2)) {\n id = arg1;\n name = arg2;\n serverOptions = arg3;\n clientOptions = arg4;\n forceDebug = !!arg5;\n }\n else {\n id = arg1.toLowerCase();\n name = arg1;\n serverOptions = arg2;\n clientOptions = arg3;\n forceDebug = arg4;\n }\n if (forceDebug === undefined) {\n forceDebug = false;\n }\n super(id, name, clientOptions);\n this._serverOptions = serverOptions;\n this._forceDebug = forceDebug;\n this._isInDebugMode = forceDebug;\n try {\n this.checkVersion();\n }\n catch (error) {\n if (Is.string(error.message)) {\n this.outputChannel.appendLine(error.message);\n }\n throw error;\n }\n }\n checkVersion() {\n const codeVersion = semverParse(vscode_1.version);\n if (!codeVersion) {\n throw new Error(`No valid VS Code version detected. Version string is: ${vscode_1.version}`);\n }\n // Remove the insider pre-release since we stay API compatible.\n if (codeVersion.prerelease && codeVersion.prerelease.length > 0) {\n codeVersion.prerelease = [];\n }\n if (!semverSatisfies(codeVersion, REQUIRED_VSCODE_VERSION)) {\n throw new Error(`The language client requires VS Code version ${REQUIRED_VSCODE_VERSION} but received version ${vscode_1.version}`);\n }\n }\n get isInDebugMode() {\n return this._isInDebugMode;\n }\n async restart() {\n await this.stop();\n // We are in debug mode. Wait a little before we restart\n // so that the debug port can be freed. We can safely ignore\n // the disposable returned from start since it will call\n // stop on the same client instance.\n if (this.isInDebugMode) {\n await new Promise((resolve) => setTimeout(resolve, 1000));\n await this.start();\n }\n else {\n await this.start();\n }\n }\n stop(timeout = 2000) {\n return super.stop(timeout).finally(() => {\n if (this._serverProcess) {\n const toCheck = this._serverProcess;\n this._serverProcess = undefined;\n if (this._isDetached === undefined || !this._isDetached) {\n this.checkProcessDied(toCheck);\n }\n this._isDetached = undefined;\n }\n });\n }\n checkProcessDied(childProcess) {\n if (!childProcess || childProcess.pid === undefined) {\n return;\n }\n setTimeout(() => {\n // Test if the process is still alive. Throws an exception if not\n try {\n if (childProcess.pid !== undefined) {\n process.kill(childProcess.pid, 0);\n (0, processes_1.terminate)(childProcess);\n }\n }\n catch (error) {\n // All is fine.\n }\n }, 2000);\n }\n handleConnectionClosed() {\n this._serverProcess = undefined;\n return super.handleConnectionClosed();\n }\n fillInitializeParams(params) {\n super.fillInitializeParams(params);\n if (params.processId === null) {\n params.processId = process.pid;\n }\n }\n createMessageTransports(encoding) {\n function getEnvironment(env, fork) {\n if (!env && !fork) {\n return undefined;\n }\n const result = Object.create(null);\n Object.keys(process.env).forEach(key => result[key] = process.env[key]);\n if (fork) {\n result['ELECTRON_RUN_AS_NODE'] = '1';\n result['ELECTRON_NO_ASAR'] = '1';\n }\n if (env) {\n Object.keys(env).forEach(key => result[key] = env[key]);\n }\n return result;\n }\n const debugStartWith = ['--debug=', '--debug-brk=', '--inspect=', '--inspect-brk='];\n const debugEquals = ['--debug', '--debug-brk', '--inspect', '--inspect-brk'];\n function startedInDebugMode() {\n let args = process.execArgv;\n if (args) {\n return args.some((arg) => {\n return debugStartWith.some(value => arg.startsWith(value)) ||\n debugEquals.some(value => arg === value);\n });\n }\n return false;\n }\n function assertStdio(process) {\n if (process.stdin === null || process.stdout === null || process.stderr === null) {\n throw new Error('Process created without stdio streams');\n }\n }\n const server = this._serverOptions;\n // We got a function.\n if (Is.func(server)) {\n return server().then((result) => {\n if (client_1.MessageTransports.is(result)) {\n this._isDetached = !!result.detached;\n return result;\n }\n else if (StreamInfo.is(result)) {\n this._isDetached = !!result.detached;\n return { reader: new node_1.StreamMessageReader(result.reader), writer: new node_1.StreamMessageWriter(result.writer) };\n }\n else {\n let cp;\n if (ChildProcessInfo.is(result)) {\n cp = result.process;\n this._isDetached = result.detached;\n }\n else {\n cp = result;\n this._isDetached = false;\n }\n cp.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n return { reader: new node_1.StreamMessageReader(cp.stdout), writer: new node_1.StreamMessageWriter(cp.stdin) };\n }\n });\n }\n let json;\n let runDebug = server;\n if (runDebug.run || runDebug.debug) {\n if (this._forceDebug || startedInDebugMode()) {\n json = runDebug.debug;\n this._isInDebugMode = true;\n }\n else {\n json = runDebug.run;\n this._isInDebugMode = false;\n }\n }\n else {\n json = server;\n }\n return this._getServerWorkingDir(json.options).then(serverWorkingDir => {\n if (NodeModule.is(json) && json.module) {\n let node = json;\n let transport = node.transport || TransportKind.stdio;\n if (node.runtime) {\n const args = [];\n const options = node.options ?? Object.create(null);\n if (options.execArgv) {\n options.execArgv.forEach(element => args.push(element));\n }\n args.push(node.module);\n if (node.args) {\n node.args.forEach(element => args.push(element));\n }\n const execOptions = Object.create(null);\n execOptions.cwd = serverWorkingDir;\n execOptions.env = getEnvironment(options.env, false);\n const runtime = this._getRuntimePath(node.runtime, serverWorkingDir);\n let pipeName = undefined;\n if (transport === TransportKind.ipc) {\n // exec options not correctly typed in lib\n execOptions.stdio = [null, null, null, 'ipc'];\n args.push('--node-ipc');\n }\n else if (transport === TransportKind.stdio) {\n args.push('--stdio');\n }\n else if (transport === TransportKind.pipe) {\n pipeName = (0, node_1.generateRandomPipeName)();\n args.push(`--pipe=${pipeName}`);\n }\n else if (Transport.isSocket(transport)) {\n args.push(`--socket=${transport.port}`);\n }\n args.push(`--clientProcessId=${process.pid.toString()}`);\n if (transport === TransportKind.ipc || transport === TransportKind.stdio) {\n const serverProcess = cp.spawn(runtime, args, execOptions);\n if (!serverProcess || !serverProcess.pid) {\n return handleChildProcessStartError(serverProcess, `Launching server using runtime ${runtime} failed.`);\n }\n this._serverProcess = serverProcess;\n serverProcess.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n if (transport === TransportKind.ipc) {\n serverProcess.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n return Promise.resolve({ reader: new node_1.IPCMessageReader(serverProcess), writer: new node_1.IPCMessageWriter(serverProcess) });\n }\n else {\n return Promise.resolve({ reader: new node_1.StreamMessageReader(serverProcess.stdout), writer: new node_1.StreamMessageWriter(serverProcess.stdin) });\n }\n }\n else if (transport === TransportKind.pipe) {\n return (0, node_1.createClientPipeTransport)(pipeName).then((transport) => {\n const process = cp.spawn(runtime, args, execOptions);\n if (!process || !process.pid) {\n return handleChildProcessStartError(process, `Launching server using runtime ${runtime} failed.`);\n }\n this._serverProcess = process;\n process.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n process.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n return transport.onConnected().then((protocol) => {\n return { reader: protocol[0], writer: protocol[1] };\n });\n });\n }\n else if (Transport.isSocket(transport)) {\n return (0, node_1.createClientSocketTransport)(transport.port).then((transport) => {\n const process = cp.spawn(runtime, args, execOptions);\n if (!process || !process.pid) {\n return handleChildProcessStartError(process, `Launching server using runtime ${runtime} failed.`);\n }\n this._serverProcess = process;\n process.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n process.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n return transport.onConnected().then((protocol) => {\n return { reader: protocol[0], writer: protocol[1] };\n });\n });\n }\n }\n else {\n let pipeName = undefined;\n return new Promise((resolve, reject) => {\n const args = (node.args && node.args.slice()) ?? [];\n if (transport === TransportKind.ipc) {\n args.push('--node-ipc');\n }\n else if (transport === TransportKind.stdio) {\n args.push('--stdio');\n }\n else if (transport === TransportKind.pipe) {\n pipeName = (0, node_1.generateRandomPipeName)();\n args.push(`--pipe=${pipeName}`);\n }\n else if (Transport.isSocket(transport)) {\n args.push(`--socket=${transport.port}`);\n }\n args.push(`--clientProcessId=${process.pid.toString()}`);\n const options = node.options ?? Object.create(null);\n options.env = getEnvironment(options.env, true);\n options.execArgv = options.execArgv || [];\n options.cwd = serverWorkingDir;\n options.silent = true;\n if (transport === TransportKind.ipc || transport === TransportKind.stdio) {\n const sp = cp.fork(node.module, args || [], options);\n assertStdio(sp);\n this._serverProcess = sp;\n sp.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n if (transport === TransportKind.ipc) {\n sp.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n resolve({ reader: new node_1.IPCMessageReader(this._serverProcess), writer: new node_1.IPCMessageWriter(this._serverProcess) });\n }\n else {\n resolve({ reader: new node_1.StreamMessageReader(sp.stdout), writer: new node_1.StreamMessageWriter(sp.stdin) });\n }\n }\n else if (transport === TransportKind.pipe) {\n (0, node_1.createClientPipeTransport)(pipeName).then((transport) => {\n const sp = cp.fork(node.module, args || [], options);\n assertStdio(sp);\n this._serverProcess = sp;\n sp.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n sp.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n transport.onConnected().then((protocol) => {\n resolve({ reader: protocol[0], writer: protocol[1] });\n }, reject);\n }, reject);\n }\n else if (Transport.isSocket(transport)) {\n (0, node_1.createClientSocketTransport)(transport.port).then((transport) => {\n const sp = cp.fork(node.module, args || [], options);\n assertStdio(sp);\n this._serverProcess = sp;\n sp.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n sp.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n transport.onConnected().then((protocol) => {\n resolve({ reader: protocol[0], writer: protocol[1] });\n }, reject);\n }, reject);\n }\n });\n }\n }\n else if (Executable.is(json) && json.command) {\n const command = json;\n const args = json.args !== undefined ? json.args.slice(0) : [];\n let pipeName = undefined;\n const transport = json.transport;\n if (transport === TransportKind.stdio) {\n args.push('--stdio');\n }\n else if (transport === TransportKind.pipe) {\n pipeName = (0, node_1.generateRandomPipeName)();\n args.push(`--pipe=${pipeName}`);\n }\n else if (Transport.isSocket(transport)) {\n args.push(`--socket=${transport.port}`);\n }\n else if (transport === TransportKind.ipc) {\n throw new Error(`Transport kind ipc is not support for command executable`);\n }\n const options = Object.assign({}, command.options);\n options.cwd = options.cwd || serverWorkingDir;\n if (transport === undefined || transport === TransportKind.stdio) {\n const serverProcess = cp.spawn(command.command, args, options);\n if (!serverProcess || !serverProcess.pid) {\n return handleChildProcessStartError(serverProcess, `Launching server using command ${command.command} failed.`);\n }\n serverProcess.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n this._serverProcess = serverProcess;\n this._isDetached = !!options.detached;\n return Promise.resolve({ reader: new node_1.StreamMessageReader(serverProcess.stdout), writer: new node_1.StreamMessageWriter(serverProcess.stdin) });\n }\n else if (transport === TransportKind.pipe) {\n return (0, node_1.createClientPipeTransport)(pipeName).then((transport) => {\n const serverProcess = cp.spawn(command.command, args, options);\n if (!serverProcess || !serverProcess.pid) {\n return handleChildProcessStartError(serverProcess, `Launching server using command ${command.command} failed.`);\n }\n this._serverProcess = serverProcess;\n this._isDetached = !!options.detached;\n serverProcess.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n serverProcess.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n return transport.onConnected().then((protocol) => {\n return { reader: protocol[0], writer: protocol[1] };\n });\n });\n }\n else if (Transport.isSocket(transport)) {\n return (0, node_1.createClientSocketTransport)(transport.port).then((transport) => {\n const serverProcess = cp.spawn(command.command, args, options);\n if (!serverProcess || !serverProcess.pid) {\n return handleChildProcessStartError(serverProcess, `Launching server using command ${command.command} failed.`);\n }\n this._serverProcess = serverProcess;\n this._isDetached = !!options.detached;\n serverProcess.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n serverProcess.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n return transport.onConnected().then((protocol) => {\n return { reader: protocol[0], writer: protocol[1] };\n });\n });\n }\n }\n return Promise.reject(new Error(`Unsupported server configuration ` + JSON.stringify(server, null, 4)));\n }).finally(() => {\n if (this._serverProcess !== undefined) {\n this._serverProcess.on('exit', (code, signal) => {\n if (code !== null) {\n this.error(`Server process exited with code ${code}.`, undefined, false);\n }\n if (signal !== null) {\n this.error(`Server process exited with signal ${signal}.`, undefined, false);\n }\n });\n }\n });\n }\n _getRuntimePath(runtime, serverWorkingDirectory) {\n if (path.isAbsolute(runtime)) {\n return runtime;\n }\n const mainRootPath = this._mainGetRootPath();\n if (mainRootPath !== undefined) {\n const result = path.join(mainRootPath, runtime);\n if (fs.existsSync(result)) {\n return result;\n }\n }\n if (serverWorkingDirectory !== undefined) {\n const result = path.join(serverWorkingDirectory, runtime);\n if (fs.existsSync(result)) {\n return result;\n }\n }\n return runtime;\n }\n _mainGetRootPath() {\n let folders = vscode_1.workspace.workspaceFolders;\n if (!folders || folders.length === 0) {\n return undefined;\n }\n let folder = folders[0];\n if (folder.uri.scheme === 'file') {\n return folder.uri.fsPath;\n }\n return undefined;\n }\n _getServerWorkingDir(options) {\n let cwd = options && options.cwd;\n if (!cwd) {\n cwd = this.clientOptions.workspaceFolder\n ? this.clientOptions.workspaceFolder.uri.fsPath\n : this._mainGetRootPath();\n }\n if (cwd) {\n // make sure the folder exists otherwise creating the process will fail\n return new Promise(s => {\n fs.lstat(cwd, (err, stats) => {\n s(!err && stats.isDirectory() ? cwd : undefined);\n });\n });\n }\n return Promise.resolve(undefined);\n }\n}\nexports.LanguageClient = LanguageClient;\nclass SettingMonitor {\n constructor(_client, _setting) {\n this._client = _client;\n this._setting = _setting;\n this._listeners = [];\n }\n start() {\n vscode_1.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration, this, this._listeners);\n this.onDidChangeConfiguration();\n return new vscode_1.Disposable(() => {\n if (this._client.needsStop()) {\n void this._client.stop();\n }\n });\n }\n onDidChangeConfiguration() {\n let index = this._setting.indexOf('.');\n let primary = index >= 0 ? this._setting.substr(0, index) : this._setting;\n let rest = index >= 0 ? this._setting.substr(index + 1) : undefined;\n let enabled = rest ? vscode_1.workspace.getConfiguration(primary).get(rest, false) : vscode_1.workspace.getConfiguration(primary);\n if (enabled && this._client.needsStart()) {\n this._client.start().catch((error) => this._client.error('Start failed after configuration change', error, 'force'));\n }\n else if (!enabled && this._client.needsStop()) {\n void this._client.stop().catch((error) => this._client.error('Stop failed after configuration change', error, 'force'));\n }\n }\n}\nexports.SettingMonitor = SettingMonitor;\nfunction handleChildProcessStartError(process, message) {\n if (process === null) {\n return Promise.reject(message);\n }\n return new Promise((_, reject) => {\n process.on('error', (err) => {\n reject(`${message} ${err}`);\n });\n // the error event should always be run immediately,\n // but race on it just in case\n setImmediate(() => reject(message));\n });\n}\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ----------------------------------------------------------------------------------------- */\n'use strict';\n\nmodule.exports = require('./lib/node/main');","import * as path from \"node:path\";\n// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport type { DuplicationMode, IssueTypeConfig, TraceLevel } from \"./types.js\";\n\nconst SECTION = \"fallow\";\n\nconst getConfig = (): vscode.WorkspaceConfiguration =>\n vscode.workspace.getConfiguration(SECTION);\n\nexport const getLspPath = (): string => getConfig().get(\"lspPath\", \"\");\n\nconst getConfigPath = (): string =>\n getConfig().get(\"configPath\", \"\").trim();\n\nexport const getResolvedConfigPath = (): string => {\n const configPath = getConfigPath();\n if (!configPath || path.isAbsolute(configPath)) {\n return configPath;\n }\n\n const workspaceRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath;\n return workspaceRoot ? path.resolve(workspaceRoot, configPath) : configPath;\n};\n\nexport const getAutoDownload = (): boolean =>\n getConfig().get(\"autoDownload\", true);\n\nexport const getIssueTypes = (): IssueTypeConfig =>\n getConfig().get(\"issueTypes\", {\n \"unused-files\": true,\n \"unused-exports\": true,\n \"unused-types\": true,\n \"private-type-leaks\": true,\n \"unused-dependencies\": true,\n \"unused-dev-dependencies\": true,\n \"unused-optional-dependencies\": true,\n \"unused-enum-members\": true,\n \"unused-class-members\": true,\n \"unresolved-imports\": true,\n \"unlisted-dependencies\": true,\n \"duplicate-exports\": true,\n \"type-only-dependencies\": true,\n \"test-only-dependencies\": true,\n \"circular-dependencies\": true,\n \"boundary-violation\": true,\n \"stale-suppressions\": true,\n \"unused-catalog-entries\": true,\n \"unresolved-catalog-references\": true,\n });\n\nexport const getDuplicationThreshold = (): number =>\n getConfig().get(\"duplication.threshold\", 5);\n\nexport const getDuplicationMode = (): DuplicationMode =>\n getConfig().get(\"duplication.mode\", \"mild\");\n\nexport const getProduction = (): boolean =>\n getConfig().get(\"production\", false);\n\nexport const getChangedSince = (): string =>\n getConfig().get(\"changedSince\", \"\").trim();\n\nexport const getTraceLevel = (): TraceLevel =>\n getConfig().get(\"trace.server\", \"off\");\n\nexport const onConfigChange = (\n callback: (e: vscode.ConfigurationChangeEvent) => void\n): vscode.Disposable =>\n vscode.workspace.onDidChangeConfiguration((e) => {\n if (e.affectsConfiguration(SECTION)) {\n callback(e);\n }\n });\n","import * as fs from \"node:fs\";\nimport * as os from \"node:os\";\nimport * as path from \"node:path\";\n// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\n\nexport const getExecutableExtension = (): string =>\n os.platform() === \"win32\" ? \".exe\" : \"\";\n\n/**\n * Look for a locally installed binary in the workspace's node_modules/.bin.\n * This allows teams to pin fallow as a devDependency for consistent versions.\n */\nexport const findLocalBinary = (name: string): string | null => {\n const folders = vscode.workspace.workspaceFolders;\n if (!folders || folders.length === 0) {\n return null;\n }\n\n const executableName = `${name}${getExecutableExtension()}`;\n const candidate = path.join(\n folders[0].uri.fsPath,\n \"node_modules\",\n \".bin\",\n executableName\n );\n\n if (fs.existsSync(candidate)) {\n return candidate;\n }\n\n return null;\n};\n\nexport const findBinaryInPath = (name: string): string | null => {\n const executableName = `${name}${getExecutableExtension()}`;\n const pathDirs = (process.env[\"PATH\"] ?? \"\").split(path.delimiter);\n\n for (const dir of pathDirs) {\n const candidate = path.join(dir, executableName);\n if (fs.existsSync(candidate)) {\n return candidate;\n }\n }\n\n return null;\n};\n","// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport type {\n HandleDiagnosticsSignature,\n ProvideDiagnosticSignature,\n vsdiag,\n} from \"vscode-languageclient/node.js\";\n\nconst STATE_KEY = \"fallow.diagnosticFilter.v1\";\nconst FALLOW_SOURCE = \"fallow\";\n\n/**\n * Cap the per-URI cache so a workspace-wide LSP publish on a 50k-file\n * monorepo doesn't grow the heap forever. fallow-lsp publishes diagnostics\n * for every diagnosed file, not just open editors, and `onDidCloseTextDocument`\n * never fires for files that were never opened. When the cap is hit we evict\n * the oldest entry (insertion order, the first key in the Map).\n */\nconst MAX_CACHE_ENTRIES = 5000;\n\nexport interface DiagnosticCategory {\n readonly code: string;\n readonly label: string;\n}\n\n/**\n * Fallback diagnostic categories for older fallow-lsp binaries that do not\n * support `fallow/issueTypes`. Current servers provide the canonical list.\n */\nexport const DIAGNOSTIC_CATEGORIES: ReadonlyArray = [\n { code: \"code-duplication\", label: \"Code Duplication\" },\n { code: \"unused-file\", label: \"Unused Files\" },\n { code: \"unused-export\", label: \"Unused Exports\" },\n { code: \"unused-type\", label: \"Unused Types\" },\n { code: \"private-type-leak\", label: \"Private Type Leaks\" },\n { code: \"unused-dependency\", label: \"Unused Dependencies\" },\n { code: \"unused-dev-dependency\", label: \"Unused Dev Dependencies\" },\n {\n code: \"unused-optional-dependency\",\n label: \"Unused Optional Dependencies\",\n },\n { code: \"unused-enum-member\", label: \"Unused Enum Members\" },\n { code: \"unused-class-member\", label: \"Unused Class Members\" },\n { code: \"unresolved-import\", label: \"Unresolved Imports\" },\n { code: \"unlisted-dependency\", label: \"Unlisted Dependencies\" },\n { code: \"duplicate-export\", label: \"Duplicate Exports\" },\n { code: \"type-only-dependency\", label: \"Type-Only Dependencies\" },\n { code: \"test-only-dependency\", label: \"Test-Only Dependencies\" },\n { code: \"circular-dependency\", label: \"Circular Dependencies\" },\n { code: \"boundary-violation\", label: \"Boundary Violations\" },\n { code: \"stale-suppression\", label: \"Stale Suppressions\" },\n { code: \"unused-catalog-entry\", label: \"Unused Catalog Entries\" },\n {\n code: \"unresolved-catalog-reference\",\n label: \"Unresolved Catalog References\",\n },\n];\n\nlet activeDiagnosticCategories: ReadonlyArray =\n DIAGNOSTIC_CATEGORIES;\n\nconst isDiagnosticCategory = (value: unknown): value is DiagnosticCategory => {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n const candidate = value as { code?: unknown; label?: unknown };\n return (\n typeof candidate.code === \"string\" &&\n candidate.code.length > 0 &&\n typeof candidate.label === \"string\" &&\n candidate.label.length > 0\n );\n};\n\nexport const parseDiagnosticCategories = (\n value: unknown\n): ReadonlyArray | null => {\n if (!Array.isArray(value)) {\n return null;\n }\n const categories = value.filter(isDiagnosticCategory);\n if (categories.length !== value.length || categories.length === 0) {\n return null;\n }\n return categories.map(({ code, label }) => ({ code, label }));\n};\n\nexport const setDiagnosticCategories = (\n categories: ReadonlyArray\n): void => {\n if (categories.length === 0) {\n return;\n }\n activeDiagnosticCategories = categories.slice();\n};\n\nexport const resetDiagnosticCategories = (): void => {\n activeDiagnosticCategories = DIAGNOSTIC_CATEGORIES;\n};\n\nexport const getDiagnosticCategories =\n (): ReadonlyArray => activeDiagnosticCategories;\n\ninterface PersistedState {\n readonly mutedAll?: boolean;\n readonly mutedCategories?: ReadonlyArray;\n}\n\ninterface FilterClient {\n readonly diagnostics?: vscode.DiagnosticCollection;\n}\n\n/** LSP diagnostics get tagged with `source: \"fallow\"` (see\n * `crates/lsp/src/diagnostics/*.rs`). Anything else flows through\n * the filter untouched so we never affect TypeScript or ESLint. */\nexport const isFallowDiagnostic = (d: vscode.Diagnostic): boolean =>\n d.source === FALLOW_SOURCE;\n\n/** `Diagnostic.code` per VSCode types is `string | number | { value, target }`,\n * and may be absent. Returns `null` when there's nothing to match against. */\nexport const diagnosticCode = (d: vscode.Diagnostic): string | null => {\n const code = d.code;\n if (code === undefined || code === null) {\n return null;\n }\n if (typeof code === \"string\") {\n return code;\n }\n if (typeof code === \"number\") {\n return String(code);\n }\n if (typeof code === \"object\" && \"value\" in code) {\n const value = (code as { value: string | number }).value;\n return typeof value === \"string\" ? value : String(value);\n }\n return null;\n};\n\ninterface DiagnosticFilterStateChange {\n readonly mutedAll: boolean;\n readonly mutedCategories: ReadonlySet;\n}\n\nexport class DiagnosticFilter {\n private mutedAll = false;\n private mutedCategories = new Set();\n private readonly cache = new Map();\n private client: FilterClient | null = null;\n private persistQueue: Promise = Promise.resolve();\n private readonly emitter =\n new vscode.EventEmitter();\n\n public readonly onDidChange = this.emitter.event;\n\n public constructor(private readonly memento: vscode.Memento) {\n const persisted = memento.get(STATE_KEY);\n if (persisted) {\n this.mutedAll = persisted.mutedAll === true;\n const list = persisted.mutedCategories ?? [];\n this.mutedCategories = new Set(list);\n }\n }\n\n public attachClient(client: FilterClient): void {\n this.client = client;\n this.refresh();\n }\n\n public detachClient(): void {\n this.client = null;\n this.cache.clear();\n }\n\n public dispose(): void {\n this.emitter.dispose();\n }\n\n public isMutedAll(): boolean {\n return this.mutedAll;\n }\n\n public isCategoryMuted(code: string): boolean {\n return this.mutedCategories.has(code);\n }\n\n public anythingMuted(): boolean {\n return this.mutedAll || this.mutedCategories.size > 0;\n }\n\n public mutedCategoriesSnapshot(): ReadonlySet {\n return new Set(this.mutedCategories);\n }\n\n public setMutedAll(value: boolean): void {\n if (this.mutedAll === value) {\n return;\n }\n this.mutedAll = value;\n this.persist();\n this.refresh();\n this.emitChange();\n }\n\n public toggleMutedAll(): boolean {\n this.setMutedAll(!this.mutedAll);\n return this.mutedAll;\n }\n\n public setCategoryMuted(code: string, value: boolean): void {\n const had = this.mutedCategories.has(code);\n if (value === had) {\n return;\n }\n if (value) {\n this.mutedCategories.add(code);\n } else {\n this.mutedCategories.delete(code);\n }\n this.persist();\n this.refresh();\n this.emitChange();\n }\n\n public setMutedCategories(codes: ReadonlySet): void {\n let changed = this.mutedCategories.size !== codes.size;\n if (!changed) {\n for (const code of codes) {\n if (!this.mutedCategories.has(code)) {\n changed = true;\n break;\n }\n }\n }\n if (!changed) {\n return;\n }\n\n this.mutedCategories = new Set(codes);\n this.persist();\n this.refresh();\n this.emitChange();\n }\n\n public toggleCategory(code: string): boolean {\n const next = !this.mutedCategories.has(code);\n this.setCategoryMuted(code, next);\n return next;\n }\n\n public clearAllMutes(): void {\n if (!this.anythingMuted()) {\n return;\n }\n this.mutedAll = false;\n this.mutedCategories.clear();\n this.persist();\n this.refresh();\n this.emitChange();\n }\n\n /** Drop the cache entry for a closed document so we don't grow unbounded\n * on large monorepos. The LSP will re-publish if it reopens. */\n public evictUri(uri: vscode.Uri): void {\n this.cache.delete(uri.toString());\n }\n\n public applyFilter(\n diagnostics: ReadonlyArray\n ): vscode.Diagnostic[] {\n if (!this.anythingMuted()) {\n return diagnostics.slice();\n }\n return diagnostics.filter((d) => {\n if (!isFallowDiagnostic(d)) {\n return true;\n }\n if (this.mutedAll) {\n return false;\n }\n const code = diagnosticCode(d);\n if (code === null) {\n return true;\n }\n return !this.mutedCategories.has(code);\n });\n }\n\n /** Push-mode middleware: intercepts `textDocument/publishDiagnostics`. */\n public handleDiagnostics(\n uri: vscode.Uri,\n diagnostics: vscode.Diagnostic[],\n next: HandleDiagnosticsSignature\n ): void {\n const key = uri.toString();\n this.evictIfFull(key);\n this.cache.set(key, diagnostics.slice());\n next(uri, this.applyFilter(diagnostics));\n }\n\n /** Pull-mode middleware: intercepts `textDocument/diagnostic`. The LSP\n * advertises `diagnostic_provider` in `build_server_capabilities()`, so\n * strict 3.17 clients (and a future VSCode pull flip) hit this path. */\n public async provideDiagnostics(\n document: vscode.TextDocument | vscode.Uri,\n previousResultId: string | undefined,\n token: vscode.CancellationToken,\n next: ProvideDiagnosticSignature\n ): Promise {\n const result = await next(document, previousResultId, token);\n if (!result) {\n return result;\n }\n if (result.kind !== \"full\") {\n return result;\n }\n // `document` is `TextDocument | Uri`. TextDocument exposes `.uri`;\n // a bare Uri does not. Structural detection works for both real and\n // mocked Uri objects (mocks aren't `instanceof vscode.Uri`).\n const uri =\n \"uri\" in document && document.uri !== undefined\n ? document.uri\n : (document as vscode.Uri);\n const key = uri.toString();\n this.evictIfFull(key);\n this.cache.set(key, result.items.slice());\n return { ...result, items: this.applyFilter(result.items) };\n }\n\n /** Re-apply current filter to all cached diagnostics via the client's\n * collection. Called on toggle change so squiggles update instantly\n * without an LSP restart or re-analysis. Snapshots entries first to\n * future-proof against async creep in callers. */\n public refresh(): void {\n const collection = this.client?.diagnostics;\n if (!collection) {\n return;\n }\n const entries = Array.from(this.cache.entries());\n for (const [uriStr, diagnostics] of entries) {\n collection.set(vscode.Uri.parse(uriStr), this.applyFilter(diagnostics));\n }\n }\n\n /** Drop the oldest cache entry when at capacity, unless the URI we're\n * about to write was already cached (in-place update doesn't grow size). */\n private evictIfFull(incomingKey: string): void {\n if (this.cache.size < MAX_CACHE_ENTRIES) {\n return;\n }\n if (this.cache.has(incomingKey)) {\n return;\n }\n const oldest = this.cache.keys().next().value;\n if (oldest !== undefined) {\n this.cache.delete(oldest);\n }\n }\n\n private persist(): void {\n const payload: PersistedState = {\n mutedAll: this.mutedAll,\n mutedCategories: Array.from(this.mutedCategories),\n };\n this.persistQueue = this.persistQueue.then(\n () => Promise.resolve(this.memento.update(STATE_KEY, payload)),\n () => Promise.resolve(this.memento.update(STATE_KEY, payload))\n );\n }\n\n private emitChange(): void {\n this.emitter.fire({\n mutedAll: this.mutedAll,\n mutedCategories: this.mutedCategoriesSnapshot(),\n });\n }\n}\n","import { execFileSync } from \"node:child_process\";\nimport { createHash, createPublicKey, verify } from \"node:crypto\";\nimport * as fs from \"node:fs\";\nimport type { IncomingMessage } from \"node:http\";\nimport * as https from \"node:https\";\nimport * as os from \"node:os\";\nimport * as path from \"node:path\";\n// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport { getExecutableExtension } from \"./binary-utils.js\";\n\nconst GITHUB_REPO = \"fallow-rs/fallow\";\nconst LSP_BINARY_NAME = \"fallow-lsp\";\nconst CLI_BINARY_NAME = \"fallow\";\nconst VERSION_FILE = \".fallow-version\";\nconst SIGNATURE_SUFFIX = \".sig\";\nconst SHA256_SUFFIX = \".sha256\";\nconst BINARY_SIGNING_PUBLIC_KEY = Buffer.from([\n 131, 78, 111, 215, 115, 51, 230, 238, 223, 119, 147, 71, 199, 16, 172, 180, 3, 210, 216, 35,\n 77, 85, 159, 94, 215, 200, 126, 85, 42, 222, 11, 209,\n]);\nconst ED25519_SPKI_HEADER = Buffer.from([\n 0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x21, 0x00,\n]);\n\ninterface GithubRelease {\n readonly tag_name: string;\n readonly assets: ReadonlyArray<{\n readonly digest?: string;\n readonly name: string;\n readonly browser_download_url: string;\n }>;\n}\n\nconst REQUEST_HEADERS = { \"User-Agent\": \"fallow-vscode\" };\n\nexport const platformTargetFor = (\n platform: NodeJS.Platform,\n arch: string\n): string | null => {\n if (platform === \"darwin\" && arch === \"arm64\") return \"darwin-arm64\";\n if (platform === \"darwin\" && arch === \"x64\") return \"darwin-x64\";\n if (platform === \"linux\" && arch === \"x64\") return \"linux-x64-gnu\";\n if (platform === \"linux\" && arch === \"arm64\") return \"linux-arm64-gnu\";\n if (platform === \"win32\" && arch === \"arm64\") return \"win32-arm64-msvc\";\n if (platform === \"win32\" && arch === \"x64\") return \"win32-x64-msvc\";\n\n return null;\n};\n\nconst getPlatformTarget = (): string | null =>\n platformTargetFor(os.platform(), os.arch());\n\nconst withRedirects = (\n url: string,\n handleResponse: (response: IncomingMessage) => Promise\n): Promise =>\n new Promise((resolve, reject) => {\n const request = https.get(\n url,\n { headers: REQUEST_HEADERS },\n (response) => {\n if (\n response.statusCode &&\n response.statusCode >= 300 &&\n response.statusCode < 400 &&\n response.headers.location\n ) {\n response.resume();\n withRedirects(response.headers.location, handleResponse).then(\n resolve,\n reject\n );\n return;\n }\n\n if (response.statusCode && response.statusCode >= 400) {\n response.resume();\n reject(new Error(`HTTP ${response.statusCode}`));\n return;\n }\n\n void handleResponse(response).then(resolve, reject);\n }\n );\n\n request.on(\"error\", reject);\n });\n\nconst httpsGet = (url: string): Promise =>\n withRedirects(url, async (response) => {\n const chunks: Buffer[] = [];\n\n return await new Promise((resolve, reject) => {\n response.on(\"data\", (chunk: Buffer) => chunks.push(chunk));\n response.on(\"end\", () => resolve(Buffer.concat(chunks).toString()));\n response.on(\"error\", reject);\n });\n });\n\nconst httpsDownload = (url: string, dest: string): Promise =>\n withRedirects(\n url,\n async (response) =>\n await new Promise((resolve, reject) => {\n const file = fs.createWriteStream(dest);\n response.pipe(file);\n file.on(\"finish\", () => {\n file.close();\n resolve();\n });\n file.on(\"error\", (err) => {\n fs.unlink(dest, () => {});\n reject(err);\n });\n })\n );\n\nconst getInstallDir = (context: vscode.ExtensionContext): string => {\n const dir = path.join(context.globalStorageUri.fsPath, \"bin\");\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true });\n }\n return dir;\n};\n\nconst getSignaturePath = (binaryPath: string): string =>\n `${binaryPath}${SIGNATURE_SUFFIX}`;\n\nconst getDigestPath = (binaryPath: string): string =>\n `${binaryPath}${SHA256_SUFFIX}`;\n\nconst getManagedBinaryPaths = (\n dir: string\n): ReadonlyArray => [\n path.join(dir, `${LSP_BINARY_NAME}${getExecutableExtension()}`),\n path.join(dir, `${CLI_BINARY_NAME}${getExecutableExtension()}`),\n];\n\nconst purgeManagedBinaries = (dir: string): void => {\n for (const binaryPath of getManagedBinaryPaths(dir)) {\n for (const candidate of [\n binaryPath,\n getSignaturePath(binaryPath),\n getDigestPath(binaryPath),\n ]) {\n try {\n if (fs.existsSync(candidate)) {\n fs.unlinkSync(candidate);\n }\n } catch {\n // Best-effort cleanup.\n }\n }\n }\n\n try {\n const versionPath = path.join(dir, VERSION_FILE);\n if (fs.existsSync(versionPath)) {\n fs.unlinkSync(versionPath);\n }\n } catch {\n // Best-effort cleanup.\n }\n};\n\nexport const writeVersionMarker = (dir: string, version: string): void => {\n try {\n fs.writeFileSync(path.join(dir, VERSION_FILE), version, \"utf-8\");\n } catch {\n // Best-effort — next activation falls back to --version\n }\n};\n\nexport const readVersionMarker = (dir: string): string | null => {\n try {\n return fs.readFileSync(path.join(dir, VERSION_FILE), \"utf-8\").trim() || null;\n } catch {\n return null;\n }\n};\n\n/** Query the version of a fallow binary. Returns the version string or null. */\nexport const getBinaryVersion = (binaryPath: string): string | null => {\n try {\n // execFileSync is safe (no shell injection) — binary path is from our own storage dir.\n const output = execFileSync(binaryPath, [\"--version\"], {\n timeout: 5000,\n encoding: \"utf-8\",\n });\n // Output format: \"fallow-lsp 2.18.3\" or \"fallow 2.18.3\"\n const match = output.trim().match(/(\\d+\\.\\d+\\.\\d+)/);\n return match?.[1] ?? null;\n } catch {\n return null;\n }\n};\n\nexport const verifyBinarySignature = (binaryPath: string): boolean => {\n try {\n const signaturePath = getSignaturePath(binaryPath);\n const binaryBytes = fs.readFileSync(binaryPath);\n const signatureBytes = fs.readFileSync(signaturePath);\n\n const publicKey = createPublicKey({\n key: Buffer.concat([ED25519_SPKI_HEADER, BINARY_SIGNING_PUBLIC_KEY]),\n format: \"der\",\n type: \"spki\",\n });\n\n return verify(null, binaryBytes, publicKey, signatureBytes);\n } catch {\n return false;\n }\n};\n\nconst normalizeSha256Digest = (digest: string | undefined): string | null => {\n if (!digest) {\n return null;\n }\n\n const lower = digest.trim().toLowerCase();\n if (!lower.startsWith(\"sha256:\")) {\n return null;\n }\n\n const value = lower.slice(\"sha256:\".length);\n return /^[0-9a-f]{64}$/.test(value) ? value : null;\n};\n\nconst writeDigestMarker = (binaryPath: string, digest: string): void => {\n try {\n fs.writeFileSync(getDigestPath(binaryPath), digest, \"utf-8\");\n } catch {\n // Best-effort — a missing digest marker forces a re-download later.\n }\n};\n\nconst readDigestMarker = (binaryPath: string): string | null => {\n try {\n return normalizeSha256Digest(\n `sha256:${fs.readFileSync(getDigestPath(binaryPath), \"utf-8\").trim()}`\n );\n } catch {\n return null;\n }\n};\n\nexport const verifyBinaryDigest = (\n binaryPath: string,\n expectedDigest: string\n): boolean => {\n try {\n const normalized = normalizeSha256Digest(`sha256:${expectedDigest}`);\n if (!normalized) {\n return false;\n }\n\n const binaryBytes = fs.readFileSync(binaryPath);\n const actual = createHash(\"sha256\").update(binaryBytes).digest(\"hex\");\n return actual === normalized;\n } catch {\n return false;\n }\n};\n\nconst ensureManagedBinaryTrusted = (\n dir: string,\n binaryPath: string,\n label: string,\n outputChannel?: vscode.OutputChannel\n): boolean => {\n const signaturePath = getSignaturePath(binaryPath);\n if (fs.existsSync(signaturePath)) {\n if (verifyBinarySignature(binaryPath)) {\n return true;\n }\n\n outputChannel?.appendLine(\n `Fallow: installed ${label} binary failed Ed25519 signature verification. Re-downloading.`\n );\n purgeManagedBinaries(dir);\n return false;\n }\n\n const expectedDigest = readDigestMarker(binaryPath);\n if (expectedDigest && verifyBinaryDigest(binaryPath, expectedDigest)) {\n outputChannel?.appendLine(\n `Fallow: installed ${label} binary reused via stored SHA-256 digest verification.`\n );\n return true;\n }\n\n outputChannel?.appendLine(\n `Fallow: installed ${label} binary is neither signature-verified nor digest-verified. Re-downloading.`\n );\n purgeManagedBinaries(dir);\n return false;\n};\n\nconst matchesExtensionVersion = (\n dir: string,\n binaryPath: string,\n label: string,\n outputChannel?: vscode.OutputChannel\n): boolean => {\n const extensionVersion =\n vscode.extensions.getExtension(\"fallow-rs.fallow-vscode\")?.packageJSON\n ?.version as string | undefined;\n if (!extensionVersion) {\n return true;\n }\n\n const binaryVersion = readVersionMarker(dir) ?? getBinaryVersion(binaryPath);\n if (binaryVersion === extensionVersion) {\n return true;\n }\n\n outputChannel?.appendLine(\n `Fallow: installed ${label} binary is v${binaryVersion ?? \"unknown\"}, extension is v${extensionVersion}. Re-downloading.`\n );\n purgeManagedBinaries(dir);\n return false;\n};\n\nconst getManagedBinaryPath = (\n context: vscode.ExtensionContext,\n binaryName: string,\n label: string,\n outputChannel?: vscode.OutputChannel\n): string | null => {\n const dir = getInstallDir(context);\n const binaryPath = path.join(\n dir,\n `${binaryName}${getExecutableExtension()}`\n );\n if (!fs.existsSync(binaryPath)) {\n return null;\n }\n\n if (!ensureManagedBinaryTrusted(dir, binaryPath, label, outputChannel)) {\n return null;\n }\n\n if (!matchesExtensionVersion(dir, binaryPath, label, outputChannel)) {\n return null;\n }\n\n return binaryPath;\n};\n\nexport const getInstalledBinaryPath = (\n context: vscode.ExtensionContext,\n outputChannel?: vscode.OutputChannel\n): string | null =>\n getManagedBinaryPath(context, LSP_BINARY_NAME, \"LSP\", outputChannel);\n\nexport const getInstalledCliPath = (\n context: vscode.ExtensionContext,\n outputChannel?: vscode.OutputChannel\n): string | null =>\n getManagedBinaryPath(context, CLI_BINARY_NAME, \"CLI\", outputChannel);\n\n/** Download a single binary asset from a GitHub release. Returns the dest path or null. */\nconst downloadAsset = async (\n release: GithubRelease,\n binaryName: string,\n target: string,\n dir: string\n): Promise => {\n const extension = getExecutableExtension();\n const assetName = `${binaryName}-${target}${extension}`;\n const asset = release.assets.find((a) => a.name === assetName);\n\n if (!asset) {\n return null;\n }\n\n const signatureAsset = release.assets.find(\n (candidate) => candidate.name === `${assetName}${SIGNATURE_SUFFIX}`\n );\n const expectedDigest = normalizeSha256Digest(asset.digest);\n\n const destPath = path.join(dir, `${binaryName}${extension}`);\n const signaturePath = getSignaturePath(destPath);\n const digestPath = getDigestPath(destPath);\n\n try {\n await httpsDownload(asset.browser_download_url, destPath);\n\n if (signatureAsset) {\n await httpsDownload(signatureAsset.browser_download_url, signaturePath);\n\n if (!verifyBinarySignature(destPath)) {\n throw new Error(`${assetName} failed Ed25519 signature verification`);\n }\n\n if (fs.existsSync(digestPath)) {\n fs.unlinkSync(digestPath);\n }\n } else if (expectedDigest) {\n if (!verifyBinaryDigest(destPath, expectedDigest)) {\n throw new Error(`${assetName} failed SHA-256 digest verification`);\n }\n\n writeDigestMarker(destPath, expectedDigest);\n } else {\n throw new Error(\n `${assetName} is missing both a signature asset and a GitHub release digest`\n );\n }\n\n if (os.platform() !== \"win32\") {\n fs.chmodSync(destPath, 0o755);\n }\n } catch (error) {\n for (const candidate of [destPath, signaturePath, digestPath]) {\n try {\n if (fs.existsSync(candidate)) {\n fs.unlinkSync(candidate);\n }\n } catch {\n // Best-effort cleanup on failed downloads.\n }\n }\n throw error;\n }\n\n return destPath;\n};\n\nexport const downloadBinary = async (\n context: vscode.ExtensionContext\n): Promise => {\n const target = getPlatformTarget();\n if (!target) {\n void vscode.window.showErrorMessage(\n `Fallow: unsupported platform ${os.platform()}-${os.arch()}`\n );\n return null;\n }\n\n return vscode.window.withProgress(\n {\n location: vscode.ProgressLocation.Notification,\n title: \"Fallow: Downloading binaries...\",\n cancellable: false,\n },\n async () => {\n try {\n const releaseJson = await httpsGet(\n `https://api.github.com/repos/${GITHUB_REPO}/releases/latest`\n );\n const release: GithubRelease = JSON.parse(releaseJson);\n const dir = getInstallDir(context);\n\n // Download LSP binary (required)\n const lspPath = await downloadAsset(release, LSP_BINARY_NAME, target, dir);\n if (!lspPath) {\n void vscode.window.showErrorMessage(\n `Fallow: no LSP binary found for ${target} in release ${release.tag_name}`\n );\n return null;\n }\n\n // Write version marker so future activations can detect stale binaries\n // without needing to execute them.\n const extensionVersion =\n vscode.extensions.getExtension(\"fallow-rs.fallow-vscode\")?.packageJSON\n ?.version as string | undefined;\n if (extensionVersion) {\n writeVersionMarker(dir, extensionVersion);\n }\n\n // Download CLI binary (best-effort — tree views and commands need it)\n let cliPath: string | null = null;\n try {\n cliPath = await downloadAsset(release, CLI_BINARY_NAME, target, dir);\n } catch (cliErr) {\n const cliMessage =\n cliErr instanceof Error ? cliErr.message : String(cliErr);\n void vscode.window.showWarningMessage(\n `Fallow: CLI download skipped: ${cliMessage}`\n );\n }\n if (cliPath) {\n void vscode.window.showInformationMessage(\n `Fallow: ${release.tag_name} installed (LSP + CLI).`\n );\n } else {\n void vscode.window.showInformationMessage(\n `Fallow: LSP ${release.tag_name} installed. CLI binary not found in release — tree views require the fallow CLI in PATH.`\n );\n }\n\n return lspPath;\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n void vscode.window.showErrorMessage(\n `Fallow: failed to download binaries: ${message}`\n );\n return null;\n }\n }\n );\n};\n","import * as fs from \"node:fs\";\n// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport {\n LanguageClient,\n LanguageClientOptions,\n ServerOptions,\n TransportKind,\n} from \"vscode-languageclient/node.js\";\nimport { Trace } from \"vscode-languageserver-protocol\";\nimport {\n getLspPath,\n getTraceLevel,\n getAutoDownload,\n getIssueTypes,\n getChangedSince,\n getResolvedConfigPath,\n} from \"./config.js\";\nimport { findBinaryInPath, findLocalBinary } from \"./binary-utils.js\";\nimport type { DiagnosticFilter } from \"./diagnosticFilter.js\";\nimport {\n parseDiagnosticCategories,\n resetDiagnosticCategories,\n setDiagnosticCategories,\n} from \"./diagnosticFilter.js\";\nimport {\n downloadBinary,\n getBinaryVersion,\n getInstalledBinaryPath,\n} from \"./download.js\";\n\nlet client: LanguageClient | null = null;\n\nconst warnIfVersionMismatch = (\n binaryPath: string,\n outputChannel?: vscode.OutputChannel\n): void => {\n const extensionVersion =\n vscode.extensions.getExtension(\"fallow-rs.fallow-vscode\")?.packageJSON\n ?.version as string | undefined;\n if (!extensionVersion) return;\n\n const binaryVersion = getBinaryVersion(binaryPath);\n if (binaryVersion && binaryVersion !== extensionVersion) {\n const msg = `Fallow: binary in PATH is v${binaryVersion}, extension is v${extensionVersion}. Update the binary or remove it from PATH to use the bundled version.`;\n outputChannel?.appendLine(msg);\n void vscode.window.showWarningMessage(msg);\n }\n};\n\nconst resolveBinaryPath = async (\n context: vscode.ExtensionContext,\n outputChannel?: vscode.OutputChannel\n): Promise => {\n const configPath = getLspPath();\n if (configPath) {\n if (fs.existsSync(configPath)) {\n outputChannel?.appendLine(`Binary resolution: using fallow.lspPath setting: ${configPath}`);\n return configPath;\n }\n void vscode.window.showWarningMessage(\n `Fallow: configured LSP path \"${configPath}\" does not exist.`\n );\n return null;\n }\n\n const local = findLocalBinary(\"fallow-lsp\");\n if (local) {\n outputChannel?.appendLine(`Binary resolution: using local node_modules/.bin: ${local}`);\n return local;\n }\n outputChannel?.appendLine(\"Binary resolution: no local node_modules/.bin/fallow-lsp found\");\n\n const inPath = findBinaryInPath(\"fallow-lsp\");\n if (inPath) {\n outputChannel?.appendLine(`Binary resolution: using system PATH: ${inPath}`);\n warnIfVersionMismatch(inPath, outputChannel);\n return inPath;\n }\n outputChannel?.appendLine(\"Binary resolution: fallow-lsp not found in PATH\");\n\n const installed = getInstalledBinaryPath(context, outputChannel);\n if (installed) {\n outputChannel?.appendLine(`Binary resolution: using previously downloaded binary: ${installed}`);\n return installed;\n }\n\n if (getAutoDownload()) {\n return downloadBinary(context);\n }\n\n const choice = await vscode.window.showErrorMessage(\n \"Fallow: fallow-lsp binary not found. Would you like to download it?\",\n \"Download\",\n \"Set Path\",\n \"Cancel\"\n );\n\n if (choice === \"Download\") {\n return downloadBinary(context);\n }\n\n if (choice === \"Set Path\") {\n void vscode.commands.executeCommand(\n \"workbench.action.openSettings\",\n \"fallow.lspPath\"\n );\n }\n\n return null;\n};\n\nexport const loadDiagnosticCategories = async (\n lspClient: LanguageClient,\n outputChannel: vscode.OutputChannel\n): Promise => {\n try {\n const response = await lspClient.sendRequest(\"fallow/issueTypes\");\n const categories = parseDiagnosticCategories(response);\n if (!categories) {\n resetDiagnosticCategories();\n outputChannel.appendLine(\n \"fallow/issueTypes returned an invalid response; using bundled diagnostic categories.\"\n );\n return;\n }\n setDiagnosticCategories(categories);\n outputChannel.appendLine(\n `Loaded ${categories.length} diagnostic categories from fallow-lsp.`\n );\n } catch (err) {\n resetDiagnosticCategories();\n const message = err instanceof Error ? err.message : String(err);\n outputChannel.appendLine(\n `fallow/issueTypes unavailable (${message}); using bundled diagnostic categories.`\n );\n }\n};\n\nexport const startClient = async (\n context: vscode.ExtensionContext,\n outputChannel: vscode.OutputChannel,\n diagnosticFilter?: DiagnosticFilter\n): Promise => {\n const binaryPath = await resolveBinaryPath(context, outputChannel);\n if (!binaryPath) {\n return null;\n }\n\n outputChannel.appendLine(`Using fallow-lsp binary: ${binaryPath}`);\n\n const serverOptions: ServerOptions = {\n command: binaryPath,\n transport: TransportKind.stdio,\n };\n\n const traceLevel = getTraceLevel();\n\n const clientOptions: LanguageClientOptions = {\n documentSelector: [\n { scheme: \"file\", language: \"javascript\" },\n { scheme: \"file\", language: \"javascriptreact\" },\n { scheme: \"file\", language: \"typescript\" },\n { scheme: \"file\", language: \"typescriptreact\" },\n { scheme: \"file\", language: \"vue\" },\n { scheme: \"file\", language: \"svelte\" },\n { scheme: \"file\", language: \"astro\" },\n { scheme: \"file\", language: \"mdx\" },\n { scheme: \"file\", language: \"json\" },\n ],\n outputChannel,\n traceOutputChannel: outputChannel,\n initializationOptions: {\n issueTypes: getIssueTypes(),\n changedSince: getChangedSince(),\n configPath: getResolvedConfigPath(),\n },\n middleware: diagnosticFilter\n ? {\n handleDiagnostics: (uri, diagnostics, next) =>\n diagnosticFilter.handleDiagnostics(uri, diagnostics, next),\n provideDiagnostics: (document, previousResultId, token, next) =>\n diagnosticFilter.provideDiagnostics(\n document,\n previousResultId,\n token,\n next\n ),\n }\n : undefined,\n };\n\n client = new LanguageClient(\n \"fallow\",\n \"Fallow Language Server\",\n serverOptions,\n clientOptions\n );\n\n if (traceLevel !== \"off\") {\n void client.setTrace(\n traceLevel === \"verbose\" ? Trace.Verbose : Trace.Messages\n );\n }\n\n try {\n await client.start();\n outputChannel.appendLine(\"Fallow language server started.\");\n await loadDiagnosticCategories(client, outputChannel);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n outputChannel.appendLine(`Failed to start language server: ${message}`);\n void vscode.window.showErrorMessage(\n `Fallow: failed to start language server. Check the output channel for details.`\n );\n client = null;\n return null;\n }\n\n diagnosticFilter?.attachClient(client);\n\n return client;\n};\n\nexport const stopClient = async (): Promise => {\n if (client) {\n await client.stop();\n client = null;\n }\n};\n\nexport const restartClient = async (\n context: vscode.ExtensionContext,\n outputChannel: vscode.OutputChannel,\n diagnosticFilter?: DiagnosticFilter\n): Promise => {\n // Detach BEFORE stop so a user toggle that fires during the gap can't\n // call refresh() against a disposed DiagnosticCollection. startClient\n // re-attaches once the new client is up.\n diagnosticFilter?.detachClient();\n await stopClient();\n return startClient(context, outputChannel, diagnosticFilter);\n};\n","import * as path from \"node:path\";\nimport type { FixAction } from \"./types.js\";\n\ninterface FixPreviewNavigateItem {\n readonly action: \"navigate\";\n readonly label: string;\n readonly description: string;\n readonly detail: string;\n readonly fix: FixAction;\n}\n\ninterface FixPreviewApplyAllItem {\n readonly action: \"apply-all\";\n readonly label: string;\n readonly description: string;\n}\n\ntype FixPreviewItem = FixPreviewNavigateItem | FixPreviewApplyAllItem;\n\nexport const buildFixArgs = (\n dryRun: boolean,\n production: boolean\n): string[] => {\n const args = dryRun\n ? [\"fix\", \"--dry-run\", \"--format\", \"json\", \"--quiet\"]\n : [\"fix\", \"--yes\", \"--format\", \"json\", \"--quiet\"];\n\n if (production) {\n args.push(\"--production\");\n }\n\n return args;\n};\n\nconst getFixLabel = (fix: FixAction): string =>\n fix.name ?? fix.package ?? fix.file ?? \"unknown\";\n\nconst getFixDetail = (fix: FixAction): string =>\n fix.path ? `${fix.path}${fix.line ? `:${fix.line}` : \"\"}` : fix.location ?? \"\";\n\nexport const createFixPreviewItems = (\n fixes: ReadonlyArray\n): FixPreviewItem[] => [\n ...fixes.map((fix) => ({\n label: getFixLabel(fix),\n description: fix.type.replace(/_/g, \" \"),\n detail: getFixDetail(fix),\n action: \"navigate\" as const,\n fix,\n })),\n {\n label: \"Apply all fixes\",\n description: `${fixes.length} fix${fixes.length === 1 ? \"\" : \"es\"}`,\n action: \"apply-all\" as const,\n },\n];\n\nexport const resolveFixLocation = (\n root: string,\n fix: FixAction\n): { absolutePath: string; line: number } | null => {\n const filePath = fix.path ?? fix.file;\n if (!filePath) {\n return null;\n }\n\n return {\n absolutePath: path.isAbsolute(filePath)\n ? filePath\n : path.resolve(root, filePath),\n line: Math.max(0, (fix.line ?? 1) - 1),\n };\n};\n","import * as child_process from \"node:child_process\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport {\n getLspPath,\n getProduction,\n getDuplicationMode,\n getDuplicationThreshold,\n getIssueTypes,\n getChangedSince,\n getResolvedConfigPath,\n} from \"./config.js\";\nimport { countCheckIssues } from \"./analysis-utils.js\";\nimport { findBinaryInPath, findLocalBinary, getExecutableExtension } from \"./binary-utils.js\";\nimport { getInstalledCliPath } from \"./download.js\";\nimport {\n buildFixArgs,\n createFixPreviewItems,\n resolveFixLocation,\n} from \"./fix-utils.js\";\nimport type {\n FallowCheckResult,\n FallowCombinedResult,\n FallowDupesResult,\n FallowFixResult,\n FixAction,\n} from \"./types.js\";\n\nconst findCliBinary = (context: vscode.ExtensionContext): string | null => {\n const lspPath = getLspPath();\n if (lspPath) {\n const dir = path.dirname(lspPath);\n const cliPath = path.join(dir, `fallow${getExecutableExtension()}`);\n if (fs.existsSync(cliPath)) {\n return cliPath;\n }\n }\n\n const local = findLocalBinary(\"fallow\");\n if (local) {\n return local;\n }\n\n const inPath = findBinaryInPath(\"fallow\");\n if (inPath) {\n return inPath;\n }\n\n const installed = getInstalledCliPath(context);\n if (installed) {\n return installed;\n }\n\n return null;\n};\n\nconst execFallow = (\n context: vscode.ExtensionContext,\n args: ReadonlyArray,\n cwd: string\n): Promise =>\n new Promise((resolve, reject) => {\n const binary = findCliBinary(context);\n if (!binary) {\n reject(new Error(\"fallow CLI binary not found in PATH.\"));\n return;\n }\n\n const child = child_process.spawn(binary, [...args], {\n cwd,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n\n let stdout = \"\";\n let stderr = \"\";\n\n child.stdout?.setEncoding(\"utf8\");\n child.stdout?.on(\"data\", (chunk: string) => {\n stdout += chunk;\n });\n\n child.stderr?.setEncoding(\"utf8\");\n child.stderr?.on(\"data\", (chunk: string) => {\n stderr += chunk;\n });\n\n child.on(\"error\", (error) => {\n reject(error);\n });\n\n child.on(\"close\", (code, signal) => {\n if (signal) {\n reject(new Error(`fallow exited via signal ${signal}`));\n return;\n }\n\n if (code !== null && code !== 0 && code !== 1) {\n reject(\n new Error(\n stderr.trim() || `fallow exited with code ${code}`\n )\n );\n return;\n }\n\n resolve(stdout);\n });\n });\n\n/** Filter check results based on the user's issueTypes configuration. */\nconst filterCheckResult = (result: FallowCheckResult): FallowCheckResult => {\n const types = getIssueTypes();\n const filtered: FallowCheckResult = {\n ...result,\n unused_files: types[\"unused-files\"] ? result.unused_files : [],\n unused_exports: types[\"unused-exports\"] ? result.unused_exports : [],\n unused_types: types[\"unused-types\"] ? result.unused_types : [],\n private_type_leaks: types[\"private-type-leaks\"] ? result.private_type_leaks : [],\n unused_dependencies: types[\"unused-dependencies\"] ? result.unused_dependencies : [],\n unused_dev_dependencies: types[\"unused-dev-dependencies\"] ? result.unused_dev_dependencies : [],\n unused_optional_dependencies: types[\"unused-optional-dependencies\"] ? result.unused_optional_dependencies : [],\n unused_enum_members: types[\"unused-enum-members\"] ? result.unused_enum_members : [],\n unused_class_members: types[\"unused-class-members\"] ? result.unused_class_members : [],\n unresolved_imports: types[\"unresolved-imports\"] ? result.unresolved_imports : [],\n unlisted_dependencies: types[\"unlisted-dependencies\"] ? result.unlisted_dependencies : [],\n duplicate_exports: types[\"duplicate-exports\"] ? result.duplicate_exports : [],\n type_only_dependencies: types[\"type-only-dependencies\"] ? result.type_only_dependencies : [],\n test_only_dependencies: types[\"test-only-dependencies\"] ? result.test_only_dependencies : [],\n circular_dependencies: types[\"circular-dependencies\"] ? result.circular_dependencies : [],\n boundary_violations: types[\"boundary-violation\"] ? result.boundary_violations : [],\n stale_suppressions: types[\"stale-suppressions\"] ? result.stale_suppressions : [],\n unused_catalog_entries: types[\"unused-catalog-entries\"]\n ? result.unused_catalog_entries\n : [],\n unresolved_catalog_references: types[\"unresolved-catalog-references\"]\n ? result.unresolved_catalog_references\n : [],\n };\n const totalIssues = countCheckIssues(filtered);\n const summary = {\n total_issues: totalIssues,\n unused_files: filtered.unused_files.length,\n unused_exports: filtered.unused_exports.length,\n unused_types: filtered.unused_types.length,\n private_type_leaks: filtered.private_type_leaks?.length ?? 0,\n unused_dependencies:\n filtered.unused_dependencies.length +\n filtered.unused_dev_dependencies.length +\n (filtered.unused_optional_dependencies?.length ?? 0),\n unused_enum_members: filtered.unused_enum_members.length,\n unused_class_members: filtered.unused_class_members.length,\n unresolved_imports: filtered.unresolved_imports.length,\n unlisted_dependencies: filtered.unlisted_dependencies.length,\n duplicate_exports: filtered.duplicate_exports.length,\n type_only_dependencies: filtered.type_only_dependencies?.length ?? 0,\n test_only_dependencies: filtered.test_only_dependencies?.length ?? 0,\n circular_dependencies: filtered.circular_dependencies?.length ?? 0,\n boundary_violations: filtered.boundary_violations?.length ?? 0,\n stale_suppressions: filtered.stale_suppressions?.length ?? 0,\n unused_catalog_entries: filtered.unused_catalog_entries?.length ?? 0,\n unresolved_catalog_references:\n filtered.unresolved_catalog_references?.length ?? 0,\n };\n return {\n ...filtered,\n total_issues: totalIssues,\n summary,\n };\n};\n\nconst getWorkspaceRoot = (): string | null => {\n const folders = vscode.workspace.workspaceFolders;\n if (!folders || folders.length === 0) {\n return null;\n }\n return folders[0].uri.fsPath;\n};\n\ninterface FixQuickPickItem extends vscode.QuickPickItem {\n readonly action: \"navigate\" | \"apply-all\";\n readonly fix?: FixAction;\n}\n\nconst confirmApplyFixes = async (): Promise => {\n const confirm = await vscode.window.showWarningMessage(\n \"Fallow: This will unexport unused exports (keeps the code) and remove unused dependencies from package.json. Continue?\",\n \"Yes\",\n \"No\"\n );\n\n return confirm === \"Yes\";\n};\n\nconst openFixLocation = async (\n root: string,\n fix: FixAction | undefined\n): Promise => {\n if (!fix) {\n return;\n }\n\n const location = resolveFixLocation(root, fix);\n if (!location) {\n return;\n }\n\n await vscode.window.showTextDocument(vscode.Uri.file(location.absolutePath), {\n selection: new vscode.Range(location.line, 0, location.line, 0),\n });\n};\n\nconst showDryRunPreview = async (\n root: string,\n result: FallowFixResult\n): Promise => {\n if (result.fixes.length === 0) {\n void vscode.window.showInformationMessage(\"Fallow: no fixes available.\");\n return;\n }\n\n const quickPickItems: FixQuickPickItem[] = [];\n for (const item of createFixPreviewItems(result.fixes)) {\n if (item.action === \"apply-all\") {\n quickPickItems.push({\n label: \"\",\n kind: vscode.QuickPickItemKind.Separator,\n action: \"navigate\",\n });\n quickPickItems.push({\n label: \"$(play) Apply all fixes\",\n description: item.description,\n action: item.action,\n });\n continue;\n }\n\n quickPickItems.push({\n label: `$(wrench) ${item.label}`,\n description: item.description,\n detail: item.detail,\n action: item.action,\n fix: item.fix,\n });\n }\n\n const picked = await vscode.window.showQuickPick(quickPickItems, {\n title: `Fallow: ${result.fixes.length} fix${result.fixes.length === 1 ? \"\" : \"es\"} available`,\n placeHolder:\n \"Review fixes — select 'Apply all fixes' to apply, or click a fix to navigate\",\n });\n\n if (!picked) {\n return;\n }\n\n if (picked.action === \"apply-all\") {\n void vscode.commands.executeCommand(\"fallow.fix\");\n return;\n }\n\n await openFixLocation(root, picked.fix);\n};\n\nexport const runAnalysis = async (\n context: vscode.ExtensionContext\n): Promise<{\n check: FallowCheckResult | null;\n dupes: FallowDupesResult | null;\n}> => {\n const root = getWorkspaceRoot();\n if (!root) {\n void vscode.window.showWarningMessage(\"Fallow: no workspace folder open.\");\n return { check: null, dupes: null };\n }\n\n let check: FallowCheckResult | null = null;\n let dupes: FallowDupesResult | null = null;\n\n try {\n const analysisArgs = [\"--format\", \"json\", \"--quiet\", \"--skip\", \"health\"];\n if (getProduction()) {\n analysisArgs.push(\"--production\");\n }\n\n const changedSince = getChangedSince();\n if (changedSince) {\n analysisArgs.push(\"--changed-since\", changedSince);\n }\n\n const configPath = getResolvedConfigPath();\n if (configPath) {\n analysisArgs.push(\"--config\", configPath);\n }\n\n analysisArgs.push(\"--dupes-mode\", getDuplicationMode());\n analysisArgs.push(\"--dupes-threshold\", String(getDuplicationThreshold()));\n\n const output = await execFallow(context, analysisArgs, root);\n\n if (output.trim().length === 0) {\n // execFallow already rejects on non-zero exit codes (other than 0/1);\n // an empty stdout on a successful exit means there was nothing to\n // report. Leave check/dupes null and return without raising.\n return { check, dupes };\n }\n\n const result = JSON.parse(output) as FallowCombinedResult;\n check = result.check ? filterCheckResult(result.check) : null;\n dupes = result.dupes ?? null;\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n void vscode.window.showErrorMessage(`Fallow analysis failed: ${message}`);\n throw err;\n }\n\n return { check, dupes };\n};\n\nexport const runFix = async (\n context: vscode.ExtensionContext,\n dryRun: boolean\n): Promise => {\n const root = getWorkspaceRoot();\n if (!root) {\n void vscode.window.showWarningMessage(\"Fallow: no workspace folder open.\");\n return null;\n }\n\n if (!dryRun && !(await confirmApplyFixes())) {\n return null;\n }\n\n try {\n const fixArgs = buildFixArgs(dryRun, getProduction());\n const configPath = getResolvedConfigPath();\n if (configPath) {\n fixArgs.push(\"--config\", configPath);\n }\n\n const output = await execFallow(\n context,\n fixArgs,\n root\n );\n const result = JSON.parse(output) as FallowFixResult;\n\n if (dryRun) {\n await showDryRunPreview(root, result);\n } else {\n const fixCount = result.fixes.length;\n void vscode.window.showInformationMessage(\n `Fallow: applied ${fixCount} fix${fixCount === 1 ? \"\" : \"es\"}.`\n );\n }\n\n return result;\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n void vscode.window.showErrorMessage(`Fallow fix failed: ${message}`);\n return null;\n }\n};\n","// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport {\n DiagnosticFilter,\n diagnosticCode,\n getDiagnosticCategories,\n isFallowDiagnostic,\n} from \"./diagnosticFilter.js\";\n\nconst DUPLICATE_CODE = \"code-duplication\";\nconst STATUS_ITEM_ID = \"fallow.diagnosticMutes\";\nconst CODE_ACTION_KIND = vscode.CodeActionKind.QuickFix.append(\"fallow.mute\");\nconst FALLOW_LANGUAGES = [\n \"javascript\",\n \"javascriptreact\",\n \"typescript\",\n \"typescriptreact\",\n \"vue\",\n \"svelte\",\n \"astro\",\n \"mdx\",\n \"json\",\n];\n\nconst labelFor = (code: string): string =>\n getDiagnosticCategories().find((c) => c.code === code)?.label ?? code;\n\nconst categoryWord = (count: number): string =>\n count === 1 ? \"category\" : \"categories\";\n\nconst muteScopeTooltip = (filter: DiagnosticFilter): vscode.MarkdownString => {\n const muted = Array.from(filter.mutedCategoriesSnapshot())\n .map(labelFor)\n .sort();\n const mutedAll = filter.isMutedAll();\n const lines: string[] = [];\n if (mutedAll) {\n lines.push(\"**All Fallow findings hidden** in the editor.\");\n } else if (muted.length > 0) {\n lines.push(`**Hiding ${muted.length} ${categoryWord(muted.length)}** in the editor:`);\n lines.push(\"\");\n for (const m of muted) {\n lines.push(`- ${m}`);\n }\n } else {\n lines.push(\"All Fallow findings visible.\");\n }\n lines.push(\"\");\n lines.push(\n \"Local view filter only. CI and `fallow check` still report every finding.\"\n );\n lines.push(\"To disable a rule project-wide, edit your fallow config.\"\n );\n const md = new vscode.MarkdownString(lines.join(\"\\n\"));\n md.isTrusted = false;\n md.supportThemeIcons = true;\n return md;\n};\n\nconst summaryText = (filter: DiagnosticFilter): string => {\n if (filter.isMutedAll()) {\n return \"Fallow: hiding all\";\n }\n const n = filter.mutedCategoriesSnapshot().size;\n return `Fallow: hiding ${n} ${categoryWord(n)}`;\n};\n\n/** A LanguageStatusItem in the right gutter that surfaces mute state.\n * Severity is `Warning` whenever anything is muted, otherwise the item is\n * hidden. Click opens the manage-mutes QuickPick. A secondary command\n * clears all mutes in one click. */\nconst createLanguageStatus = (\n filter: DiagnosticFilter\n): vscode.LanguageStatusItem => {\n const selector = FALLOW_LANGUAGES.map((language) => ({\n scheme: \"file\",\n language,\n }));\n const item = vscode.languages.createLanguageStatusItem(STATUS_ITEM_ID, []);\n item.name = \"Fallow Mute\";\n item.accessibilityInformation = {\n label: \"Fallow diagnostic mute status\",\n role: \"button\",\n };\n\n const apply = (): void => {\n if (!filter.anythingMuted()) {\n item.selector = [];\n item.severity = vscode.LanguageStatusSeverity.Information;\n item.text = \"$(check) Fallow\";\n item.detail = \"all findings visible\";\n item.command = undefined;\n return;\n }\n item.selector = selector;\n item.severity = vscode.LanguageStatusSeverity.Warning;\n item.text = `$(eye-closed) ${summaryText(filter)}`;\n item.detail = \"click to manage\";\n item.command = {\n command: \"fallow.manageDiagnosticMutes\",\n title: \"Manage\",\n tooltip: \"Manage Fallow diagnostic mutes\",\n };\n };\n\n apply();\n filter.onDidChange(apply);\n return item;\n};\n\ninterface ManagePickItem extends vscode.QuickPickItem {\n readonly code: string | null;\n}\n\nconst TITLE_BUTTONS = {\n toggleAll: {\n iconPath: new vscode.ThemeIcon(\"eye-closed\"),\n tooltip: \"Toggle mute for ALL Fallow findings\",\n },\n clearAll: {\n iconPath: new vscode.ThemeIcon(\"clear-all\"),\n tooltip: \"Show all Fallow findings (clear all mutes)\",\n },\n} as const;\n\nconst showManageQuickPick = async (filter: DiagnosticFilter): Promise => {\n const pick = vscode.window.createQuickPick();\n pick.title = \"Fallow: manage diagnostic mutes (CI is unaffected)\";\n pick.placeholder =\n \"Check categories to hide them in the editor. Press Enter to apply.\";\n pick.canSelectMany = true;\n pick.matchOnDetail = true;\n pick.buttons = [TITLE_BUTTONS.toggleAll, TITLE_BUTTONS.clearAll];\n\n const globalItem: ManagePickItem = {\n label: \"$(eye-closed) All Fallow Findings\",\n description: filter.isMutedAll() ? \"currently hidden\" : \"currently visible\",\n detail: \"Global editor-only mute. Use the title buttons to toggle or clear it.\",\n code: null,\n picked: filter.isMutedAll(),\n alwaysShow: filter.isMutedAll(),\n };\n const items: ManagePickItem[] = [\n globalItem,\n ...getDiagnosticCategories().map(({ code, label }) => ({\n label,\n description: code,\n code,\n picked: filter.isMutedAll() || filter.isCategoryMuted(code),\n })),\n ];\n pick.items = items;\n pick.selectedItems = items.filter((i) => i.picked === true);\n\n await new Promise((resolve) => {\n pick.onDidTriggerButton((button) => {\n if (button === TITLE_BUTTONS.toggleAll) {\n filter.toggleMutedAll();\n } else if (button === TITLE_BUTTONS.clearAll) {\n filter.clearAllMutes();\n }\n pick.hide();\n });\n pick.onDidAccept(() => {\n const globalSelected = pick.selectedItems.some((i) => i.code === null);\n const selected = new Set(\n pick.selectedItems\n .map((i) => i.code)\n .filter((code): code is string => code !== null)\n );\n if (globalSelected) {\n filter.setMutedAll(true);\n } else {\n if (filter.isMutedAll()) {\n filter.setMutedAll(false);\n }\n filter.setMutedCategories(selected);\n }\n pick.hide();\n });\n pick.onDidHide(() => {\n pick.dispose();\n resolve();\n });\n pick.show();\n });\n};\n\nconst updateContextKey = (filter: DiagnosticFilter): void => {\n void vscode.commands.executeCommand(\n \"setContext\",\n \"fallow.duplicatesMuted\",\n filter.isCategoryMuted(DUPLICATE_CODE) || filter.isMutedAll()\n );\n void vscode.commands.executeCommand(\n \"setContext\",\n \"fallow.allDiagnosticsMuted\",\n filter.isMutedAll()\n );\n};\n\nclass FallowMuteCodeActions implements vscode.CodeActionProvider {\n public static readonly providedKinds: ReadonlyArray = [\n CODE_ACTION_KIND,\n ];\n\n public provideCodeActions(\n _document: vscode.TextDocument,\n _range: vscode.Range | vscode.Selection,\n context: vscode.CodeActionContext\n ): vscode.CodeAction[] {\n const seen = new Set();\n const actions: vscode.CodeAction[] = [];\n for (const diag of context.diagnostics) {\n if (!isFallowDiagnostic(diag)) {\n continue;\n }\n const code = diagnosticCode(diag);\n if (!code || seen.has(code)) {\n continue;\n }\n seen.add(code);\n const label = labelFor(code);\n const action = new vscode.CodeAction(\n `Mute Fallow ${label.toLowerCase()} findings in this workspace`,\n CODE_ACTION_KIND\n );\n action.command = {\n command: \"fallow.muteDiagnosticCategory\",\n title: \"Mute Fallow category\",\n arguments: [code],\n };\n action.diagnostics = [diag];\n actions.push(action);\n }\n return actions;\n }\n}\n\nexport const registerDiagnosticMuteUi = (\n context: vscode.ExtensionContext,\n filter: DiagnosticFilter\n): void => {\n const statusItem = createLanguageStatus(filter);\n context.subscriptions.push(statusItem);\n\n context.subscriptions.push(\n filter.onDidChange(() => updateContextKey(filter))\n );\n updateContextKey(filter);\n\n context.subscriptions.push(\n vscode.workspace.onDidCloseTextDocument((doc) => {\n filter.evictUri(doc.uri);\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.toggleMuteDuplicates\", () => {\n const nowMuted = filter.toggleCategory(DUPLICATE_CODE);\n void vscode.window.setStatusBarMessage(\n nowMuted\n ? \"Fallow: muted code-duplication findings (CI is unaffected)\"\n : \"Fallow: showing code-duplication findings\",\n 4000\n );\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.toggleAllDiagnostics\", () => {\n const nowMuted = filter.toggleMutedAll();\n void vscode.window.setStatusBarMessage(\n nowMuted\n ? \"Fallow: muted all findings (CI is unaffected)\"\n : \"Fallow: showing all findings\",\n 4000\n );\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\n \"fallow.manageDiagnosticMutes\",\n async () => {\n await showManageQuickPick(filter);\n }\n )\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.clearDiagnosticMutes\", () => {\n filter.clearAllMutes();\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\n \"fallow.muteDiagnosticCategory\",\n (code: unknown) => {\n if (typeof code === \"string\" && code.length > 0) {\n filter.setCategoryMuted(code, true);\n }\n }\n )\n );\n\n for (const language of FALLOW_LANGUAGES) {\n context.subscriptions.push(\n vscode.languages.registerCodeActionsProvider(\n { scheme: \"file\", language },\n new FallowMuteCodeActions(),\n { providedCodeActionKinds: FallowMuteCodeActions.providedKinds }\n )\n );\n }\n};\n\nexport const __testHelpers = {\n createLanguageStatus,\n labelFor,\n summaryText,\n showManageQuickPick,\n muteScopeTooltip,\n};\n","import { countCheckIssues } from \"./analysis-utils.js\";\nimport type { FallowCheckResult, FallowDupesResult } from \"./types.js\";\n\nexport interface AnalysisCompleteParams {\n totalIssues: number;\n unusedFiles: number;\n unusedExports: number;\n unusedTypes: number;\n privateTypeLeaks: number;\n unusedDependencies: number;\n unusedDevDependencies: number;\n unusedOptionalDependencies: number;\n unusedEnumMembers: number;\n unusedClassMembers: number;\n unresolvedImports: number;\n unlistedDependencies: number;\n duplicateExports: number;\n typeOnlyDependencies: number;\n testOnlyDependencies: number;\n circularDependencies: number;\n boundaryViolations: number;\n staleSuppressions: number;\n unusedCatalogEntries: number;\n unresolvedCatalogReferences: number;\n duplicationPercentage: number;\n cloneGroups: number;\n}\n\n/**\n * Convert CLI analysis results into the same shape the LSP notification\n * delivers, so the status bar text and tooltip can be built from a single\n * source of truth regardless of whether LSP or CLI produced the data.\n */\nexport const buildParamsFromCli = (\n check: FallowCheckResult | null,\n dupes: FallowDupesResult | null\n): AnalysisCompleteParams => ({\n totalIssues: countCheckIssues(check),\n unusedFiles: check?.unused_files.length ?? 0,\n unusedExports: check?.unused_exports.length ?? 0,\n unusedTypes: check?.unused_types.length ?? 0,\n privateTypeLeaks: check?.private_type_leaks?.length ?? 0,\n unusedDependencies: check?.unused_dependencies.length ?? 0,\n unusedDevDependencies: check?.unused_dev_dependencies.length ?? 0,\n unusedOptionalDependencies: check?.unused_optional_dependencies?.length ?? 0,\n unusedEnumMembers: check?.unused_enum_members.length ?? 0,\n unusedClassMembers: check?.unused_class_members.length ?? 0,\n unresolvedImports: check?.unresolved_imports.length ?? 0,\n unlistedDependencies: check?.unlisted_dependencies.length ?? 0,\n duplicateExports: check?.duplicate_exports.length ?? 0,\n typeOnlyDependencies: check?.type_only_dependencies?.length ?? 0,\n testOnlyDependencies: check?.test_only_dependencies?.length ?? 0,\n circularDependencies: check?.circular_dependencies?.length ?? 0,\n boundaryViolations: check?.boundary_violations?.length ?? 0,\n staleSuppressions: check?.stale_suppressions?.length ?? 0,\n unusedCatalogEntries: check?.unused_catalog_entries?.length ?? 0,\n unresolvedCatalogReferences:\n check?.unresolved_catalog_references?.length ?? 0,\n duplicationPercentage: dupes?.stats.duplication_percentage ?? 0,\n cloneGroups: dupes?.stats.clone_groups ?? 0,\n});\n\ntype SeverityKey =\n | \"statusBarItem.errorBackground\"\n | \"statusBarItem.warningBackground\";\n\ninterface BreakdownLine {\n readonly count: keyof AnalysisCompleteParams;\n readonly icon: string;\n readonly label: string;\n}\n\nconst BREAKDOWN_LINES: ReadonlyArray = [\n {\n count: \"unresolvedImports\",\n icon: \"$(error)\",\n label: \"unresolved imports\",\n },\n { count: \"unusedFiles\", icon: \"$(warning)\", label: \"unused files\" },\n { count: \"unusedExports\", icon: \"$(warning)\", label: \"unused exports\" },\n { count: \"unusedTypes\", icon: \"$(info)\", label: \"unused types\" },\n {\n count: \"privateTypeLeaks\",\n icon: \"$(warning)\",\n label: \"private type leaks\",\n },\n {\n count: \"unusedDependencies\",\n icon: \"$(warning)\",\n label: \"unused dependencies\",\n },\n {\n count: \"unusedDevDependencies\",\n icon: \"$(warning)\",\n label: \"unused dev dependencies\",\n },\n {\n count: \"unusedOptionalDependencies\",\n icon: \"$(warning)\",\n label: \"unused optional dependencies\",\n },\n {\n count: \"unusedEnumMembers\",\n icon: \"$(info)\",\n label: \"unused enum members\",\n },\n {\n count: \"unusedClassMembers\",\n icon: \"$(info)\",\n label: \"unused class members\",\n },\n {\n count: \"unlistedDependencies\",\n icon: \"$(warning)\",\n label: \"unlisted dependencies\",\n },\n {\n count: \"duplicateExports\",\n icon: \"$(warning)\",\n label: \"duplicate exports\",\n },\n {\n count: \"typeOnlyDependencies\",\n icon: \"$(info)\",\n label: \"type-only dependencies\",\n },\n {\n count: \"testOnlyDependencies\",\n icon: \"$(info)\",\n label: \"test-only dependencies\",\n },\n {\n count: \"circularDependencies\",\n icon: \"$(warning)\",\n label: \"circular dependencies\",\n },\n {\n count: \"boundaryViolations\",\n icon: \"$(warning)\",\n label: \"boundary violations\",\n },\n {\n count: \"staleSuppressions\",\n icon: \"$(info)\",\n label: \"stale suppressions\",\n },\n {\n count: \"unusedCatalogEntries\",\n icon: \"$(warning)\",\n label: \"unused catalog entries\",\n },\n {\n count: \"unresolvedCatalogReferences\",\n icon: \"$(error)\",\n label: \"unresolved catalog references\",\n },\n];\n\nexport const getDuplicationPercentage = (\n duplicationPercentage: number\n): number => (Number.isFinite(duplicationPercentage) ? duplicationPercentage : 0);\n\nexport const buildStatusBarPartsFromLsp = (\n params: AnalysisCompleteParams\n): string[] => [\n `${params.totalIssues} issues`,\n `${getDuplicationPercentage(params.duplicationPercentage).toFixed(1)}% duplication`,\n];\n\nexport const getStatusBarSeverityKey = (\n params: AnalysisCompleteParams\n): SeverityKey | null => {\n if (params.unresolvedImports > 0) {\n return \"statusBarItem.errorBackground\";\n }\n\n if (params.totalIssues > 0) {\n return \"statusBarItem.warningBackground\";\n }\n\n return null;\n};\n\nconst normalizeInlineText = (value: string): string =>\n value.replace(/\\s+/g, \" \").trim();\n\nexport const formatChangedSinceRefForStatusBar = (ref: string): string => {\n const normalized = normalizeInlineText(ref);\n return normalized.length > 48\n ? `${normalized.slice(0, 45).trimEnd()}...`\n : normalized;\n};\n\n/**\n * Resolve the visible status bar text for a given base label, appending\n * the persistent `changedSince` suffix when that filter is active.\n *\n * Single source of truth across the four status bar states (idle,\n * analyzing, error, post-analysis). Earlier the post-analysis path was\n * the only state that showed `(since )`, which made the filter feel\n * intermittent and forced users to hover the tooltip to verify it was\n * still active. The panel review for issue #190 flagged this as the\n * visible signal that should match the `changedSince` filter applied to\n * LSP diagnostics.\n *\n * Pure: takes the resolved ref so it can be unit-tested without a vscode\n * mock. Callers in `statusBar.ts` pass `getChangedSince()` or `null`.\n */\nexport const renderStatusBarText = (\n base: string,\n changedSince: string | null\n): string => {\n if (!changedSince) {\n return base;\n }\n return `${base} (since ${formatChangedSinceRefForStatusBar(changedSince)})`;\n};\n\nconst escapeMarkdownText = (value: string): string =>\n normalizeInlineText(value).replace(/([\\\\`*_{}[\\]()#+.!|>-])/g, \"\\\\$1\");\n\nexport const buildStatusBarTooltipMarkdown = (\n params: AnalysisCompleteParams,\n changedSinceRef: string | null = null\n): string => {\n const lines: string[] = [\"**Fallow** - Analysis Results\\n\"];\n const duplicationPercentage = getDuplicationPercentage(\n params.duplicationPercentage\n );\n\n if (changedSinceRef) {\n lines.push(\n `$(git-branch) Scoped to changes since ${escapeMarkdownText(changedSinceRef)}`\n );\n }\n\n for (const line of BREAKDOWN_LINES) {\n const count = params[line.count];\n if (typeof count === \"number\" && count > 0) {\n lines.push(`${line.icon} ${count} ${line.label}`);\n }\n }\n\n if (params.cloneGroups > 0) {\n lines.push(\n `$(copy) ${params.cloneGroups} clone groups (${duplicationPercentage.toFixed(1)}% duplication)`\n );\n }\n\n if (params.totalIssues === 0 && params.cloneGroups === 0) {\n lines.push(\"$(check) No issues found\");\n }\n\n lines.push(\"\\n---\\n\");\n lines.push(\n \"[$(play) Run Analysis](command:fallow.analyze) · [$(wrench) Auto-Fix](command:fallow.fix) · [$(output) Output](command:fallow.showOutput)\"\n );\n\n return lines.join(\"\\n\\n\");\n};\n","// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport { getChangedSince } from \"./config.js\";\nimport {\n buildParamsFromCli,\n buildStatusBarPartsFromLsp,\n buildStatusBarTooltipMarkdown,\n getStatusBarSeverityKey,\n renderStatusBarText,\n} from \"./statusBar-utils.js\";\nimport type { FallowCheckResult, FallowDupesResult } from \"./types.js\";\nexport type { AnalysisCompleteParams } from \"./statusBar-utils.js\";\nimport type { AnalysisCompleteParams } from \"./statusBar-utils.js\";\n\nlet statusBarItem: vscode.StatusBarItem | null = null;\n\nconst liveChangedSince = (): string | null => getChangedSince() || null;\n\nexport const createStatusBar = (): vscode.StatusBarItem => {\n statusBarItem = vscode.window.createStatusBarItem(\n vscode.StatusBarAlignment.Left,\n 50\n );\n statusBarItem.command = \"fallow.analyze\";\n statusBarItem.text = renderStatusBarText(\n \"$(search) Fallow\",\n liveChangedSince()\n );\n statusBarItem.show();\n return statusBarItem;\n};\n\n/** Update the status bar from CLI-driven analysis results. */\nexport const updateStatusBar = (\n checkResult: FallowCheckResult | null,\n dupesResult: FallowDupesResult | null\n): void => {\n if (!statusBarItem) {\n return;\n }\n\n const params = buildParamsFromCli(checkResult, dupesResult);\n applyTooltipAndSeverity(params);\n\n const parts: string[] = [];\n if (checkResult) {\n parts.push(`${params.totalIssues} issues`);\n }\n if (dupesResult) {\n parts.push(`${params.duplicationPercentage.toFixed(1)}% duplication`);\n }\n applyStatusBarText(parts);\n};\n\n/** Update the status bar from LSP notification data. */\nexport const updateStatusBarFromLsp = (params: AnalysisCompleteParams): void => {\n if (!statusBarItem) {\n return;\n }\n\n applyTooltipAndSeverity(params);\n applyStatusBarText(buildStatusBarPartsFromLsp(params));\n};\n\nconst applyTooltipAndSeverity = (params: AnalysisCompleteParams): void => {\n if (!statusBarItem) {\n return;\n }\n\n const severity = getStatusBarSeverityKey(params);\n statusBarItem.backgroundColor = severity\n ? new vscode.ThemeColor(severity)\n : undefined;\n\n const tooltip = new vscode.MarkdownString(\n buildStatusBarTooltipMarkdown(params, getChangedSince() || null)\n );\n tooltip.isTrusted = true;\n // Required so `$(name)` codicons in the markdown render as icons rather\n // than literal text. Without this the popup shows raw `$(error)`,\n // `$(warning)`, etc. (issue #179).\n tooltip.supportThemeIcons = true;\n statusBarItem.tooltip = tooltip;\n};\n\nconst applyStatusBarText = (parts: string[]): void => {\n if (!statusBarItem) {\n return;\n }\n const base =\n parts.length > 0\n ? `$(search) Fallow: ${parts.join(\" | \")}`\n : \"$(search) Fallow\";\n statusBarItem.text = renderStatusBarText(base, liveChangedSince());\n};\n\nexport const setStatusBarAnalyzing = (): void => {\n if (statusBarItem) {\n statusBarItem.text = renderStatusBarText(\n \"$(loading~spin) Fallow: Analyzing...\",\n liveChangedSince()\n );\n }\n};\n\nexport const setStatusBarError = (): void => {\n if (statusBarItem) {\n statusBarItem.text = renderStatusBarText(\n \"$(error) Fallow: Error\",\n liveChangedSince()\n );\n }\n};\n\nexport const disposeStatusBar = (): void => {\n if (statusBarItem) {\n statusBarItem.dispose();\n statusBarItem = null;\n }\n};\n","import * as path from \"node:path\";\n\nexport interface ResolvedPath {\n readonly absolute: string;\n readonly relative: string;\n}\n\nexport const resolveFilePath = (\n filePath: string | undefined,\n workspaceRoot: string | undefined\n): ResolvedPath => {\n if (!filePath) {\n return { absolute: \"\", relative: \"\" };\n }\n const absolute = workspaceRoot && !path.isAbsolute(filePath)\n ? path.resolve(workspaceRoot, filePath)\n : filePath;\n const relative = workspaceRoot ? path.relative(workspaceRoot, absolute) : filePath;\n return { absolute, relative };\n};\n","/**\n * Tree-view category labels. The kebab-case `IssueCategory` keys mirror\n * fallow's rule names and the VS Code setting `fallow.issueTypes.*` keys.\n * These are UI strings, not part of the JSON output contract.\n */\n\nexport type IssueCategory =\n | \"unused-files\"\n | \"unused-exports\"\n | \"unused-types\"\n | \"private-type-leaks\"\n | \"unused-dependencies\"\n | \"unused-dev-dependencies\"\n | \"unused-optional-dependencies\"\n | \"unused-enum-members\"\n | \"unused-class-members\"\n | \"unresolved-imports\"\n | \"unlisted-dependencies\"\n | \"duplicate-exports\"\n | \"type-only-dependencies\"\n | \"test-only-dependencies\"\n | \"circular-dependencies\"\n | \"boundary-violation\"\n | \"stale-suppressions\"\n | \"unused-catalog-entries\"\n | \"unresolved-catalog-references\";\n\nexport const ISSUE_CATEGORY_LABELS: Record = {\n \"unused-files\": \"Unused Files\",\n \"unused-exports\": \"Unused Exports\",\n \"unused-types\": \"Unused Types\",\n \"private-type-leaks\": \"Private Type Leaks\",\n \"unused-dependencies\": \"Unused Dependencies\",\n \"unused-dev-dependencies\": \"Unused Dev Dependencies\",\n \"unused-optional-dependencies\": \"Unused Optional Dependencies\",\n \"unused-enum-members\": \"Unused Enum Members\",\n \"unused-class-members\": \"Unused Class Members\",\n \"unresolved-imports\": \"Unresolved Imports\",\n \"unlisted-dependencies\": \"Unlisted Dependencies\",\n \"duplicate-exports\": \"Duplicate Exports\",\n \"type-only-dependencies\": \"Type-Only Dependencies\",\n \"test-only-dependencies\": \"Test-Only Dependencies\",\n \"circular-dependencies\": \"Circular Dependencies\",\n \"boundary-violation\": \"Boundary Violations\",\n \"stale-suppressions\": \"Stale Suppressions\",\n \"unused-catalog-entries\": \"Unused Catalog Entries\",\n \"unresolved-catalog-references\": \"Unresolved Catalog References\",\n};\n","import * as path from \"node:path\";\n// VS Code calls TreeDataProvider members through the registered provider.\n// fallow-ignore-file unused-class-member\n// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport { countCheckIssues } from \"./analysis-utils.js\";\nimport { resolveFilePath as resolveFilePathPure } from \"./treeView-utils.js\";\nimport type {\n CloneGroup,\n FallowCheckResult,\n FallowDupesResult,\n IssueCategory,\n} from \"./types.js\";\nimport { ISSUE_CATEGORY_LABELS } from \"./types.js\";\n\nconst resolveFilePath = (filePath: string | undefined) =>\n resolveFilePathPure(filePath, vscode.workspace.workspaceFolders?.[0]?.uri.fsPath);\n\n/** Icons per issue category. */\nconst CATEGORY_ICONS: Record = {\n \"unused-files\": \"file-code\",\n \"unused-exports\": \"symbol-method\",\n \"unused-types\": \"symbol-interface\",\n \"private-type-leaks\": \"symbol-interface\",\n \"unused-dependencies\": \"package\",\n \"unused-dev-dependencies\": \"package\",\n \"unused-optional-dependencies\": \"package\",\n \"unused-enum-members\": \"symbol-enum-member\",\n \"unused-class-members\": \"symbol-field\",\n \"unresolved-imports\": \"error\",\n \"unlisted-dependencies\": \"package\",\n \"duplicate-exports\": \"files\",\n \"type-only-dependencies\": \"symbol-interface\",\n \"test-only-dependencies\": \"beaker\",\n \"circular-dependencies\": \"sync\",\n \"boundary-violation\": \"symbol-namespace\",\n \"stale-suppressions\": \"trash\",\n \"unused-catalog-entries\": \"package\",\n \"unresolved-catalog-references\": \"error\",\n};\n\n/** Icons for individual issue items. */\nconst ISSUE_ICONS: Record = {\n \"unused-files\": \"file\",\n \"unused-exports\": \"symbol-method\",\n \"unused-types\": \"symbol-interface\",\n \"private-type-leaks\": \"symbol-interface\",\n \"unused-dependencies\": \"package\",\n \"unused-dev-dependencies\": \"package\",\n \"unused-optional-dependencies\": \"package\",\n \"unused-enum-members\": \"symbol-enum-member\",\n \"unused-class-members\": \"symbol-field\",\n \"unresolved-imports\": \"error\",\n \"unlisted-dependencies\": \"package\",\n \"duplicate-exports\": \"copy\",\n \"type-only-dependencies\": \"package\",\n \"test-only-dependencies\": \"beaker\",\n \"circular-dependencies\": \"sync\",\n \"boundary-violation\": \"symbol-namespace\",\n \"stale-suppressions\": \"trash\",\n \"unused-catalog-entries\": \"package\",\n \"unresolved-catalog-references\": \"error\",\n};\n\nconst staleSuppressionLabel = (\n origin: NonNullable[number][\"origin\"]\n): string => {\n if (origin.type === \"jsdoc_tag\") {\n return `@expected-unused ${origin.export_name}`;\n }\n if (origin.issue_kind) {\n return origin.is_file_level\n ? `file ${origin.issue_kind}`\n : origin.issue_kind;\n }\n return origin.is_file_level ? \"file suppression\" : \"line suppression\";\n};\n\ntype DeadCodeItem = CategoryItem | IssueItem;\n\nclass CategoryItem extends vscode.TreeItem {\n readonly issues: ReadonlyArray;\n\n constructor(\n readonly category: IssueCategory,\n issues: ReadonlyArray\n ) {\n super(\n `${ISSUE_CATEGORY_LABELS[category]} (${issues.length})`,\n vscode.TreeItemCollapsibleState.Collapsed\n );\n this.issues = issues;\n this.contextValue = \"category\";\n this.iconPath = new vscode.ThemeIcon(CATEGORY_ICONS[category] ?? \"warning\");\n }\n}\n\nclass IssueItem extends vscode.TreeItem {\n constructor(\n label: string,\n readonly filePath: string,\n readonly line: number,\n readonly col: number,\n category: IssueCategory\n ) {\n super(label, vscode.TreeItemCollapsibleState.None);\n\n const { absolute, relative } = resolveFilePath(filePath);\n\n this.description = `${relative}:${line}`;\n this.tooltip = `${label}\\n${absolute}:${line}:${col}`;\n this.contextValue = \"issue\";\n\n this.command = {\n command: \"vscode.open\",\n title: \"Open File\",\n arguments: [\n vscode.Uri.file(absolute),\n {\n selection: new vscode.Range(\n Math.max(0, line - 1),\n col,\n Math.max(0, line - 1),\n col\n ),\n },\n ],\n };\n\n this.iconPath = new vscode.ThemeIcon(ISSUE_ICONS[category] ?? \"warning\");\n }\n}\n\nexport class DeadCodeTreeProvider\n implements vscode.TreeDataProvider\n{\n private result: FallowCheckResult | null = null;\n private view: vscode.TreeView | null = null;\n\n private readonly _onDidChangeTreeData = new vscode.EventEmitter<\n DeadCodeItem | undefined | null | void\n >();\n readonly onDidChangeTreeData = this._onDidChangeTreeData.event;\n\n setView(view: vscode.TreeView): void {\n this.view = view;\n }\n\n update(result: FallowCheckResult | null): void {\n this.result = result;\n this._onDidChangeTreeData.fire();\n this.updateBadge();\n }\n\n private updateBadge(): void {\n if (!this.view) {\n return;\n }\n if (!this.result) {\n this.view.badge = undefined;\n return;\n }\n const count = countCheckIssues(this.result);\n\n this.view.badge = count > 0\n ? { value: count, tooltip: `${count} issue${count === 1 ? \"\" : \"s\"}` }\n : undefined;\n }\n\n getTreeItem(element: DeadCodeItem): vscode.TreeItem {\n return element;\n }\n\n getChildren(element?: DeadCodeItem): DeadCodeItem[] {\n if (element instanceof CategoryItem) {\n return [...element.issues];\n }\n\n if (!this.result) {\n return [];\n }\n\n const categories: DeadCodeItem[] = [];\n\n const addCategory = (\n category: IssueCategory,\n items: ReadonlyArray\n ): void => {\n if (items.length > 0) {\n categories.push(new CategoryItem(category, items));\n }\n };\n\n addCategory(\n \"unused-files\",\n this.result.unused_files.map(\n (f) => new IssueItem(path.basename(f.path), f.path, 1, 0, \"unused-files\")\n )\n );\n\n addCategory(\n \"unused-exports\",\n this.result.unused_exports.map(\n (e) => new IssueItem(e.export_name, e.path, e.line, e.col, \"unused-exports\")\n )\n );\n\n addCategory(\n \"unused-types\",\n this.result.unused_types.map(\n (e) => new IssueItem(e.export_name, e.path, e.line, e.col, \"unused-types\")\n )\n );\n\n addCategory(\n \"private-type-leaks\",\n (this.result.private_type_leaks ?? []).map(\n (l) =>\n new IssueItem(\n `${l.export_name} -> ${l.type_name}`,\n l.path,\n l.line,\n l.col,\n \"private-type-leaks\"\n )\n )\n );\n\n addCategory(\n \"unused-dependencies\",\n this.result.unused_dependencies.map(\n (d) => new IssueItem(d.package_name, d.path, d.line, 0, \"unused-dependencies\")\n )\n );\n\n addCategory(\n \"unused-dev-dependencies\",\n this.result.unused_dev_dependencies.map(\n (d) => new IssueItem(d.package_name, d.path, d.line, 0, \"unused-dev-dependencies\")\n )\n );\n\n if (this.result.unused_optional_dependencies) {\n addCategory(\n \"unused-optional-dependencies\",\n this.result.unused_optional_dependencies.map(\n (d) => new IssueItem(d.package_name, d.path, d.line, 0, \"unused-optional-dependencies\")\n )\n );\n }\n\n addCategory(\n \"unused-enum-members\",\n this.result.unused_enum_members.map(\n (m) =>\n new IssueItem(`${m.parent_name}.${m.member_name}`, m.path, m.line, m.col, \"unused-enum-members\")\n )\n );\n\n addCategory(\n \"unused-class-members\",\n this.result.unused_class_members.map(\n (m) =>\n new IssueItem(`${m.parent_name}.${m.member_name}`, m.path, m.line, m.col, \"unused-class-members\")\n )\n );\n\n addCategory(\n \"unresolved-imports\",\n this.result.unresolved_imports.map(\n (i) => new IssueItem(i.specifier, i.path, i.line, i.col, \"unresolved-imports\")\n )\n );\n\n addCategory(\n \"unlisted-dependencies\",\n this.result.unlisted_dependencies.flatMap((d) =>\n d.imported_from.map(\n (site) => new IssueItem(d.package_name, site.path, site.line, site.col, \"unlisted-dependencies\")\n )\n )\n );\n\n addCategory(\n \"duplicate-exports\",\n this.result.duplicate_exports.flatMap((d) =>\n d.locations.map(\n (loc) => new IssueItem(d.export_name, loc.path, loc.line, loc.col, \"duplicate-exports\")\n )\n )\n );\n\n if (this.result.type_only_dependencies) {\n addCategory(\n \"type-only-dependencies\",\n this.result.type_only_dependencies.map(\n (d) => new IssueItem(d.package_name, d.path, d.line, 0, \"type-only-dependencies\")\n )\n );\n }\n\n if (this.result.test_only_dependencies) {\n addCategory(\n \"test-only-dependencies\",\n this.result.test_only_dependencies.map(\n (d) => new IssueItem(d.package_name, d.path, d.line, 0, \"test-only-dependencies\")\n )\n );\n }\n\n if (this.result.circular_dependencies) {\n addCategory(\n \"circular-dependencies\",\n this.result.circular_dependencies.map(\n (c) => new IssueItem(\n `${c.length} files`,\n c.files[0] ?? \"\",\n c.line,\n c.col,\n \"circular-dependencies\"\n )\n )\n );\n }\n\n if (this.result.boundary_violations) {\n addCategory(\n \"boundary-violation\",\n this.result.boundary_violations.map(\n (v) =>\n new IssueItem(\n `${v.from_zone} -> ${v.to_zone}`,\n v.from_path,\n v.line,\n v.col,\n \"boundary-violation\"\n )\n )\n );\n }\n\n if (this.result.stale_suppressions) {\n addCategory(\n \"stale-suppressions\",\n this.result.stale_suppressions.map(\n (s) =>\n new IssueItem(\n staleSuppressionLabel(s.origin),\n s.path,\n s.line,\n s.col,\n \"stale-suppressions\"\n )\n )\n );\n }\n\n if (this.result.unused_catalog_entries) {\n addCategory(\n \"unused-catalog-entries\",\n this.result.unused_catalog_entries.map(\n (entry) =>\n new IssueItem(\n entry.catalog_name === \"default\"\n ? entry.entry_name\n : `${entry.entry_name} (${entry.catalog_name})`,\n entry.path,\n entry.line,\n 0,\n \"unused-catalog-entries\"\n )\n )\n );\n }\n\n if (this.result.unresolved_catalog_references) {\n addCategory(\n \"unresolved-catalog-references\",\n this.result.unresolved_catalog_references.map(\n (finding) =>\n new IssueItem(\n finding.catalog_name === \"default\"\n ? finding.entry_name\n : `${finding.entry_name} (${finding.catalog_name})`,\n finding.path,\n finding.line,\n 0,\n \"unresolved-catalog-references\"\n )\n )\n );\n }\n\n return categories;\n }\n\n dispose(): void {\n this._onDidChangeTreeData.dispose();\n }\n}\n\ntype DuplicateItem = CloneFamilyItem | CloneInstanceItem;\n\nclass CloneFamilyItem extends vscode.TreeItem {\n readonly instances: ReadonlyArray;\n\n constructor(group: CloneGroup, index: number) {\n const instanceItems = group.instances.map(\n (inst) => new CloneInstanceItem(inst.file, inst.start_line, inst.end_line)\n );\n super(\n `Clone #${index + 1} (${group.line_count} lines, ${group.instances.length} instances)`,\n vscode.TreeItemCollapsibleState.Collapsed\n );\n this.instances = instanceItems;\n this.contextValue = \"cloneFamily\";\n this.iconPath = new vscode.ThemeIcon(\"files\");\n }\n}\n\nclass CloneInstanceItem extends vscode.TreeItem {\n constructor(\n readonly filePath: string,\n readonly startLine: number,\n readonly endLine: number\n ) {\n const basename = path.basename(filePath);\n super(\n `${basename}:${startLine}-${endLine}`,\n vscode.TreeItemCollapsibleState.None\n );\n\n const { absolute, relative } = resolveFilePath(filePath);\n\n this.description = relative;\n this.tooltip = `${absolute}:${startLine}-${endLine}`;\n this.contextValue = \"cloneInstance\";\n\n this.command = {\n command: \"vscode.open\",\n title: \"Open File\",\n arguments: [\n vscode.Uri.file(absolute),\n {\n selection: new vscode.Range(\n Math.max(0, startLine - 1),\n 0,\n Math.max(0, endLine - 1),\n 0\n ),\n },\n ],\n };\n\n this.iconPath = new vscode.ThemeIcon(\"copy\");\n }\n}\n\nexport class DuplicatesTreeProvider\n implements vscode.TreeDataProvider\n{\n private result: FallowDupesResult | null = null;\n\n private readonly _onDidChangeTreeData = new vscode.EventEmitter<\n DuplicateItem | undefined | null | void\n >();\n readonly onDidChangeTreeData = this._onDidChangeTreeData.event;\n\n update(result: FallowDupesResult | null): void {\n this.result = result;\n this._onDidChangeTreeData.fire();\n }\n\n getTreeItem(element: DuplicateItem): vscode.TreeItem {\n return element;\n }\n\n getChildren(element?: DuplicateItem): DuplicateItem[] {\n if (element instanceof CloneFamilyItem) {\n return [...element.instances];\n }\n\n if (!this.result) {\n return [];\n }\n\n return this.result.clone_groups.map(\n (group, i) => new CloneFamilyItem(group, i)\n );\n }\n\n dispose(): void {\n this._onDidChangeTreeData.dispose();\n }\n}\n","// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport { countCheckIssues } from \"./analysis-utils.js\";\nimport { startClient, stopClient, restartClient } from \"./client.js\";\nimport { onConfigChange } from \"./config.js\";\nimport { runAnalysis, runFix } from \"./commands.js\";\nimport { DiagnosticFilter } from \"./diagnosticFilter.js\";\nimport { registerDiagnosticMuteUi } from \"./diagnosticMute.js\";\nimport {\n createStatusBar,\n updateStatusBar,\n updateStatusBarFromLsp,\n setStatusBarAnalyzing,\n setStatusBarError,\n disposeStatusBar,\n} from \"./statusBar.js\";\nimport type { AnalysisCompleteParams } from \"./statusBar.js\";\nimport { DeadCodeTreeProvider, DuplicatesTreeProvider } from \"./treeView.js\";\nimport type { FallowCheckResult, FallowDupesResult } from \"./types.js\";\n\nlet outputChannel: vscode.OutputChannel;\nlet lastCheckResult: FallowCheckResult | null = null;\nlet lastDupesResult: FallowDupesResult | null = null;\n\nexport interface ExtensionApi {\n readonly runAnalysis: typeof runAnalysis;\n readonly runFix: typeof runFix;\n}\n\nexport const activate = async (\n context: vscode.ExtensionContext\n): Promise => {\n outputChannel = vscode.window.createOutputChannel(\"Fallow\");\n context.subscriptions.push(outputChannel);\n\n const statusBar = createStatusBar();\n context.subscriptions.push(statusBar);\n\n const diagnosticFilter = new DiagnosticFilter(context.workspaceState);\n context.subscriptions.push({ dispose: () => diagnosticFilter.dispose() });\n registerDiagnosticMuteUi(context, diagnosticFilter);\n\n const deadCodeProvider = new DeadCodeTreeProvider();\n const duplicatesProvider = new DuplicatesTreeProvider();\n\n // Use createTreeView to get visibility events — defer CLI analysis until the\n // tree view is first shown, avoiding a double analysis on activation (the LSP\n // runs its own analysis for diagnostics).\n let cliAnalysisRan = false;\n\n const triggerCliAnalysis = async (): Promise => {\n setStatusBarAnalyzing();\n await vscode.window.withProgress(\n {\n location: vscode.ProgressLocation.Notification,\n title: \"Fallow: Analyzing...\",\n cancellable: false,\n },\n async () => {\n try {\n const { check, dupes } = await runAnalysis(context);\n lastCheckResult = check;\n lastDupesResult = dupes;\n updateViews();\n void vscode.commands.executeCommand(\n \"setContext\",\n \"fallow.hasAnalyzed\",\n true\n );\n\n const issueCount = countCheckIssues(check);\n\n if (issueCount > 0) {\n void vscode.window.showInformationMessage(\n `Fallow: found ${issueCount} issue${issueCount === 1 ? \"\" : \"s\"}. Open the Fallow sidebar to explore.`,\n \"Open Sidebar\"\n ).then((choice) => {\n if (choice === \"Open Sidebar\") {\n void vscode.commands.executeCommand(\"fallow.deadCode.focus\");\n }\n });\n } else {\n void vscode.window.showInformationMessage(\n \"Fallow: no issues found.\"\n );\n }\n } catch {\n setStatusBarError();\n }\n }\n );\n };\n\n const deadCodeView = vscode.window.createTreeView(\"fallow.deadCode\", {\n treeDataProvider: deadCodeProvider,\n });\n deadCodeProvider.setView(deadCodeView);\n const duplicatesView = vscode.window.createTreeView(\"fallow.duplicates\", {\n treeDataProvider: duplicatesProvider,\n });\n context.subscriptions.push(deadCodeView, duplicatesView);\n\n const onViewVisible = (): void => {\n if (cliAnalysisRan) {\n return;\n }\n cliAnalysisRan = true;\n void triggerCliAnalysis();\n };\n\n context.subscriptions.push(\n deadCodeView.onDidChangeVisibility((e) => {\n if (e.visible) {\n onViewVisible();\n }\n })\n );\n context.subscriptions.push(\n duplicatesView.onDidChangeVisibility((e) => {\n if (e.visible) {\n onViewVisible();\n }\n })\n );\n\n const updateViews = (): void => {\n deadCodeProvider.update(lastCheckResult);\n duplicatesProvider.update(lastDupesResult);\n updateStatusBar(lastCheckResult, lastDupesResult);\n };\n\n // Register commands\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.analyze\", async () => {\n cliAnalysisRan = true;\n await triggerCliAnalysis();\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.fix\", async () => {\n // Save dirty editors first so the fix works on up-to-date content\n await vscode.workspace.saveAll(false);\n await runFix(context, false);\n // Restart LSP to force fresh analysis — the fix modified files on disk\n // bypassing VS Code's editor, so did_save never fires for those files\n await restartClient(context, outputChannel, diagnosticFilter);\n // Re-run CLI analysis for tree views\n cliAnalysisRan = true;\n await triggerCliAnalysis();\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.fixDryRun\", async () => {\n await runFix(context, true);\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.restart\", async () => {\n outputChannel.appendLine(\"Restarting language server...\");\n await restartClient(context, outputChannel, diagnosticFilter);\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.showOutput\", () => {\n outputChannel.show();\n })\n );\n\n // Open the Fallow sidebar (used by walkthrough completion event)\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.openSidebar\", () => {\n void vscode.commands.executeCommand(\"fallow.deadCode.focus\");\n })\n );\n\n // Open Fallow settings (used by walkthrough completion event)\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.openSettings\", () => {\n void vscode.commands.executeCommand(\n \"workbench.action.openSettings\",\n \"fallow\"\n );\n })\n );\n\n // Fallback command for Code Lens items with 0 references (display-only)\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.noop\", () => {})\n );\n\n // Watch for config changes\n context.subscriptions.push(\n onConfigChange(async (e) => {\n const needsRestart =\n e.affectsConfiguration(\"fallow.lspPath\") ||\n e.affectsConfiguration(\"fallow.configPath\") ||\n e.affectsConfiguration(\"fallow.trace.server\") ||\n e.affectsConfiguration(\"fallow.issueTypes\") ||\n e.affectsConfiguration(\"fallow.changedSince\");\n\n const needsReanalysis =\n e.affectsConfiguration(\"fallow.configPath\") ||\n e.affectsConfiguration(\"fallow.production\") ||\n e.affectsConfiguration(\"fallow.duplication\") ||\n e.affectsConfiguration(\"fallow.issueTypes\") ||\n e.affectsConfiguration(\"fallow.changedSince\");\n\n if (needsRestart) {\n outputChannel.appendLine(\"Configuration changed, restarting server...\");\n await restartClient(context, outputChannel, diagnosticFilter);\n }\n\n if (needsReanalysis) {\n // Re-run CLI analysis for tree views and status bar\n // (sequenced after LSP restart if both apply)\n void triggerCliAnalysis();\n }\n })\n );\n\n // Start LSP client\n const client = await startClient(context, outputChannel, diagnosticFilter);\n if (client) {\n context.subscriptions.push({ dispose: () => void stopClient() });\n\n // Handle custom LSP notification: update status bar from LSP data\n // so the extension shows results immediately without waiting for CLI\n const notificationDisposable = client.onNotification(\n \"fallow/analysisComplete\",\n (params: AnalysisCompleteParams) => {\n updateStatusBarFromLsp(params);\n void vscode.commands.executeCommand(\n \"setContext\",\n \"fallow.hasAnalyzed\",\n true\n );\n }\n );\n context.subscriptions.push(notificationDisposable);\n }\n\n // Show walkthrough on first install\n const walkthroughShown = context.globalState.get(\n \"fallow.walkthroughShown\"\n );\n if (!walkthroughShown) {\n void context.globalState.update(\"fallow.walkthroughShown\", true);\n void vscode.commands.executeCommand(\n \"workbench.action.openWalkthrough\",\n \"fallow-rs.fallow-vscode#fallow.gettingStarted\",\n false\n );\n }\n\n return {\n runAnalysis,\n runFix,\n };\n};\n\nexport const deactivate = async (): Promise => {\n disposeStatusBar();\n await stopClient();\n};\n"],"x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125],"mappings":"40BAEA,MAAa,EAAoB,GAC1B,EAKH,EAAO,aAAa,OACpB,EAAO,eAAe,OACtB,EAAO,aAAa,QACnB,EAAO,oBAAoB,QAAU,GACtC,EAAO,oBAAoB,OAC3B,EAAO,wBAAwB,QAC9B,EAAO,8BAA8B,QAAU,GAChD,EAAO,oBAAoB,OAC3B,EAAO,qBAAqB,OAC5B,EAAO,mBAAmB,OAC1B,EAAO,sBAAsB,OAC7B,EAAO,kBAAkB,QACxB,EAAO,wBAAwB,QAAU,IACzC,EAAO,wBAAwB,QAAU,IACzC,EAAO,uBAAuB,QAAU,IACxC,EAAO,qBAAqB,QAAU,IACtC,EAAO,oBAAoB,QAAU,IACrC,EAAO,wBAAwB,QAAU,IACzC,EAAO,+BAA+B,QAAU,GAtB1C,eCCX,OAAO,eAAe,EAAS,aAAc,CAAE,MAAO,GAAM,CAAC,CAC7D,EAAQ,UAAY,EAAQ,SAAW,EAAQ,WAAa,EAAQ,YAAc,EAAQ,MAAQ,EAAQ,KAAO,EAAQ,MAAQ,EAAQ,OAAS,EAAQ,OAAS,EAAQ,QAAU,IAAK,GAC1L,SAAS,EAAQ,EAAO,CACpB,OAAO,IAAU,IAAQ,IAAU,GAEvC,EAAQ,QAAU,EAClB,SAAS,EAAO,EAAO,CACnB,OAAO,OAAO,GAAU,UAAY,aAAiB,OAEzD,EAAQ,OAAS,EACjB,SAAS,EAAO,EAAO,CACnB,OAA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,SAAS,gBAAgB,yBAA4B,CACrD,EAAO,SAAS,eAAe,wBAAwB,EAC5D,CACH,CAGD,EAAQ,cAAc,KACpB,EAAO,SAAS,gBAAgB,0BAA6B,CACtD,EAAO,SAAS,eACnB,gCACA,SACD,EACD,CACH,CAGD,EAAQ,cAAc,KACpB,EAAO,SAAS,gBAAgB,kBAAqB,GAAG,CACzD,CAGD,EAAQ,cAAc,KACpB,GAAe,KAAO,IAAM,CAC1B,IAAM,EACJ,EAAE,qBAAqB,iBAAiB,EACxC,EAAE,qBAAqB,oBAAoB,EAC3C,EAAE,qBAAqB,sBAAsB,EAC7C,EAAE,qBAAqB,oBAAoB,EAC3C,EAAE,qBAAqB,sBAAsB,CAEzC,EACJ,EAAE,qBAAqB,oBAAoB,EAC3C,EAAE,qBAAqB,oBAAoB,EAC3C,EAAE,qBAAqB,qBAAqB,EAC5C,EAAE,qBAAqB,oBAAoB,EAC3C,EAAE,qBAAqB,sBAAsB,CAE3C,IACF,GAAc,WAAW,8CAA8C,CACvE,MAAM,GAAc,EAAS,GAAe,EAAiB,EAG3D,GAGG,GAAoB,EAE3B,CACH,CAGD,IAAM,EAAS,MAAM,GAAY,EAAS,GAAe,EAAiB,CAC1E,GAAI,EAAQ,CACV,EAAQ,cAAc,KAAK,CAAE,YAAe,KAAK,IAAY,CAAE,CAAC,CAIhE,IAAM,EAAyB,EAAO,eACpC,0BACC,GAAmC,CAClC,GAAuB,EAAO,CACzB,EAAO,SAAS,eACnB,aACA,qBACA,GACD,EAEJ,CACD,EAAQ,cAAc,KAAK,EAAuB,CAgBpD,OAZyB,EAAQ,YAAY,IAC3C,0BAEmB,GACd,EAAQ,YAAY,OAAO,0BAA2B,GAAK,CAC3D,EAAO,SAAS,eACnB,mCACA,gDACA,GACD,EAGI,CACL,eACA,UACD,EAGU,GAAa,SAA2B,CACnD,IAAkB,CAClB,MAAM,IAAY"} \ No newline at end of file +{"version":3,"file":"extension.js","names":["exports","path","exports","exports","exports","code","code","code","vscode","vscode","code","code","code","code","code","code","vscode_1","vscode_1","vscode_1","vscode","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","vscode","code","vscode_1","vscode_1","vscode_1","vscode_1","vscode_1","candidate","cp","exports","exports","path","os","path","fs","os","https","fs","path","fs","TransportKind","LanguageClient","Trace","path","path","fs","child_process","resolveFilePath","path","resolveFilePathPure","path"],"sources":["../src/analysis-utils.ts","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/utils/is.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/is.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/ral.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/node/ril.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/node/main.js","../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/node.js","../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/umd/main.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/node/main.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/utils/async.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolCompletionItem.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolCodeLens.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolDocumentLink.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolCodeAction.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolDiagnostic.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolCallHierarchyItem.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolTypeHierarchyItem.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolWorkspaceSymbol.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolInlayHint.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/codeConverter.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/protocolConverter.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/utils/uuid.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/progressPart.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/features.js","../node_modules/.pnpm/minimatch@5.1.9/node_modules/minimatch/lib/path.js","../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js","../node_modules/.pnpm/brace-expansion@2.1.0/node_modules/brace-expansion/index.js","../node_modules/.pnpm/minimatch@5.1.9/node_modules/minimatch/minimatch.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/diagnostic.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/notebook.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/configuration.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/textSynchronization.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/completion.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/hover.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/definition.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/signatureHelp.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/documentHighlight.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/documentSymbol.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/workspaceSymbol.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/reference.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/codeAction.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/codeLens.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/formatting.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/rename.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/documentLink.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/executeCommand.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/fileSystemWatcher.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/colorProvider.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/implementation.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/typeDefinition.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/workspaceFolder.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/foldingRange.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/declaration.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/selectionRange.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/progress.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/callHierarchy.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/semanticTokens.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/fileOperations.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/linkedEditingRange.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/typeHierarchy.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/inlineValue.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/inlayHint.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/inlineCompletion.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/client.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/node/processes.js","../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/node.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js","../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/common/api.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/lib/node/main.js","../node_modules/.pnpm/vscode-languageclient@9.0.1/node_modules/vscode-languageclient/node.js","../src/config.ts","../src/binary-utils.ts","../src/diagnosticFilter.ts","../src/download.ts","../src/client.ts","../src/fix-utils.ts","../src/commands.ts","../src/diagnosticMute.ts","../src/statusBar-utils.ts","../src/statusBar.ts","../src/treeView-utils.ts","../src/labels.ts","../src/treeView.ts","../src/extension.ts"],"sourcesContent":["import type { FallowCheckResult } from \"./types.js\";\n\nexport const countCheckIssues = (result: FallowCheckResult | null): number => {\n if (!result) {\n return 0;\n }\n\n return (\n result.unused_files.length +\n result.unused_exports.length +\n result.unused_types.length +\n (result.private_type_leaks?.length ?? 0) +\n result.unused_dependencies.length +\n result.unused_dev_dependencies.length +\n (result.unused_optional_dependencies?.length ?? 0) +\n result.unused_enum_members.length +\n result.unused_class_members.length +\n result.unresolved_imports.length +\n result.unlisted_dependencies.length +\n result.duplicate_exports.length +\n (result.type_only_dependencies?.length ?? 0) +\n (result.test_only_dependencies?.length ?? 0) +\n (result.circular_dependencies?.length ?? 0) +\n (result.boundary_violations?.length ?? 0) +\n (result.stale_suppressions?.length ?? 0) +\n (result.unused_catalog_entries?.length ?? 0) +\n (result.unresolved_catalog_references?.length ?? 0) +\n (result.unused_dependency_overrides?.length ?? 0) +\n (result.misconfigured_dependency_overrides?.length ?? 0)\n );\n};\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.asPromise = exports.thenable = exports.typedArray = exports.stringArray = exports.array = exports.func = exports.error = exports.number = exports.string = exports.boolean = void 0;\nfunction boolean(value) {\n return value === true || value === false;\n}\nexports.boolean = boolean;\nfunction string(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexports.string = string;\nfunction number(value) {\n return typeof value === 'number' || value instanceof Number;\n}\nexports.number = number;\nfunction error(value) {\n return value instanceof Error;\n}\nexports.error = error;\nfunction func(value) {\n return typeof value === 'function';\n}\nexports.func = func;\nfunction array(value) {\n return Array.isArray(value);\n}\nexports.array = array;\nfunction stringArray(value) {\n return array(value) && value.every(elem => string(elem));\n}\nexports.stringArray = stringArray;\nfunction typedArray(value, check) {\n return Array.isArray(value) && value.every(check);\n}\nexports.typedArray = typedArray;\nfunction thenable(value) {\n return value && func(value.then);\n}\nexports.thenable = thenable;\nfunction asPromise(value) {\n if (value instanceof Promise) {\n return value;\n }\n else if (thenable(value)) {\n return new Promise((resolve, reject) => {\n value.then((resolved) => resolve(resolved), (error) => reject(error));\n });\n }\n else {\n return Promise.resolve(value);\n }\n}\nexports.asPromise = asPromise;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.stringArray = exports.array = exports.func = exports.error = exports.number = exports.string = exports.boolean = void 0;\nfunction boolean(value) {\n return value === true || value === false;\n}\nexports.boolean = boolean;\nfunction string(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexports.string = string;\nfunction number(value) {\n return typeof value === 'number' || value instanceof Number;\n}\nexports.number = number;\nfunction error(value) {\n return value instanceof Error;\n}\nexports.error = error;\nfunction func(value) {\n return typeof value === 'function';\n}\nexports.func = func;\nfunction array(value) {\n return Array.isArray(value);\n}\nexports.array = array;\nfunction stringArray(value) {\n return array(value) && value.every(elem => string(elem));\n}\nexports.stringArray = stringArray;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Message = exports.NotificationType9 = exports.NotificationType8 = exports.NotificationType7 = exports.NotificationType6 = exports.NotificationType5 = exports.NotificationType4 = exports.NotificationType3 = exports.NotificationType2 = exports.NotificationType1 = exports.NotificationType0 = exports.NotificationType = exports.RequestType9 = exports.RequestType8 = exports.RequestType7 = exports.RequestType6 = exports.RequestType5 = exports.RequestType4 = exports.RequestType3 = exports.RequestType2 = exports.RequestType1 = exports.RequestType = exports.RequestType0 = exports.AbstractMessageSignature = exports.ParameterStructures = exports.ResponseError = exports.ErrorCodes = void 0;\nconst is = require(\"./is\");\n/**\n * Predefined error codes.\n */\nvar ErrorCodes;\n(function (ErrorCodes) {\n // Defined by JSON RPC\n ErrorCodes.ParseError = -32700;\n ErrorCodes.InvalidRequest = -32600;\n ErrorCodes.MethodNotFound = -32601;\n ErrorCodes.InvalidParams = -32602;\n ErrorCodes.InternalError = -32603;\n /**\n * This is the start range of JSON RPC reserved error codes.\n * It doesn't denote a real error code. No application error codes should\n * be defined between the start and end range. For backwards\n * compatibility the `ServerNotInitialized` and the `UnknownErrorCode`\n * are left in the range.\n *\n * @since 3.16.0\n */\n ErrorCodes.jsonrpcReservedErrorRangeStart = -32099;\n /** @deprecated use jsonrpcReservedErrorRangeStart */\n ErrorCodes.serverErrorStart = -32099;\n /**\n * An error occurred when write a message to the transport layer.\n */\n ErrorCodes.MessageWriteError = -32099;\n /**\n * An error occurred when reading a message from the transport layer.\n */\n ErrorCodes.MessageReadError = -32098;\n /**\n * The connection got disposed or lost and all pending responses got\n * rejected.\n */\n ErrorCodes.PendingResponseRejected = -32097;\n /**\n * The connection is inactive and a use of it failed.\n */\n ErrorCodes.ConnectionInactive = -32096;\n /**\n * Error code indicating that a server received a notification or\n * request before the server has received the `initialize` request.\n */\n ErrorCodes.ServerNotInitialized = -32002;\n ErrorCodes.UnknownErrorCode = -32001;\n /**\n * This is the end range of JSON RPC reserved error codes.\n * It doesn't denote a real error code.\n *\n * @since 3.16.0\n */\n ErrorCodes.jsonrpcReservedErrorRangeEnd = -32000;\n /** @deprecated use jsonrpcReservedErrorRangeEnd */\n ErrorCodes.serverErrorEnd = -32000;\n})(ErrorCodes || (exports.ErrorCodes = ErrorCodes = {}));\n/**\n * An error object return in a response in case a request\n * has failed.\n */\nclass ResponseError extends Error {\n constructor(code, message, data) {\n super(message);\n this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode;\n this.data = data;\n Object.setPrototypeOf(this, ResponseError.prototype);\n }\n toJson() {\n const result = {\n code: this.code,\n message: this.message\n };\n if (this.data !== undefined) {\n result.data = this.data;\n }\n return result;\n }\n}\nexports.ResponseError = ResponseError;\nclass ParameterStructures {\n constructor(kind) {\n this.kind = kind;\n }\n static is(value) {\n return value === ParameterStructures.auto || value === ParameterStructures.byName || value === ParameterStructures.byPosition;\n }\n toString() {\n return this.kind;\n }\n}\nexports.ParameterStructures = ParameterStructures;\n/**\n * The parameter structure is automatically inferred on the number of parameters\n * and the parameter type in case of a single param.\n */\nParameterStructures.auto = new ParameterStructures('auto');\n/**\n * Forces `byPosition` parameter structure. This is useful if you have a single\n * parameter which has a literal type.\n */\nParameterStructures.byPosition = new ParameterStructures('byPosition');\n/**\n * Forces `byName` parameter structure. This is only useful when having a single\n * parameter. The library will report errors if used with a different number of\n * parameters.\n */\nParameterStructures.byName = new ParameterStructures('byName');\n/**\n * An abstract implementation of a MessageType.\n */\nclass AbstractMessageSignature {\n constructor(method, numberOfParams) {\n this.method = method;\n this.numberOfParams = numberOfParams;\n }\n get parameterStructures() {\n return ParameterStructures.auto;\n }\n}\nexports.AbstractMessageSignature = AbstractMessageSignature;\n/**\n * Classes to type request response pairs\n */\nclass RequestType0 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 0);\n }\n}\nexports.RequestType0 = RequestType0;\nclass RequestType extends AbstractMessageSignature {\n constructor(method, _parameterStructures = ParameterStructures.auto) {\n super(method, 1);\n this._parameterStructures = _parameterStructures;\n }\n get parameterStructures() {\n return this._parameterStructures;\n }\n}\nexports.RequestType = RequestType;\nclass RequestType1 extends AbstractMessageSignature {\n constructor(method, _parameterStructures = ParameterStructures.auto) {\n super(method, 1);\n this._parameterStructures = _parameterStructures;\n }\n get parameterStructures() {\n return this._parameterStructures;\n }\n}\nexports.RequestType1 = RequestType1;\nclass RequestType2 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 2);\n }\n}\nexports.RequestType2 = RequestType2;\nclass RequestType3 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 3);\n }\n}\nexports.RequestType3 = RequestType3;\nclass RequestType4 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 4);\n }\n}\nexports.RequestType4 = RequestType4;\nclass RequestType5 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 5);\n }\n}\nexports.RequestType5 = RequestType5;\nclass RequestType6 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 6);\n }\n}\nexports.RequestType6 = RequestType6;\nclass RequestType7 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 7);\n }\n}\nexports.RequestType7 = RequestType7;\nclass RequestType8 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 8);\n }\n}\nexports.RequestType8 = RequestType8;\nclass RequestType9 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 9);\n }\n}\nexports.RequestType9 = RequestType9;\nclass NotificationType extends AbstractMessageSignature {\n constructor(method, _parameterStructures = ParameterStructures.auto) {\n super(method, 1);\n this._parameterStructures = _parameterStructures;\n }\n get parameterStructures() {\n return this._parameterStructures;\n }\n}\nexports.NotificationType = NotificationType;\nclass NotificationType0 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 0);\n }\n}\nexports.NotificationType0 = NotificationType0;\nclass NotificationType1 extends AbstractMessageSignature {\n constructor(method, _parameterStructures = ParameterStructures.auto) {\n super(method, 1);\n this._parameterStructures = _parameterStructures;\n }\n get parameterStructures() {\n return this._parameterStructures;\n }\n}\nexports.NotificationType1 = NotificationType1;\nclass NotificationType2 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 2);\n }\n}\nexports.NotificationType2 = NotificationType2;\nclass NotificationType3 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 3);\n }\n}\nexports.NotificationType3 = NotificationType3;\nclass NotificationType4 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 4);\n }\n}\nexports.NotificationType4 = NotificationType4;\nclass NotificationType5 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 5);\n }\n}\nexports.NotificationType5 = NotificationType5;\nclass NotificationType6 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 6);\n }\n}\nexports.NotificationType6 = NotificationType6;\nclass NotificationType7 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 7);\n }\n}\nexports.NotificationType7 = NotificationType7;\nclass NotificationType8 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 8);\n }\n}\nexports.NotificationType8 = NotificationType8;\nclass NotificationType9 extends AbstractMessageSignature {\n constructor(method) {\n super(method, 9);\n }\n}\nexports.NotificationType9 = NotificationType9;\nvar Message;\n(function (Message) {\n /**\n * Tests if the given message is a request message\n */\n function isRequest(message) {\n const candidate = message;\n return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id));\n }\n Message.isRequest = isRequest;\n /**\n * Tests if the given message is a notification message\n */\n function isNotification(message) {\n const candidate = message;\n return candidate && is.string(candidate.method) && message.id === void 0;\n }\n Message.isNotification = isNotification;\n /**\n * Tests if the given message is a response message\n */\n function isResponse(message) {\n const candidate = message;\n return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);\n }\n Message.isResponse = isResponse;\n})(Message || (exports.Message = Message = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LRUCache = exports.LinkedMap = exports.Touch = void 0;\nvar Touch;\n(function (Touch) {\n Touch.None = 0;\n Touch.First = 1;\n Touch.AsOld = Touch.First;\n Touch.Last = 2;\n Touch.AsNew = Touch.Last;\n})(Touch || (exports.Touch = Touch = {}));\nclass LinkedMap {\n constructor() {\n this[_a] = 'LinkedMap';\n this._map = new Map();\n this._head = undefined;\n this._tail = undefined;\n this._size = 0;\n this._state = 0;\n }\n clear() {\n this._map.clear();\n this._head = undefined;\n this._tail = undefined;\n this._size = 0;\n this._state++;\n }\n isEmpty() {\n return !this._head && !this._tail;\n }\n get size() {\n return this._size;\n }\n get first() {\n return this._head?.value;\n }\n get last() {\n return this._tail?.value;\n }\n has(key) {\n return this._map.has(key);\n }\n get(key, touch = Touch.None) {\n const item = this._map.get(key);\n if (!item) {\n return undefined;\n }\n if (touch !== Touch.None) {\n this.touch(item, touch);\n }\n return item.value;\n }\n set(key, value, touch = Touch.None) {\n let item = this._map.get(key);\n if (item) {\n item.value = value;\n if (touch !== Touch.None) {\n this.touch(item, touch);\n }\n }\n else {\n item = { key, value, next: undefined, previous: undefined };\n switch (touch) {\n case Touch.None:\n this.addItemLast(item);\n break;\n case Touch.First:\n this.addItemFirst(item);\n break;\n case Touch.Last:\n this.addItemLast(item);\n break;\n default:\n this.addItemLast(item);\n break;\n }\n this._map.set(key, item);\n this._size++;\n }\n return this;\n }\n delete(key) {\n return !!this.remove(key);\n }\n remove(key) {\n const item = this._map.get(key);\n if (!item) {\n return undefined;\n }\n this._map.delete(key);\n this.removeItem(item);\n this._size--;\n return item.value;\n }\n shift() {\n if (!this._head && !this._tail) {\n return undefined;\n }\n if (!this._head || !this._tail) {\n throw new Error('Invalid list');\n }\n const item = this._head;\n this._map.delete(item.key);\n this.removeItem(item);\n this._size--;\n return item.value;\n }\n forEach(callbackfn, thisArg) {\n const state = this._state;\n let current = this._head;\n while (current) {\n if (thisArg) {\n callbackfn.bind(thisArg)(current.value, current.key, this);\n }\n else {\n callbackfn(current.value, current.key, this);\n }\n if (this._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n current = current.next;\n }\n }\n keys() {\n const state = this._state;\n let current = this._head;\n const iterator = {\n [Symbol.iterator]: () => {\n return iterator;\n },\n next: () => {\n if (this._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: current.key, done: false };\n current = current.next;\n return result;\n }\n else {\n return { value: undefined, done: true };\n }\n }\n };\n return iterator;\n }\n values() {\n const state = this._state;\n let current = this._head;\n const iterator = {\n [Symbol.iterator]: () => {\n return iterator;\n },\n next: () => {\n if (this._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: current.value, done: false };\n current = current.next;\n return result;\n }\n else {\n return { value: undefined, done: true };\n }\n }\n };\n return iterator;\n }\n entries() {\n const state = this._state;\n let current = this._head;\n const iterator = {\n [Symbol.iterator]: () => {\n return iterator;\n },\n next: () => {\n if (this._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: [current.key, current.value], done: false };\n current = current.next;\n return result;\n }\n else {\n return { value: undefined, done: true };\n }\n }\n };\n return iterator;\n }\n [(_a = Symbol.toStringTag, Symbol.iterator)]() {\n return this.entries();\n }\n trimOld(newSize) {\n if (newSize >= this.size) {\n return;\n }\n if (newSize === 0) {\n this.clear();\n return;\n }\n let current = this._head;\n let currentSize = this.size;\n while (current && currentSize > newSize) {\n this._map.delete(current.key);\n current = current.next;\n currentSize--;\n }\n this._head = current;\n this._size = currentSize;\n if (current) {\n current.previous = undefined;\n }\n this._state++;\n }\n addItemFirst(item) {\n // First time Insert\n if (!this._head && !this._tail) {\n this._tail = item;\n }\n else if (!this._head) {\n throw new Error('Invalid list');\n }\n else {\n item.next = this._head;\n this._head.previous = item;\n }\n this._head = item;\n this._state++;\n }\n addItemLast(item) {\n // First time Insert\n if (!this._head && !this._tail) {\n this._head = item;\n }\n else if (!this._tail) {\n throw new Error('Invalid list');\n }\n else {\n item.previous = this._tail;\n this._tail.next = item;\n }\n this._tail = item;\n this._state++;\n }\n removeItem(item) {\n if (item === this._head && item === this._tail) {\n this._head = undefined;\n this._tail = undefined;\n }\n else if (item === this._head) {\n // This can only happened if size === 1 which is handle\n // by the case above.\n if (!item.next) {\n throw new Error('Invalid list');\n }\n item.next.previous = undefined;\n this._head = item.next;\n }\n else if (item === this._tail) {\n // This can only happened if size === 1 which is handle\n // by the case above.\n if (!item.previous) {\n throw new Error('Invalid list');\n }\n item.previous.next = undefined;\n this._tail = item.previous;\n }\n else {\n const next = item.next;\n const previous = item.previous;\n if (!next || !previous) {\n throw new Error('Invalid list');\n }\n next.previous = previous;\n previous.next = next;\n }\n item.next = undefined;\n item.previous = undefined;\n this._state++;\n }\n touch(item, touch) {\n if (!this._head || !this._tail) {\n throw new Error('Invalid list');\n }\n if ((touch !== Touch.First && touch !== Touch.Last)) {\n return;\n }\n if (touch === Touch.First) {\n if (item === this._head) {\n return;\n }\n const next = item.next;\n const previous = item.previous;\n // Unlink the item\n if (item === this._tail) {\n // previous must be defined since item was not head but is tail\n // So there are more than on item in the map\n previous.next = undefined;\n this._tail = previous;\n }\n else {\n // Both next and previous are not undefined since item was neither head nor tail.\n next.previous = previous;\n previous.next = next;\n }\n // Insert the node at head\n item.previous = undefined;\n item.next = this._head;\n this._head.previous = item;\n this._head = item;\n this._state++;\n }\n else if (touch === Touch.Last) {\n if (item === this._tail) {\n return;\n }\n const next = item.next;\n const previous = item.previous;\n // Unlink the item.\n if (item === this._head) {\n // next must be defined since item was not tail but is head\n // So there are more than on item in the map\n next.previous = undefined;\n this._head = next;\n }\n else {\n // Both next and previous are not undefined since item was neither head nor tail.\n next.previous = previous;\n previous.next = next;\n }\n item.next = undefined;\n item.previous = this._tail;\n this._tail.next = item;\n this._tail = item;\n this._state++;\n }\n }\n toJSON() {\n const data = [];\n this.forEach((value, key) => {\n data.push([key, value]);\n });\n return data;\n }\n fromJSON(data) {\n this.clear();\n for (const [key, value] of data) {\n this.set(key, value);\n }\n }\n}\nexports.LinkedMap = LinkedMap;\nclass LRUCache extends LinkedMap {\n constructor(limit, ratio = 1) {\n super();\n this._limit = limit;\n this._ratio = Math.min(Math.max(0, ratio), 1);\n }\n get limit() {\n return this._limit;\n }\n set limit(limit) {\n this._limit = limit;\n this.checkTrim();\n }\n get ratio() {\n return this._ratio;\n }\n set ratio(ratio) {\n this._ratio = Math.min(Math.max(0, ratio), 1);\n this.checkTrim();\n }\n get(key, touch = Touch.AsNew) {\n return super.get(key, touch);\n }\n peek(key) {\n return super.get(key, Touch.None);\n }\n set(key, value) {\n super.set(key, value, Touch.Last);\n this.checkTrim();\n return this;\n }\n checkTrim() {\n if (this.size > this._limit) {\n this.trimOld(Math.round(this._limit * this._ratio));\n }\n }\n}\nexports.LRUCache = LRUCache;\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Disposable = void 0;\nvar Disposable;\n(function (Disposable) {\n function create(func) {\n return {\n dispose: func\n };\n }\n Disposable.create = create;\n})(Disposable || (exports.Disposable = Disposable = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nlet _ral;\nfunction RAL() {\n if (_ral === undefined) {\n throw new Error(`No runtime abstraction layer installed`);\n }\n return _ral;\n}\n(function (RAL) {\n function install(ral) {\n if (ral === undefined) {\n throw new Error(`No runtime abstraction layer provided`);\n }\n _ral = ral;\n }\n RAL.install = install;\n})(RAL || (RAL = {}));\nexports.default = RAL;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emitter = exports.Event = void 0;\nconst ral_1 = require(\"./ral\");\nvar Event;\n(function (Event) {\n const _disposable = { dispose() { } };\n Event.None = function () { return _disposable; };\n})(Event || (exports.Event = Event = {}));\nclass CallbackList {\n add(callback, context = null, bucket) {\n if (!this._callbacks) {\n this._callbacks = [];\n this._contexts = [];\n }\n this._callbacks.push(callback);\n this._contexts.push(context);\n if (Array.isArray(bucket)) {\n bucket.push({ dispose: () => this.remove(callback, context) });\n }\n }\n remove(callback, context = null) {\n if (!this._callbacks) {\n return;\n }\n let foundCallbackWithDifferentContext = false;\n for (let i = 0, len = this._callbacks.length; i < len; i++) {\n if (this._callbacks[i] === callback) {\n if (this._contexts[i] === context) {\n // callback & context match => remove it\n this._callbacks.splice(i, 1);\n this._contexts.splice(i, 1);\n return;\n }\n else {\n foundCallbackWithDifferentContext = true;\n }\n }\n }\n if (foundCallbackWithDifferentContext) {\n throw new Error('When adding a listener with a context, you should remove it with the same context');\n }\n }\n invoke(...args) {\n if (!this._callbacks) {\n return [];\n }\n const ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0);\n for (let i = 0, len = callbacks.length; i < len; i++) {\n try {\n ret.push(callbacks[i].apply(contexts[i], args));\n }\n catch (e) {\n // eslint-disable-next-line no-console\n (0, ral_1.default)().console.error(e);\n }\n }\n return ret;\n }\n isEmpty() {\n return !this._callbacks || this._callbacks.length === 0;\n }\n dispose() {\n this._callbacks = undefined;\n this._contexts = undefined;\n }\n}\nclass Emitter {\n constructor(_options) {\n this._options = _options;\n }\n /**\n * For the public to allow to subscribe\n * to events from this Emitter\n */\n get event() {\n if (!this._event) {\n this._event = (listener, thisArgs, disposables) => {\n if (!this._callbacks) {\n this._callbacks = new CallbackList();\n }\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\n this._options.onFirstListenerAdd(this);\n }\n this._callbacks.add(listener, thisArgs);\n const result = {\n dispose: () => {\n if (!this._callbacks) {\n // disposable is disposed after emitter is disposed.\n return;\n }\n this._callbacks.remove(listener, thisArgs);\n result.dispose = Emitter._noop;\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\n this._options.onLastListenerRemove(this);\n }\n }\n };\n if (Array.isArray(disposables)) {\n disposables.push(result);\n }\n return result;\n };\n }\n return this._event;\n }\n /**\n * To be kept private to fire an event to\n * subscribers\n */\n fire(event) {\n if (this._callbacks) {\n this._callbacks.invoke.call(this._callbacks, event);\n }\n }\n dispose() {\n if (this._callbacks) {\n this._callbacks.dispose();\n this._callbacks = undefined;\n }\n }\n}\nexports.Emitter = Emitter;\nEmitter._noop = function () { };\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CancellationTokenSource = exports.CancellationToken = void 0;\nconst ral_1 = require(\"./ral\");\nconst Is = require(\"./is\");\nconst events_1 = require(\"./events\");\nvar CancellationToken;\n(function (CancellationToken) {\n CancellationToken.None = Object.freeze({\n isCancellationRequested: false,\n onCancellationRequested: events_1.Event.None\n });\n CancellationToken.Cancelled = Object.freeze({\n isCancellationRequested: true,\n onCancellationRequested: events_1.Event.None\n });\n function is(value) {\n const candidate = value;\n return candidate && (candidate === CancellationToken.None\n || candidate === CancellationToken.Cancelled\n || (Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested));\n }\n CancellationToken.is = is;\n})(CancellationToken || (exports.CancellationToken = CancellationToken = {}));\nconst shortcutEvent = Object.freeze(function (callback, context) {\n const handle = (0, ral_1.default)().timer.setTimeout(callback.bind(context), 0);\n return { dispose() { handle.dispose(); } };\n});\nclass MutableToken {\n constructor() {\n this._isCancelled = false;\n }\n cancel() {\n if (!this._isCancelled) {\n this._isCancelled = true;\n if (this._emitter) {\n this._emitter.fire(undefined);\n this.dispose();\n }\n }\n }\n get isCancellationRequested() {\n return this._isCancelled;\n }\n get onCancellationRequested() {\n if (this._isCancelled) {\n return shortcutEvent;\n }\n if (!this._emitter) {\n this._emitter = new events_1.Emitter();\n }\n return this._emitter.event;\n }\n dispose() {\n if (this._emitter) {\n this._emitter.dispose();\n this._emitter = undefined;\n }\n }\n}\nclass CancellationTokenSource {\n get token() {\n if (!this._token) {\n // be lazy and create the token only when\n // actually needed\n this._token = new MutableToken();\n }\n return this._token;\n }\n cancel() {\n if (!this._token) {\n // save an object by returning the default\n // cancelled token when cancellation happens\n // before someone asks for the token\n this._token = CancellationToken.Cancelled;\n }\n else {\n this._token.cancel();\n }\n }\n dispose() {\n if (!this._token) {\n // ensure to initialize with an empty token if we had none\n this._token = CancellationToken.None;\n }\n else if (this._token instanceof MutableToken) {\n // actually dispose\n this._token.dispose();\n }\n }\n}\nexports.CancellationTokenSource = CancellationTokenSource;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SharedArrayReceiverStrategy = exports.SharedArraySenderStrategy = void 0;\nconst cancellation_1 = require(\"./cancellation\");\nvar CancellationState;\n(function (CancellationState) {\n CancellationState.Continue = 0;\n CancellationState.Cancelled = 1;\n})(CancellationState || (CancellationState = {}));\nclass SharedArraySenderStrategy {\n constructor() {\n this.buffers = new Map();\n }\n enableCancellation(request) {\n if (request.id === null) {\n return;\n }\n const buffer = new SharedArrayBuffer(4);\n const data = new Int32Array(buffer, 0, 1);\n data[0] = CancellationState.Continue;\n this.buffers.set(request.id, buffer);\n request.$cancellationData = buffer;\n }\n async sendCancellation(_conn, id) {\n const buffer = this.buffers.get(id);\n if (buffer === undefined) {\n return;\n }\n const data = new Int32Array(buffer, 0, 1);\n Atomics.store(data, 0, CancellationState.Cancelled);\n }\n cleanup(id) {\n this.buffers.delete(id);\n }\n dispose() {\n this.buffers.clear();\n }\n}\nexports.SharedArraySenderStrategy = SharedArraySenderStrategy;\nclass SharedArrayBufferCancellationToken {\n constructor(buffer) {\n this.data = new Int32Array(buffer, 0, 1);\n }\n get isCancellationRequested() {\n return Atomics.load(this.data, 0) === CancellationState.Cancelled;\n }\n get onCancellationRequested() {\n throw new Error(`Cancellation over SharedArrayBuffer doesn't support cancellation events`);\n }\n}\nclass SharedArrayBufferCancellationTokenSource {\n constructor(buffer) {\n this.token = new SharedArrayBufferCancellationToken(buffer);\n }\n cancel() {\n }\n dispose() {\n }\n}\nclass SharedArrayReceiverStrategy {\n constructor() {\n this.kind = 'request';\n }\n createCancellationTokenSource(request) {\n const buffer = request.$cancellationData;\n if (buffer === undefined) {\n return new cancellation_1.CancellationTokenSource();\n }\n return new SharedArrayBufferCancellationTokenSource(buffer);\n }\n}\nexports.SharedArrayReceiverStrategy = SharedArrayReceiverStrategy;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Semaphore = void 0;\nconst ral_1 = require(\"./ral\");\nclass Semaphore {\n constructor(capacity = 1) {\n if (capacity <= 0) {\n throw new Error('Capacity must be greater than 0');\n }\n this._capacity = capacity;\n this._active = 0;\n this._waiting = [];\n }\n lock(thunk) {\n return new Promise((resolve, reject) => {\n this._waiting.push({ thunk, resolve, reject });\n this.runNext();\n });\n }\n get active() {\n return this._active;\n }\n runNext() {\n if (this._waiting.length === 0 || this._active === this._capacity) {\n return;\n }\n (0, ral_1.default)().timer.setImmediate(() => this.doRunNext());\n }\n doRunNext() {\n if (this._waiting.length === 0 || this._active === this._capacity) {\n return;\n }\n const next = this._waiting.shift();\n this._active++;\n if (this._active > this._capacity) {\n throw new Error(`To many thunks active`);\n }\n try {\n const result = next.thunk();\n if (result instanceof Promise) {\n result.then((value) => {\n this._active--;\n next.resolve(value);\n this.runNext();\n }, (err) => {\n this._active--;\n next.reject(err);\n this.runNext();\n });\n }\n else {\n this._active--;\n next.resolve(result);\n this.runNext();\n }\n }\n catch (err) {\n this._active--;\n next.reject(err);\n this.runNext();\n }\n }\n}\nexports.Semaphore = Semaphore;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ReadableStreamMessageReader = exports.AbstractMessageReader = exports.MessageReader = void 0;\nconst ral_1 = require(\"./ral\");\nconst Is = require(\"./is\");\nconst events_1 = require(\"./events\");\nconst semaphore_1 = require(\"./semaphore\");\nvar MessageReader;\n(function (MessageReader) {\n function is(value) {\n let candidate = value;\n return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) &&\n Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage);\n }\n MessageReader.is = is;\n})(MessageReader || (exports.MessageReader = MessageReader = {}));\nclass AbstractMessageReader {\n constructor() {\n this.errorEmitter = new events_1.Emitter();\n this.closeEmitter = new events_1.Emitter();\n this.partialMessageEmitter = new events_1.Emitter();\n }\n dispose() {\n this.errorEmitter.dispose();\n this.closeEmitter.dispose();\n }\n get onError() {\n return this.errorEmitter.event;\n }\n fireError(error) {\n this.errorEmitter.fire(this.asError(error));\n }\n get onClose() {\n return this.closeEmitter.event;\n }\n fireClose() {\n this.closeEmitter.fire(undefined);\n }\n get onPartialMessage() {\n return this.partialMessageEmitter.event;\n }\n firePartialMessage(info) {\n this.partialMessageEmitter.fire(info);\n }\n asError(error) {\n if (error instanceof Error) {\n return error;\n }\n else {\n return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);\n }\n }\n}\nexports.AbstractMessageReader = AbstractMessageReader;\nvar ResolvedMessageReaderOptions;\n(function (ResolvedMessageReaderOptions) {\n function fromOptions(options) {\n let charset;\n let result;\n let contentDecoder;\n const contentDecoders = new Map();\n let contentTypeDecoder;\n const contentTypeDecoders = new Map();\n if (options === undefined || typeof options === 'string') {\n charset = options ?? 'utf-8';\n }\n else {\n charset = options.charset ?? 'utf-8';\n if (options.contentDecoder !== undefined) {\n contentDecoder = options.contentDecoder;\n contentDecoders.set(contentDecoder.name, contentDecoder);\n }\n if (options.contentDecoders !== undefined) {\n for (const decoder of options.contentDecoders) {\n contentDecoders.set(decoder.name, decoder);\n }\n }\n if (options.contentTypeDecoder !== undefined) {\n contentTypeDecoder = options.contentTypeDecoder;\n contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);\n }\n if (options.contentTypeDecoders !== undefined) {\n for (const decoder of options.contentTypeDecoders) {\n contentTypeDecoders.set(decoder.name, decoder);\n }\n }\n }\n if (contentTypeDecoder === undefined) {\n contentTypeDecoder = (0, ral_1.default)().applicationJson.decoder;\n contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);\n }\n return { charset, contentDecoder, contentDecoders, contentTypeDecoder, contentTypeDecoders };\n }\n ResolvedMessageReaderOptions.fromOptions = fromOptions;\n})(ResolvedMessageReaderOptions || (ResolvedMessageReaderOptions = {}));\nclass ReadableStreamMessageReader extends AbstractMessageReader {\n constructor(readable, options) {\n super();\n this.readable = readable;\n this.options = ResolvedMessageReaderOptions.fromOptions(options);\n this.buffer = (0, ral_1.default)().messageBuffer.create(this.options.charset);\n this._partialMessageTimeout = 10000;\n this.nextMessageLength = -1;\n this.messageToken = 0;\n this.readSemaphore = new semaphore_1.Semaphore(1);\n }\n set partialMessageTimeout(timeout) {\n this._partialMessageTimeout = timeout;\n }\n get partialMessageTimeout() {\n return this._partialMessageTimeout;\n }\n listen(callback) {\n this.nextMessageLength = -1;\n this.messageToken = 0;\n this.partialMessageTimer = undefined;\n this.callback = callback;\n const result = this.readable.onData((data) => {\n this.onData(data);\n });\n this.readable.onError((error) => this.fireError(error));\n this.readable.onClose(() => this.fireClose());\n return result;\n }\n onData(data) {\n try {\n this.buffer.append(data);\n while (true) {\n if (this.nextMessageLength === -1) {\n const headers = this.buffer.tryReadHeaders(true);\n if (!headers) {\n return;\n }\n const contentLength = headers.get('content-length');\n if (!contentLength) {\n this.fireError(new Error(`Header must provide a Content-Length property.\\n${JSON.stringify(Object.fromEntries(headers))}`));\n return;\n }\n const length = parseInt(contentLength);\n if (isNaN(length)) {\n this.fireError(new Error(`Content-Length value must be a number. Got ${contentLength}`));\n return;\n }\n this.nextMessageLength = length;\n }\n const body = this.buffer.tryReadBody(this.nextMessageLength);\n if (body === undefined) {\n /** We haven't received the full message yet. */\n this.setPartialMessageTimer();\n return;\n }\n this.clearPartialMessageTimer();\n this.nextMessageLength = -1;\n // Make sure that we convert one received message after the\n // other. Otherwise it could happen that a decoding of a second\n // smaller message finished before the decoding of a first larger\n // message and then we would deliver the second message first.\n this.readSemaphore.lock(async () => {\n const bytes = this.options.contentDecoder !== undefined\n ? await this.options.contentDecoder.decode(body)\n : body;\n const message = await this.options.contentTypeDecoder.decode(bytes, this.options);\n this.callback(message);\n }).catch((error) => {\n this.fireError(error);\n });\n }\n }\n catch (error) {\n this.fireError(error);\n }\n }\n clearPartialMessageTimer() {\n if (this.partialMessageTimer) {\n this.partialMessageTimer.dispose();\n this.partialMessageTimer = undefined;\n }\n }\n setPartialMessageTimer() {\n this.clearPartialMessageTimer();\n if (this._partialMessageTimeout <= 0) {\n return;\n }\n this.partialMessageTimer = (0, ral_1.default)().timer.setTimeout((token, timeout) => {\n this.partialMessageTimer = undefined;\n if (token === this.messageToken) {\n this.firePartialMessage({ messageToken: token, waitingTime: timeout });\n this.setPartialMessageTimer();\n }\n }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout);\n }\n}\nexports.ReadableStreamMessageReader = ReadableStreamMessageReader;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WriteableStreamMessageWriter = exports.AbstractMessageWriter = exports.MessageWriter = void 0;\nconst ral_1 = require(\"./ral\");\nconst Is = require(\"./is\");\nconst semaphore_1 = require(\"./semaphore\");\nconst events_1 = require(\"./events\");\nconst ContentLength = 'Content-Length: ';\nconst CRLF = '\\r\\n';\nvar MessageWriter;\n(function (MessageWriter) {\n function is(value) {\n let candidate = value;\n return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) &&\n Is.func(candidate.onError) && Is.func(candidate.write);\n }\n MessageWriter.is = is;\n})(MessageWriter || (exports.MessageWriter = MessageWriter = {}));\nclass AbstractMessageWriter {\n constructor() {\n this.errorEmitter = new events_1.Emitter();\n this.closeEmitter = new events_1.Emitter();\n }\n dispose() {\n this.errorEmitter.dispose();\n this.closeEmitter.dispose();\n }\n get onError() {\n return this.errorEmitter.event;\n }\n fireError(error, message, count) {\n this.errorEmitter.fire([this.asError(error), message, count]);\n }\n get onClose() {\n return this.closeEmitter.event;\n }\n fireClose() {\n this.closeEmitter.fire(undefined);\n }\n asError(error) {\n if (error instanceof Error) {\n return error;\n }\n else {\n return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);\n }\n }\n}\nexports.AbstractMessageWriter = AbstractMessageWriter;\nvar ResolvedMessageWriterOptions;\n(function (ResolvedMessageWriterOptions) {\n function fromOptions(options) {\n if (options === undefined || typeof options === 'string') {\n return { charset: options ?? 'utf-8', contentTypeEncoder: (0, ral_1.default)().applicationJson.encoder };\n }\n else {\n return { charset: options.charset ?? 'utf-8', contentEncoder: options.contentEncoder, contentTypeEncoder: options.contentTypeEncoder ?? (0, ral_1.default)().applicationJson.encoder };\n }\n }\n ResolvedMessageWriterOptions.fromOptions = fromOptions;\n})(ResolvedMessageWriterOptions || (ResolvedMessageWriterOptions = {}));\nclass WriteableStreamMessageWriter extends AbstractMessageWriter {\n constructor(writable, options) {\n super();\n this.writable = writable;\n this.options = ResolvedMessageWriterOptions.fromOptions(options);\n this.errorCount = 0;\n this.writeSemaphore = new semaphore_1.Semaphore(1);\n this.writable.onError((error) => this.fireError(error));\n this.writable.onClose(() => this.fireClose());\n }\n async write(msg) {\n return this.writeSemaphore.lock(async () => {\n const payload = this.options.contentTypeEncoder.encode(msg, this.options).then((buffer) => {\n if (this.options.contentEncoder !== undefined) {\n return this.options.contentEncoder.encode(buffer);\n }\n else {\n return buffer;\n }\n });\n return payload.then((buffer) => {\n const headers = [];\n headers.push(ContentLength, buffer.byteLength.toString(), CRLF);\n headers.push(CRLF);\n return this.doWrite(msg, headers, buffer);\n }, (error) => {\n this.fireError(error);\n throw error;\n });\n });\n }\n async doWrite(msg, headers, data) {\n try {\n await this.writable.write(headers.join(''), 'ascii');\n return this.writable.write(data);\n }\n catch (error) {\n this.handleError(error, msg);\n return Promise.reject(error);\n }\n }\n handleError(error, msg) {\n this.errorCount++;\n this.fireError(error, msg, this.errorCount);\n }\n end() {\n this.writable.end();\n }\n}\nexports.WriteableStreamMessageWriter = WriteableStreamMessageWriter;\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AbstractMessageBuffer = void 0;\nconst CR = 13;\nconst LF = 10;\nconst CRLF = '\\r\\n';\nclass AbstractMessageBuffer {\n constructor(encoding = 'utf-8') {\n this._encoding = encoding;\n this._chunks = [];\n this._totalLength = 0;\n }\n get encoding() {\n return this._encoding;\n }\n append(chunk) {\n const toAppend = typeof chunk === 'string' ? this.fromString(chunk, this._encoding) : chunk;\n this._chunks.push(toAppend);\n this._totalLength += toAppend.byteLength;\n }\n tryReadHeaders(lowerCaseKeys = false) {\n if (this._chunks.length === 0) {\n return undefined;\n }\n let state = 0;\n let chunkIndex = 0;\n let offset = 0;\n let chunkBytesRead = 0;\n row: while (chunkIndex < this._chunks.length) {\n const chunk = this._chunks[chunkIndex];\n offset = 0;\n column: while (offset < chunk.length) {\n const value = chunk[offset];\n switch (value) {\n case CR:\n switch (state) {\n case 0:\n state = 1;\n break;\n case 2:\n state = 3;\n break;\n default:\n state = 0;\n }\n break;\n case LF:\n switch (state) {\n case 1:\n state = 2;\n break;\n case 3:\n state = 4;\n offset++;\n break row;\n default:\n state = 0;\n }\n break;\n default:\n state = 0;\n }\n offset++;\n }\n chunkBytesRead += chunk.byteLength;\n chunkIndex++;\n }\n if (state !== 4) {\n return undefined;\n }\n // The buffer contains the two CRLF at the end. So we will\n // have two empty lines after the split at the end as well.\n const buffer = this._read(chunkBytesRead + offset);\n const result = new Map();\n const headers = this.toString(buffer, 'ascii').split(CRLF);\n if (headers.length < 2) {\n return result;\n }\n for (let i = 0; i < headers.length - 2; i++) {\n const header = headers[i];\n const index = header.indexOf(':');\n if (index === -1) {\n throw new Error(`Message header must separate key and value using ':'\\n${header}`);\n }\n const key = header.substr(0, index);\n const value = header.substr(index + 1).trim();\n result.set(lowerCaseKeys ? key.toLowerCase() : key, value);\n }\n return result;\n }\n tryReadBody(length) {\n if (this._totalLength < length) {\n return undefined;\n }\n return this._read(length);\n }\n get numberOfBytes() {\n return this._totalLength;\n }\n _read(byteCount) {\n if (byteCount === 0) {\n return this.emptyBuffer();\n }\n if (byteCount > this._totalLength) {\n throw new Error(`Cannot read so many bytes!`);\n }\n if (this._chunks[0].byteLength === byteCount) {\n // super fast path, precisely first chunk must be returned\n const chunk = this._chunks[0];\n this._chunks.shift();\n this._totalLength -= byteCount;\n return this.asNative(chunk);\n }\n if (this._chunks[0].byteLength > byteCount) {\n // fast path, the reading is entirely within the first chunk\n const chunk = this._chunks[0];\n const result = this.asNative(chunk, byteCount);\n this._chunks[0] = chunk.slice(byteCount);\n this._totalLength -= byteCount;\n return result;\n }\n const result = this.allocNative(byteCount);\n let resultOffset = 0;\n let chunkIndex = 0;\n while (byteCount > 0) {\n const chunk = this._chunks[chunkIndex];\n if (chunk.byteLength > byteCount) {\n // this chunk will survive\n const chunkPart = chunk.slice(0, byteCount);\n result.set(chunkPart, resultOffset);\n resultOffset += byteCount;\n this._chunks[chunkIndex] = chunk.slice(byteCount);\n this._totalLength -= byteCount;\n byteCount -= byteCount;\n }\n else {\n // this chunk will be entirely read\n result.set(chunk, resultOffset);\n resultOffset += chunk.byteLength;\n this._chunks.shift();\n this._totalLength -= chunk.byteLength;\n byteCount -= chunk.byteLength;\n }\n }\n return result;\n }\n}\nexports.AbstractMessageBuffer = AbstractMessageBuffer;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createMessageConnection = exports.ConnectionOptions = exports.MessageStrategy = exports.CancellationStrategy = exports.CancellationSenderStrategy = exports.CancellationReceiverStrategy = exports.RequestCancellationReceiverStrategy = exports.IdCancellationReceiverStrategy = exports.ConnectionStrategy = exports.ConnectionError = exports.ConnectionErrors = exports.LogTraceNotification = exports.SetTraceNotification = exports.TraceFormat = exports.TraceValues = exports.Trace = exports.NullLogger = exports.ProgressType = exports.ProgressToken = void 0;\nconst ral_1 = require(\"./ral\");\nconst Is = require(\"./is\");\nconst messages_1 = require(\"./messages\");\nconst linkedMap_1 = require(\"./linkedMap\");\nconst events_1 = require(\"./events\");\nconst cancellation_1 = require(\"./cancellation\");\nvar CancelNotification;\n(function (CancelNotification) {\n CancelNotification.type = new messages_1.NotificationType('$/cancelRequest');\n})(CancelNotification || (CancelNotification = {}));\nvar ProgressToken;\n(function (ProgressToken) {\n function is(value) {\n return typeof value === 'string' || typeof value === 'number';\n }\n ProgressToken.is = is;\n})(ProgressToken || (exports.ProgressToken = ProgressToken = {}));\nvar ProgressNotification;\n(function (ProgressNotification) {\n ProgressNotification.type = new messages_1.NotificationType('$/progress');\n})(ProgressNotification || (ProgressNotification = {}));\nclass ProgressType {\n constructor() {\n }\n}\nexports.ProgressType = ProgressType;\nvar StarRequestHandler;\n(function (StarRequestHandler) {\n function is(value) {\n return Is.func(value);\n }\n StarRequestHandler.is = is;\n})(StarRequestHandler || (StarRequestHandler = {}));\nexports.NullLogger = Object.freeze({\n error: () => { },\n warn: () => { },\n info: () => { },\n log: () => { }\n});\nvar Trace;\n(function (Trace) {\n Trace[Trace[\"Off\"] = 0] = \"Off\";\n Trace[Trace[\"Messages\"] = 1] = \"Messages\";\n Trace[Trace[\"Compact\"] = 2] = \"Compact\";\n Trace[Trace[\"Verbose\"] = 3] = \"Verbose\";\n})(Trace || (exports.Trace = Trace = {}));\nvar TraceValues;\n(function (TraceValues) {\n /**\n * Turn tracing off.\n */\n TraceValues.Off = 'off';\n /**\n * Trace messages only.\n */\n TraceValues.Messages = 'messages';\n /**\n * Compact message tracing.\n */\n TraceValues.Compact = 'compact';\n /**\n * Verbose message tracing.\n */\n TraceValues.Verbose = 'verbose';\n})(TraceValues || (exports.TraceValues = TraceValues = {}));\n(function (Trace) {\n function fromString(value) {\n if (!Is.string(value)) {\n return Trace.Off;\n }\n value = value.toLowerCase();\n switch (value) {\n case 'off':\n return Trace.Off;\n case 'messages':\n return Trace.Messages;\n case 'compact':\n return Trace.Compact;\n case 'verbose':\n return Trace.Verbose;\n default:\n return Trace.Off;\n }\n }\n Trace.fromString = fromString;\n function toString(value) {\n switch (value) {\n case Trace.Off:\n return 'off';\n case Trace.Messages:\n return 'messages';\n case Trace.Compact:\n return 'compact';\n case Trace.Verbose:\n return 'verbose';\n default:\n return 'off';\n }\n }\n Trace.toString = toString;\n})(Trace || (exports.Trace = Trace = {}));\nvar TraceFormat;\n(function (TraceFormat) {\n TraceFormat[\"Text\"] = \"text\";\n TraceFormat[\"JSON\"] = \"json\";\n})(TraceFormat || (exports.TraceFormat = TraceFormat = {}));\n(function (TraceFormat) {\n function fromString(value) {\n if (!Is.string(value)) {\n return TraceFormat.Text;\n }\n value = value.toLowerCase();\n if (value === 'json') {\n return TraceFormat.JSON;\n }\n else {\n return TraceFormat.Text;\n }\n }\n TraceFormat.fromString = fromString;\n})(TraceFormat || (exports.TraceFormat = TraceFormat = {}));\nvar SetTraceNotification;\n(function (SetTraceNotification) {\n SetTraceNotification.type = new messages_1.NotificationType('$/setTrace');\n})(SetTraceNotification || (exports.SetTraceNotification = SetTraceNotification = {}));\nvar LogTraceNotification;\n(function (LogTraceNotification) {\n LogTraceNotification.type = new messages_1.NotificationType('$/logTrace');\n})(LogTraceNotification || (exports.LogTraceNotification = LogTraceNotification = {}));\nvar ConnectionErrors;\n(function (ConnectionErrors) {\n /**\n * The connection is closed.\n */\n ConnectionErrors[ConnectionErrors[\"Closed\"] = 1] = \"Closed\";\n /**\n * The connection got disposed.\n */\n ConnectionErrors[ConnectionErrors[\"Disposed\"] = 2] = \"Disposed\";\n /**\n * The connection is already in listening mode.\n */\n ConnectionErrors[ConnectionErrors[\"AlreadyListening\"] = 3] = \"AlreadyListening\";\n})(ConnectionErrors || (exports.ConnectionErrors = ConnectionErrors = {}));\nclass ConnectionError extends Error {\n constructor(code, message) {\n super(message);\n this.code = code;\n Object.setPrototypeOf(this, ConnectionError.prototype);\n }\n}\nexports.ConnectionError = ConnectionError;\nvar ConnectionStrategy;\n(function (ConnectionStrategy) {\n function is(value) {\n const candidate = value;\n return candidate && Is.func(candidate.cancelUndispatched);\n }\n ConnectionStrategy.is = is;\n})(ConnectionStrategy || (exports.ConnectionStrategy = ConnectionStrategy = {}));\nvar IdCancellationReceiverStrategy;\n(function (IdCancellationReceiverStrategy) {\n function is(value) {\n const candidate = value;\n return candidate && (candidate.kind === undefined || candidate.kind === 'id') && Is.func(candidate.createCancellationTokenSource) && (candidate.dispose === undefined || Is.func(candidate.dispose));\n }\n IdCancellationReceiverStrategy.is = is;\n})(IdCancellationReceiverStrategy || (exports.IdCancellationReceiverStrategy = IdCancellationReceiverStrategy = {}));\nvar RequestCancellationReceiverStrategy;\n(function (RequestCancellationReceiverStrategy) {\n function is(value) {\n const candidate = value;\n return candidate && candidate.kind === 'request' && Is.func(candidate.createCancellationTokenSource) && (candidate.dispose === undefined || Is.func(candidate.dispose));\n }\n RequestCancellationReceiverStrategy.is = is;\n})(RequestCancellationReceiverStrategy || (exports.RequestCancellationReceiverStrategy = RequestCancellationReceiverStrategy = {}));\nvar CancellationReceiverStrategy;\n(function (CancellationReceiverStrategy) {\n CancellationReceiverStrategy.Message = Object.freeze({\n createCancellationTokenSource(_) {\n return new cancellation_1.CancellationTokenSource();\n }\n });\n function is(value) {\n return IdCancellationReceiverStrategy.is(value) || RequestCancellationReceiverStrategy.is(value);\n }\n CancellationReceiverStrategy.is = is;\n})(CancellationReceiverStrategy || (exports.CancellationReceiverStrategy = CancellationReceiverStrategy = {}));\nvar CancellationSenderStrategy;\n(function (CancellationSenderStrategy) {\n CancellationSenderStrategy.Message = Object.freeze({\n sendCancellation(conn, id) {\n return conn.sendNotification(CancelNotification.type, { id });\n },\n cleanup(_) { }\n });\n function is(value) {\n const candidate = value;\n return candidate && Is.func(candidate.sendCancellation) && Is.func(candidate.cleanup);\n }\n CancellationSenderStrategy.is = is;\n})(CancellationSenderStrategy || (exports.CancellationSenderStrategy = CancellationSenderStrategy = {}));\nvar CancellationStrategy;\n(function (CancellationStrategy) {\n CancellationStrategy.Message = Object.freeze({\n receiver: CancellationReceiverStrategy.Message,\n sender: CancellationSenderStrategy.Message\n });\n function is(value) {\n const candidate = value;\n return candidate && CancellationReceiverStrategy.is(candidate.receiver) && CancellationSenderStrategy.is(candidate.sender);\n }\n CancellationStrategy.is = is;\n})(CancellationStrategy || (exports.CancellationStrategy = CancellationStrategy = {}));\nvar MessageStrategy;\n(function (MessageStrategy) {\n function is(value) {\n const candidate = value;\n return candidate && Is.func(candidate.handleMessage);\n }\n MessageStrategy.is = is;\n})(MessageStrategy || (exports.MessageStrategy = MessageStrategy = {}));\nvar ConnectionOptions;\n(function (ConnectionOptions) {\n function is(value) {\n const candidate = value;\n return candidate && (CancellationStrategy.is(candidate.cancellationStrategy) || ConnectionStrategy.is(candidate.connectionStrategy) || MessageStrategy.is(candidate.messageStrategy));\n }\n ConnectionOptions.is = is;\n})(ConnectionOptions || (exports.ConnectionOptions = ConnectionOptions = {}));\nvar ConnectionState;\n(function (ConnectionState) {\n ConnectionState[ConnectionState[\"New\"] = 1] = \"New\";\n ConnectionState[ConnectionState[\"Listening\"] = 2] = \"Listening\";\n ConnectionState[ConnectionState[\"Closed\"] = 3] = \"Closed\";\n ConnectionState[ConnectionState[\"Disposed\"] = 4] = \"Disposed\";\n})(ConnectionState || (ConnectionState = {}));\nfunction createMessageConnection(messageReader, messageWriter, _logger, options) {\n const logger = _logger !== undefined ? _logger : exports.NullLogger;\n let sequenceNumber = 0;\n let notificationSequenceNumber = 0;\n let unknownResponseSequenceNumber = 0;\n const version = '2.0';\n let starRequestHandler = undefined;\n const requestHandlers = new Map();\n let starNotificationHandler = undefined;\n const notificationHandlers = new Map();\n const progressHandlers = new Map();\n let timer;\n let messageQueue = new linkedMap_1.LinkedMap();\n let responsePromises = new Map();\n let knownCanceledRequests = new Set();\n let requestTokens = new Map();\n let trace = Trace.Off;\n let traceFormat = TraceFormat.Text;\n let tracer;\n let state = ConnectionState.New;\n const errorEmitter = new events_1.Emitter();\n const closeEmitter = new events_1.Emitter();\n const unhandledNotificationEmitter = new events_1.Emitter();\n const unhandledProgressEmitter = new events_1.Emitter();\n const disposeEmitter = new events_1.Emitter();\n const cancellationStrategy = (options && options.cancellationStrategy) ? options.cancellationStrategy : CancellationStrategy.Message;\n function createRequestQueueKey(id) {\n if (id === null) {\n throw new Error(`Can't send requests with id null since the response can't be correlated.`);\n }\n return 'req-' + id.toString();\n }\n function createResponseQueueKey(id) {\n if (id === null) {\n return 'res-unknown-' + (++unknownResponseSequenceNumber).toString();\n }\n else {\n return 'res-' + id.toString();\n }\n }\n function createNotificationQueueKey() {\n return 'not-' + (++notificationSequenceNumber).toString();\n }\n function addMessageToQueue(queue, message) {\n if (messages_1.Message.isRequest(message)) {\n queue.set(createRequestQueueKey(message.id), message);\n }\n else if (messages_1.Message.isResponse(message)) {\n queue.set(createResponseQueueKey(message.id), message);\n }\n else {\n queue.set(createNotificationQueueKey(), message);\n }\n }\n function cancelUndispatched(_message) {\n return undefined;\n }\n function isListening() {\n return state === ConnectionState.Listening;\n }\n function isClosed() {\n return state === ConnectionState.Closed;\n }\n function isDisposed() {\n return state === ConnectionState.Disposed;\n }\n function closeHandler() {\n if (state === ConnectionState.New || state === ConnectionState.Listening) {\n state = ConnectionState.Closed;\n closeEmitter.fire(undefined);\n }\n // If the connection is disposed don't sent close events.\n }\n function readErrorHandler(error) {\n errorEmitter.fire([error, undefined, undefined]);\n }\n function writeErrorHandler(data) {\n errorEmitter.fire(data);\n }\n messageReader.onClose(closeHandler);\n messageReader.onError(readErrorHandler);\n messageWriter.onClose(closeHandler);\n messageWriter.onError(writeErrorHandler);\n function triggerMessageQueue() {\n if (timer || messageQueue.size === 0) {\n return;\n }\n timer = (0, ral_1.default)().timer.setImmediate(() => {\n timer = undefined;\n processMessageQueue();\n });\n }\n function handleMessage(message) {\n if (messages_1.Message.isRequest(message)) {\n handleRequest(message);\n }\n else if (messages_1.Message.isNotification(message)) {\n handleNotification(message);\n }\n else if (messages_1.Message.isResponse(message)) {\n handleResponse(message);\n }\n else {\n handleInvalidMessage(message);\n }\n }\n function processMessageQueue() {\n if (messageQueue.size === 0) {\n return;\n }\n const message = messageQueue.shift();\n try {\n const messageStrategy = options?.messageStrategy;\n if (MessageStrategy.is(messageStrategy)) {\n messageStrategy.handleMessage(message, handleMessage);\n }\n else {\n handleMessage(message);\n }\n }\n finally {\n triggerMessageQueue();\n }\n }\n const callback = (message) => {\n try {\n // We have received a cancellation message. Check if the message is still in the queue\n // and cancel it if allowed to do so.\n if (messages_1.Message.isNotification(message) && message.method === CancelNotification.type.method) {\n const cancelId = message.params.id;\n const key = createRequestQueueKey(cancelId);\n const toCancel = messageQueue.get(key);\n if (messages_1.Message.isRequest(toCancel)) {\n const strategy = options?.connectionStrategy;\n const response = (strategy && strategy.cancelUndispatched) ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel);\n if (response && (response.error !== undefined || response.result !== undefined)) {\n messageQueue.delete(key);\n requestTokens.delete(cancelId);\n response.id = toCancel.id;\n traceSendingResponse(response, message.method, Date.now());\n messageWriter.write(response).catch(() => logger.error(`Sending response for canceled message failed.`));\n return;\n }\n }\n const cancellationToken = requestTokens.get(cancelId);\n // The request is already running. Cancel the token\n if (cancellationToken !== undefined) {\n cancellationToken.cancel();\n traceReceivedNotification(message);\n return;\n }\n else {\n // Remember the cancel but still queue the message to\n // clean up state in process message.\n knownCanceledRequests.add(cancelId);\n }\n }\n addMessageToQueue(messageQueue, message);\n }\n finally {\n triggerMessageQueue();\n }\n };\n function handleRequest(requestMessage) {\n if (isDisposed()) {\n // we return here silently since we fired an event when the\n // connection got disposed.\n return;\n }\n function reply(resultOrError, method, startTime) {\n const message = {\n jsonrpc: version,\n id: requestMessage.id\n };\n if (resultOrError instanceof messages_1.ResponseError) {\n message.error = resultOrError.toJson();\n }\n else {\n message.result = resultOrError === undefined ? null : resultOrError;\n }\n traceSendingResponse(message, method, startTime);\n messageWriter.write(message).catch(() => logger.error(`Sending response failed.`));\n }\n function replyError(error, method, startTime) {\n const message = {\n jsonrpc: version,\n id: requestMessage.id,\n error: error.toJson()\n };\n traceSendingResponse(message, method, startTime);\n messageWriter.write(message).catch(() => logger.error(`Sending response failed.`));\n }\n function replySuccess(result, method, startTime) {\n // The JSON RPC defines that a response must either have a result or an error\n // So we can't treat undefined as a valid response result.\n if (result === undefined) {\n result = null;\n }\n const message = {\n jsonrpc: version,\n id: requestMessage.id,\n result: result\n };\n traceSendingResponse(message, method, startTime);\n messageWriter.write(message).catch(() => logger.error(`Sending response failed.`));\n }\n traceReceivedRequest(requestMessage);\n const element = requestHandlers.get(requestMessage.method);\n let type;\n let requestHandler;\n if (element) {\n type = element.type;\n requestHandler = element.handler;\n }\n const startTime = Date.now();\n if (requestHandler || starRequestHandler) {\n const tokenKey = requestMessage.id ?? String(Date.now()); //\n const cancellationSource = IdCancellationReceiverStrategy.is(cancellationStrategy.receiver)\n ? cancellationStrategy.receiver.createCancellationTokenSource(tokenKey)\n : cancellationStrategy.receiver.createCancellationTokenSource(requestMessage);\n if (requestMessage.id !== null && knownCanceledRequests.has(requestMessage.id)) {\n cancellationSource.cancel();\n }\n if (requestMessage.id !== null) {\n requestTokens.set(tokenKey, cancellationSource);\n }\n try {\n let handlerResult;\n if (requestHandler) {\n if (requestMessage.params === undefined) {\n if (type !== undefined && type.numberOfParams !== 0) {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines ${type.numberOfParams} params but received none.`), requestMessage.method, startTime);\n return;\n }\n handlerResult = requestHandler(cancellationSource.token);\n }\n else if (Array.isArray(requestMessage.params)) {\n if (type !== undefined && type.parameterStructures === messages_1.ParameterStructures.byName) {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by name but received parameters by position`), requestMessage.method, startTime);\n return;\n }\n handlerResult = requestHandler(...requestMessage.params, cancellationSource.token);\n }\n else {\n if (type !== undefined && type.parameterStructures === messages_1.ParameterStructures.byPosition) {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by position but received parameters by name`), requestMessage.method, startTime);\n return;\n }\n handlerResult = requestHandler(requestMessage.params, cancellationSource.token);\n }\n }\n else if (starRequestHandler) {\n handlerResult = starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token);\n }\n const promise = handlerResult;\n if (!handlerResult) {\n requestTokens.delete(tokenKey);\n replySuccess(handlerResult, requestMessage.method, startTime);\n }\n else if (promise.then) {\n promise.then((resultOrError) => {\n requestTokens.delete(tokenKey);\n reply(resultOrError, requestMessage.method, startTime);\n }, error => {\n requestTokens.delete(tokenKey);\n if (error instanceof messages_1.ResponseError) {\n replyError(error, requestMessage.method, startTime);\n }\n else if (error && Is.string(error.message)) {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);\n }\n else {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);\n }\n });\n }\n else {\n requestTokens.delete(tokenKey);\n reply(handlerResult, requestMessage.method, startTime);\n }\n }\n catch (error) {\n requestTokens.delete(tokenKey);\n if (error instanceof messages_1.ResponseError) {\n reply(error, requestMessage.method, startTime);\n }\n else if (error && Is.string(error.message)) {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);\n }\n else {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);\n }\n }\n }\n else {\n replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime);\n }\n }\n function handleResponse(responseMessage) {\n if (isDisposed()) {\n // See handle request.\n return;\n }\n if (responseMessage.id === null) {\n if (responseMessage.error) {\n logger.error(`Received response message without id: Error is: \\n${JSON.stringify(responseMessage.error, undefined, 4)}`);\n }\n else {\n logger.error(`Received response message without id. No further error information provided.`);\n }\n }\n else {\n const key = responseMessage.id;\n const responsePromise = responsePromises.get(key);\n traceReceivedResponse(responseMessage, responsePromise);\n if (responsePromise !== undefined) {\n responsePromises.delete(key);\n try {\n if (responseMessage.error) {\n const error = responseMessage.error;\n responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data));\n }\n else if (responseMessage.result !== undefined) {\n responsePromise.resolve(responseMessage.result);\n }\n else {\n throw new Error('Should never happen.');\n }\n }\n catch (error) {\n if (error.message) {\n logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`);\n }\n else {\n logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`);\n }\n }\n }\n }\n }\n function handleNotification(message) {\n if (isDisposed()) {\n // See handle request.\n return;\n }\n let type = undefined;\n let notificationHandler;\n if (message.method === CancelNotification.type.method) {\n const cancelId = message.params.id;\n knownCanceledRequests.delete(cancelId);\n traceReceivedNotification(message);\n return;\n }\n else {\n const element = notificationHandlers.get(message.method);\n if (element) {\n notificationHandler = element.handler;\n type = element.type;\n }\n }\n if (notificationHandler || starNotificationHandler) {\n try {\n traceReceivedNotification(message);\n if (notificationHandler) {\n if (message.params === undefined) {\n if (type !== undefined) {\n if (type.numberOfParams !== 0 && type.parameterStructures !== messages_1.ParameterStructures.byName) {\n logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but received none.`);\n }\n }\n notificationHandler();\n }\n else if (Array.isArray(message.params)) {\n // There are JSON-RPC libraries that send progress message as positional params although\n // specified as named. So convert them if this is the case.\n const params = message.params;\n if (message.method === ProgressNotification.type.method && params.length === 2 && ProgressToken.is(params[0])) {\n notificationHandler({ token: params[0], value: params[1] });\n }\n else {\n if (type !== undefined) {\n if (type.parameterStructures === messages_1.ParameterStructures.byName) {\n logger.error(`Notification ${message.method} defines parameters by name but received parameters by position`);\n }\n if (type.numberOfParams !== message.params.length) {\n logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but received ${params.length} arguments`);\n }\n }\n notificationHandler(...params);\n }\n }\n else {\n if (type !== undefined && type.parameterStructures === messages_1.ParameterStructures.byPosition) {\n logger.error(`Notification ${message.method} defines parameters by position but received parameters by name`);\n }\n notificationHandler(message.params);\n }\n }\n else if (starNotificationHandler) {\n starNotificationHandler(message.method, message.params);\n }\n }\n catch (error) {\n if (error.message) {\n logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`);\n }\n else {\n logger.error(`Notification handler '${message.method}' failed unexpectedly.`);\n }\n }\n }\n else {\n unhandledNotificationEmitter.fire(message);\n }\n }\n function handleInvalidMessage(message) {\n if (!message) {\n logger.error('Received empty message.');\n return;\n }\n logger.error(`Received message which is neither a response nor a notification message:\\n${JSON.stringify(message, null, 4)}`);\n // Test whether we find an id to reject the promise\n const responseMessage = message;\n if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) {\n const key = responseMessage.id;\n const responseHandler = responsePromises.get(key);\n if (responseHandler) {\n responseHandler.reject(new Error('The received response has neither a result nor an error property.'));\n }\n }\n }\n function stringifyTrace(params) {\n if (params === undefined || params === null) {\n return undefined;\n }\n switch (trace) {\n case Trace.Verbose:\n return JSON.stringify(params, null, 4);\n case Trace.Compact:\n return JSON.stringify(params);\n default:\n return undefined;\n }\n }\n function traceSendingRequest(message) {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if ((trace === Trace.Verbose || trace === Trace.Compact) && message.params) {\n data = `Params: ${stringifyTrace(message.params)}\\n\\n`;\n }\n tracer.log(`Sending request '${message.method} - (${message.id})'.`, data);\n }\n else {\n logLSPMessage('send-request', message);\n }\n }\n function traceSendingNotification(message) {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if (trace === Trace.Verbose || trace === Trace.Compact) {\n if (message.params) {\n data = `Params: ${stringifyTrace(message.params)}\\n\\n`;\n }\n else {\n data = 'No parameters provided.\\n\\n';\n }\n }\n tracer.log(`Sending notification '${message.method}'.`, data);\n }\n else {\n logLSPMessage('send-notification', message);\n }\n }\n function traceSendingResponse(message, method, startTime) {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if (trace === Trace.Verbose || trace === Trace.Compact) {\n if (message.error && message.error.data) {\n data = `Error data: ${stringifyTrace(message.error.data)}\\n\\n`;\n }\n else {\n if (message.result) {\n data = `Result: ${stringifyTrace(message.result)}\\n\\n`;\n }\n else if (message.error === undefined) {\n data = 'No result returned.\\n\\n';\n }\n }\n }\n tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data);\n }\n else {\n logLSPMessage('send-response', message);\n }\n }\n function traceReceivedRequest(message) {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if ((trace === Trace.Verbose || trace === Trace.Compact) && message.params) {\n data = `Params: ${stringifyTrace(message.params)}\\n\\n`;\n }\n tracer.log(`Received request '${message.method} - (${message.id})'.`, data);\n }\n else {\n logLSPMessage('receive-request', message);\n }\n }\n function traceReceivedNotification(message) {\n if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if (trace === Trace.Verbose || trace === Trace.Compact) {\n if (message.params) {\n data = `Params: ${stringifyTrace(message.params)}\\n\\n`;\n }\n else {\n data = 'No parameters provided.\\n\\n';\n }\n }\n tracer.log(`Received notification '${message.method}'.`, data);\n }\n else {\n logLSPMessage('receive-notification', message);\n }\n }\n function traceReceivedResponse(message, responsePromise) {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n if (traceFormat === TraceFormat.Text) {\n let data = undefined;\n if (trace === Trace.Verbose || trace === Trace.Compact) {\n if (message.error && message.error.data) {\n data = `Error data: ${stringifyTrace(message.error.data)}\\n\\n`;\n }\n else {\n if (message.result) {\n data = `Result: ${stringifyTrace(message.result)}\\n\\n`;\n }\n else if (message.error === undefined) {\n data = 'No result returned.\\n\\n';\n }\n }\n }\n if (responsePromise) {\n const error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : '';\n tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data);\n }\n else {\n tracer.log(`Received response ${message.id} without active response promise.`, data);\n }\n }\n else {\n logLSPMessage('receive-response', message);\n }\n }\n function logLSPMessage(type, message) {\n if (!tracer || trace === Trace.Off) {\n return;\n }\n const lspMessage = {\n isLSPMessage: true,\n type,\n message,\n timestamp: Date.now()\n };\n tracer.log(lspMessage);\n }\n function throwIfClosedOrDisposed() {\n if (isClosed()) {\n throw new ConnectionError(ConnectionErrors.Closed, 'Connection is closed.');\n }\n if (isDisposed()) {\n throw new ConnectionError(ConnectionErrors.Disposed, 'Connection is disposed.');\n }\n }\n function throwIfListening() {\n if (isListening()) {\n throw new ConnectionError(ConnectionErrors.AlreadyListening, 'Connection is already listening');\n }\n }\n function throwIfNotListening() {\n if (!isListening()) {\n throw new Error('Call listen() first.');\n }\n }\n function undefinedToNull(param) {\n if (param === undefined) {\n return null;\n }\n else {\n return param;\n }\n }\n function nullToUndefined(param) {\n if (param === null) {\n return undefined;\n }\n else {\n return param;\n }\n }\n function isNamedParam(param) {\n return param !== undefined && param !== null && !Array.isArray(param) && typeof param === 'object';\n }\n function computeSingleParam(parameterStructures, param) {\n switch (parameterStructures) {\n case messages_1.ParameterStructures.auto:\n if (isNamedParam(param)) {\n return nullToUndefined(param);\n }\n else {\n return [undefinedToNull(param)];\n }\n case messages_1.ParameterStructures.byName:\n if (!isNamedParam(param)) {\n throw new Error(`Received parameters by name but param is not an object literal.`);\n }\n return nullToUndefined(param);\n case messages_1.ParameterStructures.byPosition:\n return [undefinedToNull(param)];\n default:\n throw new Error(`Unknown parameter structure ${parameterStructures.toString()}`);\n }\n }\n function computeMessageParams(type, params) {\n let result;\n const numberOfParams = type.numberOfParams;\n switch (numberOfParams) {\n case 0:\n result = undefined;\n break;\n case 1:\n result = computeSingleParam(type.parameterStructures, params[0]);\n break;\n default:\n result = [];\n for (let i = 0; i < params.length && i < numberOfParams; i++) {\n result.push(undefinedToNull(params[i]));\n }\n if (params.length < numberOfParams) {\n for (let i = params.length; i < numberOfParams; i++) {\n result.push(null);\n }\n }\n break;\n }\n return result;\n }\n const connection = {\n sendNotification: (type, ...args) => {\n throwIfClosedOrDisposed();\n let method;\n let messageParams;\n if (Is.string(type)) {\n method = type;\n const first = args[0];\n let paramStart = 0;\n let parameterStructures = messages_1.ParameterStructures.auto;\n if (messages_1.ParameterStructures.is(first)) {\n paramStart = 1;\n parameterStructures = first;\n }\n let paramEnd = args.length;\n const numberOfParams = paramEnd - paramStart;\n switch (numberOfParams) {\n case 0:\n messageParams = undefined;\n break;\n case 1:\n messageParams = computeSingleParam(parameterStructures, args[paramStart]);\n break;\n default:\n if (parameterStructures === messages_1.ParameterStructures.byName) {\n throw new Error(`Received ${numberOfParams} parameters for 'by Name' notification parameter structure.`);\n }\n messageParams = args.slice(paramStart, paramEnd).map(value => undefinedToNull(value));\n break;\n }\n }\n else {\n const params = args;\n method = type.method;\n messageParams = computeMessageParams(type, params);\n }\n const notificationMessage = {\n jsonrpc: version,\n method: method,\n params: messageParams\n };\n traceSendingNotification(notificationMessage);\n return messageWriter.write(notificationMessage).catch((error) => {\n logger.error(`Sending notification failed.`);\n throw error;\n });\n },\n onNotification: (type, handler) => {\n throwIfClosedOrDisposed();\n let method;\n if (Is.func(type)) {\n starNotificationHandler = type;\n }\n else if (handler) {\n if (Is.string(type)) {\n method = type;\n notificationHandlers.set(type, { type: undefined, handler });\n }\n else {\n method = type.method;\n notificationHandlers.set(type.method, { type, handler });\n }\n }\n return {\n dispose: () => {\n if (method !== undefined) {\n notificationHandlers.delete(method);\n }\n else {\n starNotificationHandler = undefined;\n }\n }\n };\n },\n onProgress: (_type, token, handler) => {\n if (progressHandlers.has(token)) {\n throw new Error(`Progress handler for token ${token} already registered`);\n }\n progressHandlers.set(token, handler);\n return {\n dispose: () => {\n progressHandlers.delete(token);\n }\n };\n },\n sendProgress: (_type, token, value) => {\n // This should not await but simple return to ensure that we don't have another\n // async scheduling. Otherwise one send could overtake another send.\n return connection.sendNotification(ProgressNotification.type, { token, value });\n },\n onUnhandledProgress: unhandledProgressEmitter.event,\n sendRequest: (type, ...args) => {\n throwIfClosedOrDisposed();\n throwIfNotListening();\n let method;\n let messageParams;\n let token = undefined;\n if (Is.string(type)) {\n method = type;\n const first = args[0];\n const last = args[args.length - 1];\n let paramStart = 0;\n let parameterStructures = messages_1.ParameterStructures.auto;\n if (messages_1.ParameterStructures.is(first)) {\n paramStart = 1;\n parameterStructures = first;\n }\n let paramEnd = args.length;\n if (cancellation_1.CancellationToken.is(last)) {\n paramEnd = paramEnd - 1;\n token = last;\n }\n const numberOfParams = paramEnd - paramStart;\n switch (numberOfParams) {\n case 0:\n messageParams = undefined;\n break;\n case 1:\n messageParams = computeSingleParam(parameterStructures, args[paramStart]);\n break;\n default:\n if (parameterStructures === messages_1.ParameterStructures.byName) {\n throw new Error(`Received ${numberOfParams} parameters for 'by Name' request parameter structure.`);\n }\n messageParams = args.slice(paramStart, paramEnd).map(value => undefinedToNull(value));\n break;\n }\n }\n else {\n const params = args;\n method = type.method;\n messageParams = computeMessageParams(type, params);\n const numberOfParams = type.numberOfParams;\n token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : undefined;\n }\n const id = sequenceNumber++;\n let disposable;\n if (token) {\n disposable = token.onCancellationRequested(() => {\n const p = cancellationStrategy.sender.sendCancellation(connection, id);\n if (p === undefined) {\n logger.log(`Received no promise from cancellation strategy when cancelling id ${id}`);\n return Promise.resolve();\n }\n else {\n return p.catch(() => {\n logger.log(`Sending cancellation messages for id ${id} failed`);\n });\n }\n });\n }\n const requestMessage = {\n jsonrpc: version,\n id: id,\n method: method,\n params: messageParams\n };\n traceSendingRequest(requestMessage);\n if (typeof cancellationStrategy.sender.enableCancellation === 'function') {\n cancellationStrategy.sender.enableCancellation(requestMessage);\n }\n return new Promise(async (resolve, reject) => {\n const resolveWithCleanup = (r) => {\n resolve(r);\n cancellationStrategy.sender.cleanup(id);\n disposable?.dispose();\n };\n const rejectWithCleanup = (r) => {\n reject(r);\n cancellationStrategy.sender.cleanup(id);\n disposable?.dispose();\n };\n const responsePromise = { method: method, timerStart: Date.now(), resolve: resolveWithCleanup, reject: rejectWithCleanup };\n try {\n await messageWriter.write(requestMessage);\n responsePromises.set(id, responsePromise);\n }\n catch (error) {\n logger.error(`Sending request failed.`);\n // Writing the message failed. So we need to reject the promise.\n responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, error.message ? error.message : 'Unknown reason'));\n throw error;\n }\n });\n },\n onRequest: (type, handler) => {\n throwIfClosedOrDisposed();\n let method = null;\n if (StarRequestHandler.is(type)) {\n method = undefined;\n starRequestHandler = type;\n }\n else if (Is.string(type)) {\n method = null;\n if (handler !== undefined) {\n method = type;\n requestHandlers.set(type, { handler: handler, type: undefined });\n }\n }\n else {\n if (handler !== undefined) {\n method = type.method;\n requestHandlers.set(type.method, { type, handler });\n }\n }\n return {\n dispose: () => {\n if (method === null) {\n return;\n }\n if (method !== undefined) {\n requestHandlers.delete(method);\n }\n else {\n starRequestHandler = undefined;\n }\n }\n };\n },\n hasPendingResponse: () => {\n return responsePromises.size > 0;\n },\n trace: async (_value, _tracer, sendNotificationOrTraceOptions) => {\n let _sendNotification = false;\n let _traceFormat = TraceFormat.Text;\n if (sendNotificationOrTraceOptions !== undefined) {\n if (Is.boolean(sendNotificationOrTraceOptions)) {\n _sendNotification = sendNotificationOrTraceOptions;\n }\n else {\n _sendNotification = sendNotificationOrTraceOptions.sendNotification || false;\n _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text;\n }\n }\n trace = _value;\n traceFormat = _traceFormat;\n if (trace === Trace.Off) {\n tracer = undefined;\n }\n else {\n tracer = _tracer;\n }\n if (_sendNotification && !isClosed() && !isDisposed()) {\n await connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) });\n }\n },\n onError: errorEmitter.event,\n onClose: closeEmitter.event,\n onUnhandledNotification: unhandledNotificationEmitter.event,\n onDispose: disposeEmitter.event,\n end: () => {\n messageWriter.end();\n },\n dispose: () => {\n if (isDisposed()) {\n return;\n }\n state = ConnectionState.Disposed;\n disposeEmitter.fire(undefined);\n const error = new messages_1.ResponseError(messages_1.ErrorCodes.PendingResponseRejected, 'Pending response rejected since connection got disposed');\n for (const promise of responsePromises.values()) {\n promise.reject(error);\n }\n responsePromises = new Map();\n requestTokens = new Map();\n knownCanceledRequests = new Set();\n messageQueue = new linkedMap_1.LinkedMap();\n // Test for backwards compatibility\n if (Is.func(messageWriter.dispose)) {\n messageWriter.dispose();\n }\n if (Is.func(messageReader.dispose)) {\n messageReader.dispose();\n }\n },\n listen: () => {\n throwIfClosedOrDisposed();\n throwIfListening();\n state = ConnectionState.Listening;\n messageReader.listen(callback);\n },\n inspect: () => {\n // eslint-disable-next-line no-console\n (0, ral_1.default)().console.log('inspect');\n }\n };\n connection.onNotification(LogTraceNotification.type, (params) => {\n if (trace === Trace.Off || !tracer) {\n return;\n }\n const verbose = trace === Trace.Verbose || trace === Trace.Compact;\n tracer.log(params.message, verbose ? params.verbose : undefined);\n });\n connection.onNotification(ProgressNotification.type, (params) => {\n const handler = progressHandlers.get(params.token);\n if (handler) {\n handler(params.value);\n }\n else {\n unhandledProgressEmitter.fire(params);\n }\n });\n return connection;\n}\nexports.createMessageConnection = createMessageConnection;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n/// \nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProgressType = exports.ProgressToken = exports.createMessageConnection = exports.NullLogger = exports.ConnectionOptions = exports.ConnectionStrategy = exports.AbstractMessageBuffer = exports.WriteableStreamMessageWriter = exports.AbstractMessageWriter = exports.MessageWriter = exports.ReadableStreamMessageReader = exports.AbstractMessageReader = exports.MessageReader = exports.SharedArrayReceiverStrategy = exports.SharedArraySenderStrategy = exports.CancellationToken = exports.CancellationTokenSource = exports.Emitter = exports.Event = exports.Disposable = exports.LRUCache = exports.Touch = exports.LinkedMap = exports.ParameterStructures = exports.NotificationType9 = exports.NotificationType8 = exports.NotificationType7 = exports.NotificationType6 = exports.NotificationType5 = exports.NotificationType4 = exports.NotificationType3 = exports.NotificationType2 = exports.NotificationType1 = exports.NotificationType0 = exports.NotificationType = exports.ErrorCodes = exports.ResponseError = exports.RequestType9 = exports.RequestType8 = exports.RequestType7 = exports.RequestType6 = exports.RequestType5 = exports.RequestType4 = exports.RequestType3 = exports.RequestType2 = exports.RequestType1 = exports.RequestType0 = exports.RequestType = exports.Message = exports.RAL = void 0;\nexports.MessageStrategy = exports.CancellationStrategy = exports.CancellationSenderStrategy = exports.CancellationReceiverStrategy = exports.ConnectionError = exports.ConnectionErrors = exports.LogTraceNotification = exports.SetTraceNotification = exports.TraceFormat = exports.TraceValues = exports.Trace = void 0;\nconst messages_1 = require(\"./messages\");\nObject.defineProperty(exports, \"Message\", { enumerable: true, get: function () { return messages_1.Message; } });\nObject.defineProperty(exports, \"RequestType\", { enumerable: true, get: function () { return messages_1.RequestType; } });\nObject.defineProperty(exports, \"RequestType0\", { enumerable: true, get: function () { return messages_1.RequestType0; } });\nObject.defineProperty(exports, \"RequestType1\", { enumerable: true, get: function () { return messages_1.RequestType1; } });\nObject.defineProperty(exports, \"RequestType2\", { enumerable: true, get: function () { return messages_1.RequestType2; } });\nObject.defineProperty(exports, \"RequestType3\", { enumerable: true, get: function () { return messages_1.RequestType3; } });\nObject.defineProperty(exports, \"RequestType4\", { enumerable: true, get: function () { return messages_1.RequestType4; } });\nObject.defineProperty(exports, \"RequestType5\", { enumerable: true, get: function () { return messages_1.RequestType5; } });\nObject.defineProperty(exports, \"RequestType6\", { enumerable: true, get: function () { return messages_1.RequestType6; } });\nObject.defineProperty(exports, \"RequestType7\", { enumerable: true, get: function () { return messages_1.RequestType7; } });\nObject.defineProperty(exports, \"RequestType8\", { enumerable: true, get: function () { return messages_1.RequestType8; } });\nObject.defineProperty(exports, \"RequestType9\", { enumerable: true, get: function () { return messages_1.RequestType9; } });\nObject.defineProperty(exports, \"ResponseError\", { enumerable: true, get: function () { return messages_1.ResponseError; } });\nObject.defineProperty(exports, \"ErrorCodes\", { enumerable: true, get: function () { return messages_1.ErrorCodes; } });\nObject.defineProperty(exports, \"NotificationType\", { enumerable: true, get: function () { return messages_1.NotificationType; } });\nObject.defineProperty(exports, \"NotificationType0\", { enumerable: true, get: function () { return messages_1.NotificationType0; } });\nObject.defineProperty(exports, \"NotificationType1\", { enumerable: true, get: function () { return messages_1.NotificationType1; } });\nObject.defineProperty(exports, \"NotificationType2\", { enumerable: true, get: function () { return messages_1.NotificationType2; } });\nObject.defineProperty(exports, \"NotificationType3\", { enumerable: true, get: function () { return messages_1.NotificationType3; } });\nObject.defineProperty(exports, \"NotificationType4\", { enumerable: true, get: function () { return messages_1.NotificationType4; } });\nObject.defineProperty(exports, \"NotificationType5\", { enumerable: true, get: function () { return messages_1.NotificationType5; } });\nObject.defineProperty(exports, \"NotificationType6\", { enumerable: true, get: function () { return messages_1.NotificationType6; } });\nObject.defineProperty(exports, \"NotificationType7\", { enumerable: true, get: function () { return messages_1.NotificationType7; } });\nObject.defineProperty(exports, \"NotificationType8\", { enumerable: true, get: function () { return messages_1.NotificationType8; } });\nObject.defineProperty(exports, \"NotificationType9\", { enumerable: true, get: function () { return messages_1.NotificationType9; } });\nObject.defineProperty(exports, \"ParameterStructures\", { enumerable: true, get: function () { return messages_1.ParameterStructures; } });\nconst linkedMap_1 = require(\"./linkedMap\");\nObject.defineProperty(exports, \"LinkedMap\", { enumerable: true, get: function () { return linkedMap_1.LinkedMap; } });\nObject.defineProperty(exports, \"LRUCache\", { enumerable: true, get: function () { return linkedMap_1.LRUCache; } });\nObject.defineProperty(exports, \"Touch\", { enumerable: true, get: function () { return linkedMap_1.Touch; } });\nconst disposable_1 = require(\"./disposable\");\nObject.defineProperty(exports, \"Disposable\", { enumerable: true, get: function () { return disposable_1.Disposable; } });\nconst events_1 = require(\"./events\");\nObject.defineProperty(exports, \"Event\", { enumerable: true, get: function () { return events_1.Event; } });\nObject.defineProperty(exports, \"Emitter\", { enumerable: true, get: function () { return events_1.Emitter; } });\nconst cancellation_1 = require(\"./cancellation\");\nObject.defineProperty(exports, \"CancellationTokenSource\", { enumerable: true, get: function () { return cancellation_1.CancellationTokenSource; } });\nObject.defineProperty(exports, \"CancellationToken\", { enumerable: true, get: function () { return cancellation_1.CancellationToken; } });\nconst sharedArrayCancellation_1 = require(\"./sharedArrayCancellation\");\nObject.defineProperty(exports, \"SharedArraySenderStrategy\", { enumerable: true, get: function () { return sharedArrayCancellation_1.SharedArraySenderStrategy; } });\nObject.defineProperty(exports, \"SharedArrayReceiverStrategy\", { enumerable: true, get: function () { return sharedArrayCancellation_1.SharedArrayReceiverStrategy; } });\nconst messageReader_1 = require(\"./messageReader\");\nObject.defineProperty(exports, \"MessageReader\", { enumerable: true, get: function () { return messageReader_1.MessageReader; } });\nObject.defineProperty(exports, \"AbstractMessageReader\", { enumerable: true, get: function () { return messageReader_1.AbstractMessageReader; } });\nObject.defineProperty(exports, \"ReadableStreamMessageReader\", { enumerable: true, get: function () { return messageReader_1.ReadableStreamMessageReader; } });\nconst messageWriter_1 = require(\"./messageWriter\");\nObject.defineProperty(exports, \"MessageWriter\", { enumerable: true, get: function () { return messageWriter_1.MessageWriter; } });\nObject.defineProperty(exports, \"AbstractMessageWriter\", { enumerable: true, get: function () { return messageWriter_1.AbstractMessageWriter; } });\nObject.defineProperty(exports, \"WriteableStreamMessageWriter\", { enumerable: true, get: function () { return messageWriter_1.WriteableStreamMessageWriter; } });\nconst messageBuffer_1 = require(\"./messageBuffer\");\nObject.defineProperty(exports, \"AbstractMessageBuffer\", { enumerable: true, get: function () { return messageBuffer_1.AbstractMessageBuffer; } });\nconst connection_1 = require(\"./connection\");\nObject.defineProperty(exports, \"ConnectionStrategy\", { enumerable: true, get: function () { return connection_1.ConnectionStrategy; } });\nObject.defineProperty(exports, \"ConnectionOptions\", { enumerable: true, get: function () { return connection_1.ConnectionOptions; } });\nObject.defineProperty(exports, \"NullLogger\", { enumerable: true, get: function () { return connection_1.NullLogger; } });\nObject.defineProperty(exports, \"createMessageConnection\", { enumerable: true, get: function () { return connection_1.createMessageConnection; } });\nObject.defineProperty(exports, \"ProgressToken\", { enumerable: true, get: function () { return connection_1.ProgressToken; } });\nObject.defineProperty(exports, \"ProgressType\", { enumerable: true, get: function () { return connection_1.ProgressType; } });\nObject.defineProperty(exports, \"Trace\", { enumerable: true, get: function () { return connection_1.Trace; } });\nObject.defineProperty(exports, \"TraceValues\", { enumerable: true, get: function () { return connection_1.TraceValues; } });\nObject.defineProperty(exports, \"TraceFormat\", { enumerable: true, get: function () { return connection_1.TraceFormat; } });\nObject.defineProperty(exports, \"SetTraceNotification\", { enumerable: true, get: function () { return connection_1.SetTraceNotification; } });\nObject.defineProperty(exports, \"LogTraceNotification\", { enumerable: true, get: function () { return connection_1.LogTraceNotification; } });\nObject.defineProperty(exports, \"ConnectionErrors\", { enumerable: true, get: function () { return connection_1.ConnectionErrors; } });\nObject.defineProperty(exports, \"ConnectionError\", { enumerable: true, get: function () { return connection_1.ConnectionError; } });\nObject.defineProperty(exports, \"CancellationReceiverStrategy\", { enumerable: true, get: function () { return connection_1.CancellationReceiverStrategy; } });\nObject.defineProperty(exports, \"CancellationSenderStrategy\", { enumerable: true, get: function () { return connection_1.CancellationSenderStrategy; } });\nObject.defineProperty(exports, \"CancellationStrategy\", { enumerable: true, get: function () { return connection_1.CancellationStrategy; } });\nObject.defineProperty(exports, \"MessageStrategy\", { enumerable: true, get: function () { return connection_1.MessageStrategy; } });\nconst ral_1 = require(\"./ral\");\nexports.RAL = ral_1.default;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst util_1 = require(\"util\");\nconst api_1 = require(\"../common/api\");\nclass MessageBuffer extends api_1.AbstractMessageBuffer {\n constructor(encoding = 'utf-8') {\n super(encoding);\n }\n emptyBuffer() {\n return MessageBuffer.emptyBuffer;\n }\n fromString(value, encoding) {\n return Buffer.from(value, encoding);\n }\n toString(value, encoding) {\n if (value instanceof Buffer) {\n return value.toString(encoding);\n }\n else {\n return new util_1.TextDecoder(encoding).decode(value);\n }\n }\n asNative(buffer, length) {\n if (length === undefined) {\n return buffer instanceof Buffer ? buffer : Buffer.from(buffer);\n }\n else {\n return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer, 0, length);\n }\n }\n allocNative(length) {\n return Buffer.allocUnsafe(length);\n }\n}\nMessageBuffer.emptyBuffer = Buffer.allocUnsafe(0);\nclass ReadableStreamWrapper {\n constructor(stream) {\n this.stream = stream;\n }\n onClose(listener) {\n this.stream.on('close', listener);\n return api_1.Disposable.create(() => this.stream.off('close', listener));\n }\n onError(listener) {\n this.stream.on('error', listener);\n return api_1.Disposable.create(() => this.stream.off('error', listener));\n }\n onEnd(listener) {\n this.stream.on('end', listener);\n return api_1.Disposable.create(() => this.stream.off('end', listener));\n }\n onData(listener) {\n this.stream.on('data', listener);\n return api_1.Disposable.create(() => this.stream.off('data', listener));\n }\n}\nclass WritableStreamWrapper {\n constructor(stream) {\n this.stream = stream;\n }\n onClose(listener) {\n this.stream.on('close', listener);\n return api_1.Disposable.create(() => this.stream.off('close', listener));\n }\n onError(listener) {\n this.stream.on('error', listener);\n return api_1.Disposable.create(() => this.stream.off('error', listener));\n }\n onEnd(listener) {\n this.stream.on('end', listener);\n return api_1.Disposable.create(() => this.stream.off('end', listener));\n }\n write(data, encoding) {\n return new Promise((resolve, reject) => {\n const callback = (error) => {\n if (error === undefined || error === null) {\n resolve();\n }\n else {\n reject(error);\n }\n };\n if (typeof data === 'string') {\n this.stream.write(data, encoding, callback);\n }\n else {\n this.stream.write(data, callback);\n }\n });\n }\n end() {\n this.stream.end();\n }\n}\nconst _ril = Object.freeze({\n messageBuffer: Object.freeze({\n create: (encoding) => new MessageBuffer(encoding)\n }),\n applicationJson: Object.freeze({\n encoder: Object.freeze({\n name: 'application/json',\n encode: (msg, options) => {\n try {\n return Promise.resolve(Buffer.from(JSON.stringify(msg, undefined, 0), options.charset));\n }\n catch (err) {\n return Promise.reject(err);\n }\n }\n }),\n decoder: Object.freeze({\n name: 'application/json',\n decode: (buffer, options) => {\n try {\n if (buffer instanceof Buffer) {\n return Promise.resolve(JSON.parse(buffer.toString(options.charset)));\n }\n else {\n return Promise.resolve(JSON.parse(new util_1.TextDecoder(options.charset).decode(buffer)));\n }\n }\n catch (err) {\n return Promise.reject(err);\n }\n }\n })\n }),\n stream: Object.freeze({\n asReadableStream: (stream) => new ReadableStreamWrapper(stream),\n asWritableStream: (stream) => new WritableStreamWrapper(stream)\n }),\n console: console,\n timer: Object.freeze({\n setTimeout(callback, ms, ...args) {\n const handle = setTimeout(callback, ms, ...args);\n return { dispose: () => clearTimeout(handle) };\n },\n setImmediate(callback, ...args) {\n const handle = setImmediate(callback, ...args);\n return { dispose: () => clearImmediate(handle) };\n },\n setInterval(callback, ms, ...args) {\n const handle = setInterval(callback, ms, ...args);\n return { dispose: () => clearInterval(handle) };\n }\n })\n});\nfunction RIL() {\n return _ril;\n}\n(function (RIL) {\n function install() {\n api_1.RAL.install(_ril);\n }\n RIL.install = install;\n})(RIL || (RIL = {}));\nexports.default = RIL;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createMessageConnection = exports.createServerSocketTransport = exports.createClientSocketTransport = exports.createServerPipeTransport = exports.createClientPipeTransport = exports.generateRandomPipeName = exports.StreamMessageWriter = exports.StreamMessageReader = exports.SocketMessageWriter = exports.SocketMessageReader = exports.PortMessageWriter = exports.PortMessageReader = exports.IPCMessageWriter = exports.IPCMessageReader = void 0;\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ----------------------------------------------------------------------------------------- */\nconst ril_1 = require(\"./ril\");\n// Install the node runtime abstract.\nril_1.default.install();\nconst path = require(\"path\");\nconst os = require(\"os\");\nconst crypto_1 = require(\"crypto\");\nconst net_1 = require(\"net\");\nconst api_1 = require(\"../common/api\");\n__exportStar(require(\"../common/api\"), exports);\nclass IPCMessageReader extends api_1.AbstractMessageReader {\n constructor(process) {\n super();\n this.process = process;\n let eventEmitter = this.process;\n eventEmitter.on('error', (error) => this.fireError(error));\n eventEmitter.on('close', () => this.fireClose());\n }\n listen(callback) {\n this.process.on('message', callback);\n return api_1.Disposable.create(() => this.process.off('message', callback));\n }\n}\nexports.IPCMessageReader = IPCMessageReader;\nclass IPCMessageWriter extends api_1.AbstractMessageWriter {\n constructor(process) {\n super();\n this.process = process;\n this.errorCount = 0;\n const eventEmitter = this.process;\n eventEmitter.on('error', (error) => this.fireError(error));\n eventEmitter.on('close', () => this.fireClose);\n }\n write(msg) {\n try {\n if (typeof this.process.send === 'function') {\n this.process.send(msg, undefined, undefined, (error) => {\n if (error) {\n this.errorCount++;\n this.handleError(error, msg);\n }\n else {\n this.errorCount = 0;\n }\n });\n }\n return Promise.resolve();\n }\n catch (error) {\n this.handleError(error, msg);\n return Promise.reject(error);\n }\n }\n handleError(error, msg) {\n this.errorCount++;\n this.fireError(error, msg, this.errorCount);\n }\n end() {\n }\n}\nexports.IPCMessageWriter = IPCMessageWriter;\nclass PortMessageReader extends api_1.AbstractMessageReader {\n constructor(port) {\n super();\n this.onData = new api_1.Emitter;\n port.on('close', () => this.fireClose);\n port.on('error', (error) => this.fireError(error));\n port.on('message', (message) => {\n this.onData.fire(message);\n });\n }\n listen(callback) {\n return this.onData.event(callback);\n }\n}\nexports.PortMessageReader = PortMessageReader;\nclass PortMessageWriter extends api_1.AbstractMessageWriter {\n constructor(port) {\n super();\n this.port = port;\n this.errorCount = 0;\n port.on('close', () => this.fireClose());\n port.on('error', (error) => this.fireError(error));\n }\n write(msg) {\n try {\n this.port.postMessage(msg);\n return Promise.resolve();\n }\n catch (error) {\n this.handleError(error, msg);\n return Promise.reject(error);\n }\n }\n handleError(error, msg) {\n this.errorCount++;\n this.fireError(error, msg, this.errorCount);\n }\n end() {\n }\n}\nexports.PortMessageWriter = PortMessageWriter;\nclass SocketMessageReader extends api_1.ReadableStreamMessageReader {\n constructor(socket, encoding = 'utf-8') {\n super((0, ril_1.default)().stream.asReadableStream(socket), encoding);\n }\n}\nexports.SocketMessageReader = SocketMessageReader;\nclass SocketMessageWriter extends api_1.WriteableStreamMessageWriter {\n constructor(socket, options) {\n super((0, ril_1.default)().stream.asWritableStream(socket), options);\n this.socket = socket;\n }\n dispose() {\n super.dispose();\n this.socket.destroy();\n }\n}\nexports.SocketMessageWriter = SocketMessageWriter;\nclass StreamMessageReader extends api_1.ReadableStreamMessageReader {\n constructor(readable, encoding) {\n super((0, ril_1.default)().stream.asReadableStream(readable), encoding);\n }\n}\nexports.StreamMessageReader = StreamMessageReader;\nclass StreamMessageWriter extends api_1.WriteableStreamMessageWriter {\n constructor(writable, options) {\n super((0, ril_1.default)().stream.asWritableStream(writable), options);\n }\n}\nexports.StreamMessageWriter = StreamMessageWriter;\nconst XDG_RUNTIME_DIR = process.env['XDG_RUNTIME_DIR'];\nconst safeIpcPathLengths = new Map([\n ['linux', 107],\n ['darwin', 103]\n]);\nfunction generateRandomPipeName() {\n const randomSuffix = (0, crypto_1.randomBytes)(21).toString('hex');\n if (process.platform === 'win32') {\n return `\\\\\\\\.\\\\pipe\\\\vscode-jsonrpc-${randomSuffix}-sock`;\n }\n let result;\n if (XDG_RUNTIME_DIR) {\n result = path.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`);\n }\n else {\n result = path.join(os.tmpdir(), `vscode-${randomSuffix}.sock`);\n }\n const limit = safeIpcPathLengths.get(process.platform);\n if (limit !== undefined && result.length > limit) {\n (0, ril_1.default)().console.warn(`WARNING: IPC handle \"${result}\" is longer than ${limit} characters.`);\n }\n return result;\n}\nexports.generateRandomPipeName = generateRandomPipeName;\nfunction createClientPipeTransport(pipeName, encoding = 'utf-8') {\n let connectResolve;\n const connected = new Promise((resolve, _reject) => {\n connectResolve = resolve;\n });\n return new Promise((resolve, reject) => {\n let server = (0, net_1.createServer)((socket) => {\n server.close();\n connectResolve([\n new SocketMessageReader(socket, encoding),\n new SocketMessageWriter(socket, encoding)\n ]);\n });\n server.on('error', reject);\n server.listen(pipeName, () => {\n server.removeListener('error', reject);\n resolve({\n onConnected: () => { return connected; }\n });\n });\n });\n}\nexports.createClientPipeTransport = createClientPipeTransport;\nfunction createServerPipeTransport(pipeName, encoding = 'utf-8') {\n const socket = (0, net_1.createConnection)(pipeName);\n return [\n new SocketMessageReader(socket, encoding),\n new SocketMessageWriter(socket, encoding)\n ];\n}\nexports.createServerPipeTransport = createServerPipeTransport;\nfunction createClientSocketTransport(port, encoding = 'utf-8') {\n let connectResolve;\n const connected = new Promise((resolve, _reject) => {\n connectResolve = resolve;\n });\n return new Promise((resolve, reject) => {\n const server = (0, net_1.createServer)((socket) => {\n server.close();\n connectResolve([\n new SocketMessageReader(socket, encoding),\n new SocketMessageWriter(socket, encoding)\n ]);\n });\n server.on('error', reject);\n server.listen(port, '127.0.0.1', () => {\n server.removeListener('error', reject);\n resolve({\n onConnected: () => { return connected; }\n });\n });\n });\n}\nexports.createClientSocketTransport = createClientSocketTransport;\nfunction createServerSocketTransport(port, encoding = 'utf-8') {\n const socket = (0, net_1.createConnection)(port, '127.0.0.1');\n return [\n new SocketMessageReader(socket, encoding),\n new SocketMessageWriter(socket, encoding)\n ];\n}\nexports.createServerSocketTransport = createServerSocketTransport;\nfunction isReadableStream(value) {\n const candidate = value;\n return candidate.read !== undefined && candidate.addListener !== undefined;\n}\nfunction isWritableStream(value) {\n const candidate = value;\n return candidate.write !== undefined && candidate.addListener !== undefined;\n}\nfunction createMessageConnection(input, output, logger, options) {\n if (!logger) {\n logger = api_1.NullLogger;\n }\n const reader = isReadableStream(input) ? new StreamMessageReader(input) : input;\n const writer = isWritableStream(output) ? new StreamMessageWriter(output) : output;\n if (api_1.ConnectionStrategy.is(options)) {\n options = { connectionStrategy: options };\n }\n return (0, api_1.createMessageConnection)(reader, writer, logger, options);\n}\nexports.createMessageConnection = createMessageConnection;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ----------------------------------------------------------------------------------------- */\n'use strict';\n\nmodule.exports = require('./lib/node/main');","(function (factory) {\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n var v = factory(require, exports);\n if (v !== undefined) module.exports = v;\n }\n else if (typeof define === \"function\" && define.amd) {\n define([\"require\", \"exports\"], factory);\n }\n})(function (require, exports) {\n /* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n 'use strict';\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.TextDocument = exports.EOL = exports.WorkspaceFolder = exports.InlineCompletionContext = exports.SelectedCompletionInfo = exports.InlineCompletionTriggerKind = exports.InlineCompletionList = exports.InlineCompletionItem = exports.StringValue = exports.InlayHint = exports.InlayHintLabelPart = exports.InlayHintKind = exports.InlineValueContext = exports.InlineValueEvaluatableExpression = exports.InlineValueVariableLookup = exports.InlineValueText = exports.SemanticTokens = exports.SemanticTokenModifiers = exports.SemanticTokenTypes = exports.SelectionRange = exports.DocumentLink = exports.FormattingOptions = exports.CodeLens = exports.CodeAction = exports.CodeActionContext = exports.CodeActionTriggerKind = exports.CodeActionKind = exports.DocumentSymbol = exports.WorkspaceSymbol = exports.SymbolInformation = exports.SymbolTag = exports.SymbolKind = exports.DocumentHighlight = exports.DocumentHighlightKind = exports.SignatureInformation = exports.ParameterInformation = exports.Hover = exports.MarkedString = exports.CompletionList = exports.CompletionItem = exports.CompletionItemLabelDetails = exports.InsertTextMode = exports.InsertReplaceEdit = exports.CompletionItemTag = exports.InsertTextFormat = exports.CompletionItemKind = exports.MarkupContent = exports.MarkupKind = exports.TextDocumentItem = exports.OptionalVersionedTextDocumentIdentifier = exports.VersionedTextDocumentIdentifier = exports.TextDocumentIdentifier = exports.WorkspaceChange = exports.WorkspaceEdit = exports.DeleteFile = exports.RenameFile = exports.CreateFile = exports.TextDocumentEdit = exports.AnnotatedTextEdit = exports.ChangeAnnotationIdentifier = exports.ChangeAnnotation = exports.TextEdit = exports.Command = exports.Diagnostic = exports.CodeDescription = exports.DiagnosticTag = exports.DiagnosticSeverity = exports.DiagnosticRelatedInformation = exports.FoldingRange = exports.FoldingRangeKind = exports.ColorPresentation = exports.ColorInformation = exports.Color = exports.LocationLink = exports.Location = exports.Range = exports.Position = exports.uinteger = exports.integer = exports.URI = exports.DocumentUri = void 0;\n var DocumentUri;\n (function (DocumentUri) {\n function is(value) {\n return typeof value === 'string';\n }\n DocumentUri.is = is;\n })(DocumentUri || (exports.DocumentUri = DocumentUri = {}));\n var URI;\n (function (URI) {\n function is(value) {\n return typeof value === 'string';\n }\n URI.is = is;\n })(URI || (exports.URI = URI = {}));\n var integer;\n (function (integer) {\n integer.MIN_VALUE = -2147483648;\n integer.MAX_VALUE = 2147483647;\n function is(value) {\n return typeof value === 'number' && integer.MIN_VALUE <= value && value <= integer.MAX_VALUE;\n }\n integer.is = is;\n })(integer || (exports.integer = integer = {}));\n var uinteger;\n (function (uinteger) {\n uinteger.MIN_VALUE = 0;\n uinteger.MAX_VALUE = 2147483647;\n function is(value) {\n return typeof value === 'number' && uinteger.MIN_VALUE <= value && value <= uinteger.MAX_VALUE;\n }\n uinteger.is = is;\n })(uinteger || (exports.uinteger = uinteger = {}));\n /**\n * The Position namespace provides helper functions to work with\n * {@link Position} literals.\n */\n var Position;\n (function (Position) {\n /**\n * Creates a new Position literal from the given line and character.\n * @param line The position's line.\n * @param character The position's character.\n */\n function create(line, character) {\n if (line === Number.MAX_VALUE) {\n line = uinteger.MAX_VALUE;\n }\n if (character === Number.MAX_VALUE) {\n character = uinteger.MAX_VALUE;\n }\n return { line: line, character: character };\n }\n Position.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Position} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);\n }\n Position.is = is;\n })(Position || (exports.Position = Position = {}));\n /**\n * The Range namespace provides helper functions to work with\n * {@link Range} literals.\n */\n var Range;\n (function (Range) {\n function create(one, two, three, four) {\n if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {\n return { start: Position.create(one, two), end: Position.create(three, four) };\n }\n else if (Position.is(one) && Position.is(two)) {\n return { start: one, end: two };\n }\n else {\n throw new Error(\"Range#create called with invalid arguments[\".concat(one, \", \").concat(two, \", \").concat(three, \", \").concat(four, \"]\"));\n }\n }\n Range.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Range} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }\n Range.is = is;\n })(Range || (exports.Range = Range = {}));\n /**\n * The Location namespace provides helper functions to work with\n * {@link Location} literals.\n */\n var Location;\n (function (Location) {\n /**\n * Creates a Location literal.\n * @param uri The location's uri.\n * @param range The location's range.\n */\n function create(uri, range) {\n return { uri: uri, range: range };\n }\n Location.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Location} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));\n }\n Location.is = is;\n })(Location || (exports.Location = Location = {}));\n /**\n * The LocationLink namespace provides helper functions to work with\n * {@link LocationLink} literals.\n */\n var LocationLink;\n (function (LocationLink) {\n /**\n * Creates a LocationLink literal.\n * @param targetUri The definition's uri.\n * @param targetRange The full range of the definition.\n * @param targetSelectionRange The span of the symbol definition at the target.\n * @param originSelectionRange The span of the symbol being defined in the originating source file.\n */\n function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {\n return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };\n }\n LocationLink.create = create;\n /**\n * Checks whether the given literal conforms to the {@link LocationLink} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)\n && Range.is(candidate.targetSelectionRange)\n && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));\n }\n LocationLink.is = is;\n })(LocationLink || (exports.LocationLink = LocationLink = {}));\n /**\n * The Color namespace provides helper functions to work with\n * {@link Color} literals.\n */\n var Color;\n (function (Color) {\n /**\n * Creates a new Color literal.\n */\n function create(red, green, blue, alpha) {\n return {\n red: red,\n green: green,\n blue: blue,\n alpha: alpha,\n };\n }\n Color.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Color} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1)\n && Is.numberRange(candidate.green, 0, 1)\n && Is.numberRange(candidate.blue, 0, 1)\n && Is.numberRange(candidate.alpha, 0, 1);\n }\n Color.is = is;\n })(Color || (exports.Color = Color = {}));\n /**\n * The ColorInformation namespace provides helper functions to work with\n * {@link ColorInformation} literals.\n */\n var ColorInformation;\n (function (ColorInformation) {\n /**\n * Creates a new ColorInformation literal.\n */\n function create(range, color) {\n return {\n range: range,\n color: color,\n };\n }\n ColorInformation.create = create;\n /**\n * Checks whether the given literal conforms to the {@link ColorInformation} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);\n }\n ColorInformation.is = is;\n })(ColorInformation || (exports.ColorInformation = ColorInformation = {}));\n /**\n * The Color namespace provides helper functions to work with\n * {@link ColorPresentation} literals.\n */\n var ColorPresentation;\n (function (ColorPresentation) {\n /**\n * Creates a new ColorInformation literal.\n */\n function create(label, textEdit, additionalTextEdits) {\n return {\n label: label,\n textEdit: textEdit,\n additionalTextEdits: additionalTextEdits,\n };\n }\n ColorPresentation.create = create;\n /**\n * Checks whether the given literal conforms to the {@link ColorInformation} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.label)\n && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))\n && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));\n }\n ColorPresentation.is = is;\n })(ColorPresentation || (exports.ColorPresentation = ColorPresentation = {}));\n /**\n * A set of predefined range kinds.\n */\n var FoldingRangeKind;\n (function (FoldingRangeKind) {\n /**\n * Folding range for a comment\n */\n FoldingRangeKind.Comment = 'comment';\n /**\n * Folding range for an import or include\n */\n FoldingRangeKind.Imports = 'imports';\n /**\n * Folding range for a region (e.g. `#region`)\n */\n FoldingRangeKind.Region = 'region';\n })(FoldingRangeKind || (exports.FoldingRangeKind = FoldingRangeKind = {}));\n /**\n * The folding range namespace provides helper functions to work with\n * {@link FoldingRange} literals.\n */\n var FoldingRange;\n (function (FoldingRange) {\n /**\n * Creates a new FoldingRange literal.\n */\n function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {\n var result = {\n startLine: startLine,\n endLine: endLine\n };\n if (Is.defined(startCharacter)) {\n result.startCharacter = startCharacter;\n }\n if (Is.defined(endCharacter)) {\n result.endCharacter = endCharacter;\n }\n if (Is.defined(kind)) {\n result.kind = kind;\n }\n if (Is.defined(collapsedText)) {\n result.collapsedText = collapsedText;\n }\n return result;\n }\n FoldingRange.create = create;\n /**\n * Checks whether the given literal conforms to the {@link FoldingRange} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine)\n && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))\n && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))\n && (Is.undefined(candidate.kind) || Is.string(candidate.kind));\n }\n FoldingRange.is = is;\n })(FoldingRange || (exports.FoldingRange = FoldingRange = {}));\n /**\n * The DiagnosticRelatedInformation namespace provides helper functions to work with\n * {@link DiagnosticRelatedInformation} literals.\n */\n var DiagnosticRelatedInformation;\n (function (DiagnosticRelatedInformation) {\n /**\n * Creates a new DiagnosticRelatedInformation literal.\n */\n function create(location, message) {\n return {\n location: location,\n message: message\n };\n }\n DiagnosticRelatedInformation.create = create;\n /**\n * Checks whether the given literal conforms to the {@link DiagnosticRelatedInformation} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);\n }\n DiagnosticRelatedInformation.is = is;\n })(DiagnosticRelatedInformation || (exports.DiagnosticRelatedInformation = DiagnosticRelatedInformation = {}));\n /**\n * The diagnostic's severity.\n */\n var DiagnosticSeverity;\n (function (DiagnosticSeverity) {\n /**\n * Reports an error.\n */\n DiagnosticSeverity.Error = 1;\n /**\n * Reports a warning.\n */\n DiagnosticSeverity.Warning = 2;\n /**\n * Reports an information.\n */\n DiagnosticSeverity.Information = 3;\n /**\n * Reports a hint.\n */\n DiagnosticSeverity.Hint = 4;\n })(DiagnosticSeverity || (exports.DiagnosticSeverity = DiagnosticSeverity = {}));\n /**\n * The diagnostic tags.\n *\n * @since 3.15.0\n */\n var DiagnosticTag;\n (function (DiagnosticTag) {\n /**\n * Unused or unnecessary code.\n *\n * Clients are allowed to render diagnostics with this tag faded out instead of having\n * an error squiggle.\n */\n DiagnosticTag.Unnecessary = 1;\n /**\n * Deprecated or obsolete code.\n *\n * Clients are allowed to rendered diagnostics with this tag strike through.\n */\n DiagnosticTag.Deprecated = 2;\n })(DiagnosticTag || (exports.DiagnosticTag = DiagnosticTag = {}));\n /**\n * The CodeDescription namespace provides functions to deal with descriptions for diagnostic codes.\n *\n * @since 3.16.0\n */\n var CodeDescription;\n (function (CodeDescription) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.href);\n }\n CodeDescription.is = is;\n })(CodeDescription || (exports.CodeDescription = CodeDescription = {}));\n /**\n * The Diagnostic namespace provides helper functions to work with\n * {@link Diagnostic} literals.\n */\n var Diagnostic;\n (function (Diagnostic) {\n /**\n * Creates a new Diagnostic literal.\n */\n function create(range, message, severity, code, source, relatedInformation) {\n var result = { range: range, message: message };\n if (Is.defined(severity)) {\n result.severity = severity;\n }\n if (Is.defined(code)) {\n result.code = code;\n }\n if (Is.defined(source)) {\n result.source = source;\n }\n if (Is.defined(relatedInformation)) {\n result.relatedInformation = relatedInformation;\n }\n return result;\n }\n Diagnostic.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Diagnostic} interface.\n */\n function is(value) {\n var _a;\n var candidate = value;\n return Is.defined(candidate)\n && Range.is(candidate.range)\n && Is.string(candidate.message)\n && (Is.number(candidate.severity) || Is.undefined(candidate.severity))\n && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))\n && (Is.undefined(candidate.codeDescription) || (Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)))\n && (Is.string(candidate.source) || Is.undefined(candidate.source))\n && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));\n }\n Diagnostic.is = is;\n })(Diagnostic || (exports.Diagnostic = Diagnostic = {}));\n /**\n * The Command namespace provides helper functions to work with\n * {@link Command} literals.\n */\n var Command;\n (function (Command) {\n /**\n * Creates a new Command literal.\n */\n function create(title, command) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var result = { title: title, command: command };\n if (Is.defined(args) && args.length > 0) {\n result.arguments = args;\n }\n return result;\n }\n Command.create = create;\n /**\n * Checks whether the given literal conforms to the {@link Command} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);\n }\n Command.is = is;\n })(Command || (exports.Command = Command = {}));\n /**\n * The TextEdit namespace provides helper function to create replace,\n * insert and delete edits more easily.\n */\n var TextEdit;\n (function (TextEdit) {\n /**\n * Creates a replace text edit.\n * @param range The range of text to be replaced.\n * @param newText The new text.\n */\n function replace(range, newText) {\n return { range: range, newText: newText };\n }\n TextEdit.replace = replace;\n /**\n * Creates an insert text edit.\n * @param position The position to insert the text at.\n * @param newText The text to be inserted.\n */\n function insert(position, newText) {\n return { range: { start: position, end: position }, newText: newText };\n }\n TextEdit.insert = insert;\n /**\n * Creates a delete text edit.\n * @param range The range of text to be deleted.\n */\n function del(range) {\n return { range: range, newText: '' };\n }\n TextEdit.del = del;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate)\n && Is.string(candidate.newText)\n && Range.is(candidate.range);\n }\n TextEdit.is = is;\n })(TextEdit || (exports.TextEdit = TextEdit = {}));\n var ChangeAnnotation;\n (function (ChangeAnnotation) {\n function create(label, needsConfirmation, description) {\n var result = { label: label };\n if (needsConfirmation !== undefined) {\n result.needsConfirmation = needsConfirmation;\n }\n if (description !== undefined) {\n result.description = description;\n }\n return result;\n }\n ChangeAnnotation.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.label) &&\n (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) &&\n (Is.string(candidate.description) || candidate.description === undefined);\n }\n ChangeAnnotation.is = is;\n })(ChangeAnnotation || (exports.ChangeAnnotation = ChangeAnnotation = {}));\n var ChangeAnnotationIdentifier;\n (function (ChangeAnnotationIdentifier) {\n function is(value) {\n var candidate = value;\n return Is.string(candidate);\n }\n ChangeAnnotationIdentifier.is = is;\n })(ChangeAnnotationIdentifier || (exports.ChangeAnnotationIdentifier = ChangeAnnotationIdentifier = {}));\n var AnnotatedTextEdit;\n (function (AnnotatedTextEdit) {\n /**\n * Creates an annotated replace text edit.\n *\n * @param range The range of text to be replaced.\n * @param newText The new text.\n * @param annotation The annotation.\n */\n function replace(range, newText, annotation) {\n return { range: range, newText: newText, annotationId: annotation };\n }\n AnnotatedTextEdit.replace = replace;\n /**\n * Creates an annotated insert text edit.\n *\n * @param position The position to insert the text at.\n * @param newText The text to be inserted.\n * @param annotation The annotation.\n */\n function insert(position, newText, annotation) {\n return { range: { start: position, end: position }, newText: newText, annotationId: annotation };\n }\n AnnotatedTextEdit.insert = insert;\n /**\n * Creates an annotated delete text edit.\n *\n * @param range The range of text to be deleted.\n * @param annotation The annotation.\n */\n function del(range, annotation) {\n return { range: range, newText: '', annotationId: annotation };\n }\n AnnotatedTextEdit.del = del;\n function is(value) {\n var candidate = value;\n return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n AnnotatedTextEdit.is = is;\n })(AnnotatedTextEdit || (exports.AnnotatedTextEdit = AnnotatedTextEdit = {}));\n /**\n * The TextDocumentEdit namespace provides helper function to create\n * an edit that manipulates a text document.\n */\n var TextDocumentEdit;\n (function (TextDocumentEdit) {\n /**\n * Creates a new `TextDocumentEdit`\n */\n function create(textDocument, edits) {\n return { textDocument: textDocument, edits: edits };\n }\n TextDocumentEdit.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate)\n && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument)\n && Array.isArray(candidate.edits);\n }\n TextDocumentEdit.is = is;\n })(TextDocumentEdit || (exports.TextDocumentEdit = TextDocumentEdit = {}));\n var CreateFile;\n (function (CreateFile) {\n function create(uri, options, annotation) {\n var result = {\n kind: 'create',\n uri: uri\n };\n if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n CreateFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined ||\n ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n CreateFile.is = is;\n })(CreateFile || (exports.CreateFile = CreateFile = {}));\n var RenameFile;\n (function (RenameFile) {\n function create(oldUri, newUri, options, annotation) {\n var result = {\n kind: 'rename',\n oldUri: oldUri,\n newUri: newUri\n };\n if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n RenameFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined ||\n ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n RenameFile.is = is;\n })(RenameFile || (exports.RenameFile = RenameFile = {}));\n var DeleteFile;\n (function (DeleteFile) {\n function create(uri, options, annotation) {\n var result = {\n kind: 'delete',\n uri: uri\n };\n if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n DeleteFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined ||\n ((candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n DeleteFile.is = is;\n })(DeleteFile || (exports.DeleteFile = DeleteFile = {}));\n var WorkspaceEdit;\n (function (WorkspaceEdit) {\n function is(value) {\n var candidate = value;\n return candidate &&\n (candidate.changes !== undefined || candidate.documentChanges !== undefined) &&\n (candidate.documentChanges === undefined || candidate.documentChanges.every(function (change) {\n if (Is.string(change.kind)) {\n return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);\n }\n else {\n return TextDocumentEdit.is(change);\n }\n }));\n }\n WorkspaceEdit.is = is;\n })(WorkspaceEdit || (exports.WorkspaceEdit = WorkspaceEdit = {}));\n var TextEditChangeImpl = /** @class */ (function () {\n function TextEditChangeImpl(edits, changeAnnotations) {\n this.edits = edits;\n this.changeAnnotations = changeAnnotations;\n }\n TextEditChangeImpl.prototype.insert = function (position, newText, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.insert(position, newText);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.insert(position, newText, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.insert(position, newText, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.replace = function (range, newText, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.replace(range, newText);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.replace(range, newText, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.replace(range, newText, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.delete = function (range, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.del(range);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.del(range, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.del(range, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.add = function (edit) {\n this.edits.push(edit);\n };\n TextEditChangeImpl.prototype.all = function () {\n return this.edits;\n };\n TextEditChangeImpl.prototype.clear = function () {\n this.edits.splice(0, this.edits.length);\n };\n TextEditChangeImpl.prototype.assertChangeAnnotations = function (value) {\n if (value === undefined) {\n throw new Error(\"Text edit change is not configured to manage change annotations.\");\n }\n };\n return TextEditChangeImpl;\n }());\n /**\n * A helper class\n */\n var ChangeAnnotations = /** @class */ (function () {\n function ChangeAnnotations(annotations) {\n this._annotations = annotations === undefined ? Object.create(null) : annotations;\n this._counter = 0;\n this._size = 0;\n }\n ChangeAnnotations.prototype.all = function () {\n return this._annotations;\n };\n Object.defineProperty(ChangeAnnotations.prototype, \"size\", {\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) {\n var id;\n if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {\n id = idOrAnnotation;\n }\n else {\n id = this.nextId();\n annotation = idOrAnnotation;\n }\n if (this._annotations[id] !== undefined) {\n throw new Error(\"Id \".concat(id, \" is already in use.\"));\n }\n if (annotation === undefined) {\n throw new Error(\"No annotation provided for id \".concat(id));\n }\n this._annotations[id] = annotation;\n this._size++;\n return id;\n };\n ChangeAnnotations.prototype.nextId = function () {\n this._counter++;\n return this._counter.toString();\n };\n return ChangeAnnotations;\n }());\n /**\n * A workspace change helps constructing changes to a workspace.\n */\n var WorkspaceChange = /** @class */ (function () {\n function WorkspaceChange(workspaceEdit) {\n var _this = this;\n this._textEditChanges = Object.create(null);\n if (workspaceEdit !== undefined) {\n this._workspaceEdit = workspaceEdit;\n if (workspaceEdit.documentChanges) {\n this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);\n workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n workspaceEdit.documentChanges.forEach(function (change) {\n if (TextDocumentEdit.is(change)) {\n var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);\n _this._textEditChanges[change.textDocument.uri] = textEditChange;\n }\n });\n }\n else if (workspaceEdit.changes) {\n Object.keys(workspaceEdit.changes).forEach(function (key) {\n var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);\n _this._textEditChanges[key] = textEditChange;\n });\n }\n }\n else {\n this._workspaceEdit = {};\n }\n }\n Object.defineProperty(WorkspaceChange.prototype, \"edit\", {\n /**\n * Returns the underlying {@link WorkspaceEdit} literal\n * use to be returned from a workspace edit operation like rename.\n */\n get: function () {\n this.initDocumentChanges();\n if (this._changeAnnotations !== undefined) {\n if (this._changeAnnotations.size === 0) {\n this._workspaceEdit.changeAnnotations = undefined;\n }\n else {\n this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n }\n }\n return this._workspaceEdit;\n },\n enumerable: false,\n configurable: true\n });\n WorkspaceChange.prototype.getTextEditChange = function (key) {\n if (OptionalVersionedTextDocumentIdentifier.is(key)) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var textDocument = { uri: key.uri, version: key.version };\n var result = this._textEditChanges[textDocument.uri];\n if (!result) {\n var edits = [];\n var textDocumentEdit = {\n textDocument: textDocument,\n edits: edits\n };\n this._workspaceEdit.documentChanges.push(textDocumentEdit);\n result = new TextEditChangeImpl(edits, this._changeAnnotations);\n this._textEditChanges[textDocument.uri] = result;\n }\n return result;\n }\n else {\n this.initChanges();\n if (this._workspaceEdit.changes === undefined) {\n throw new Error('Workspace edit is not configured for normal text edit changes.');\n }\n var result = this._textEditChanges[key];\n if (!result) {\n var edits = [];\n this._workspaceEdit.changes[key] = edits;\n result = new TextEditChangeImpl(edits);\n this._textEditChanges[key] = result;\n }\n return result;\n }\n };\n WorkspaceChange.prototype.initDocumentChanges = function () {\n if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {\n this._changeAnnotations = new ChangeAnnotations();\n this._workspaceEdit.documentChanges = [];\n this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n }\n };\n WorkspaceChange.prototype.initChanges = function () {\n if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {\n this._workspaceEdit.changes = Object.create(null);\n }\n };\n WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = CreateFile.create(uri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = CreateFile.create(uri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = RenameFile.create(oldUri, newUri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = RenameFile.create(oldUri, newUri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = DeleteFile.create(uri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = DeleteFile.create(uri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n return WorkspaceChange;\n }());\n exports.WorkspaceChange = WorkspaceChange;\n /**\n * The TextDocumentIdentifier namespace provides helper functions to work with\n * {@link TextDocumentIdentifier} literals.\n */\n var TextDocumentIdentifier;\n (function (TextDocumentIdentifier) {\n /**\n * Creates a new TextDocumentIdentifier literal.\n * @param uri The document's uri.\n */\n function create(uri) {\n return { uri: uri };\n }\n TextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the {@link TextDocumentIdentifier} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri);\n }\n TextDocumentIdentifier.is = is;\n })(TextDocumentIdentifier || (exports.TextDocumentIdentifier = TextDocumentIdentifier = {}));\n /**\n * The VersionedTextDocumentIdentifier namespace provides helper functions to work with\n * {@link VersionedTextDocumentIdentifier} literals.\n */\n var VersionedTextDocumentIdentifier;\n (function (VersionedTextDocumentIdentifier) {\n /**\n * Creates a new VersionedTextDocumentIdentifier literal.\n * @param uri The document's uri.\n * @param version The document's version.\n */\n function create(uri, version) {\n return { uri: uri, version: version };\n }\n VersionedTextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the {@link VersionedTextDocumentIdentifier} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);\n }\n VersionedTextDocumentIdentifier.is = is;\n })(VersionedTextDocumentIdentifier || (exports.VersionedTextDocumentIdentifier = VersionedTextDocumentIdentifier = {}));\n /**\n * The OptionalVersionedTextDocumentIdentifier namespace provides helper functions to work with\n * {@link OptionalVersionedTextDocumentIdentifier} literals.\n */\n var OptionalVersionedTextDocumentIdentifier;\n (function (OptionalVersionedTextDocumentIdentifier) {\n /**\n * Creates a new OptionalVersionedTextDocumentIdentifier literal.\n * @param uri The document's uri.\n * @param version The document's version.\n */\n function create(uri, version) {\n return { uri: uri, version: version };\n }\n OptionalVersionedTextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the {@link OptionalVersionedTextDocumentIdentifier} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));\n }\n OptionalVersionedTextDocumentIdentifier.is = is;\n })(OptionalVersionedTextDocumentIdentifier || (exports.OptionalVersionedTextDocumentIdentifier = OptionalVersionedTextDocumentIdentifier = {}));\n /**\n * The TextDocumentItem namespace provides helper functions to work with\n * {@link TextDocumentItem} literals.\n */\n var TextDocumentItem;\n (function (TextDocumentItem) {\n /**\n * Creates a new TextDocumentItem literal.\n * @param uri The document's uri.\n * @param languageId The document's language identifier.\n * @param version The document's version number.\n * @param text The document's text.\n */\n function create(uri, languageId, version, text) {\n return { uri: uri, languageId: languageId, version: version, text: text };\n }\n TextDocumentItem.create = create;\n /**\n * Checks whether the given literal conforms to the {@link TextDocumentItem} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);\n }\n TextDocumentItem.is = is;\n })(TextDocumentItem || (exports.TextDocumentItem = TextDocumentItem = {}));\n /**\n * Describes the content type that a client supports in various\n * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.\n *\n * Please note that `MarkupKinds` must not start with a `$`. This kinds\n * are reserved for internal usage.\n */\n var MarkupKind;\n (function (MarkupKind) {\n /**\n * Plain text is supported as a content format\n */\n MarkupKind.PlainText = 'plaintext';\n /**\n * Markdown is supported as a content format\n */\n MarkupKind.Markdown = 'markdown';\n /**\n * Checks whether the given value is a value of the {@link MarkupKind} type.\n */\n function is(value) {\n var candidate = value;\n return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;\n }\n MarkupKind.is = is;\n })(MarkupKind || (exports.MarkupKind = MarkupKind = {}));\n var MarkupContent;\n (function (MarkupContent) {\n /**\n * Checks whether the given value conforms to the {@link MarkupContent} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\n }\n MarkupContent.is = is;\n })(MarkupContent || (exports.MarkupContent = MarkupContent = {}));\n /**\n * The kind of a completion entry.\n */\n var CompletionItemKind;\n (function (CompletionItemKind) {\n CompletionItemKind.Text = 1;\n CompletionItemKind.Method = 2;\n CompletionItemKind.Function = 3;\n CompletionItemKind.Constructor = 4;\n CompletionItemKind.Field = 5;\n CompletionItemKind.Variable = 6;\n CompletionItemKind.Class = 7;\n CompletionItemKind.Interface = 8;\n CompletionItemKind.Module = 9;\n CompletionItemKind.Property = 10;\n CompletionItemKind.Unit = 11;\n CompletionItemKind.Value = 12;\n CompletionItemKind.Enum = 13;\n CompletionItemKind.Keyword = 14;\n CompletionItemKind.Snippet = 15;\n CompletionItemKind.Color = 16;\n CompletionItemKind.File = 17;\n CompletionItemKind.Reference = 18;\n CompletionItemKind.Folder = 19;\n CompletionItemKind.EnumMember = 20;\n CompletionItemKind.Constant = 21;\n CompletionItemKind.Struct = 22;\n CompletionItemKind.Event = 23;\n CompletionItemKind.Operator = 24;\n CompletionItemKind.TypeParameter = 25;\n })(CompletionItemKind || (exports.CompletionItemKind = CompletionItemKind = {}));\n /**\n * Defines whether the insert text in a completion item should be interpreted as\n * plain text or a snippet.\n */\n var InsertTextFormat;\n (function (InsertTextFormat) {\n /**\n * The primary text to be inserted is treated as a plain string.\n */\n InsertTextFormat.PlainText = 1;\n /**\n * The primary text to be inserted is treated as a snippet.\n *\n * A snippet can define tab stops and placeholders with `$1`, `$2`\n * and `${3:foo}`. `$0` defines the final tab stop, it defaults to\n * the end of the snippet. Placeholders with equal identifiers are linked,\n * that is typing in one will update others too.\n *\n * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax\n */\n InsertTextFormat.Snippet = 2;\n })(InsertTextFormat || (exports.InsertTextFormat = InsertTextFormat = {}));\n /**\n * Completion item tags are extra annotations that tweak the rendering of a completion\n * item.\n *\n * @since 3.15.0\n */\n var CompletionItemTag;\n (function (CompletionItemTag) {\n /**\n * Render a completion as obsolete, usually using a strike-out.\n */\n CompletionItemTag.Deprecated = 1;\n })(CompletionItemTag || (exports.CompletionItemTag = CompletionItemTag = {}));\n /**\n * The InsertReplaceEdit namespace provides functions to deal with insert / replace edits.\n *\n * @since 3.16.0\n */\n var InsertReplaceEdit;\n (function (InsertReplaceEdit) {\n /**\n * Creates a new insert / replace edit\n */\n function create(newText, insert, replace) {\n return { newText: newText, insert: insert, replace: replace };\n }\n InsertReplaceEdit.create = create;\n /**\n * Checks whether the given literal conforms to the {@link InsertReplaceEdit} interface.\n */\n function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);\n }\n InsertReplaceEdit.is = is;\n })(InsertReplaceEdit || (exports.InsertReplaceEdit = InsertReplaceEdit = {}));\n /**\n * How whitespace and indentation is handled during completion\n * item insertion.\n *\n * @since 3.16.0\n */\n var InsertTextMode;\n (function (InsertTextMode) {\n /**\n * The insertion or replace strings is taken as it is. If the\n * value is multi line the lines below the cursor will be\n * inserted using the indentation defined in the string value.\n * The client will not apply any kind of adjustments to the\n * string.\n */\n InsertTextMode.asIs = 1;\n /**\n * The editor adjusts leading whitespace of new lines so that\n * they match the indentation up to the cursor of the line for\n * which the item is accepted.\n *\n * Consider a line like this: <2tabs><3tabs>foo. Accepting a\n * multi line completion item is indented using 2 tabs and all\n * following lines inserted will be indented using 2 tabs as well.\n */\n InsertTextMode.adjustIndentation = 2;\n })(InsertTextMode || (exports.InsertTextMode = InsertTextMode = {}));\n var CompletionItemLabelDetails;\n (function (CompletionItemLabelDetails) {\n function is(value) {\n var candidate = value;\n return candidate && (Is.string(candidate.detail) || candidate.detail === undefined) &&\n (Is.string(candidate.description) || candidate.description === undefined);\n }\n CompletionItemLabelDetails.is = is;\n })(CompletionItemLabelDetails || (exports.CompletionItemLabelDetails = CompletionItemLabelDetails = {}));\n /**\n * The CompletionItem namespace provides functions to deal with\n * completion items.\n */\n var CompletionItem;\n (function (CompletionItem) {\n /**\n * Create a completion item and seed it with a label.\n * @param label The completion item's label\n */\n function create(label) {\n return { label: label };\n }\n CompletionItem.create = create;\n })(CompletionItem || (exports.CompletionItem = CompletionItem = {}));\n /**\n * The CompletionList namespace provides functions to deal with\n * completion lists.\n */\n var CompletionList;\n (function (CompletionList) {\n /**\n * Creates a new completion list.\n *\n * @param items The completion items.\n * @param isIncomplete The list is not complete.\n */\n function create(items, isIncomplete) {\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\n }\n CompletionList.create = create;\n })(CompletionList || (exports.CompletionList = CompletionList = {}));\n var MarkedString;\n (function (MarkedString) {\n /**\n * Creates a marked string from plain text.\n *\n * @param plainText The plain text.\n */\n function fromPlainText(plainText) {\n return plainText.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, '\\\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\n }\n MarkedString.fromPlainText = fromPlainText;\n /**\n * Checks whether the given value conforms to the {@link MarkedString} type.\n */\n function is(value) {\n var candidate = value;\n return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\n }\n MarkedString.is = is;\n })(MarkedString || (exports.MarkedString = MarkedString = {}));\n var Hover;\n (function (Hover) {\n /**\n * Checks whether the given value conforms to the {@link Hover} interface.\n */\n function is(value) {\n var candidate = value;\n return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||\n MarkedString.is(candidate.contents) ||\n Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range));\n }\n Hover.is = is;\n })(Hover || (exports.Hover = Hover = {}));\n /**\n * The ParameterInformation namespace provides helper functions to work with\n * {@link ParameterInformation} literals.\n */\n var ParameterInformation;\n (function (ParameterInformation) {\n /**\n * Creates a new parameter information literal.\n *\n * @param label A label string.\n * @param documentation A doc string.\n */\n function create(label, documentation) {\n return documentation ? { label: label, documentation: documentation } : { label: label };\n }\n ParameterInformation.create = create;\n })(ParameterInformation || (exports.ParameterInformation = ParameterInformation = {}));\n /**\n * The SignatureInformation namespace provides helper functions to work with\n * {@link SignatureInformation} literals.\n */\n var SignatureInformation;\n (function (SignatureInformation) {\n function create(label, documentation) {\n var parameters = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n parameters[_i - 2] = arguments[_i];\n }\n var result = { label: label };\n if (Is.defined(documentation)) {\n result.documentation = documentation;\n }\n if (Is.defined(parameters)) {\n result.parameters = parameters;\n }\n else {\n result.parameters = [];\n }\n return result;\n }\n SignatureInformation.create = create;\n })(SignatureInformation || (exports.SignatureInformation = SignatureInformation = {}));\n /**\n * A document highlight kind.\n */\n var DocumentHighlightKind;\n (function (DocumentHighlightKind) {\n /**\n * A textual occurrence.\n */\n DocumentHighlightKind.Text = 1;\n /**\n * Read-access of a symbol, like reading a variable.\n */\n DocumentHighlightKind.Read = 2;\n /**\n * Write-access of a symbol, like writing to a variable.\n */\n DocumentHighlightKind.Write = 3;\n })(DocumentHighlightKind || (exports.DocumentHighlightKind = DocumentHighlightKind = {}));\n /**\n * DocumentHighlight namespace to provide helper functions to work with\n * {@link DocumentHighlight} literals.\n */\n var DocumentHighlight;\n (function (DocumentHighlight) {\n /**\n * Create a DocumentHighlight object.\n * @param range The range the highlight applies to.\n * @param kind The highlight kind\n */\n function create(range, kind) {\n var result = { range: range };\n if (Is.number(kind)) {\n result.kind = kind;\n }\n return result;\n }\n DocumentHighlight.create = create;\n })(DocumentHighlight || (exports.DocumentHighlight = DocumentHighlight = {}));\n /**\n * A symbol kind.\n */\n var SymbolKind;\n (function (SymbolKind) {\n SymbolKind.File = 1;\n SymbolKind.Module = 2;\n SymbolKind.Namespace = 3;\n SymbolKind.Package = 4;\n SymbolKind.Class = 5;\n SymbolKind.Method = 6;\n SymbolKind.Property = 7;\n SymbolKind.Field = 8;\n SymbolKind.Constructor = 9;\n SymbolKind.Enum = 10;\n SymbolKind.Interface = 11;\n SymbolKind.Function = 12;\n SymbolKind.Variable = 13;\n SymbolKind.Constant = 14;\n SymbolKind.String = 15;\n SymbolKind.Number = 16;\n SymbolKind.Boolean = 17;\n SymbolKind.Array = 18;\n SymbolKind.Object = 19;\n SymbolKind.Key = 20;\n SymbolKind.Null = 21;\n SymbolKind.EnumMember = 22;\n SymbolKind.Struct = 23;\n SymbolKind.Event = 24;\n SymbolKind.Operator = 25;\n SymbolKind.TypeParameter = 26;\n })(SymbolKind || (exports.SymbolKind = SymbolKind = {}));\n /**\n * Symbol tags are extra annotations that tweak the rendering of a symbol.\n *\n * @since 3.16\n */\n var SymbolTag;\n (function (SymbolTag) {\n /**\n * Render a symbol as obsolete, usually using a strike-out.\n */\n SymbolTag.Deprecated = 1;\n })(SymbolTag || (exports.SymbolTag = SymbolTag = {}));\n var SymbolInformation;\n (function (SymbolInformation) {\n /**\n * Creates a new symbol information literal.\n *\n * @param name The name of the symbol.\n * @param kind The kind of the symbol.\n * @param range The range of the location of the symbol.\n * @param uri The resource of the location of symbol.\n * @param containerName The name of the symbol containing the symbol.\n */\n function create(name, kind, range, uri, containerName) {\n var result = {\n name: name,\n kind: kind,\n location: { uri: uri, range: range }\n };\n if (containerName) {\n result.containerName = containerName;\n }\n return result;\n }\n SymbolInformation.create = create;\n })(SymbolInformation || (exports.SymbolInformation = SymbolInformation = {}));\n var WorkspaceSymbol;\n (function (WorkspaceSymbol) {\n /**\n * Create a new workspace symbol.\n *\n * @param name The name of the symbol.\n * @param kind The kind of the symbol.\n * @param uri The resource of the location of the symbol.\n * @param range An options range of the location.\n * @returns A WorkspaceSymbol.\n */\n function create(name, kind, uri, range) {\n return range !== undefined\n ? { name: name, kind: kind, location: { uri: uri, range: range } }\n : { name: name, kind: kind, location: { uri: uri } };\n }\n WorkspaceSymbol.create = create;\n })(WorkspaceSymbol || (exports.WorkspaceSymbol = WorkspaceSymbol = {}));\n var DocumentSymbol;\n (function (DocumentSymbol) {\n /**\n * Creates a new symbol information literal.\n *\n * @param name The name of the symbol.\n * @param detail The detail of the symbol.\n * @param kind The kind of the symbol.\n * @param range The range of the symbol.\n * @param selectionRange The selectionRange of the symbol.\n * @param children Children of the symbol.\n */\n function create(name, detail, kind, range, selectionRange, children) {\n var result = {\n name: name,\n detail: detail,\n kind: kind,\n range: range,\n selectionRange: selectionRange\n };\n if (children !== undefined) {\n result.children = children;\n }\n return result;\n }\n DocumentSymbol.create = create;\n /**\n * Checks whether the given literal conforms to the {@link DocumentSymbol} interface.\n */\n function is(value) {\n var candidate = value;\n return candidate &&\n Is.string(candidate.name) && Is.number(candidate.kind) &&\n Range.is(candidate.range) && Range.is(candidate.selectionRange) &&\n (candidate.detail === undefined || Is.string(candidate.detail)) &&\n (candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) &&\n (candidate.children === undefined || Array.isArray(candidate.children)) &&\n (candidate.tags === undefined || Array.isArray(candidate.tags));\n }\n DocumentSymbol.is = is;\n })(DocumentSymbol || (exports.DocumentSymbol = DocumentSymbol = {}));\n /**\n * A set of predefined code action kinds\n */\n var CodeActionKind;\n (function (CodeActionKind) {\n /**\n * Empty kind.\n */\n CodeActionKind.Empty = '';\n /**\n * Base kind for quickfix actions: 'quickfix'\n */\n CodeActionKind.QuickFix = 'quickfix';\n /**\n * Base kind for refactoring actions: 'refactor'\n */\n CodeActionKind.Refactor = 'refactor';\n /**\n * Base kind for refactoring extraction actions: 'refactor.extract'\n *\n * Example extract actions:\n *\n * - Extract method\n * - Extract function\n * - Extract variable\n * - Extract interface from class\n * - ...\n */\n CodeActionKind.RefactorExtract = 'refactor.extract';\n /**\n * Base kind for refactoring inline actions: 'refactor.inline'\n *\n * Example inline actions:\n *\n * - Inline function\n * - Inline variable\n * - Inline constant\n * - ...\n */\n CodeActionKind.RefactorInline = 'refactor.inline';\n /**\n * Base kind for refactoring rewrite actions: 'refactor.rewrite'\n *\n * Example rewrite actions:\n *\n * - Convert JavaScript function to class\n * - Add or remove parameter\n * - Encapsulate field\n * - Make method static\n * - Move method to base class\n * - ...\n */\n CodeActionKind.RefactorRewrite = 'refactor.rewrite';\n /**\n * Base kind for source actions: `source`\n *\n * Source code actions apply to the entire file.\n */\n CodeActionKind.Source = 'source';\n /**\n * Base kind for an organize imports source action: `source.organizeImports`\n */\n CodeActionKind.SourceOrganizeImports = 'source.organizeImports';\n /**\n * Base kind for auto-fix source actions: `source.fixAll`.\n *\n * Fix all actions automatically fix errors that have a clear fix that do not require user input.\n * They should not suppress errors or perform unsafe fixes such as generating new types or classes.\n *\n * @since 3.15.0\n */\n CodeActionKind.SourceFixAll = 'source.fixAll';\n })(CodeActionKind || (exports.CodeActionKind = CodeActionKind = {}));\n /**\n * The reason why code actions were requested.\n *\n * @since 3.17.0\n */\n var CodeActionTriggerKind;\n (function (CodeActionTriggerKind) {\n /**\n * Code actions were explicitly requested by the user or by an extension.\n */\n CodeActionTriggerKind.Invoked = 1;\n /**\n * Code actions were requested automatically.\n *\n * This typically happens when current selection in a file changes, but can\n * also be triggered when file content changes.\n */\n CodeActionTriggerKind.Automatic = 2;\n })(CodeActionTriggerKind || (exports.CodeActionTriggerKind = CodeActionTriggerKind = {}));\n /**\n * The CodeActionContext namespace provides helper functions to work with\n * {@link CodeActionContext} literals.\n */\n var CodeActionContext;\n (function (CodeActionContext) {\n /**\n * Creates a new CodeActionContext literal.\n */\n function create(diagnostics, only, triggerKind) {\n var result = { diagnostics: diagnostics };\n if (only !== undefined && only !== null) {\n result.only = only;\n }\n if (triggerKind !== undefined && triggerKind !== null) {\n result.triggerKind = triggerKind;\n }\n return result;\n }\n CodeActionContext.create = create;\n /**\n * Checks whether the given literal conforms to the {@link CodeActionContext} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is)\n && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string))\n && (candidate.triggerKind === undefined || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);\n }\n CodeActionContext.is = is;\n })(CodeActionContext || (exports.CodeActionContext = CodeActionContext = {}));\n var CodeAction;\n (function (CodeAction) {\n function create(title, kindOrCommandOrEdit, kind) {\n var result = { title: title };\n var checkKind = true;\n if (typeof kindOrCommandOrEdit === 'string') {\n checkKind = false;\n result.kind = kindOrCommandOrEdit;\n }\n else if (Command.is(kindOrCommandOrEdit)) {\n result.command = kindOrCommandOrEdit;\n }\n else {\n result.edit = kindOrCommandOrEdit;\n }\n if (checkKind && kind !== undefined) {\n result.kind = kind;\n }\n return result;\n }\n CodeAction.create = create;\n function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.title) &&\n (candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&\n (candidate.kind === undefined || Is.string(candidate.kind)) &&\n (candidate.edit !== undefined || candidate.command !== undefined) &&\n (candidate.command === undefined || Command.is(candidate.command)) &&\n (candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) &&\n (candidate.edit === undefined || WorkspaceEdit.is(candidate.edit));\n }\n CodeAction.is = is;\n })(CodeAction || (exports.CodeAction = CodeAction = {}));\n /**\n * The CodeLens namespace provides helper functions to work with\n * {@link CodeLens} literals.\n */\n var CodeLens;\n (function (CodeLens) {\n /**\n * Creates a new CodeLens literal.\n */\n function create(range, data) {\n var result = { range: range };\n if (Is.defined(data)) {\n result.data = data;\n }\n return result;\n }\n CodeLens.create = create;\n /**\n * Checks whether the given literal conforms to the {@link CodeLens} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));\n }\n CodeLens.is = is;\n })(CodeLens || (exports.CodeLens = CodeLens = {}));\n /**\n * The FormattingOptions namespace provides helper functions to work with\n * {@link FormattingOptions} literals.\n */\n var FormattingOptions;\n (function (FormattingOptions) {\n /**\n * Creates a new FormattingOptions literal.\n */\n function create(tabSize, insertSpaces) {\n return { tabSize: tabSize, insertSpaces: insertSpaces };\n }\n FormattingOptions.create = create;\n /**\n * Checks whether the given literal conforms to the {@link FormattingOptions} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);\n }\n FormattingOptions.is = is;\n })(FormattingOptions || (exports.FormattingOptions = FormattingOptions = {}));\n /**\n * The DocumentLink namespace provides helper functions to work with\n * {@link DocumentLink} literals.\n */\n var DocumentLink;\n (function (DocumentLink) {\n /**\n * Creates a new DocumentLink literal.\n */\n function create(range, target, data) {\n return { range: range, target: target, data: data };\n }\n DocumentLink.create = create;\n /**\n * Checks whether the given literal conforms to the {@link DocumentLink} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));\n }\n DocumentLink.is = is;\n })(DocumentLink || (exports.DocumentLink = DocumentLink = {}));\n /**\n * The SelectionRange namespace provides helper function to work with\n * SelectionRange literals.\n */\n var SelectionRange;\n (function (SelectionRange) {\n /**\n * Creates a new SelectionRange\n * @param range the range.\n * @param parent an optional parent.\n */\n function create(range, parent) {\n return { range: range, parent: parent };\n }\n SelectionRange.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));\n }\n SelectionRange.is = is;\n })(SelectionRange || (exports.SelectionRange = SelectionRange = {}));\n /**\n * A set of predefined token types. This set is not fixed\n * an clients can specify additional token types via the\n * corresponding client capabilities.\n *\n * @since 3.16.0\n */\n var SemanticTokenTypes;\n (function (SemanticTokenTypes) {\n SemanticTokenTypes[\"namespace\"] = \"namespace\";\n /**\n * Represents a generic type. Acts as a fallback for types which can't be mapped to\n * a specific type like class or enum.\n */\n SemanticTokenTypes[\"type\"] = \"type\";\n SemanticTokenTypes[\"class\"] = \"class\";\n SemanticTokenTypes[\"enum\"] = \"enum\";\n SemanticTokenTypes[\"interface\"] = \"interface\";\n SemanticTokenTypes[\"struct\"] = \"struct\";\n SemanticTokenTypes[\"typeParameter\"] = \"typeParameter\";\n SemanticTokenTypes[\"parameter\"] = \"parameter\";\n SemanticTokenTypes[\"variable\"] = \"variable\";\n SemanticTokenTypes[\"property\"] = \"property\";\n SemanticTokenTypes[\"enumMember\"] = \"enumMember\";\n SemanticTokenTypes[\"event\"] = \"event\";\n SemanticTokenTypes[\"function\"] = \"function\";\n SemanticTokenTypes[\"method\"] = \"method\";\n SemanticTokenTypes[\"macro\"] = \"macro\";\n SemanticTokenTypes[\"keyword\"] = \"keyword\";\n SemanticTokenTypes[\"modifier\"] = \"modifier\";\n SemanticTokenTypes[\"comment\"] = \"comment\";\n SemanticTokenTypes[\"string\"] = \"string\";\n SemanticTokenTypes[\"number\"] = \"number\";\n SemanticTokenTypes[\"regexp\"] = \"regexp\";\n SemanticTokenTypes[\"operator\"] = \"operator\";\n /**\n * @since 3.17.0\n */\n SemanticTokenTypes[\"decorator\"] = \"decorator\";\n })(SemanticTokenTypes || (exports.SemanticTokenTypes = SemanticTokenTypes = {}));\n /**\n * A set of predefined token modifiers. This set is not fixed\n * an clients can specify additional token types via the\n * corresponding client capabilities.\n *\n * @since 3.16.0\n */\n var SemanticTokenModifiers;\n (function (SemanticTokenModifiers) {\n SemanticTokenModifiers[\"declaration\"] = \"declaration\";\n SemanticTokenModifiers[\"definition\"] = \"definition\";\n SemanticTokenModifiers[\"readonly\"] = \"readonly\";\n SemanticTokenModifiers[\"static\"] = \"static\";\n SemanticTokenModifiers[\"deprecated\"] = \"deprecated\";\n SemanticTokenModifiers[\"abstract\"] = \"abstract\";\n SemanticTokenModifiers[\"async\"] = \"async\";\n SemanticTokenModifiers[\"modification\"] = \"modification\";\n SemanticTokenModifiers[\"documentation\"] = \"documentation\";\n SemanticTokenModifiers[\"defaultLibrary\"] = \"defaultLibrary\";\n })(SemanticTokenModifiers || (exports.SemanticTokenModifiers = SemanticTokenModifiers = {}));\n /**\n * @since 3.16.0\n */\n var SemanticTokens;\n (function (SemanticTokens) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && (candidate.resultId === undefined || typeof candidate.resultId === 'string') &&\n Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');\n }\n SemanticTokens.is = is;\n })(SemanticTokens || (exports.SemanticTokens = SemanticTokens = {}));\n /**\n * The InlineValueText namespace provides functions to deal with InlineValueTexts.\n *\n * @since 3.17.0\n */\n var InlineValueText;\n (function (InlineValueText) {\n /**\n * Creates a new InlineValueText literal.\n */\n function create(range, text) {\n return { range: range, text: text };\n }\n InlineValueText.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);\n }\n InlineValueText.is = is;\n })(InlineValueText || (exports.InlineValueText = InlineValueText = {}));\n /**\n * The InlineValueVariableLookup namespace provides functions to deal with InlineValueVariableLookups.\n *\n * @since 3.17.0\n */\n var InlineValueVariableLookup;\n (function (InlineValueVariableLookup) {\n /**\n * Creates a new InlineValueText literal.\n */\n function create(range, variableName, caseSensitiveLookup) {\n return { range: range, variableName: variableName, caseSensitiveLookup: caseSensitiveLookup };\n }\n InlineValueVariableLookup.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup)\n && (Is.string(candidate.variableName) || candidate.variableName === undefined);\n }\n InlineValueVariableLookup.is = is;\n })(InlineValueVariableLookup || (exports.InlineValueVariableLookup = InlineValueVariableLookup = {}));\n /**\n * The InlineValueEvaluatableExpression namespace provides functions to deal with InlineValueEvaluatableExpression.\n *\n * @since 3.17.0\n */\n var InlineValueEvaluatableExpression;\n (function (InlineValueEvaluatableExpression) {\n /**\n * Creates a new InlineValueEvaluatableExpression literal.\n */\n function create(range, expression) {\n return { range: range, expression: expression };\n }\n InlineValueEvaluatableExpression.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Range.is(candidate.range)\n && (Is.string(candidate.expression) || candidate.expression === undefined);\n }\n InlineValueEvaluatableExpression.is = is;\n })(InlineValueEvaluatableExpression || (exports.InlineValueEvaluatableExpression = InlineValueEvaluatableExpression = {}));\n /**\n * The InlineValueContext namespace provides helper functions to work with\n * {@link InlineValueContext} literals.\n *\n * @since 3.17.0\n */\n var InlineValueContext;\n (function (InlineValueContext) {\n /**\n * Creates a new InlineValueContext literal.\n */\n function create(frameId, stoppedLocation) {\n return { frameId: frameId, stoppedLocation: stoppedLocation };\n }\n InlineValueContext.create = create;\n /**\n * Checks whether the given literal conforms to the {@link InlineValueContext} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(value.stoppedLocation);\n }\n InlineValueContext.is = is;\n })(InlineValueContext || (exports.InlineValueContext = InlineValueContext = {}));\n /**\n * Inlay hint kinds.\n *\n * @since 3.17.0\n */\n var InlayHintKind;\n (function (InlayHintKind) {\n /**\n * An inlay hint that for a type annotation.\n */\n InlayHintKind.Type = 1;\n /**\n * An inlay hint that is for a parameter.\n */\n InlayHintKind.Parameter = 2;\n function is(value) {\n return value === 1 || value === 2;\n }\n InlayHintKind.is = is;\n })(InlayHintKind || (exports.InlayHintKind = InlayHintKind = {}));\n var InlayHintLabelPart;\n (function (InlayHintLabelPart) {\n function create(value) {\n return { value: value };\n }\n InlayHintLabelPart.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate)\n && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))\n && (candidate.location === undefined || Location.is(candidate.location))\n && (candidate.command === undefined || Command.is(candidate.command));\n }\n InlayHintLabelPart.is = is;\n })(InlayHintLabelPart || (exports.InlayHintLabelPart = InlayHintLabelPart = {}));\n var InlayHint;\n (function (InlayHint) {\n function create(position, label, kind) {\n var result = { position: position, label: label };\n if (kind !== undefined) {\n result.kind = kind;\n }\n return result;\n }\n InlayHint.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.position)\n && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is))\n && (candidate.kind === undefined || InlayHintKind.is(candidate.kind))\n && (candidate.textEdits === undefined) || Is.typedArray(candidate.textEdits, TextEdit.is)\n && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))\n && (candidate.paddingLeft === undefined || Is.boolean(candidate.paddingLeft))\n && (candidate.paddingRight === undefined || Is.boolean(candidate.paddingRight));\n }\n InlayHint.is = is;\n })(InlayHint || (exports.InlayHint = InlayHint = {}));\n var StringValue;\n (function (StringValue) {\n function createSnippet(value) {\n return { kind: 'snippet', value: value };\n }\n StringValue.createSnippet = createSnippet;\n })(StringValue || (exports.StringValue = StringValue = {}));\n var InlineCompletionItem;\n (function (InlineCompletionItem) {\n function create(insertText, filterText, range, command) {\n return { insertText: insertText, filterText: filterText, range: range, command: command };\n }\n InlineCompletionItem.create = create;\n })(InlineCompletionItem || (exports.InlineCompletionItem = InlineCompletionItem = {}));\n var InlineCompletionList;\n (function (InlineCompletionList) {\n function create(items) {\n return { items: items };\n }\n InlineCompletionList.create = create;\n })(InlineCompletionList || (exports.InlineCompletionList = InlineCompletionList = {}));\n /**\n * Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.\n *\n * @since 3.18.0\n * @proposed\n */\n var InlineCompletionTriggerKind;\n (function (InlineCompletionTriggerKind) {\n /**\n * Completion was triggered explicitly by a user gesture.\n */\n InlineCompletionTriggerKind.Invoked = 0;\n /**\n * Completion was triggered automatically while editing.\n */\n InlineCompletionTriggerKind.Automatic = 1;\n })(InlineCompletionTriggerKind || (exports.InlineCompletionTriggerKind = InlineCompletionTriggerKind = {}));\n var SelectedCompletionInfo;\n (function (SelectedCompletionInfo) {\n function create(range, text) {\n return { range: range, text: text };\n }\n SelectedCompletionInfo.create = create;\n })(SelectedCompletionInfo || (exports.SelectedCompletionInfo = SelectedCompletionInfo = {}));\n var InlineCompletionContext;\n (function (InlineCompletionContext) {\n function create(triggerKind, selectedCompletionInfo) {\n return { triggerKind: triggerKind, selectedCompletionInfo: selectedCompletionInfo };\n }\n InlineCompletionContext.create = create;\n })(InlineCompletionContext || (exports.InlineCompletionContext = InlineCompletionContext = {}));\n var WorkspaceFolder;\n (function (WorkspaceFolder) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);\n }\n WorkspaceFolder.is = is;\n })(WorkspaceFolder || (exports.WorkspaceFolder = WorkspaceFolder = {}));\n exports.EOL = ['\\n', '\\r\\n', '\\r'];\n /**\n * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\n */\n var TextDocument;\n (function (TextDocument) {\n /**\n * Creates a new ITextDocument literal from the given uri and content.\n * @param uri The document's uri.\n * @param languageId The document's language Id.\n * @param version The document's version.\n * @param content The document's content.\n */\n function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }\n TextDocument.create = create;\n /**\n * Checks whether the given literal conforms to the {@link ITextDocument} interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount)\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }\n TextDocument.is = is;\n function applyEdits(document, edits) {\n var text = document.getText();\n var sortedEdits = mergeSort(edits, function (a, b) {\n var diff = a.range.start.line - b.range.start.line;\n if (diff === 0) {\n return a.range.start.character - b.range.start.character;\n }\n return diff;\n });\n var lastModifiedOffset = text.length;\n for (var i = sortedEdits.length - 1; i >= 0; i--) {\n var e = sortedEdits[i];\n var startOffset = document.offsetAt(e.range.start);\n var endOffset = document.offsetAt(e.range.end);\n if (endOffset <= lastModifiedOffset) {\n text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);\n }\n else {\n throw new Error('Overlapping edit');\n }\n lastModifiedOffset = startOffset;\n }\n return text;\n }\n TextDocument.applyEdits = applyEdits;\n function mergeSort(data, compare) {\n if (data.length <= 1) {\n // sorted\n return data;\n }\n var p = (data.length / 2) | 0;\n var left = data.slice(0, p);\n var right = data.slice(p);\n mergeSort(left, compare);\n mergeSort(right, compare);\n var leftIdx = 0;\n var rightIdx = 0;\n var i = 0;\n while (leftIdx < left.length && rightIdx < right.length) {\n var ret = compare(left[leftIdx], right[rightIdx]);\n if (ret <= 0) {\n // smaller_equal -> take left to preserve order\n data[i++] = left[leftIdx++];\n }\n else {\n // greater -> take right\n data[i++] = right[rightIdx++];\n }\n }\n while (leftIdx < left.length) {\n data[i++] = left[leftIdx++];\n }\n while (rightIdx < right.length) {\n data[i++] = right[rightIdx++];\n }\n return data;\n }\n })(TextDocument || (exports.TextDocument = TextDocument = {}));\n /**\n * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\n */\n var FullTextDocument = /** @class */ (function () {\n function FullTextDocument(uri, languageId, version, content) {\n this._uri = uri;\n this._languageId = languageId;\n this._version = version;\n this._content = content;\n this._lineOffsets = undefined;\n }\n Object.defineProperty(FullTextDocument.prototype, \"uri\", {\n get: function () {\n return this._uri;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FullTextDocument.prototype, \"languageId\", {\n get: function () {\n return this._languageId;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FullTextDocument.prototype, \"version\", {\n get: function () {\n return this._version;\n },\n enumerable: false,\n configurable: true\n });\n FullTextDocument.prototype.getText = function (range) {\n if (range) {\n var start = this.offsetAt(range.start);\n var end = this.offsetAt(range.end);\n return this._content.substring(start, end);\n }\n return this._content;\n };\n FullTextDocument.prototype.update = function (event, version) {\n this._content = event.text;\n this._version = version;\n this._lineOffsets = undefined;\n };\n FullTextDocument.prototype.getLineOffsets = function () {\n if (this._lineOffsets === undefined) {\n var lineOffsets = [];\n var text = this._content;\n var isLineStart = true;\n for (var i = 0; i < text.length; i++) {\n if (isLineStart) {\n lineOffsets.push(i);\n isLineStart = false;\n }\n var ch = text.charAt(i);\n isLineStart = (ch === '\\r' || ch === '\\n');\n if (ch === '\\r' && i + 1 < text.length && text.charAt(i + 1) === '\\n') {\n i++;\n }\n }\n if (isLineStart && text.length > 0) {\n lineOffsets.push(text.length);\n }\n this._lineOffsets = lineOffsets;\n }\n return this._lineOffsets;\n };\n FullTextDocument.prototype.positionAt = function (offset) {\n offset = Math.max(Math.min(offset, this._content.length), 0);\n var lineOffsets = this.getLineOffsets();\n var low = 0, high = lineOffsets.length;\n if (high === 0) {\n return Position.create(0, offset);\n }\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (lineOffsets[mid] > offset) {\n high = mid;\n }\n else {\n low = mid + 1;\n }\n }\n // low is the least x for which the line offset is larger than the current offset\n // or array.length if no line offset is larger than the current offset\n var line = low - 1;\n return Position.create(line, offset - lineOffsets[line]);\n };\n FullTextDocument.prototype.offsetAt = function (position) {\n var lineOffsets = this.getLineOffsets();\n if (position.line >= lineOffsets.length) {\n return this._content.length;\n }\n else if (position.line < 0) {\n return 0;\n }\n var lineOffset = lineOffsets[position.line];\n var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\n return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\n };\n Object.defineProperty(FullTextDocument.prototype, \"lineCount\", {\n get: function () {\n return this.getLineOffsets().length;\n },\n enumerable: false,\n configurable: true\n });\n return FullTextDocument;\n }());\n var Is;\n (function (Is) {\n var toString = Object.prototype.toString;\n function defined(value) {\n return typeof value !== 'undefined';\n }\n Is.defined = defined;\n function undefined(value) {\n return typeof value === 'undefined';\n }\n Is.undefined = undefined;\n function boolean(value) {\n return value === true || value === false;\n }\n Is.boolean = boolean;\n function string(value) {\n return toString.call(value) === '[object String]';\n }\n Is.string = string;\n function number(value) {\n return toString.call(value) === '[object Number]';\n }\n Is.number = number;\n function numberRange(value, min, max) {\n return toString.call(value) === '[object Number]' && min <= value && value <= max;\n }\n Is.numberRange = numberRange;\n function integer(value) {\n return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647;\n }\n Is.integer = integer;\n function uinteger(value) {\n return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647;\n }\n Is.uinteger = uinteger;\n function func(value) {\n return toString.call(value) === '[object Function]';\n }\n Is.func = func;\n function objectLiteral(value) {\n // Strictly speaking class instances pass this check as well. Since the LSP\n // doesn't use classes we ignore this for now. If we do we need to add something\n // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\n return value !== null && typeof value === 'object';\n }\n Is.objectLiteral = objectLiteral;\n function typedArray(value, check) {\n return Array.isArray(value) && value.every(check);\n }\n Is.typedArray = typedArray;\n })(Is || (Is = {}));\n});\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProtocolNotificationType = exports.ProtocolNotificationType0 = exports.ProtocolRequestType = exports.ProtocolRequestType0 = exports.RegistrationType = exports.MessageDirection = void 0;\nconst vscode_jsonrpc_1 = require(\"vscode-jsonrpc\");\nvar MessageDirection;\n(function (MessageDirection) {\n MessageDirection[\"clientToServer\"] = \"clientToServer\";\n MessageDirection[\"serverToClient\"] = \"serverToClient\";\n MessageDirection[\"both\"] = \"both\";\n})(MessageDirection || (exports.MessageDirection = MessageDirection = {}));\nclass RegistrationType {\n constructor(method) {\n this.method = method;\n }\n}\nexports.RegistrationType = RegistrationType;\nclass ProtocolRequestType0 extends vscode_jsonrpc_1.RequestType0 {\n constructor(method) {\n super(method);\n }\n}\nexports.ProtocolRequestType0 = ProtocolRequestType0;\nclass ProtocolRequestType extends vscode_jsonrpc_1.RequestType {\n constructor(method) {\n super(method, vscode_jsonrpc_1.ParameterStructures.byName);\n }\n}\nexports.ProtocolRequestType = ProtocolRequestType;\nclass ProtocolNotificationType0 extends vscode_jsonrpc_1.NotificationType0 {\n constructor(method) {\n super(method);\n }\n}\nexports.ProtocolNotificationType0 = ProtocolNotificationType0;\nclass ProtocolNotificationType extends vscode_jsonrpc_1.NotificationType {\n constructor(method) {\n super(method, vscode_jsonrpc_1.ParameterStructures.byName);\n }\n}\nexports.ProtocolNotificationType = ProtocolNotificationType;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n'use strict';\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.objectLiteral = exports.typedArray = exports.stringArray = exports.array = exports.func = exports.error = exports.number = exports.string = exports.boolean = void 0;\nfunction boolean(value) {\n return value === true || value === false;\n}\nexports.boolean = boolean;\nfunction string(value) {\n return typeof value === 'string' || value instanceof String;\n}\nexports.string = string;\nfunction number(value) {\n return typeof value === 'number' || value instanceof Number;\n}\nexports.number = number;\nfunction error(value) {\n return value instanceof Error;\n}\nexports.error = error;\nfunction func(value) {\n return typeof value === 'function';\n}\nexports.func = func;\nfunction array(value) {\n return Array.isArray(value);\n}\nexports.array = array;\nfunction stringArray(value) {\n return array(value) && value.every(elem => string(elem));\n}\nexports.stringArray = stringArray;\nfunction typedArray(value, check) {\n return Array.isArray(value) && value.every(check);\n}\nexports.typedArray = typedArray;\nfunction objectLiteral(value) {\n // Strictly speaking class instances pass this check as well. Since the LSP\n // doesn't use classes we ignore this for now. If we do we need to add something\n // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\n return value !== null && typeof value === 'object';\n}\nexports.objectLiteral = objectLiteral;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ImplementationRequest = void 0;\nconst messages_1 = require(\"./messages\");\n// @ts-ignore: to avoid inlining LocationLink as dynamic import\nlet __noDynamicImport;\n/**\n * A request to resolve the implementation locations of a symbol at a given text\n * document position. The request's parameter is of type {@link TextDocumentPositionParams}\n * the response is of type {@link Definition} or a Thenable that resolves to such.\n */\nvar ImplementationRequest;\n(function (ImplementationRequest) {\n ImplementationRequest.method = 'textDocument/implementation';\n ImplementationRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n ImplementationRequest.type = new messages_1.ProtocolRequestType(ImplementationRequest.method);\n})(ImplementationRequest || (exports.ImplementationRequest = ImplementationRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TypeDefinitionRequest = void 0;\nconst messages_1 = require(\"./messages\");\n// @ts-ignore: to avoid inlining LocatioLink as dynamic import\nlet __noDynamicImport;\n/**\n * A request to resolve the type definition locations of a symbol at a given text\n * document position. The request's parameter is of type {@link TextDocumentPositionParams}\n * the response is of type {@link Definition} or a Thenable that resolves to such.\n */\nvar TypeDefinitionRequest;\n(function (TypeDefinitionRequest) {\n TypeDefinitionRequest.method = 'textDocument/typeDefinition';\n TypeDefinitionRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n TypeDefinitionRequest.type = new messages_1.ProtocolRequestType(TypeDefinitionRequest.method);\n})(TypeDefinitionRequest || (exports.TypeDefinitionRequest = TypeDefinitionRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DidChangeWorkspaceFoldersNotification = exports.WorkspaceFoldersRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.\n */\nvar WorkspaceFoldersRequest;\n(function (WorkspaceFoldersRequest) {\n WorkspaceFoldersRequest.method = 'workspace/workspaceFolders';\n WorkspaceFoldersRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n WorkspaceFoldersRequest.type = new messages_1.ProtocolRequestType0(WorkspaceFoldersRequest.method);\n})(WorkspaceFoldersRequest || (exports.WorkspaceFoldersRequest = WorkspaceFoldersRequest = {}));\n/**\n * The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace\n * folder configuration changes.\n */\nvar DidChangeWorkspaceFoldersNotification;\n(function (DidChangeWorkspaceFoldersNotification) {\n DidChangeWorkspaceFoldersNotification.method = 'workspace/didChangeWorkspaceFolders';\n DidChangeWorkspaceFoldersNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidChangeWorkspaceFoldersNotification.type = new messages_1.ProtocolNotificationType(DidChangeWorkspaceFoldersNotification.method);\n})(DidChangeWorkspaceFoldersNotification || (exports.DidChangeWorkspaceFoldersNotification = DidChangeWorkspaceFoldersNotification = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConfigurationRequest = void 0;\nconst messages_1 = require(\"./messages\");\n//---- Get Configuration request ----\n/**\n * The 'workspace/configuration' request is sent from the server to the client to fetch a certain\n * configuration setting.\n *\n * This pull model replaces the old push model were the client signaled configuration change via an\n * event. If the server still needs to react to configuration changes (since the server caches the\n * result of `workspace/configuration` requests) the server should register for an empty configuration\n * change event and empty the cache if such an event is received.\n */\nvar ConfigurationRequest;\n(function (ConfigurationRequest) {\n ConfigurationRequest.method = 'workspace/configuration';\n ConfigurationRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n ConfigurationRequest.type = new messages_1.ProtocolRequestType(ConfigurationRequest.method);\n})(ConfigurationRequest || (exports.ConfigurationRequest = ConfigurationRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ColorPresentationRequest = exports.DocumentColorRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to list all color symbols found in a given text document. The request's\n * parameter is of type {@link DocumentColorParams} the\n * response is of type {@link ColorInformation ColorInformation[]} or a Thenable\n * that resolves to such.\n */\nvar DocumentColorRequest;\n(function (DocumentColorRequest) {\n DocumentColorRequest.method = 'textDocument/documentColor';\n DocumentColorRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentColorRequest.type = new messages_1.ProtocolRequestType(DocumentColorRequest.method);\n})(DocumentColorRequest || (exports.DocumentColorRequest = DocumentColorRequest = {}));\n/**\n * A request to list all presentation for a color. The request's\n * parameter is of type {@link ColorPresentationParams} the\n * response is of type {@link ColorInformation ColorInformation[]} or a Thenable\n * that resolves to such.\n */\nvar ColorPresentationRequest;\n(function (ColorPresentationRequest) {\n ColorPresentationRequest.method = 'textDocument/colorPresentation';\n ColorPresentationRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n ColorPresentationRequest.type = new messages_1.ProtocolRequestType(ColorPresentationRequest.method);\n})(ColorPresentationRequest || (exports.ColorPresentationRequest = ColorPresentationRequest = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FoldingRangeRefreshRequest = exports.FoldingRangeRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide folding ranges in a document. The request's\n * parameter is of type {@link FoldingRangeParams}, the\n * response is of type {@link FoldingRangeList} or a Thenable\n * that resolves to such.\n */\nvar FoldingRangeRequest;\n(function (FoldingRangeRequest) {\n FoldingRangeRequest.method = 'textDocument/foldingRange';\n FoldingRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n FoldingRangeRequest.type = new messages_1.ProtocolRequestType(FoldingRangeRequest.method);\n})(FoldingRangeRequest || (exports.FoldingRangeRequest = FoldingRangeRequest = {}));\n/**\n * @since 3.18.0\n * @proposed\n */\nvar FoldingRangeRefreshRequest;\n(function (FoldingRangeRefreshRequest) {\n FoldingRangeRefreshRequest.method = `workspace/foldingRange/refresh`;\n FoldingRangeRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n FoldingRangeRefreshRequest.type = new messages_1.ProtocolRequestType0(FoldingRangeRefreshRequest.method);\n})(FoldingRangeRefreshRequest || (exports.FoldingRangeRefreshRequest = FoldingRangeRefreshRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DeclarationRequest = void 0;\nconst messages_1 = require(\"./messages\");\n// @ts-ignore: to avoid inlining LocationLink as dynamic import\nlet __noDynamicImport;\n/**\n * A request to resolve the type definition locations of a symbol at a given text\n * document position. The request's parameter is of type {@link TextDocumentPositionParams}\n * the response is of type {@link Declaration} or a typed array of {@link DeclarationLink}\n * or a Thenable that resolves to such.\n */\nvar DeclarationRequest;\n(function (DeclarationRequest) {\n DeclarationRequest.method = 'textDocument/declaration';\n DeclarationRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DeclarationRequest.type = new messages_1.ProtocolRequestType(DeclarationRequest.method);\n})(DeclarationRequest || (exports.DeclarationRequest = DeclarationRequest = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SelectionRangeRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide selection ranges in a document. The request's\n * parameter is of type {@link SelectionRangeParams}, the\n * response is of type {@link SelectionRange SelectionRange[]} or a Thenable\n * that resolves to such.\n */\nvar SelectionRangeRequest;\n(function (SelectionRangeRequest) {\n SelectionRangeRequest.method = 'textDocument/selectionRange';\n SelectionRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n SelectionRangeRequest.type = new messages_1.ProtocolRequestType(SelectionRangeRequest.method);\n})(SelectionRangeRequest || (exports.SelectionRangeRequest = SelectionRangeRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkDoneProgressCancelNotification = exports.WorkDoneProgressCreateRequest = exports.WorkDoneProgress = void 0;\nconst vscode_jsonrpc_1 = require(\"vscode-jsonrpc\");\nconst messages_1 = require(\"./messages\");\nvar WorkDoneProgress;\n(function (WorkDoneProgress) {\n WorkDoneProgress.type = new vscode_jsonrpc_1.ProgressType();\n function is(value) {\n return value === WorkDoneProgress.type;\n }\n WorkDoneProgress.is = is;\n})(WorkDoneProgress || (exports.WorkDoneProgress = WorkDoneProgress = {}));\n/**\n * The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress\n * reporting from the server.\n */\nvar WorkDoneProgressCreateRequest;\n(function (WorkDoneProgressCreateRequest) {\n WorkDoneProgressCreateRequest.method = 'window/workDoneProgress/create';\n WorkDoneProgressCreateRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n WorkDoneProgressCreateRequest.type = new messages_1.ProtocolRequestType(WorkDoneProgressCreateRequest.method);\n})(WorkDoneProgressCreateRequest || (exports.WorkDoneProgressCreateRequest = WorkDoneProgressCreateRequest = {}));\n/**\n * The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress\n * initiated on the server side.\n */\nvar WorkDoneProgressCancelNotification;\n(function (WorkDoneProgressCancelNotification) {\n WorkDoneProgressCancelNotification.method = 'window/workDoneProgress/cancel';\n WorkDoneProgressCancelNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n WorkDoneProgressCancelNotification.type = new messages_1.ProtocolNotificationType(WorkDoneProgressCancelNotification.method);\n})(WorkDoneProgressCancelNotification || (exports.WorkDoneProgressCancelNotification = WorkDoneProgressCancelNotification = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) TypeFox, Microsoft and others. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CallHierarchyOutgoingCallsRequest = exports.CallHierarchyIncomingCallsRequest = exports.CallHierarchyPrepareRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to result a `CallHierarchyItem` in a document at a given position.\n * Can be used as an input to an incoming or outgoing call hierarchy.\n *\n * @since 3.16.0\n */\nvar CallHierarchyPrepareRequest;\n(function (CallHierarchyPrepareRequest) {\n CallHierarchyPrepareRequest.method = 'textDocument/prepareCallHierarchy';\n CallHierarchyPrepareRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CallHierarchyPrepareRequest.type = new messages_1.ProtocolRequestType(CallHierarchyPrepareRequest.method);\n})(CallHierarchyPrepareRequest || (exports.CallHierarchyPrepareRequest = CallHierarchyPrepareRequest = {}));\n/**\n * A request to resolve the incoming calls for a given `CallHierarchyItem`.\n *\n * @since 3.16.0\n */\nvar CallHierarchyIncomingCallsRequest;\n(function (CallHierarchyIncomingCallsRequest) {\n CallHierarchyIncomingCallsRequest.method = 'callHierarchy/incomingCalls';\n CallHierarchyIncomingCallsRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CallHierarchyIncomingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyIncomingCallsRequest.method);\n})(CallHierarchyIncomingCallsRequest || (exports.CallHierarchyIncomingCallsRequest = CallHierarchyIncomingCallsRequest = {}));\n/**\n * A request to resolve the outgoing calls for a given `CallHierarchyItem`.\n *\n * @since 3.16.0\n */\nvar CallHierarchyOutgoingCallsRequest;\n(function (CallHierarchyOutgoingCallsRequest) {\n CallHierarchyOutgoingCallsRequest.method = 'callHierarchy/outgoingCalls';\n CallHierarchyOutgoingCallsRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CallHierarchyOutgoingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyOutgoingCallsRequest.method);\n})(CallHierarchyOutgoingCallsRequest || (exports.CallHierarchyOutgoingCallsRequest = CallHierarchyOutgoingCallsRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SemanticTokensRefreshRequest = exports.SemanticTokensRangeRequest = exports.SemanticTokensDeltaRequest = exports.SemanticTokensRequest = exports.SemanticTokensRegistrationType = exports.TokenFormat = void 0;\nconst messages_1 = require(\"./messages\");\n//------- 'textDocument/semanticTokens' -----\nvar TokenFormat;\n(function (TokenFormat) {\n TokenFormat.Relative = 'relative';\n})(TokenFormat || (exports.TokenFormat = TokenFormat = {}));\nvar SemanticTokensRegistrationType;\n(function (SemanticTokensRegistrationType) {\n SemanticTokensRegistrationType.method = 'textDocument/semanticTokens';\n SemanticTokensRegistrationType.type = new messages_1.RegistrationType(SemanticTokensRegistrationType.method);\n})(SemanticTokensRegistrationType || (exports.SemanticTokensRegistrationType = SemanticTokensRegistrationType = {}));\n/**\n * @since 3.16.0\n */\nvar SemanticTokensRequest;\n(function (SemanticTokensRequest) {\n SemanticTokensRequest.method = 'textDocument/semanticTokens/full';\n SemanticTokensRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n SemanticTokensRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRequest.method);\n SemanticTokensRequest.registrationMethod = SemanticTokensRegistrationType.method;\n})(SemanticTokensRequest || (exports.SemanticTokensRequest = SemanticTokensRequest = {}));\n/**\n * @since 3.16.0\n */\nvar SemanticTokensDeltaRequest;\n(function (SemanticTokensDeltaRequest) {\n SemanticTokensDeltaRequest.method = 'textDocument/semanticTokens/full/delta';\n SemanticTokensDeltaRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n SemanticTokensDeltaRequest.type = new messages_1.ProtocolRequestType(SemanticTokensDeltaRequest.method);\n SemanticTokensDeltaRequest.registrationMethod = SemanticTokensRegistrationType.method;\n})(SemanticTokensDeltaRequest || (exports.SemanticTokensDeltaRequest = SemanticTokensDeltaRequest = {}));\n/**\n * @since 3.16.0\n */\nvar SemanticTokensRangeRequest;\n(function (SemanticTokensRangeRequest) {\n SemanticTokensRangeRequest.method = 'textDocument/semanticTokens/range';\n SemanticTokensRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n SemanticTokensRangeRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRangeRequest.method);\n SemanticTokensRangeRequest.registrationMethod = SemanticTokensRegistrationType.method;\n})(SemanticTokensRangeRequest || (exports.SemanticTokensRangeRequest = SemanticTokensRangeRequest = {}));\n/**\n * @since 3.16.0\n */\nvar SemanticTokensRefreshRequest;\n(function (SemanticTokensRefreshRequest) {\n SemanticTokensRefreshRequest.method = `workspace/semanticTokens/refresh`;\n SemanticTokensRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n SemanticTokensRefreshRequest.type = new messages_1.ProtocolRequestType0(SemanticTokensRefreshRequest.method);\n})(SemanticTokensRefreshRequest || (exports.SemanticTokensRefreshRequest = SemanticTokensRefreshRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ShowDocumentRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to show a document. This request might open an\n * external program depending on the value of the URI to open.\n * For example a request to open `https://code.visualstudio.com/`\n * will very likely open the URI in a WEB browser.\n *\n * @since 3.16.0\n*/\nvar ShowDocumentRequest;\n(function (ShowDocumentRequest) {\n ShowDocumentRequest.method = 'window/showDocument';\n ShowDocumentRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n ShowDocumentRequest.type = new messages_1.ProtocolRequestType(ShowDocumentRequest.method);\n})(ShowDocumentRequest || (exports.ShowDocumentRequest = ShowDocumentRequest = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LinkedEditingRangeRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide ranges that can be edited together.\n *\n * @since 3.16.0\n */\nvar LinkedEditingRangeRequest;\n(function (LinkedEditingRangeRequest) {\n LinkedEditingRangeRequest.method = 'textDocument/linkedEditingRange';\n LinkedEditingRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n LinkedEditingRangeRequest.type = new messages_1.ProtocolRequestType(LinkedEditingRangeRequest.method);\n})(LinkedEditingRangeRequest || (exports.LinkedEditingRangeRequest = LinkedEditingRangeRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WillDeleteFilesRequest = exports.DidDeleteFilesNotification = exports.DidRenameFilesNotification = exports.WillRenameFilesRequest = exports.DidCreateFilesNotification = exports.WillCreateFilesRequest = exports.FileOperationPatternKind = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A pattern kind describing if a glob pattern matches a file a folder or\n * both.\n *\n * @since 3.16.0\n */\nvar FileOperationPatternKind;\n(function (FileOperationPatternKind) {\n /**\n * The pattern matches a file only.\n */\n FileOperationPatternKind.file = 'file';\n /**\n * The pattern matches a folder only.\n */\n FileOperationPatternKind.folder = 'folder';\n})(FileOperationPatternKind || (exports.FileOperationPatternKind = FileOperationPatternKind = {}));\n/**\n * The will create files request is sent from the client to the server before files are actually\n * created as long as the creation is triggered from within the client.\n *\n * The request can return a `WorkspaceEdit` which will be applied to workspace before the\n * files are created. Hence the `WorkspaceEdit` can not manipulate the content of the file\n * to be created.\n *\n * @since 3.16.0\n */\nvar WillCreateFilesRequest;\n(function (WillCreateFilesRequest) {\n WillCreateFilesRequest.method = 'workspace/willCreateFiles';\n WillCreateFilesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WillCreateFilesRequest.type = new messages_1.ProtocolRequestType(WillCreateFilesRequest.method);\n})(WillCreateFilesRequest || (exports.WillCreateFilesRequest = WillCreateFilesRequest = {}));\n/**\n * The did create files notification is sent from the client to the server when\n * files were created from within the client.\n *\n * @since 3.16.0\n */\nvar DidCreateFilesNotification;\n(function (DidCreateFilesNotification) {\n DidCreateFilesNotification.method = 'workspace/didCreateFiles';\n DidCreateFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidCreateFilesNotification.type = new messages_1.ProtocolNotificationType(DidCreateFilesNotification.method);\n})(DidCreateFilesNotification || (exports.DidCreateFilesNotification = DidCreateFilesNotification = {}));\n/**\n * The will rename files request is sent from the client to the server before files are actually\n * renamed as long as the rename is triggered from within the client.\n *\n * @since 3.16.0\n */\nvar WillRenameFilesRequest;\n(function (WillRenameFilesRequest) {\n WillRenameFilesRequest.method = 'workspace/willRenameFiles';\n WillRenameFilesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WillRenameFilesRequest.type = new messages_1.ProtocolRequestType(WillRenameFilesRequest.method);\n})(WillRenameFilesRequest || (exports.WillRenameFilesRequest = WillRenameFilesRequest = {}));\n/**\n * The did rename files notification is sent from the client to the server when\n * files were renamed from within the client.\n *\n * @since 3.16.0\n */\nvar DidRenameFilesNotification;\n(function (DidRenameFilesNotification) {\n DidRenameFilesNotification.method = 'workspace/didRenameFiles';\n DidRenameFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidRenameFilesNotification.type = new messages_1.ProtocolNotificationType(DidRenameFilesNotification.method);\n})(DidRenameFilesNotification || (exports.DidRenameFilesNotification = DidRenameFilesNotification = {}));\n/**\n * The will delete files request is sent from the client to the server before files are actually\n * deleted as long as the deletion is triggered from within the client.\n *\n * @since 3.16.0\n */\nvar DidDeleteFilesNotification;\n(function (DidDeleteFilesNotification) {\n DidDeleteFilesNotification.method = 'workspace/didDeleteFiles';\n DidDeleteFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidDeleteFilesNotification.type = new messages_1.ProtocolNotificationType(DidDeleteFilesNotification.method);\n})(DidDeleteFilesNotification || (exports.DidDeleteFilesNotification = DidDeleteFilesNotification = {}));\n/**\n * The did delete files notification is sent from the client to the server when\n * files were deleted from within the client.\n *\n * @since 3.16.0\n */\nvar WillDeleteFilesRequest;\n(function (WillDeleteFilesRequest) {\n WillDeleteFilesRequest.method = 'workspace/willDeleteFiles';\n WillDeleteFilesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WillDeleteFilesRequest.type = new messages_1.ProtocolRequestType(WillDeleteFilesRequest.method);\n})(WillDeleteFilesRequest || (exports.WillDeleteFilesRequest = WillDeleteFilesRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MonikerRequest = exports.MonikerKind = exports.UniquenessLevel = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * Moniker uniqueness level to define scope of the moniker.\n *\n * @since 3.16.0\n */\nvar UniquenessLevel;\n(function (UniquenessLevel) {\n /**\n * The moniker is only unique inside a document\n */\n UniquenessLevel.document = 'document';\n /**\n * The moniker is unique inside a project for which a dump got created\n */\n UniquenessLevel.project = 'project';\n /**\n * The moniker is unique inside the group to which a project belongs\n */\n UniquenessLevel.group = 'group';\n /**\n * The moniker is unique inside the moniker scheme.\n */\n UniquenessLevel.scheme = 'scheme';\n /**\n * The moniker is globally unique\n */\n UniquenessLevel.global = 'global';\n})(UniquenessLevel || (exports.UniquenessLevel = UniquenessLevel = {}));\n/**\n * The moniker kind.\n *\n * @since 3.16.0\n */\nvar MonikerKind;\n(function (MonikerKind) {\n /**\n * The moniker represent a symbol that is imported into a project\n */\n MonikerKind.$import = 'import';\n /**\n * The moniker represents a symbol that is exported from a project\n */\n MonikerKind.$export = 'export';\n /**\n * The moniker represents a symbol that is local to a project (e.g. a local\n * variable of a function, a class not visible outside the project, ...)\n */\n MonikerKind.local = 'local';\n})(MonikerKind || (exports.MonikerKind = MonikerKind = {}));\n/**\n * A request to get the moniker of a symbol at a given text document position.\n * The request parameter is of type {@link TextDocumentPositionParams}.\n * The response is of type {@link Moniker Moniker[]} or `null`.\n */\nvar MonikerRequest;\n(function (MonikerRequest) {\n MonikerRequest.method = 'textDocument/moniker';\n MonikerRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n MonikerRequest.type = new messages_1.ProtocolRequestType(MonikerRequest.method);\n})(MonikerRequest || (exports.MonikerRequest = MonikerRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) TypeFox, Microsoft and others. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TypeHierarchySubtypesRequest = exports.TypeHierarchySupertypesRequest = exports.TypeHierarchyPrepareRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to result a `TypeHierarchyItem` in a document at a given position.\n * Can be used as an input to a subtypes or supertypes type hierarchy.\n *\n * @since 3.17.0\n */\nvar TypeHierarchyPrepareRequest;\n(function (TypeHierarchyPrepareRequest) {\n TypeHierarchyPrepareRequest.method = 'textDocument/prepareTypeHierarchy';\n TypeHierarchyPrepareRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n TypeHierarchyPrepareRequest.type = new messages_1.ProtocolRequestType(TypeHierarchyPrepareRequest.method);\n})(TypeHierarchyPrepareRequest || (exports.TypeHierarchyPrepareRequest = TypeHierarchyPrepareRequest = {}));\n/**\n * A request to resolve the supertypes for a given `TypeHierarchyItem`.\n *\n * @since 3.17.0\n */\nvar TypeHierarchySupertypesRequest;\n(function (TypeHierarchySupertypesRequest) {\n TypeHierarchySupertypesRequest.method = 'typeHierarchy/supertypes';\n TypeHierarchySupertypesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n TypeHierarchySupertypesRequest.type = new messages_1.ProtocolRequestType(TypeHierarchySupertypesRequest.method);\n})(TypeHierarchySupertypesRequest || (exports.TypeHierarchySupertypesRequest = TypeHierarchySupertypesRequest = {}));\n/**\n * A request to resolve the subtypes for a given `TypeHierarchyItem`.\n *\n * @since 3.17.0\n */\nvar TypeHierarchySubtypesRequest;\n(function (TypeHierarchySubtypesRequest) {\n TypeHierarchySubtypesRequest.method = 'typeHierarchy/subtypes';\n TypeHierarchySubtypesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n TypeHierarchySubtypesRequest.type = new messages_1.ProtocolRequestType(TypeHierarchySubtypesRequest.method);\n})(TypeHierarchySubtypesRequest || (exports.TypeHierarchySubtypesRequest = TypeHierarchySubtypesRequest = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlineValueRefreshRequest = exports.InlineValueRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide inline values in a document. The request's parameter is of\n * type {@link InlineValueParams}, the response is of type\n * {@link InlineValue InlineValue[]} or a Thenable that resolves to such.\n *\n * @since 3.17.0\n */\nvar InlineValueRequest;\n(function (InlineValueRequest) {\n InlineValueRequest.method = 'textDocument/inlineValue';\n InlineValueRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n InlineValueRequest.type = new messages_1.ProtocolRequestType(InlineValueRequest.method);\n})(InlineValueRequest || (exports.InlineValueRequest = InlineValueRequest = {}));\n/**\n * @since 3.17.0\n */\nvar InlineValueRefreshRequest;\n(function (InlineValueRefreshRequest) {\n InlineValueRefreshRequest.method = `workspace/inlineValue/refresh`;\n InlineValueRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n InlineValueRefreshRequest.type = new messages_1.ProtocolRequestType0(InlineValueRefreshRequest.method);\n})(InlineValueRefreshRequest || (exports.InlineValueRefreshRequest = InlineValueRefreshRequest = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlayHintRefreshRequest = exports.InlayHintResolveRequest = exports.InlayHintRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide inlay hints in a document. The request's parameter is of\n * type {@link InlayHintsParams}, the response is of type\n * {@link InlayHint InlayHint[]} or a Thenable that resolves to such.\n *\n * @since 3.17.0\n */\nvar InlayHintRequest;\n(function (InlayHintRequest) {\n InlayHintRequest.method = 'textDocument/inlayHint';\n InlayHintRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n InlayHintRequest.type = new messages_1.ProtocolRequestType(InlayHintRequest.method);\n})(InlayHintRequest || (exports.InlayHintRequest = InlayHintRequest = {}));\n/**\n * A request to resolve additional properties for an inlay hint.\n * The request's parameter is of type {@link InlayHint}, the response is\n * of type {@link InlayHint} or a Thenable that resolves to such.\n *\n * @since 3.17.0\n */\nvar InlayHintResolveRequest;\n(function (InlayHintResolveRequest) {\n InlayHintResolveRequest.method = 'inlayHint/resolve';\n InlayHintResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n InlayHintResolveRequest.type = new messages_1.ProtocolRequestType(InlayHintResolveRequest.method);\n})(InlayHintResolveRequest || (exports.InlayHintResolveRequest = InlayHintResolveRequest = {}));\n/**\n * @since 3.17.0\n */\nvar InlayHintRefreshRequest;\n(function (InlayHintRefreshRequest) {\n InlayHintRefreshRequest.method = `workspace/inlayHint/refresh`;\n InlayHintRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n InlayHintRefreshRequest.type = new messages_1.ProtocolRequestType0(InlayHintRefreshRequest.method);\n})(InlayHintRefreshRequest || (exports.InlayHintRefreshRequest = InlayHintRefreshRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagnosticRefreshRequest = exports.WorkspaceDiagnosticRequest = exports.DocumentDiagnosticRequest = exports.DocumentDiagnosticReportKind = exports.DiagnosticServerCancellationData = void 0;\nconst vscode_jsonrpc_1 = require(\"vscode-jsonrpc\");\nconst Is = require(\"./utils/is\");\nconst messages_1 = require(\"./messages\");\n/**\n * @since 3.17.0\n */\nvar DiagnosticServerCancellationData;\n(function (DiagnosticServerCancellationData) {\n function is(value) {\n const candidate = value;\n return candidate && Is.boolean(candidate.retriggerRequest);\n }\n DiagnosticServerCancellationData.is = is;\n})(DiagnosticServerCancellationData || (exports.DiagnosticServerCancellationData = DiagnosticServerCancellationData = {}));\n/**\n * The document diagnostic report kinds.\n *\n * @since 3.17.0\n */\nvar DocumentDiagnosticReportKind;\n(function (DocumentDiagnosticReportKind) {\n /**\n * A diagnostic report with a full\n * set of problems.\n */\n DocumentDiagnosticReportKind.Full = 'full';\n /**\n * A report indicating that the last\n * returned report is still accurate.\n */\n DocumentDiagnosticReportKind.Unchanged = 'unchanged';\n})(DocumentDiagnosticReportKind || (exports.DocumentDiagnosticReportKind = DocumentDiagnosticReportKind = {}));\n/**\n * The document diagnostic request definition.\n *\n * @since 3.17.0\n */\nvar DocumentDiagnosticRequest;\n(function (DocumentDiagnosticRequest) {\n DocumentDiagnosticRequest.method = 'textDocument/diagnostic';\n DocumentDiagnosticRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentDiagnosticRequest.type = new messages_1.ProtocolRequestType(DocumentDiagnosticRequest.method);\n DocumentDiagnosticRequest.partialResult = new vscode_jsonrpc_1.ProgressType();\n})(DocumentDiagnosticRequest || (exports.DocumentDiagnosticRequest = DocumentDiagnosticRequest = {}));\n/**\n * The workspace diagnostic request definition.\n *\n * @since 3.17.0\n */\nvar WorkspaceDiagnosticRequest;\n(function (WorkspaceDiagnosticRequest) {\n WorkspaceDiagnosticRequest.method = 'workspace/diagnostic';\n WorkspaceDiagnosticRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WorkspaceDiagnosticRequest.type = new messages_1.ProtocolRequestType(WorkspaceDiagnosticRequest.method);\n WorkspaceDiagnosticRequest.partialResult = new vscode_jsonrpc_1.ProgressType();\n})(WorkspaceDiagnosticRequest || (exports.WorkspaceDiagnosticRequest = WorkspaceDiagnosticRequest = {}));\n/**\n * The diagnostic refresh request definition.\n *\n * @since 3.17.0\n */\nvar DiagnosticRefreshRequest;\n(function (DiagnosticRefreshRequest) {\n DiagnosticRefreshRequest.method = `workspace/diagnostic/refresh`;\n DiagnosticRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n DiagnosticRefreshRequest.type = new messages_1.ProtocolRequestType0(DiagnosticRefreshRequest.method);\n})(DiagnosticRefreshRequest || (exports.DiagnosticRefreshRequest = DiagnosticRefreshRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.ExecutionSummary = exports.NotebookCellKind = void 0;\nconst vscode_languageserver_types_1 = require(\"vscode-languageserver-types\");\nconst Is = require(\"./utils/is\");\nconst messages_1 = require(\"./messages\");\n/**\n * A notebook cell kind.\n *\n * @since 3.17.0\n */\nvar NotebookCellKind;\n(function (NotebookCellKind) {\n /**\n * A markup-cell is formatted source that is used for display.\n */\n NotebookCellKind.Markup = 1;\n /**\n * A code-cell is source code.\n */\n NotebookCellKind.Code = 2;\n function is(value) {\n return value === 1 || value === 2;\n }\n NotebookCellKind.is = is;\n})(NotebookCellKind || (exports.NotebookCellKind = NotebookCellKind = {}));\nvar ExecutionSummary;\n(function (ExecutionSummary) {\n function create(executionOrder, success) {\n const result = { executionOrder };\n if (success === true || success === false) {\n result.success = success;\n }\n return result;\n }\n ExecutionSummary.create = create;\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.executionOrder) && (candidate.success === undefined || Is.boolean(candidate.success));\n }\n ExecutionSummary.is = is;\n function equals(one, other) {\n if (one === other) {\n return true;\n }\n if (one === null || one === undefined || other === null || other === undefined) {\n return false;\n }\n return one.executionOrder === other.executionOrder && one.success === other.success;\n }\n ExecutionSummary.equals = equals;\n})(ExecutionSummary || (exports.ExecutionSummary = ExecutionSummary = {}));\nvar NotebookCell;\n(function (NotebookCell) {\n function create(kind, document) {\n return { kind, document };\n }\n NotebookCell.create = create;\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && NotebookCellKind.is(candidate.kind) && vscode_languageserver_types_1.DocumentUri.is(candidate.document) &&\n (candidate.metadata === undefined || Is.objectLiteral(candidate.metadata));\n }\n NotebookCell.is = is;\n function diff(one, two) {\n const result = new Set();\n if (one.document !== two.document) {\n result.add('document');\n }\n if (one.kind !== two.kind) {\n result.add('kind');\n }\n if (one.executionSummary !== two.executionSummary) {\n result.add('executionSummary');\n }\n if ((one.metadata !== undefined || two.metadata !== undefined) && !equalsMetadata(one.metadata, two.metadata)) {\n result.add('metadata');\n }\n if ((one.executionSummary !== undefined || two.executionSummary !== undefined) && !ExecutionSummary.equals(one.executionSummary, two.executionSummary)) {\n result.add('executionSummary');\n }\n return result;\n }\n NotebookCell.diff = diff;\n function equalsMetadata(one, other) {\n if (one === other) {\n return true;\n }\n if (one === null || one === undefined || other === null || other === undefined) {\n return false;\n }\n if (typeof one !== typeof other) {\n return false;\n }\n if (typeof one !== 'object') {\n return false;\n }\n const oneArray = Array.isArray(one);\n const otherArray = Array.isArray(other);\n if (oneArray !== otherArray) {\n return false;\n }\n if (oneArray && otherArray) {\n if (one.length !== other.length) {\n return false;\n }\n for (let i = 0; i < one.length; i++) {\n if (!equalsMetadata(one[i], other[i])) {\n return false;\n }\n }\n }\n if (Is.objectLiteral(one) && Is.objectLiteral(other)) {\n const oneKeys = Object.keys(one);\n const otherKeys = Object.keys(other);\n if (oneKeys.length !== otherKeys.length) {\n return false;\n }\n oneKeys.sort();\n otherKeys.sort();\n if (!equalsMetadata(oneKeys, otherKeys)) {\n return false;\n }\n for (let i = 0; i < oneKeys.length; i++) {\n const prop = oneKeys[i];\n if (!equalsMetadata(one[prop], other[prop])) {\n return false;\n }\n }\n }\n return true;\n }\n})(NotebookCell || (exports.NotebookCell = NotebookCell = {}));\nvar NotebookDocument;\n(function (NotebookDocument) {\n function create(uri, notebookType, version, cells) {\n return { uri, notebookType, version, cells };\n }\n NotebookDocument.create = create;\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.uri) && vscode_languageserver_types_1.integer.is(candidate.version) && Is.typedArray(candidate.cells, NotebookCell.is);\n }\n NotebookDocument.is = is;\n})(NotebookDocument || (exports.NotebookDocument = NotebookDocument = {}));\nvar NotebookDocumentSyncRegistrationType;\n(function (NotebookDocumentSyncRegistrationType) {\n NotebookDocumentSyncRegistrationType.method = 'notebookDocument/sync';\n NotebookDocumentSyncRegistrationType.messageDirection = messages_1.MessageDirection.clientToServer;\n NotebookDocumentSyncRegistrationType.type = new messages_1.RegistrationType(NotebookDocumentSyncRegistrationType.method);\n})(NotebookDocumentSyncRegistrationType || (exports.NotebookDocumentSyncRegistrationType = NotebookDocumentSyncRegistrationType = {}));\n/**\n * A notification sent when a notebook opens.\n *\n * @since 3.17.0\n */\nvar DidOpenNotebookDocumentNotification;\n(function (DidOpenNotebookDocumentNotification) {\n DidOpenNotebookDocumentNotification.method = 'notebookDocument/didOpen';\n DidOpenNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidOpenNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenNotebookDocumentNotification.method);\n DidOpenNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;\n})(DidOpenNotebookDocumentNotification || (exports.DidOpenNotebookDocumentNotification = DidOpenNotebookDocumentNotification = {}));\nvar NotebookCellArrayChange;\n(function (NotebookCellArrayChange) {\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.start) && vscode_languageserver_types_1.uinteger.is(candidate.deleteCount) && (candidate.cells === undefined || Is.typedArray(candidate.cells, NotebookCell.is));\n }\n NotebookCellArrayChange.is = is;\n function create(start, deleteCount, cells) {\n const result = { start, deleteCount };\n if (cells !== undefined) {\n result.cells = cells;\n }\n return result;\n }\n NotebookCellArrayChange.create = create;\n})(NotebookCellArrayChange || (exports.NotebookCellArrayChange = NotebookCellArrayChange = {}));\nvar DidChangeNotebookDocumentNotification;\n(function (DidChangeNotebookDocumentNotification) {\n DidChangeNotebookDocumentNotification.method = 'notebookDocument/didChange';\n DidChangeNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidChangeNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeNotebookDocumentNotification.method);\n DidChangeNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;\n})(DidChangeNotebookDocumentNotification || (exports.DidChangeNotebookDocumentNotification = DidChangeNotebookDocumentNotification = {}));\n/**\n * A notification sent when a notebook document is saved.\n *\n * @since 3.17.0\n */\nvar DidSaveNotebookDocumentNotification;\n(function (DidSaveNotebookDocumentNotification) {\n DidSaveNotebookDocumentNotification.method = 'notebookDocument/didSave';\n DidSaveNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidSaveNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveNotebookDocumentNotification.method);\n DidSaveNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;\n})(DidSaveNotebookDocumentNotification || (exports.DidSaveNotebookDocumentNotification = DidSaveNotebookDocumentNotification = {}));\n/**\n * A notification sent when a notebook closes.\n *\n * @since 3.17.0\n */\nvar DidCloseNotebookDocumentNotification;\n(function (DidCloseNotebookDocumentNotification) {\n DidCloseNotebookDocumentNotification.method = 'notebookDocument/didClose';\n DidCloseNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidCloseNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidCloseNotebookDocumentNotification.method);\n DidCloseNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;\n})(DidCloseNotebookDocumentNotification || (exports.DidCloseNotebookDocumentNotification = DidCloseNotebookDocumentNotification = {}));\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlineCompletionRequest = void 0;\nconst messages_1 = require(\"./messages\");\n/**\n * A request to provide inline completions in a document. The request's parameter is of\n * type {@link InlineCompletionParams}, the response is of type\n * {@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such.\n *\n * @since 3.18.0\n * @proposed\n */\nvar InlineCompletionRequest;\n(function (InlineCompletionRequest) {\n InlineCompletionRequest.method = 'textDocument/inlineCompletion';\n InlineCompletionRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n InlineCompletionRequest.type = new messages_1.ProtocolRequestType(InlineCompletionRequest.method);\n})(InlineCompletionRequest || (exports.InlineCompletionRequest = InlineCompletionRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkspaceSymbolRequest = exports.CodeActionResolveRequest = exports.CodeActionRequest = exports.DocumentSymbolRequest = exports.DocumentHighlightRequest = exports.ReferencesRequest = exports.DefinitionRequest = exports.SignatureHelpRequest = exports.SignatureHelpTriggerKind = exports.HoverRequest = exports.CompletionResolveRequest = exports.CompletionRequest = exports.CompletionTriggerKind = exports.PublishDiagnosticsNotification = exports.WatchKind = exports.RelativePattern = exports.FileChangeType = exports.DidChangeWatchedFilesNotification = exports.WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentNotification = exports.TextDocumentSaveReason = exports.DidSaveTextDocumentNotification = exports.DidCloseTextDocumentNotification = exports.DidChangeTextDocumentNotification = exports.TextDocumentContentChangeEvent = exports.DidOpenTextDocumentNotification = exports.TextDocumentSyncKind = exports.TelemetryEventNotification = exports.LogMessageNotification = exports.ShowMessageRequest = exports.ShowMessageNotification = exports.MessageType = exports.DidChangeConfigurationNotification = exports.ExitNotification = exports.ShutdownRequest = exports.InitializedNotification = exports.InitializeErrorCodes = exports.InitializeRequest = exports.WorkDoneProgressOptions = exports.TextDocumentRegistrationOptions = exports.StaticRegistrationOptions = exports.PositionEncodingKind = exports.FailureHandlingKind = exports.ResourceOperationKind = exports.UnregistrationRequest = exports.RegistrationRequest = exports.DocumentSelector = exports.NotebookCellTextDocumentFilter = exports.NotebookDocumentFilter = exports.TextDocumentFilter = void 0;\nexports.MonikerRequest = exports.MonikerKind = exports.UniquenessLevel = exports.WillDeleteFilesRequest = exports.DidDeleteFilesNotification = exports.WillRenameFilesRequest = exports.DidRenameFilesNotification = exports.WillCreateFilesRequest = exports.DidCreateFilesNotification = exports.FileOperationPatternKind = exports.LinkedEditingRangeRequest = exports.ShowDocumentRequest = exports.SemanticTokensRegistrationType = exports.SemanticTokensRefreshRequest = exports.SemanticTokensRangeRequest = exports.SemanticTokensDeltaRequest = exports.SemanticTokensRequest = exports.TokenFormat = exports.CallHierarchyPrepareRequest = exports.CallHierarchyOutgoingCallsRequest = exports.CallHierarchyIncomingCallsRequest = exports.WorkDoneProgressCancelNotification = exports.WorkDoneProgressCreateRequest = exports.WorkDoneProgress = exports.SelectionRangeRequest = exports.DeclarationRequest = exports.FoldingRangeRefreshRequest = exports.FoldingRangeRequest = exports.ColorPresentationRequest = exports.DocumentColorRequest = exports.ConfigurationRequest = exports.DidChangeWorkspaceFoldersNotification = exports.WorkspaceFoldersRequest = exports.TypeDefinitionRequest = exports.ImplementationRequest = exports.ApplyWorkspaceEditRequest = exports.ExecuteCommandRequest = exports.PrepareRenameRequest = exports.RenameRequest = exports.PrepareSupportDefaultBehavior = exports.DocumentOnTypeFormattingRequest = exports.DocumentRangesFormattingRequest = exports.DocumentRangeFormattingRequest = exports.DocumentFormattingRequest = exports.DocumentLinkResolveRequest = exports.DocumentLinkRequest = exports.CodeLensRefreshRequest = exports.CodeLensResolveRequest = exports.CodeLensRequest = exports.WorkspaceSymbolResolveRequest = void 0;\nexports.InlineCompletionRequest = exports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.ExecutionSummary = exports.NotebookCellKind = exports.DiagnosticRefreshRequest = exports.WorkspaceDiagnosticRequest = exports.DocumentDiagnosticRequest = exports.DocumentDiagnosticReportKind = exports.DiagnosticServerCancellationData = exports.InlayHintRefreshRequest = exports.InlayHintResolveRequest = exports.InlayHintRequest = exports.InlineValueRefreshRequest = exports.InlineValueRequest = exports.TypeHierarchySupertypesRequest = exports.TypeHierarchySubtypesRequest = exports.TypeHierarchyPrepareRequest = void 0;\nconst messages_1 = require(\"./messages\");\nconst vscode_languageserver_types_1 = require(\"vscode-languageserver-types\");\nconst Is = require(\"./utils/is\");\nconst protocol_implementation_1 = require(\"./protocol.implementation\");\nObject.defineProperty(exports, \"ImplementationRequest\", { enumerable: true, get: function () { return protocol_implementation_1.ImplementationRequest; } });\nconst protocol_typeDefinition_1 = require(\"./protocol.typeDefinition\");\nObject.defineProperty(exports, \"TypeDefinitionRequest\", { enumerable: true, get: function () { return protocol_typeDefinition_1.TypeDefinitionRequest; } });\nconst protocol_workspaceFolder_1 = require(\"./protocol.workspaceFolder\");\nObject.defineProperty(exports, \"WorkspaceFoldersRequest\", { enumerable: true, get: function () { return protocol_workspaceFolder_1.WorkspaceFoldersRequest; } });\nObject.defineProperty(exports, \"DidChangeWorkspaceFoldersNotification\", { enumerable: true, get: function () { return protocol_workspaceFolder_1.DidChangeWorkspaceFoldersNotification; } });\nconst protocol_configuration_1 = require(\"./protocol.configuration\");\nObject.defineProperty(exports, \"ConfigurationRequest\", { enumerable: true, get: function () { return protocol_configuration_1.ConfigurationRequest; } });\nconst protocol_colorProvider_1 = require(\"./protocol.colorProvider\");\nObject.defineProperty(exports, \"DocumentColorRequest\", { enumerable: true, get: function () { return protocol_colorProvider_1.DocumentColorRequest; } });\nObject.defineProperty(exports, \"ColorPresentationRequest\", { enumerable: true, get: function () { return protocol_colorProvider_1.ColorPresentationRequest; } });\nconst protocol_foldingRange_1 = require(\"./protocol.foldingRange\");\nObject.defineProperty(exports, \"FoldingRangeRequest\", { enumerable: true, get: function () { return protocol_foldingRange_1.FoldingRangeRequest; } });\nObject.defineProperty(exports, \"FoldingRangeRefreshRequest\", { enumerable: true, get: function () { return protocol_foldingRange_1.FoldingRangeRefreshRequest; } });\nconst protocol_declaration_1 = require(\"./protocol.declaration\");\nObject.defineProperty(exports, \"DeclarationRequest\", { enumerable: true, get: function () { return protocol_declaration_1.DeclarationRequest; } });\nconst protocol_selectionRange_1 = require(\"./protocol.selectionRange\");\nObject.defineProperty(exports, \"SelectionRangeRequest\", { enumerable: true, get: function () { return protocol_selectionRange_1.SelectionRangeRequest; } });\nconst protocol_progress_1 = require(\"./protocol.progress\");\nObject.defineProperty(exports, \"WorkDoneProgress\", { enumerable: true, get: function () { return protocol_progress_1.WorkDoneProgress; } });\nObject.defineProperty(exports, \"WorkDoneProgressCreateRequest\", { enumerable: true, get: function () { return protocol_progress_1.WorkDoneProgressCreateRequest; } });\nObject.defineProperty(exports, \"WorkDoneProgressCancelNotification\", { enumerable: true, get: function () { return protocol_progress_1.WorkDoneProgressCancelNotification; } });\nconst protocol_callHierarchy_1 = require(\"./protocol.callHierarchy\");\nObject.defineProperty(exports, \"CallHierarchyIncomingCallsRequest\", { enumerable: true, get: function () { return protocol_callHierarchy_1.CallHierarchyIncomingCallsRequest; } });\nObject.defineProperty(exports, \"CallHierarchyOutgoingCallsRequest\", { enumerable: true, get: function () { return protocol_callHierarchy_1.CallHierarchyOutgoingCallsRequest; } });\nObject.defineProperty(exports, \"CallHierarchyPrepareRequest\", { enumerable: true, get: function () { return protocol_callHierarchy_1.CallHierarchyPrepareRequest; } });\nconst protocol_semanticTokens_1 = require(\"./protocol.semanticTokens\");\nObject.defineProperty(exports, \"TokenFormat\", { enumerable: true, get: function () { return protocol_semanticTokens_1.TokenFormat; } });\nObject.defineProperty(exports, \"SemanticTokensRequest\", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRequest; } });\nObject.defineProperty(exports, \"SemanticTokensDeltaRequest\", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensDeltaRequest; } });\nObject.defineProperty(exports, \"SemanticTokensRangeRequest\", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRangeRequest; } });\nObject.defineProperty(exports, \"SemanticTokensRefreshRequest\", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRefreshRequest; } });\nObject.defineProperty(exports, \"SemanticTokensRegistrationType\", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRegistrationType; } });\nconst protocol_showDocument_1 = require(\"./protocol.showDocument\");\nObject.defineProperty(exports, \"ShowDocumentRequest\", { enumerable: true, get: function () { return protocol_showDocument_1.ShowDocumentRequest; } });\nconst protocol_linkedEditingRange_1 = require(\"./protocol.linkedEditingRange\");\nObject.defineProperty(exports, \"LinkedEditingRangeRequest\", { enumerable: true, get: function () { return protocol_linkedEditingRange_1.LinkedEditingRangeRequest; } });\nconst protocol_fileOperations_1 = require(\"./protocol.fileOperations\");\nObject.defineProperty(exports, \"FileOperationPatternKind\", { enumerable: true, get: function () { return protocol_fileOperations_1.FileOperationPatternKind; } });\nObject.defineProperty(exports, \"DidCreateFilesNotification\", { enumerable: true, get: function () { return protocol_fileOperations_1.DidCreateFilesNotification; } });\nObject.defineProperty(exports, \"WillCreateFilesRequest\", { enumerable: true, get: function () { return protocol_fileOperations_1.WillCreateFilesRequest; } });\nObject.defineProperty(exports, \"DidRenameFilesNotification\", { enumerable: true, get: function () { return protocol_fileOperations_1.DidRenameFilesNotification; } });\nObject.defineProperty(exports, \"WillRenameFilesRequest\", { enumerable: true, get: function () { return protocol_fileOperations_1.WillRenameFilesRequest; } });\nObject.defineProperty(exports, \"DidDeleteFilesNotification\", { enumerable: true, get: function () { return protocol_fileOperations_1.DidDeleteFilesNotification; } });\nObject.defineProperty(exports, \"WillDeleteFilesRequest\", { enumerable: true, get: function () { return protocol_fileOperations_1.WillDeleteFilesRequest; } });\nconst protocol_moniker_1 = require(\"./protocol.moniker\");\nObject.defineProperty(exports, \"UniquenessLevel\", { enumerable: true, get: function () { return protocol_moniker_1.UniquenessLevel; } });\nObject.defineProperty(exports, \"MonikerKind\", { enumerable: true, get: function () { return protocol_moniker_1.MonikerKind; } });\nObject.defineProperty(exports, \"MonikerRequest\", { enumerable: true, get: function () { return protocol_moniker_1.MonikerRequest; } });\nconst protocol_typeHierarchy_1 = require(\"./protocol.typeHierarchy\");\nObject.defineProperty(exports, \"TypeHierarchyPrepareRequest\", { enumerable: true, get: function () { return protocol_typeHierarchy_1.TypeHierarchyPrepareRequest; } });\nObject.defineProperty(exports, \"TypeHierarchySubtypesRequest\", { enumerable: true, get: function () { return protocol_typeHierarchy_1.TypeHierarchySubtypesRequest; } });\nObject.defineProperty(exports, \"TypeHierarchySupertypesRequest\", { enumerable: true, get: function () { return protocol_typeHierarchy_1.TypeHierarchySupertypesRequest; } });\nconst protocol_inlineValue_1 = require(\"./protocol.inlineValue\");\nObject.defineProperty(exports, \"InlineValueRequest\", { enumerable: true, get: function () { return protocol_inlineValue_1.InlineValueRequest; } });\nObject.defineProperty(exports, \"InlineValueRefreshRequest\", { enumerable: true, get: function () { return protocol_inlineValue_1.InlineValueRefreshRequest; } });\nconst protocol_inlayHint_1 = require(\"./protocol.inlayHint\");\nObject.defineProperty(exports, \"InlayHintRequest\", { enumerable: true, get: function () { return protocol_inlayHint_1.InlayHintRequest; } });\nObject.defineProperty(exports, \"InlayHintResolveRequest\", { enumerable: true, get: function () { return protocol_inlayHint_1.InlayHintResolveRequest; } });\nObject.defineProperty(exports, \"InlayHintRefreshRequest\", { enumerable: true, get: function () { return protocol_inlayHint_1.InlayHintRefreshRequest; } });\nconst protocol_diagnostic_1 = require(\"./protocol.diagnostic\");\nObject.defineProperty(exports, \"DiagnosticServerCancellationData\", { enumerable: true, get: function () { return protocol_diagnostic_1.DiagnosticServerCancellationData; } });\nObject.defineProperty(exports, \"DocumentDiagnosticReportKind\", { enumerable: true, get: function () { return protocol_diagnostic_1.DocumentDiagnosticReportKind; } });\nObject.defineProperty(exports, \"DocumentDiagnosticRequest\", { enumerable: true, get: function () { return protocol_diagnostic_1.DocumentDiagnosticRequest; } });\nObject.defineProperty(exports, \"WorkspaceDiagnosticRequest\", { enumerable: true, get: function () { return protocol_diagnostic_1.WorkspaceDiagnosticRequest; } });\nObject.defineProperty(exports, \"DiagnosticRefreshRequest\", { enumerable: true, get: function () { return protocol_diagnostic_1.DiagnosticRefreshRequest; } });\nconst protocol_notebook_1 = require(\"./protocol.notebook\");\nObject.defineProperty(exports, \"NotebookCellKind\", { enumerable: true, get: function () { return protocol_notebook_1.NotebookCellKind; } });\nObject.defineProperty(exports, \"ExecutionSummary\", { enumerable: true, get: function () { return protocol_notebook_1.ExecutionSummary; } });\nObject.defineProperty(exports, \"NotebookCell\", { enumerable: true, get: function () { return protocol_notebook_1.NotebookCell; } });\nObject.defineProperty(exports, \"NotebookDocument\", { enumerable: true, get: function () { return protocol_notebook_1.NotebookDocument; } });\nObject.defineProperty(exports, \"NotebookDocumentSyncRegistrationType\", { enumerable: true, get: function () { return protocol_notebook_1.NotebookDocumentSyncRegistrationType; } });\nObject.defineProperty(exports, \"DidOpenNotebookDocumentNotification\", { enumerable: true, get: function () { return protocol_notebook_1.DidOpenNotebookDocumentNotification; } });\nObject.defineProperty(exports, \"NotebookCellArrayChange\", { enumerable: true, get: function () { return protocol_notebook_1.NotebookCellArrayChange; } });\nObject.defineProperty(exports, \"DidChangeNotebookDocumentNotification\", { enumerable: true, get: function () { return protocol_notebook_1.DidChangeNotebookDocumentNotification; } });\nObject.defineProperty(exports, \"DidSaveNotebookDocumentNotification\", { enumerable: true, get: function () { return protocol_notebook_1.DidSaveNotebookDocumentNotification; } });\nObject.defineProperty(exports, \"DidCloseNotebookDocumentNotification\", { enumerable: true, get: function () { return protocol_notebook_1.DidCloseNotebookDocumentNotification; } });\nconst protocol_inlineCompletion_1 = require(\"./protocol.inlineCompletion\");\nObject.defineProperty(exports, \"InlineCompletionRequest\", { enumerable: true, get: function () { return protocol_inlineCompletion_1.InlineCompletionRequest; } });\n// @ts-ignore: to avoid inlining LocationLink as dynamic import\nlet __noDynamicImport;\n/**\n * The TextDocumentFilter namespace provides helper functions to work with\n * {@link TextDocumentFilter} literals.\n *\n * @since 3.17.0\n */\nvar TextDocumentFilter;\n(function (TextDocumentFilter) {\n function is(value) {\n const candidate = value;\n return Is.string(candidate) || (Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern));\n }\n TextDocumentFilter.is = is;\n})(TextDocumentFilter || (exports.TextDocumentFilter = TextDocumentFilter = {}));\n/**\n * The NotebookDocumentFilter namespace provides helper functions to work with\n * {@link NotebookDocumentFilter} literals.\n *\n * @since 3.17.0\n */\nvar NotebookDocumentFilter;\n(function (NotebookDocumentFilter) {\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && (Is.string(candidate.notebookType) || Is.string(candidate.scheme) || Is.string(candidate.pattern));\n }\n NotebookDocumentFilter.is = is;\n})(NotebookDocumentFilter || (exports.NotebookDocumentFilter = NotebookDocumentFilter = {}));\n/**\n * The NotebookCellTextDocumentFilter namespace provides helper functions to work with\n * {@link NotebookCellTextDocumentFilter} literals.\n *\n * @since 3.17.0\n */\nvar NotebookCellTextDocumentFilter;\n(function (NotebookCellTextDocumentFilter) {\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate)\n && (Is.string(candidate.notebook) || NotebookDocumentFilter.is(candidate.notebook))\n && (candidate.language === undefined || Is.string(candidate.language));\n }\n NotebookCellTextDocumentFilter.is = is;\n})(NotebookCellTextDocumentFilter || (exports.NotebookCellTextDocumentFilter = NotebookCellTextDocumentFilter = {}));\n/**\n * The DocumentSelector namespace provides helper functions to work with\n * {@link DocumentSelector}s.\n */\nvar DocumentSelector;\n(function (DocumentSelector) {\n function is(value) {\n if (!Array.isArray(value)) {\n return false;\n }\n for (let elem of value) {\n if (!Is.string(elem) && !TextDocumentFilter.is(elem) && !NotebookCellTextDocumentFilter.is(elem)) {\n return false;\n }\n }\n return true;\n }\n DocumentSelector.is = is;\n})(DocumentSelector || (exports.DocumentSelector = DocumentSelector = {}));\n/**\n * The `client/registerCapability` request is sent from the server to the client to register a new capability\n * handler on the client side.\n */\nvar RegistrationRequest;\n(function (RegistrationRequest) {\n RegistrationRequest.method = 'client/registerCapability';\n RegistrationRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n RegistrationRequest.type = new messages_1.ProtocolRequestType(RegistrationRequest.method);\n})(RegistrationRequest || (exports.RegistrationRequest = RegistrationRequest = {}));\n/**\n * The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability\n * handler on the client side.\n */\nvar UnregistrationRequest;\n(function (UnregistrationRequest) {\n UnregistrationRequest.method = 'client/unregisterCapability';\n UnregistrationRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n UnregistrationRequest.type = new messages_1.ProtocolRequestType(UnregistrationRequest.method);\n})(UnregistrationRequest || (exports.UnregistrationRequest = UnregistrationRequest = {}));\nvar ResourceOperationKind;\n(function (ResourceOperationKind) {\n /**\n * Supports creating new files and folders.\n */\n ResourceOperationKind.Create = 'create';\n /**\n * Supports renaming existing files and folders.\n */\n ResourceOperationKind.Rename = 'rename';\n /**\n * Supports deleting existing files and folders.\n */\n ResourceOperationKind.Delete = 'delete';\n})(ResourceOperationKind || (exports.ResourceOperationKind = ResourceOperationKind = {}));\nvar FailureHandlingKind;\n(function (FailureHandlingKind) {\n /**\n * Applying the workspace change is simply aborted if one of the changes provided\n * fails. All operations executed before the failing operation stay executed.\n */\n FailureHandlingKind.Abort = 'abort';\n /**\n * All operations are executed transactional. That means they either all\n * succeed or no changes at all are applied to the workspace.\n */\n FailureHandlingKind.Transactional = 'transactional';\n /**\n * If the workspace edit contains only textual file changes they are executed transactional.\n * If resource changes (create, rename or delete file) are part of the change the failure\n * handling strategy is abort.\n */\n FailureHandlingKind.TextOnlyTransactional = 'textOnlyTransactional';\n /**\n * The client tries to undo the operations already executed. But there is no\n * guarantee that this is succeeding.\n */\n FailureHandlingKind.Undo = 'undo';\n})(FailureHandlingKind || (exports.FailureHandlingKind = FailureHandlingKind = {}));\n/**\n * A set of predefined position encoding kinds.\n *\n * @since 3.17.0\n */\nvar PositionEncodingKind;\n(function (PositionEncodingKind) {\n /**\n * Character offsets count UTF-8 code units (e.g. bytes).\n */\n PositionEncodingKind.UTF8 = 'utf-8';\n /**\n * Character offsets count UTF-16 code units.\n *\n * This is the default and must always be supported\n * by servers\n */\n PositionEncodingKind.UTF16 = 'utf-16';\n /**\n * Character offsets count UTF-32 code units.\n *\n * Implementation note: these are the same as Unicode codepoints,\n * so this `PositionEncodingKind` may also be used for an\n * encoding-agnostic representation of character offsets.\n */\n PositionEncodingKind.UTF32 = 'utf-32';\n})(PositionEncodingKind || (exports.PositionEncodingKind = PositionEncodingKind = {}));\n/**\n * The StaticRegistrationOptions namespace provides helper functions to work with\n * {@link StaticRegistrationOptions} literals.\n */\nvar StaticRegistrationOptions;\n(function (StaticRegistrationOptions) {\n function hasId(value) {\n const candidate = value;\n return candidate && Is.string(candidate.id) && candidate.id.length > 0;\n }\n StaticRegistrationOptions.hasId = hasId;\n})(StaticRegistrationOptions || (exports.StaticRegistrationOptions = StaticRegistrationOptions = {}));\n/**\n * The TextDocumentRegistrationOptions namespace provides helper functions to work with\n * {@link TextDocumentRegistrationOptions} literals.\n */\nvar TextDocumentRegistrationOptions;\n(function (TextDocumentRegistrationOptions) {\n function is(value) {\n const candidate = value;\n return candidate && (candidate.documentSelector === null || DocumentSelector.is(candidate.documentSelector));\n }\n TextDocumentRegistrationOptions.is = is;\n})(TextDocumentRegistrationOptions || (exports.TextDocumentRegistrationOptions = TextDocumentRegistrationOptions = {}));\n/**\n * The WorkDoneProgressOptions namespace provides helper functions to work with\n * {@link WorkDoneProgressOptions} literals.\n */\nvar WorkDoneProgressOptions;\n(function (WorkDoneProgressOptions) {\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && (candidate.workDoneProgress === undefined || Is.boolean(candidate.workDoneProgress));\n }\n WorkDoneProgressOptions.is = is;\n function hasWorkDoneProgress(value) {\n const candidate = value;\n return candidate && Is.boolean(candidate.workDoneProgress);\n }\n WorkDoneProgressOptions.hasWorkDoneProgress = hasWorkDoneProgress;\n})(WorkDoneProgressOptions || (exports.WorkDoneProgressOptions = WorkDoneProgressOptions = {}));\n/**\n * The initialize request is sent from the client to the server.\n * It is sent once as the request after starting up the server.\n * The requests parameter is of type {@link InitializeParams}\n * the response if of type {@link InitializeResult} of a Thenable that\n * resolves to such.\n */\nvar InitializeRequest;\n(function (InitializeRequest) {\n InitializeRequest.method = 'initialize';\n InitializeRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n InitializeRequest.type = new messages_1.ProtocolRequestType(InitializeRequest.method);\n})(InitializeRequest || (exports.InitializeRequest = InitializeRequest = {}));\n/**\n * Known error codes for an `InitializeErrorCodes`;\n */\nvar InitializeErrorCodes;\n(function (InitializeErrorCodes) {\n /**\n * If the protocol version provided by the client can't be handled by the server.\n *\n * @deprecated This initialize error got replaced by client capabilities. There is\n * no version handshake in version 3.0x\n */\n InitializeErrorCodes.unknownProtocolVersion = 1;\n})(InitializeErrorCodes || (exports.InitializeErrorCodes = InitializeErrorCodes = {}));\n/**\n * The initialized notification is sent from the client to the\n * server after the client is fully initialized and the server\n * is allowed to send requests from the server to the client.\n */\nvar InitializedNotification;\n(function (InitializedNotification) {\n InitializedNotification.method = 'initialized';\n InitializedNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n InitializedNotification.type = new messages_1.ProtocolNotificationType(InitializedNotification.method);\n})(InitializedNotification || (exports.InitializedNotification = InitializedNotification = {}));\n//---- Shutdown Method ----\n/**\n * A shutdown request is sent from the client to the server.\n * It is sent once when the client decides to shutdown the\n * server. The only notification that is sent after a shutdown request\n * is the exit event.\n */\nvar ShutdownRequest;\n(function (ShutdownRequest) {\n ShutdownRequest.method = 'shutdown';\n ShutdownRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n ShutdownRequest.type = new messages_1.ProtocolRequestType0(ShutdownRequest.method);\n})(ShutdownRequest || (exports.ShutdownRequest = ShutdownRequest = {}));\n//---- Exit Notification ----\n/**\n * The exit event is sent from the client to the server to\n * ask the server to exit its process.\n */\nvar ExitNotification;\n(function (ExitNotification) {\n ExitNotification.method = 'exit';\n ExitNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n ExitNotification.type = new messages_1.ProtocolNotificationType0(ExitNotification.method);\n})(ExitNotification || (exports.ExitNotification = ExitNotification = {}));\n/**\n * The configuration change notification is sent from the client to the server\n * when the client's configuration has changed. The notification contains\n * the changed configuration as defined by the language client.\n */\nvar DidChangeConfigurationNotification;\n(function (DidChangeConfigurationNotification) {\n DidChangeConfigurationNotification.method = 'workspace/didChangeConfiguration';\n DidChangeConfigurationNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidChangeConfigurationNotification.type = new messages_1.ProtocolNotificationType(DidChangeConfigurationNotification.method);\n})(DidChangeConfigurationNotification || (exports.DidChangeConfigurationNotification = DidChangeConfigurationNotification = {}));\n//---- Message show and log notifications ----\n/**\n * The message type\n */\nvar MessageType;\n(function (MessageType) {\n /**\n * An error message.\n */\n MessageType.Error = 1;\n /**\n * A warning message.\n */\n MessageType.Warning = 2;\n /**\n * An information message.\n */\n MessageType.Info = 3;\n /**\n * A log message.\n */\n MessageType.Log = 4;\n /**\n * A debug message.\n *\n * @since 3.18.0\n */\n MessageType.Debug = 5;\n})(MessageType || (exports.MessageType = MessageType = {}));\n/**\n * The show message notification is sent from a server to a client to ask\n * the client to display a particular message in the user interface.\n */\nvar ShowMessageNotification;\n(function (ShowMessageNotification) {\n ShowMessageNotification.method = 'window/showMessage';\n ShowMessageNotification.messageDirection = messages_1.MessageDirection.serverToClient;\n ShowMessageNotification.type = new messages_1.ProtocolNotificationType(ShowMessageNotification.method);\n})(ShowMessageNotification || (exports.ShowMessageNotification = ShowMessageNotification = {}));\n/**\n * The show message request is sent from the server to the client to show a message\n * and a set of options actions to the user.\n */\nvar ShowMessageRequest;\n(function (ShowMessageRequest) {\n ShowMessageRequest.method = 'window/showMessageRequest';\n ShowMessageRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n ShowMessageRequest.type = new messages_1.ProtocolRequestType(ShowMessageRequest.method);\n})(ShowMessageRequest || (exports.ShowMessageRequest = ShowMessageRequest = {}));\n/**\n * The log message notification is sent from the server to the client to ask\n * the client to log a particular message.\n */\nvar LogMessageNotification;\n(function (LogMessageNotification) {\n LogMessageNotification.method = 'window/logMessage';\n LogMessageNotification.messageDirection = messages_1.MessageDirection.serverToClient;\n LogMessageNotification.type = new messages_1.ProtocolNotificationType(LogMessageNotification.method);\n})(LogMessageNotification || (exports.LogMessageNotification = LogMessageNotification = {}));\n//---- Telemetry notification\n/**\n * The telemetry event notification is sent from the server to the client to ask\n * the client to log telemetry data.\n */\nvar TelemetryEventNotification;\n(function (TelemetryEventNotification) {\n TelemetryEventNotification.method = 'telemetry/event';\n TelemetryEventNotification.messageDirection = messages_1.MessageDirection.serverToClient;\n TelemetryEventNotification.type = new messages_1.ProtocolNotificationType(TelemetryEventNotification.method);\n})(TelemetryEventNotification || (exports.TelemetryEventNotification = TelemetryEventNotification = {}));\n/**\n * Defines how the host (editor) should sync\n * document changes to the language server.\n */\nvar TextDocumentSyncKind;\n(function (TextDocumentSyncKind) {\n /**\n * Documents should not be synced at all.\n */\n TextDocumentSyncKind.None = 0;\n /**\n * Documents are synced by always sending the full content\n * of the document.\n */\n TextDocumentSyncKind.Full = 1;\n /**\n * Documents are synced by sending the full content on open.\n * After that only incremental updates to the document are\n * send.\n */\n TextDocumentSyncKind.Incremental = 2;\n})(TextDocumentSyncKind || (exports.TextDocumentSyncKind = TextDocumentSyncKind = {}));\n/**\n * The document open notification is sent from the client to the server to signal\n * newly opened text documents. The document's truth is now managed by the client\n * and the server must not try to read the document's truth using the document's\n * uri. Open in this sense means it is managed by the client. It doesn't necessarily\n * mean that its content is presented in an editor. An open notification must not\n * be sent more than once without a corresponding close notification send before.\n * This means open and close notification must be balanced and the max open count\n * is one.\n */\nvar DidOpenTextDocumentNotification;\n(function (DidOpenTextDocumentNotification) {\n DidOpenTextDocumentNotification.method = 'textDocument/didOpen';\n DidOpenTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidOpenTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenTextDocumentNotification.method);\n})(DidOpenTextDocumentNotification || (exports.DidOpenTextDocumentNotification = DidOpenTextDocumentNotification = {}));\nvar TextDocumentContentChangeEvent;\n(function (TextDocumentContentChangeEvent) {\n /**\n * Checks whether the information describes a delta event.\n */\n function isIncremental(event) {\n let candidate = event;\n return candidate !== undefined && candidate !== null &&\n typeof candidate.text === 'string' && candidate.range !== undefined &&\n (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number');\n }\n TextDocumentContentChangeEvent.isIncremental = isIncremental;\n /**\n * Checks whether the information describes a full replacement event.\n */\n function isFull(event) {\n let candidate = event;\n return candidate !== undefined && candidate !== null &&\n typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined;\n }\n TextDocumentContentChangeEvent.isFull = isFull;\n})(TextDocumentContentChangeEvent || (exports.TextDocumentContentChangeEvent = TextDocumentContentChangeEvent = {}));\n/**\n * The document change notification is sent from the client to the server to signal\n * changes to a text document.\n */\nvar DidChangeTextDocumentNotification;\n(function (DidChangeTextDocumentNotification) {\n DidChangeTextDocumentNotification.method = 'textDocument/didChange';\n DidChangeTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidChangeTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeTextDocumentNotification.method);\n})(DidChangeTextDocumentNotification || (exports.DidChangeTextDocumentNotification = DidChangeTextDocumentNotification = {}));\n/**\n * The document close notification is sent from the client to the server when\n * the document got closed in the client. The document's truth now exists where\n * the document's uri points to (e.g. if the document's uri is a file uri the\n * truth now exists on disk). As with the open notification the close notification\n * is about managing the document's content. Receiving a close notification\n * doesn't mean that the document was open in an editor before. A close\n * notification requires a previous open notification to be sent.\n */\nvar DidCloseTextDocumentNotification;\n(function (DidCloseTextDocumentNotification) {\n DidCloseTextDocumentNotification.method = 'textDocument/didClose';\n DidCloseTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidCloseTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidCloseTextDocumentNotification.method);\n})(DidCloseTextDocumentNotification || (exports.DidCloseTextDocumentNotification = DidCloseTextDocumentNotification = {}));\n/**\n * The document save notification is sent from the client to the server when\n * the document got saved in the client.\n */\nvar DidSaveTextDocumentNotification;\n(function (DidSaveTextDocumentNotification) {\n DidSaveTextDocumentNotification.method = 'textDocument/didSave';\n DidSaveTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveTextDocumentNotification.method);\n})(DidSaveTextDocumentNotification || (exports.DidSaveTextDocumentNotification = DidSaveTextDocumentNotification = {}));\n/**\n * Represents reasons why a text document is saved.\n */\nvar TextDocumentSaveReason;\n(function (TextDocumentSaveReason) {\n /**\n * Manually triggered, e.g. by the user pressing save, by starting debugging,\n * or by an API call.\n */\n TextDocumentSaveReason.Manual = 1;\n /**\n * Automatic after a delay.\n */\n TextDocumentSaveReason.AfterDelay = 2;\n /**\n * When the editor lost focus.\n */\n TextDocumentSaveReason.FocusOut = 3;\n})(TextDocumentSaveReason || (exports.TextDocumentSaveReason = TextDocumentSaveReason = {}));\n/**\n * A document will save notification is sent from the client to the server before\n * the document is actually saved.\n */\nvar WillSaveTextDocumentNotification;\n(function (WillSaveTextDocumentNotification) {\n WillSaveTextDocumentNotification.method = 'textDocument/willSave';\n WillSaveTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n WillSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(WillSaveTextDocumentNotification.method);\n})(WillSaveTextDocumentNotification || (exports.WillSaveTextDocumentNotification = WillSaveTextDocumentNotification = {}));\n/**\n * A document will save request is sent from the client to the server before\n * the document is actually saved. The request can return an array of TextEdits\n * which will be applied to the text document before it is saved. Please note that\n * clients might drop results if computing the text edits took too long or if a\n * server constantly fails on this request. This is done to keep the save fast and\n * reliable.\n */\nvar WillSaveTextDocumentWaitUntilRequest;\n(function (WillSaveTextDocumentWaitUntilRequest) {\n WillSaveTextDocumentWaitUntilRequest.method = 'textDocument/willSaveWaitUntil';\n WillSaveTextDocumentWaitUntilRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WillSaveTextDocumentWaitUntilRequest.type = new messages_1.ProtocolRequestType(WillSaveTextDocumentWaitUntilRequest.method);\n})(WillSaveTextDocumentWaitUntilRequest || (exports.WillSaveTextDocumentWaitUntilRequest = WillSaveTextDocumentWaitUntilRequest = {}));\n/**\n * The watched files notification is sent from the client to the server when\n * the client detects changes to file watched by the language client.\n */\nvar DidChangeWatchedFilesNotification;\n(function (DidChangeWatchedFilesNotification) {\n DidChangeWatchedFilesNotification.method = 'workspace/didChangeWatchedFiles';\n DidChangeWatchedFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;\n DidChangeWatchedFilesNotification.type = new messages_1.ProtocolNotificationType(DidChangeWatchedFilesNotification.method);\n})(DidChangeWatchedFilesNotification || (exports.DidChangeWatchedFilesNotification = DidChangeWatchedFilesNotification = {}));\n/**\n * The file event type\n */\nvar FileChangeType;\n(function (FileChangeType) {\n /**\n * The file got created.\n */\n FileChangeType.Created = 1;\n /**\n * The file got changed.\n */\n FileChangeType.Changed = 2;\n /**\n * The file got deleted.\n */\n FileChangeType.Deleted = 3;\n})(FileChangeType || (exports.FileChangeType = FileChangeType = {}));\nvar RelativePattern;\n(function (RelativePattern) {\n function is(value) {\n const candidate = value;\n return Is.objectLiteral(candidate) && (vscode_languageserver_types_1.URI.is(candidate.baseUri) || vscode_languageserver_types_1.WorkspaceFolder.is(candidate.baseUri)) && Is.string(candidate.pattern);\n }\n RelativePattern.is = is;\n})(RelativePattern || (exports.RelativePattern = RelativePattern = {}));\nvar WatchKind;\n(function (WatchKind) {\n /**\n * Interested in create events.\n */\n WatchKind.Create = 1;\n /**\n * Interested in change events\n */\n WatchKind.Change = 2;\n /**\n * Interested in delete events\n */\n WatchKind.Delete = 4;\n})(WatchKind || (exports.WatchKind = WatchKind = {}));\n/**\n * Diagnostics notification are sent from the server to the client to signal\n * results of validation runs.\n */\nvar PublishDiagnosticsNotification;\n(function (PublishDiagnosticsNotification) {\n PublishDiagnosticsNotification.method = 'textDocument/publishDiagnostics';\n PublishDiagnosticsNotification.messageDirection = messages_1.MessageDirection.serverToClient;\n PublishDiagnosticsNotification.type = new messages_1.ProtocolNotificationType(PublishDiagnosticsNotification.method);\n})(PublishDiagnosticsNotification || (exports.PublishDiagnosticsNotification = PublishDiagnosticsNotification = {}));\n/**\n * How a completion was triggered\n */\nvar CompletionTriggerKind;\n(function (CompletionTriggerKind) {\n /**\n * Completion was triggered by typing an identifier (24x7 code\n * complete), manual invocation (e.g Ctrl+Space) or via API.\n */\n CompletionTriggerKind.Invoked = 1;\n /**\n * Completion was triggered by a trigger character specified by\n * the `triggerCharacters` properties of the `CompletionRegistrationOptions`.\n */\n CompletionTriggerKind.TriggerCharacter = 2;\n /**\n * Completion was re-triggered as current completion list is incomplete\n */\n CompletionTriggerKind.TriggerForIncompleteCompletions = 3;\n})(CompletionTriggerKind || (exports.CompletionTriggerKind = CompletionTriggerKind = {}));\n/**\n * Request to request completion at a given text document position. The request's\n * parameter is of type {@link TextDocumentPosition} the response\n * is of type {@link CompletionItem CompletionItem[]} or {@link CompletionList}\n * or a Thenable that resolves to such.\n *\n * The request can delay the computation of the {@link CompletionItem.detail `detail`}\n * and {@link CompletionItem.documentation `documentation`} properties to the `completionItem/resolve`\n * request. However, properties that are needed for the initial sorting and filtering, like `sortText`,\n * `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.\n */\nvar CompletionRequest;\n(function (CompletionRequest) {\n CompletionRequest.method = 'textDocument/completion';\n CompletionRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CompletionRequest.type = new messages_1.ProtocolRequestType(CompletionRequest.method);\n})(CompletionRequest || (exports.CompletionRequest = CompletionRequest = {}));\n/**\n * Request to resolve additional information for a given completion item.The request's\n * parameter is of type {@link CompletionItem} the response\n * is of type {@link CompletionItem} or a Thenable that resolves to such.\n */\nvar CompletionResolveRequest;\n(function (CompletionResolveRequest) {\n CompletionResolveRequest.method = 'completionItem/resolve';\n CompletionResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CompletionResolveRequest.type = new messages_1.ProtocolRequestType(CompletionResolveRequest.method);\n})(CompletionResolveRequest || (exports.CompletionResolveRequest = CompletionResolveRequest = {}));\n/**\n * Request to request hover information at a given text document position. The request's\n * parameter is of type {@link TextDocumentPosition} the response is of\n * type {@link Hover} or a Thenable that resolves to such.\n */\nvar HoverRequest;\n(function (HoverRequest) {\n HoverRequest.method = 'textDocument/hover';\n HoverRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n HoverRequest.type = new messages_1.ProtocolRequestType(HoverRequest.method);\n})(HoverRequest || (exports.HoverRequest = HoverRequest = {}));\n/**\n * How a signature help was triggered.\n *\n * @since 3.15.0\n */\nvar SignatureHelpTriggerKind;\n(function (SignatureHelpTriggerKind) {\n /**\n * Signature help was invoked manually by the user or by a command.\n */\n SignatureHelpTriggerKind.Invoked = 1;\n /**\n * Signature help was triggered by a trigger character.\n */\n SignatureHelpTriggerKind.TriggerCharacter = 2;\n /**\n * Signature help was triggered by the cursor moving or by the document content changing.\n */\n SignatureHelpTriggerKind.ContentChange = 3;\n})(SignatureHelpTriggerKind || (exports.SignatureHelpTriggerKind = SignatureHelpTriggerKind = {}));\nvar SignatureHelpRequest;\n(function (SignatureHelpRequest) {\n SignatureHelpRequest.method = 'textDocument/signatureHelp';\n SignatureHelpRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n SignatureHelpRequest.type = new messages_1.ProtocolRequestType(SignatureHelpRequest.method);\n})(SignatureHelpRequest || (exports.SignatureHelpRequest = SignatureHelpRequest = {}));\n/**\n * A request to resolve the definition location of a symbol at a given text\n * document position. The request's parameter is of type {@link TextDocumentPosition}\n * the response is of either type {@link Definition} or a typed array of\n * {@link DefinitionLink} or a Thenable that resolves to such.\n */\nvar DefinitionRequest;\n(function (DefinitionRequest) {\n DefinitionRequest.method = 'textDocument/definition';\n DefinitionRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DefinitionRequest.type = new messages_1.ProtocolRequestType(DefinitionRequest.method);\n})(DefinitionRequest || (exports.DefinitionRequest = DefinitionRequest = {}));\n/**\n * A request to resolve project-wide references for the symbol denoted\n * by the given text document position. The request's parameter is of\n * type {@link ReferenceParams} the response is of type\n * {@link Location Location[]} or a Thenable that resolves to such.\n */\nvar ReferencesRequest;\n(function (ReferencesRequest) {\n ReferencesRequest.method = 'textDocument/references';\n ReferencesRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n ReferencesRequest.type = new messages_1.ProtocolRequestType(ReferencesRequest.method);\n})(ReferencesRequest || (exports.ReferencesRequest = ReferencesRequest = {}));\n/**\n * Request to resolve a {@link DocumentHighlight} for a given\n * text document position. The request's parameter is of type {@link TextDocumentPosition}\n * the request response is an array of type {@link DocumentHighlight}\n * or a Thenable that resolves to such.\n */\nvar DocumentHighlightRequest;\n(function (DocumentHighlightRequest) {\n DocumentHighlightRequest.method = 'textDocument/documentHighlight';\n DocumentHighlightRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentHighlightRequest.type = new messages_1.ProtocolRequestType(DocumentHighlightRequest.method);\n})(DocumentHighlightRequest || (exports.DocumentHighlightRequest = DocumentHighlightRequest = {}));\n/**\n * A request to list all symbols found in a given text document. The request's\n * parameter is of type {@link TextDocumentIdentifier} the\n * response is of type {@link SymbolInformation SymbolInformation[]} or a Thenable\n * that resolves to such.\n */\nvar DocumentSymbolRequest;\n(function (DocumentSymbolRequest) {\n DocumentSymbolRequest.method = 'textDocument/documentSymbol';\n DocumentSymbolRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentSymbolRequest.type = new messages_1.ProtocolRequestType(DocumentSymbolRequest.method);\n})(DocumentSymbolRequest || (exports.DocumentSymbolRequest = DocumentSymbolRequest = {}));\n/**\n * A request to provide commands for the given text document and range.\n */\nvar CodeActionRequest;\n(function (CodeActionRequest) {\n CodeActionRequest.method = 'textDocument/codeAction';\n CodeActionRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CodeActionRequest.type = new messages_1.ProtocolRequestType(CodeActionRequest.method);\n})(CodeActionRequest || (exports.CodeActionRequest = CodeActionRequest = {}));\n/**\n * Request to resolve additional information for a given code action.The request's\n * parameter is of type {@link CodeAction} the response\n * is of type {@link CodeAction} or a Thenable that resolves to such.\n */\nvar CodeActionResolveRequest;\n(function (CodeActionResolveRequest) {\n CodeActionResolveRequest.method = 'codeAction/resolve';\n CodeActionResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CodeActionResolveRequest.type = new messages_1.ProtocolRequestType(CodeActionResolveRequest.method);\n})(CodeActionResolveRequest || (exports.CodeActionResolveRequest = CodeActionResolveRequest = {}));\n/**\n * A request to list project-wide symbols matching the query string given\n * by the {@link WorkspaceSymbolParams}. The response is\n * of type {@link SymbolInformation SymbolInformation[]} or a Thenable that\n * resolves to such.\n *\n * @since 3.17.0 - support for WorkspaceSymbol in the returned data. Clients\n * need to advertise support for WorkspaceSymbols via the client capability\n * `workspace.symbol.resolveSupport`.\n *\n */\nvar WorkspaceSymbolRequest;\n(function (WorkspaceSymbolRequest) {\n WorkspaceSymbolRequest.method = 'workspace/symbol';\n WorkspaceSymbolRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WorkspaceSymbolRequest.type = new messages_1.ProtocolRequestType(WorkspaceSymbolRequest.method);\n})(WorkspaceSymbolRequest || (exports.WorkspaceSymbolRequest = WorkspaceSymbolRequest = {}));\n/**\n * A request to resolve the range inside the workspace\n * symbol's location.\n *\n * @since 3.17.0\n */\nvar WorkspaceSymbolResolveRequest;\n(function (WorkspaceSymbolResolveRequest) {\n WorkspaceSymbolResolveRequest.method = 'workspaceSymbol/resolve';\n WorkspaceSymbolResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n WorkspaceSymbolResolveRequest.type = new messages_1.ProtocolRequestType(WorkspaceSymbolResolveRequest.method);\n})(WorkspaceSymbolResolveRequest || (exports.WorkspaceSymbolResolveRequest = WorkspaceSymbolResolveRequest = {}));\n/**\n * A request to provide code lens for the given text document.\n */\nvar CodeLensRequest;\n(function (CodeLensRequest) {\n CodeLensRequest.method = 'textDocument/codeLens';\n CodeLensRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CodeLensRequest.type = new messages_1.ProtocolRequestType(CodeLensRequest.method);\n})(CodeLensRequest || (exports.CodeLensRequest = CodeLensRequest = {}));\n/**\n * A request to resolve a command for a given code lens.\n */\nvar CodeLensResolveRequest;\n(function (CodeLensResolveRequest) {\n CodeLensResolveRequest.method = 'codeLens/resolve';\n CodeLensResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n CodeLensResolveRequest.type = new messages_1.ProtocolRequestType(CodeLensResolveRequest.method);\n})(CodeLensResolveRequest || (exports.CodeLensResolveRequest = CodeLensResolveRequest = {}));\n/**\n * A request to refresh all code actions\n *\n * @since 3.16.0\n */\nvar CodeLensRefreshRequest;\n(function (CodeLensRefreshRequest) {\n CodeLensRefreshRequest.method = `workspace/codeLens/refresh`;\n CodeLensRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n CodeLensRefreshRequest.type = new messages_1.ProtocolRequestType0(CodeLensRefreshRequest.method);\n})(CodeLensRefreshRequest || (exports.CodeLensRefreshRequest = CodeLensRefreshRequest = {}));\n/**\n * A request to provide document links\n */\nvar DocumentLinkRequest;\n(function (DocumentLinkRequest) {\n DocumentLinkRequest.method = 'textDocument/documentLink';\n DocumentLinkRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentLinkRequest.type = new messages_1.ProtocolRequestType(DocumentLinkRequest.method);\n})(DocumentLinkRequest || (exports.DocumentLinkRequest = DocumentLinkRequest = {}));\n/**\n * Request to resolve additional information for a given document link. The request's\n * parameter is of type {@link DocumentLink} the response\n * is of type {@link DocumentLink} or a Thenable that resolves to such.\n */\nvar DocumentLinkResolveRequest;\n(function (DocumentLinkResolveRequest) {\n DocumentLinkResolveRequest.method = 'documentLink/resolve';\n DocumentLinkResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentLinkResolveRequest.type = new messages_1.ProtocolRequestType(DocumentLinkResolveRequest.method);\n})(DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = DocumentLinkResolveRequest = {}));\n/**\n * A request to format a whole document.\n */\nvar DocumentFormattingRequest;\n(function (DocumentFormattingRequest) {\n DocumentFormattingRequest.method = 'textDocument/formatting';\n DocumentFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentFormattingRequest.method);\n})(DocumentFormattingRequest || (exports.DocumentFormattingRequest = DocumentFormattingRequest = {}));\n/**\n * A request to format a range in a document.\n */\nvar DocumentRangeFormattingRequest;\n(function (DocumentRangeFormattingRequest) {\n DocumentRangeFormattingRequest.method = 'textDocument/rangeFormatting';\n DocumentRangeFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentRangeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentRangeFormattingRequest.method);\n})(DocumentRangeFormattingRequest || (exports.DocumentRangeFormattingRequest = DocumentRangeFormattingRequest = {}));\n/**\n * A request to format ranges in a document.\n *\n * @since 3.18.0\n * @proposed\n */\nvar DocumentRangesFormattingRequest;\n(function (DocumentRangesFormattingRequest) {\n DocumentRangesFormattingRequest.method = 'textDocument/rangesFormatting';\n DocumentRangesFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentRangesFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentRangesFormattingRequest.method);\n})(DocumentRangesFormattingRequest || (exports.DocumentRangesFormattingRequest = DocumentRangesFormattingRequest = {}));\n/**\n * A request to format a document on type.\n */\nvar DocumentOnTypeFormattingRequest;\n(function (DocumentOnTypeFormattingRequest) {\n DocumentOnTypeFormattingRequest.method = 'textDocument/onTypeFormatting';\n DocumentOnTypeFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n DocumentOnTypeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentOnTypeFormattingRequest.method);\n})(DocumentOnTypeFormattingRequest || (exports.DocumentOnTypeFormattingRequest = DocumentOnTypeFormattingRequest = {}));\n//---- Rename ----------------------------------------------\nvar PrepareSupportDefaultBehavior;\n(function (PrepareSupportDefaultBehavior) {\n /**\n * The client's default behavior is to select the identifier\n * according the to language's syntax rule.\n */\n PrepareSupportDefaultBehavior.Identifier = 1;\n})(PrepareSupportDefaultBehavior || (exports.PrepareSupportDefaultBehavior = PrepareSupportDefaultBehavior = {}));\n/**\n * A request to rename a symbol.\n */\nvar RenameRequest;\n(function (RenameRequest) {\n RenameRequest.method = 'textDocument/rename';\n RenameRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n RenameRequest.type = new messages_1.ProtocolRequestType(RenameRequest.method);\n})(RenameRequest || (exports.RenameRequest = RenameRequest = {}));\n/**\n * A request to test and perform the setup necessary for a rename.\n *\n * @since 3.16 - support for default behavior\n */\nvar PrepareRenameRequest;\n(function (PrepareRenameRequest) {\n PrepareRenameRequest.method = 'textDocument/prepareRename';\n PrepareRenameRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n PrepareRenameRequest.type = new messages_1.ProtocolRequestType(PrepareRenameRequest.method);\n})(PrepareRenameRequest || (exports.PrepareRenameRequest = PrepareRenameRequest = {}));\n/**\n * A request send from the client to the server to execute a command. The request might return\n * a workspace edit which the client will apply to the workspace.\n */\nvar ExecuteCommandRequest;\n(function (ExecuteCommandRequest) {\n ExecuteCommandRequest.method = 'workspace/executeCommand';\n ExecuteCommandRequest.messageDirection = messages_1.MessageDirection.clientToServer;\n ExecuteCommandRequest.type = new messages_1.ProtocolRequestType(ExecuteCommandRequest.method);\n})(ExecuteCommandRequest || (exports.ExecuteCommandRequest = ExecuteCommandRequest = {}));\n/**\n * A request sent from the server to the client to modified certain resources.\n */\nvar ApplyWorkspaceEditRequest;\n(function (ApplyWorkspaceEditRequest) {\n ApplyWorkspaceEditRequest.method = 'workspace/applyEdit';\n ApplyWorkspaceEditRequest.messageDirection = messages_1.MessageDirection.serverToClient;\n ApplyWorkspaceEditRequest.type = new messages_1.ProtocolRequestType('workspace/applyEdit');\n})(ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = ApplyWorkspaceEditRequest = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createProtocolConnection = void 0;\nconst vscode_jsonrpc_1 = require(\"vscode-jsonrpc\");\nfunction createProtocolConnection(input, output, logger, options) {\n if (vscode_jsonrpc_1.ConnectionStrategy.is(options)) {\n options = { connectionStrategy: options };\n }\n return (0, vscode_jsonrpc_1.createMessageConnection)(input, output, logger, options);\n}\nexports.createProtocolConnection = createProtocolConnection;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LSPErrorCodes = exports.createProtocolConnection = void 0;\n__exportStar(require(\"vscode-jsonrpc\"), exports);\n__exportStar(require(\"vscode-languageserver-types\"), exports);\n__exportStar(require(\"./messages\"), exports);\n__exportStar(require(\"./protocol\"), exports);\nvar connection_1 = require(\"./connection\");\nObject.defineProperty(exports, \"createProtocolConnection\", { enumerable: true, get: function () { return connection_1.createProtocolConnection; } });\nvar LSPErrorCodes;\n(function (LSPErrorCodes) {\n /**\n * This is the start range of LSP reserved error codes.\n * It doesn't denote a real error code.\n *\n * @since 3.16.0\n */\n LSPErrorCodes.lspReservedErrorRangeStart = -32899;\n /**\n * A request failed but it was syntactically correct, e.g the\n * method name was known and the parameters were valid. The error\n * message should contain human readable information about why\n * the request failed.\n *\n * @since 3.17.0\n */\n LSPErrorCodes.RequestFailed = -32803;\n /**\n * The server cancelled the request. This error code should\n * only be used for requests that explicitly support being\n * server cancellable.\n *\n * @since 3.17.0\n */\n LSPErrorCodes.ServerCancelled = -32802;\n /**\n * The server detected that the content of a document got\n * modified outside normal conditions. A server should\n * NOT send this error code if it detects a content change\n * in it unprocessed messages. The result even computed\n * on an older state might still be useful for the client.\n *\n * If a client decides that a result is not of any use anymore\n * the client should cancel the request.\n */\n LSPErrorCodes.ContentModified = -32801;\n /**\n * The client has canceled a request and a server as detected\n * the cancel.\n */\n LSPErrorCodes.RequestCancelled = -32800;\n /**\n * This is the end range of LSP reserved error codes.\n * It doesn't denote a real error code.\n *\n * @since 3.16.0\n */\n LSPErrorCodes.lspReservedErrorRangeEnd = -32800;\n})(LSPErrorCodes || (exports.LSPErrorCodes = LSPErrorCodes = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createProtocolConnection = void 0;\nconst node_1 = require(\"vscode-jsonrpc/node\");\n__exportStar(require(\"vscode-jsonrpc/node\"), exports);\n__exportStar(require(\"../common/api\"), exports);\nfunction createProtocolConnection(input, output, logger, options) {\n return (0, node_1.createMessageConnection)(input, output, logger, options);\n}\nexports.createProtocolConnection = createProtocolConnection;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.forEach = exports.mapAsync = exports.map = exports.clearTestMode = exports.setTestMode = exports.Semaphore = exports.Delayer = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nclass Delayer {\n constructor(defaultDelay) {\n this.defaultDelay = defaultDelay;\n this.timeout = undefined;\n this.completionPromise = undefined;\n this.onSuccess = undefined;\n this.task = undefined;\n }\n trigger(task, delay = this.defaultDelay) {\n this.task = task;\n if (delay >= 0) {\n this.cancelTimeout();\n }\n if (!this.completionPromise) {\n this.completionPromise = new Promise((resolve) => {\n this.onSuccess = resolve;\n }).then(() => {\n this.completionPromise = undefined;\n this.onSuccess = undefined;\n var result = this.task();\n this.task = undefined;\n return result;\n });\n }\n if (delay >= 0 || this.timeout === void 0) {\n this.timeout = (0, vscode_languageserver_protocol_1.RAL)().timer.setTimeout(() => {\n this.timeout = undefined;\n this.onSuccess(undefined);\n }, delay >= 0 ? delay : this.defaultDelay);\n }\n return this.completionPromise;\n }\n forceDelivery() {\n if (!this.completionPromise) {\n return undefined;\n }\n this.cancelTimeout();\n let result = this.task();\n this.completionPromise = undefined;\n this.onSuccess = undefined;\n this.task = undefined;\n return result;\n }\n isTriggered() {\n return this.timeout !== undefined;\n }\n cancel() {\n this.cancelTimeout();\n this.completionPromise = undefined;\n }\n cancelTimeout() {\n if (this.timeout !== undefined) {\n this.timeout.dispose();\n this.timeout = undefined;\n }\n }\n}\nexports.Delayer = Delayer;\nclass Semaphore {\n constructor(capacity = 1) {\n if (capacity <= 0) {\n throw new Error('Capacity must be greater than 0');\n }\n this._capacity = capacity;\n this._active = 0;\n this._waiting = [];\n }\n lock(thunk) {\n return new Promise((resolve, reject) => {\n this._waiting.push({ thunk, resolve, reject });\n this.runNext();\n });\n }\n get active() {\n return this._active;\n }\n runNext() {\n if (this._waiting.length === 0 || this._active === this._capacity) {\n return;\n }\n (0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => this.doRunNext());\n }\n doRunNext() {\n if (this._waiting.length === 0 || this._active === this._capacity) {\n return;\n }\n const next = this._waiting.shift();\n this._active++;\n if (this._active > this._capacity) {\n throw new Error(`To many thunks active`);\n }\n try {\n const result = next.thunk();\n if (result instanceof Promise) {\n result.then((value) => {\n this._active--;\n next.resolve(value);\n this.runNext();\n }, (err) => {\n this._active--;\n next.reject(err);\n this.runNext();\n });\n }\n else {\n this._active--;\n next.resolve(result);\n this.runNext();\n }\n }\n catch (err) {\n this._active--;\n next.reject(err);\n this.runNext();\n }\n }\n}\nexports.Semaphore = Semaphore;\nlet $test = false;\nfunction setTestMode() {\n $test = true;\n}\nexports.setTestMode = setTestMode;\nfunction clearTestMode() {\n $test = false;\n}\nexports.clearTestMode = clearTestMode;\nconst defaultYieldTimeout = 15 /*ms*/;\nclass Timer {\n constructor(yieldAfter = defaultYieldTimeout) {\n this.yieldAfter = $test === true ? Math.max(yieldAfter, 2) : Math.max(yieldAfter, defaultYieldTimeout);\n this.startTime = Date.now();\n this.counter = 0;\n this.total = 0;\n // start with a counter interval of 1.\n this.counterInterval = 1;\n }\n start() {\n this.counter = 0;\n this.total = 0;\n this.counterInterval = 1;\n this.startTime = Date.now();\n }\n shouldYield() {\n if (++this.counter >= this.counterInterval) {\n const timeTaken = Date.now() - this.startTime;\n const timeLeft = Math.max(0, this.yieldAfter - timeTaken);\n this.total += this.counter;\n this.counter = 0;\n if (timeTaken >= this.yieldAfter || timeLeft <= 1) {\n // Yield also if time left <= 1 since we compute the counter\n // for max < 2 ms.\n // Start with interval 1 again. We could do some calculation\n // with using 80% of the last counter however other things (GC)\n // affect the timing heavily since we have small timings (1 - 15ms).\n this.counterInterval = 1;\n this.total = 0;\n return true;\n }\n else {\n // Only increase the counter until we have spent <= 2 ms. Increasing\n // the counter further is very fragile since timing is influenced\n // by other things and can increase the counter too much. This will result\n // that we yield in average after [14 - 16]ms.\n switch (timeTaken) {\n case 0:\n case 1:\n this.counterInterval = this.total * 2;\n break;\n }\n }\n }\n return false;\n }\n}\nasync function map(items, func, token, options) {\n if (items.length === 0) {\n return [];\n }\n const result = new Array(items.length);\n const timer = new Timer(options?.yieldAfter);\n function convertBatch(start) {\n timer.start();\n for (let i = start; i < items.length; i++) {\n result[i] = func(items[i]);\n if (timer.shouldYield()) {\n options?.yieldCallback && options.yieldCallback();\n return i + 1;\n }\n }\n return -1;\n }\n // Convert the first batch sync on the same frame.\n let index = convertBatch(0);\n while (index !== -1) {\n if (token !== undefined && token.isCancellationRequested) {\n break;\n }\n index = await new Promise((resolve) => {\n (0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => {\n resolve(convertBatch(index));\n });\n });\n }\n return result;\n}\nexports.map = map;\nasync function mapAsync(items, func, token, options) {\n if (items.length === 0) {\n return [];\n }\n const result = new Array(items.length);\n const timer = new Timer(options?.yieldAfter);\n async function convertBatch(start) {\n timer.start();\n for (let i = start; i < items.length; i++) {\n result[i] = await func(items[i], token);\n if (timer.shouldYield()) {\n options?.yieldCallback && options.yieldCallback();\n return i + 1;\n }\n }\n return -1;\n }\n let index = await convertBatch(0);\n while (index !== -1) {\n if (token !== undefined && token.isCancellationRequested) {\n break;\n }\n index = await new Promise((resolve) => {\n (0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => {\n resolve(convertBatch(index));\n });\n });\n }\n return result;\n}\nexports.mapAsync = mapAsync;\nasync function forEach(items, func, token, options) {\n if (items.length === 0) {\n return;\n }\n const timer = new Timer(options?.yieldAfter);\n function runBatch(start) {\n timer.start();\n for (let i = start; i < items.length; i++) {\n func(items[i]);\n if (timer.shouldYield()) {\n options?.yieldCallback && options.yieldCallback();\n return i + 1;\n }\n }\n return -1;\n }\n // Convert the first batch sync on the same frame.\n let index = runBatch(0);\n while (index !== -1) {\n if (token !== undefined && token.isCancellationRequested) {\n break;\n }\n index = await new Promise((resolve) => {\n (0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => {\n resolve(runBatch(index));\n });\n });\n }\n}\nexports.forEach = forEach;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code = require(\"vscode\");\nclass ProtocolCompletionItem extends code.CompletionItem {\n constructor(label) {\n super(label);\n }\n}\nexports.default = ProtocolCompletionItem;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code = require(\"vscode\");\nclass ProtocolCodeLens extends code.CodeLens {\n constructor(range) {\n super(range);\n }\n}\nexports.default = ProtocolCodeLens;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code = require(\"vscode\");\nclass ProtocolDocumentLink extends code.DocumentLink {\n constructor(range, target) {\n super(range, target);\n }\n}\nexports.default = ProtocolDocumentLink;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst vscode = require(\"vscode\");\nclass ProtocolCodeAction extends vscode.CodeAction {\n constructor(title, data) {\n super(title);\n this.data = data;\n }\n}\nexports.default = ProtocolCodeAction;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProtocolDiagnostic = exports.DiagnosticCode = void 0;\nconst vscode = require(\"vscode\");\nconst Is = require(\"./utils/is\");\nvar DiagnosticCode;\n(function (DiagnosticCode) {\n function is(value) {\n const candidate = value;\n return candidate !== undefined && candidate !== null && (Is.number(candidate.value) || Is.string(candidate.value)) && Is.string(candidate.target);\n }\n DiagnosticCode.is = is;\n})(DiagnosticCode || (exports.DiagnosticCode = DiagnosticCode = {}));\nclass ProtocolDiagnostic extends vscode.Diagnostic {\n constructor(range, message, severity, data) {\n super(range, message, severity);\n this.data = data;\n this.hasDiagnosticCode = false;\n }\n}\nexports.ProtocolDiagnostic = ProtocolDiagnostic;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code = require(\"vscode\");\nclass ProtocolCallHierarchyItem extends code.CallHierarchyItem {\n constructor(kind, name, detail, uri, range, selectionRange, data) {\n super(kind, name, detail, uri, range, selectionRange);\n if (data !== undefined) {\n this.data = data;\n }\n }\n}\nexports.default = ProtocolCallHierarchyItem;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code = require(\"vscode\");\nclass ProtocolTypeHierarchyItem extends code.TypeHierarchyItem {\n constructor(kind, name, detail, uri, range, selectionRange, data) {\n super(kind, name, detail, uri, range, selectionRange);\n if (data !== undefined) {\n this.data = data;\n }\n }\n}\nexports.default = ProtocolTypeHierarchyItem;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code = require(\"vscode\");\nclass WorkspaceSymbol extends code.SymbolInformation {\n constructor(name, kind, containerName, locationOrUri, data) {\n const hasRange = !(locationOrUri instanceof code.Uri);\n super(name, kind, containerName, hasRange ? locationOrUri : new code.Location(locationOrUri, new code.Range(0, 0, 0, 0)));\n this.hasRange = hasRange;\n if (data !== undefined) {\n this.data = data;\n }\n }\n}\nexports.default = WorkspaceSymbol;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst code = require(\"vscode\");\nclass ProtocolInlayHint extends code.InlayHint {\n constructor(position, label, kind) {\n super(position, label, kind);\n }\n}\nexports.default = ProtocolInlayHint;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createConverter = void 0;\nconst code = require(\"vscode\");\nconst proto = require(\"vscode-languageserver-protocol\");\nconst Is = require(\"./utils/is\");\nconst async = require(\"./utils/async\");\nconst protocolCompletionItem_1 = require(\"./protocolCompletionItem\");\nconst protocolCodeLens_1 = require(\"./protocolCodeLens\");\nconst protocolDocumentLink_1 = require(\"./protocolDocumentLink\");\nconst protocolCodeAction_1 = require(\"./protocolCodeAction\");\nconst protocolDiagnostic_1 = require(\"./protocolDiagnostic\");\nconst protocolCallHierarchyItem_1 = require(\"./protocolCallHierarchyItem\");\nconst protocolTypeHierarchyItem_1 = require(\"./protocolTypeHierarchyItem\");\nconst protocolWorkspaceSymbol_1 = require(\"./protocolWorkspaceSymbol\");\nconst protocolInlayHint_1 = require(\"./protocolInlayHint\");\nvar InsertReplaceRange;\n(function (InsertReplaceRange) {\n function is(value) {\n const candidate = value;\n return candidate && !!candidate.inserting && !!candidate.replacing;\n }\n InsertReplaceRange.is = is;\n})(InsertReplaceRange || (InsertReplaceRange = {}));\nfunction createConverter(uriConverter) {\n const nullConverter = (value) => value.toString();\n const _uriConverter = uriConverter || nullConverter;\n function asUri(value) {\n return _uriConverter(value);\n }\n function asTextDocumentIdentifier(textDocument) {\n return {\n uri: _uriConverter(textDocument.uri)\n };\n }\n function asTextDocumentItem(textDocument) {\n return {\n uri: _uriConverter(textDocument.uri),\n languageId: textDocument.languageId,\n version: textDocument.version,\n text: textDocument.getText()\n };\n }\n function asVersionedTextDocumentIdentifier(textDocument) {\n return {\n uri: _uriConverter(textDocument.uri),\n version: textDocument.version\n };\n }\n function asOpenTextDocumentParams(textDocument) {\n return {\n textDocument: asTextDocumentItem(textDocument)\n };\n }\n function isTextDocumentChangeEvent(value) {\n const candidate = value;\n return !!candidate.document && !!candidate.contentChanges;\n }\n function isTextDocument(value) {\n const candidate = value;\n return !!candidate.uri && !!candidate.version;\n }\n function asChangeTextDocumentParams(arg0, arg1, arg2) {\n if (isTextDocument(arg0)) {\n const result = {\n textDocument: {\n uri: _uriConverter(arg0.uri),\n version: arg0.version\n },\n contentChanges: [{ text: arg0.getText() }]\n };\n return result;\n }\n else if (isTextDocumentChangeEvent(arg0)) {\n const uri = arg1;\n const version = arg2;\n const result = {\n textDocument: {\n uri: _uriConverter(uri),\n version: version\n },\n contentChanges: arg0.contentChanges.map((change) => {\n const range = change.range;\n return {\n range: {\n start: { line: range.start.line, character: range.start.character },\n end: { line: range.end.line, character: range.end.character }\n },\n rangeLength: change.rangeLength,\n text: change.text\n };\n })\n };\n return result;\n }\n else {\n throw Error('Unsupported text document change parameter');\n }\n }\n function asCloseTextDocumentParams(textDocument) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument)\n };\n }\n function asSaveTextDocumentParams(textDocument, includeContent = false) {\n let result = {\n textDocument: asTextDocumentIdentifier(textDocument)\n };\n if (includeContent) {\n result.text = textDocument.getText();\n }\n return result;\n }\n function asTextDocumentSaveReason(reason) {\n switch (reason) {\n case code.TextDocumentSaveReason.Manual:\n return proto.TextDocumentSaveReason.Manual;\n case code.TextDocumentSaveReason.AfterDelay:\n return proto.TextDocumentSaveReason.AfterDelay;\n case code.TextDocumentSaveReason.FocusOut:\n return proto.TextDocumentSaveReason.FocusOut;\n }\n return proto.TextDocumentSaveReason.Manual;\n }\n function asWillSaveTextDocumentParams(event) {\n return {\n textDocument: asTextDocumentIdentifier(event.document),\n reason: asTextDocumentSaveReason(event.reason)\n };\n }\n function asDidCreateFilesParams(event) {\n return {\n files: event.files.map((fileUri) => ({\n uri: _uriConverter(fileUri),\n })),\n };\n }\n function asDidRenameFilesParams(event) {\n return {\n files: event.files.map((file) => ({\n oldUri: _uriConverter(file.oldUri),\n newUri: _uriConverter(file.newUri),\n })),\n };\n }\n function asDidDeleteFilesParams(event) {\n return {\n files: event.files.map((fileUri) => ({\n uri: _uriConverter(fileUri),\n })),\n };\n }\n function asWillCreateFilesParams(event) {\n return {\n files: event.files.map((fileUri) => ({\n uri: _uriConverter(fileUri),\n })),\n };\n }\n function asWillRenameFilesParams(event) {\n return {\n files: event.files.map((file) => ({\n oldUri: _uriConverter(file.oldUri),\n newUri: _uriConverter(file.newUri),\n })),\n };\n }\n function asWillDeleteFilesParams(event) {\n return {\n files: event.files.map((fileUri) => ({\n uri: _uriConverter(fileUri),\n })),\n };\n }\n function asTextDocumentPositionParams(textDocument, position) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument),\n position: asWorkerPosition(position)\n };\n }\n function asCompletionTriggerKind(triggerKind) {\n switch (triggerKind) {\n case code.CompletionTriggerKind.TriggerCharacter:\n return proto.CompletionTriggerKind.TriggerCharacter;\n case code.CompletionTriggerKind.TriggerForIncompleteCompletions:\n return proto.CompletionTriggerKind.TriggerForIncompleteCompletions;\n default:\n return proto.CompletionTriggerKind.Invoked;\n }\n }\n function asCompletionParams(textDocument, position, context) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument),\n position: asWorkerPosition(position),\n context: {\n triggerKind: asCompletionTriggerKind(context.triggerKind),\n triggerCharacter: context.triggerCharacter\n }\n };\n }\n function asSignatureHelpTriggerKind(triggerKind) {\n switch (triggerKind) {\n case code.SignatureHelpTriggerKind.Invoke:\n return proto.SignatureHelpTriggerKind.Invoked;\n case code.SignatureHelpTriggerKind.TriggerCharacter:\n return proto.SignatureHelpTriggerKind.TriggerCharacter;\n case code.SignatureHelpTriggerKind.ContentChange:\n return proto.SignatureHelpTriggerKind.ContentChange;\n }\n }\n function asParameterInformation(value) {\n // We leave the documentation out on purpose since it usually adds no\n // value for the server.\n return {\n label: value.label\n };\n }\n function asParameterInformations(values) {\n return values.map(asParameterInformation);\n }\n function asSignatureInformation(value) {\n // We leave the documentation out on purpose since it usually adds no\n // value for the server.\n return {\n label: value.label,\n parameters: asParameterInformations(value.parameters)\n };\n }\n function asSignatureInformations(values) {\n return values.map(asSignatureInformation);\n }\n function asSignatureHelp(value) {\n if (value === undefined) {\n return value;\n }\n return {\n signatures: asSignatureInformations(value.signatures),\n activeSignature: value.activeSignature,\n activeParameter: value.activeParameter\n };\n }\n function asSignatureHelpParams(textDocument, position, context) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument),\n position: asWorkerPosition(position),\n context: {\n isRetrigger: context.isRetrigger,\n triggerCharacter: context.triggerCharacter,\n triggerKind: asSignatureHelpTriggerKind(context.triggerKind),\n activeSignatureHelp: asSignatureHelp(context.activeSignatureHelp)\n }\n };\n }\n function asWorkerPosition(position) {\n return { line: position.line, character: position.character };\n }\n function asPosition(value) {\n if (value === undefined || value === null) {\n return value;\n }\n return { line: value.line > proto.uinteger.MAX_VALUE ? proto.uinteger.MAX_VALUE : value.line, character: value.character > proto.uinteger.MAX_VALUE ? proto.uinteger.MAX_VALUE : value.character };\n }\n function asPositions(values, token) {\n return async.map(values, asPosition, token);\n }\n function asPositionsSync(values) {\n return values.map(asPosition);\n }\n function asRange(value) {\n if (value === undefined || value === null) {\n return value;\n }\n return { start: asPosition(value.start), end: asPosition(value.end) };\n }\n function asRanges(values) {\n return values.map(asRange);\n }\n function asLocation(value) {\n if (value === undefined || value === null) {\n return value;\n }\n return proto.Location.create(asUri(value.uri), asRange(value.range));\n }\n function asDiagnosticSeverity(value) {\n switch (value) {\n case code.DiagnosticSeverity.Error:\n return proto.DiagnosticSeverity.Error;\n case code.DiagnosticSeverity.Warning:\n return proto.DiagnosticSeverity.Warning;\n case code.DiagnosticSeverity.Information:\n return proto.DiagnosticSeverity.Information;\n case code.DiagnosticSeverity.Hint:\n return proto.DiagnosticSeverity.Hint;\n }\n }\n function asDiagnosticTags(tags) {\n if (!tags) {\n return undefined;\n }\n let result = [];\n for (let tag of tags) {\n let converted = asDiagnosticTag(tag);\n if (converted !== undefined) {\n result.push(converted);\n }\n }\n return result.length > 0 ? result : undefined;\n }\n function asDiagnosticTag(tag) {\n switch (tag) {\n case code.DiagnosticTag.Unnecessary:\n return proto.DiagnosticTag.Unnecessary;\n case code.DiagnosticTag.Deprecated:\n return proto.DiagnosticTag.Deprecated;\n default:\n return undefined;\n }\n }\n function asRelatedInformation(item) {\n return {\n message: item.message,\n location: asLocation(item.location)\n };\n }\n function asRelatedInformations(items) {\n return items.map(asRelatedInformation);\n }\n function asDiagnosticCode(value) {\n if (value === undefined || value === null) {\n return undefined;\n }\n if (Is.number(value) || Is.string(value)) {\n return value;\n }\n return { value: value.value, target: asUri(value.target) };\n }\n function asDiagnostic(item) {\n const result = proto.Diagnostic.create(asRange(item.range), item.message);\n const protocolDiagnostic = item instanceof protocolDiagnostic_1.ProtocolDiagnostic ? item : undefined;\n if (protocolDiagnostic !== undefined && protocolDiagnostic.data !== undefined) {\n result.data = protocolDiagnostic.data;\n }\n const code = asDiagnosticCode(item.code);\n if (protocolDiagnostic_1.DiagnosticCode.is(code)) {\n if (protocolDiagnostic !== undefined && protocolDiagnostic.hasDiagnosticCode) {\n result.code = code;\n }\n else {\n result.code = code.value;\n result.codeDescription = { href: code.target };\n }\n }\n else {\n result.code = code;\n }\n if (Is.number(item.severity)) {\n result.severity = asDiagnosticSeverity(item.severity);\n }\n if (Array.isArray(item.tags)) {\n result.tags = asDiagnosticTags(item.tags);\n }\n if (item.relatedInformation) {\n result.relatedInformation = asRelatedInformations(item.relatedInformation);\n }\n if (item.source) {\n result.source = item.source;\n }\n return result;\n }\n function asDiagnostics(items, token) {\n if (items === undefined || items === null) {\n return items;\n }\n return async.map(items, asDiagnostic, token);\n }\n function asDiagnosticsSync(items) {\n if (items === undefined || items === null) {\n return items;\n }\n return items.map(asDiagnostic);\n }\n function asDocumentation(format, documentation) {\n switch (format) {\n case '$string':\n return documentation;\n case proto.MarkupKind.PlainText:\n return { kind: format, value: documentation };\n case proto.MarkupKind.Markdown:\n return { kind: format, value: documentation.value };\n default:\n return `Unsupported Markup content received. Kind is: ${format}`;\n }\n }\n function asCompletionItemTag(tag) {\n switch (tag) {\n case code.CompletionItemTag.Deprecated:\n return proto.CompletionItemTag.Deprecated;\n }\n return undefined;\n }\n function asCompletionItemTags(tags) {\n if (tags === undefined) {\n return tags;\n }\n const result = [];\n for (let tag of tags) {\n const converted = asCompletionItemTag(tag);\n if (converted !== undefined) {\n result.push(converted);\n }\n }\n return result;\n }\n function asCompletionItemKind(value, original) {\n if (original !== undefined) {\n return original;\n }\n return value + 1;\n }\n function asCompletionItem(item, labelDetailsSupport = false) {\n let label;\n let labelDetails;\n if (Is.string(item.label)) {\n label = item.label;\n }\n else {\n label = item.label.label;\n if (labelDetailsSupport && (item.label.detail !== undefined || item.label.description !== undefined)) {\n labelDetails = { detail: item.label.detail, description: item.label.description };\n }\n }\n let result = { label: label };\n if (labelDetails !== undefined) {\n result.labelDetails = labelDetails;\n }\n let protocolItem = item instanceof protocolCompletionItem_1.default ? item : undefined;\n if (item.detail) {\n result.detail = item.detail;\n }\n // We only send items back we created. So this can't be something else than\n // a string right now.\n if (item.documentation) {\n if (!protocolItem || protocolItem.documentationFormat === '$string') {\n result.documentation = item.documentation;\n }\n else {\n result.documentation = asDocumentation(protocolItem.documentationFormat, item.documentation);\n }\n }\n if (item.filterText) {\n result.filterText = item.filterText;\n }\n fillPrimaryInsertText(result, item);\n if (Is.number(item.kind)) {\n result.kind = asCompletionItemKind(item.kind, protocolItem && protocolItem.originalItemKind);\n }\n if (item.sortText) {\n result.sortText = item.sortText;\n }\n if (item.additionalTextEdits) {\n result.additionalTextEdits = asTextEdits(item.additionalTextEdits);\n }\n if (item.commitCharacters) {\n result.commitCharacters = item.commitCharacters.slice();\n }\n if (item.command) {\n result.command = asCommand(item.command);\n }\n if (item.preselect === true || item.preselect === false) {\n result.preselect = item.preselect;\n }\n const tags = asCompletionItemTags(item.tags);\n if (protocolItem) {\n if (protocolItem.data !== undefined) {\n result.data = protocolItem.data;\n }\n if (protocolItem.deprecated === true || protocolItem.deprecated === false) {\n if (protocolItem.deprecated === true && tags !== undefined && tags.length > 0) {\n const index = tags.indexOf(code.CompletionItemTag.Deprecated);\n if (index !== -1) {\n tags.splice(index, 1);\n }\n }\n result.deprecated = protocolItem.deprecated;\n }\n if (protocolItem.insertTextMode !== undefined) {\n result.insertTextMode = protocolItem.insertTextMode;\n }\n }\n if (tags !== undefined && tags.length > 0) {\n result.tags = tags;\n }\n if (result.insertTextMode === undefined && item.keepWhitespace === true) {\n result.insertTextMode = proto.InsertTextMode.adjustIndentation;\n }\n return result;\n }\n function fillPrimaryInsertText(target, source) {\n let format = proto.InsertTextFormat.PlainText;\n let text = undefined;\n let range = undefined;\n if (source.textEdit) {\n text = source.textEdit.newText;\n range = source.textEdit.range;\n }\n else if (source.insertText instanceof code.SnippetString) {\n format = proto.InsertTextFormat.Snippet;\n text = source.insertText.value;\n }\n else {\n text = source.insertText;\n }\n if (source.range) {\n range = source.range;\n }\n target.insertTextFormat = format;\n if (source.fromEdit && text !== undefined && range !== undefined) {\n target.textEdit = asCompletionTextEdit(text, range);\n }\n else {\n target.insertText = text;\n }\n }\n function asCompletionTextEdit(newText, range) {\n if (InsertReplaceRange.is(range)) {\n return proto.InsertReplaceEdit.create(newText, asRange(range.inserting), asRange(range.replacing));\n }\n else {\n return { newText, range: asRange(range) };\n }\n }\n function asTextEdit(edit) {\n return { range: asRange(edit.range), newText: edit.newText };\n }\n function asTextEdits(edits) {\n if (edits === undefined || edits === null) {\n return edits;\n }\n return edits.map(asTextEdit);\n }\n function asSymbolKind(item) {\n if (item <= code.SymbolKind.TypeParameter) {\n // Symbol kind is one based in the protocol and zero based in code.\n return (item + 1);\n }\n return proto.SymbolKind.Property;\n }\n function asSymbolTag(item) {\n return item;\n }\n function asSymbolTags(items) {\n return items.map(asSymbolTag);\n }\n function asReferenceParams(textDocument, position, options) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument),\n position: asWorkerPosition(position),\n context: { includeDeclaration: options.includeDeclaration }\n };\n }\n async function asCodeAction(item, token) {\n let result = proto.CodeAction.create(item.title);\n if (item instanceof protocolCodeAction_1.default && item.data !== undefined) {\n result.data = item.data;\n }\n if (item.kind !== undefined) {\n result.kind = asCodeActionKind(item.kind);\n }\n if (item.diagnostics !== undefined) {\n result.diagnostics = await asDiagnostics(item.diagnostics, token);\n }\n if (item.edit !== undefined) {\n throw new Error(`VS Code code actions can only be converted to a protocol code action without an edit.`);\n }\n if (item.command !== undefined) {\n result.command = asCommand(item.command);\n }\n if (item.isPreferred !== undefined) {\n result.isPreferred = item.isPreferred;\n }\n if (item.disabled !== undefined) {\n result.disabled = { reason: item.disabled.reason };\n }\n return result;\n }\n function asCodeActionSync(item) {\n let result = proto.CodeAction.create(item.title);\n if (item instanceof protocolCodeAction_1.default && item.data !== undefined) {\n result.data = item.data;\n }\n if (item.kind !== undefined) {\n result.kind = asCodeActionKind(item.kind);\n }\n if (item.diagnostics !== undefined) {\n result.diagnostics = asDiagnosticsSync(item.diagnostics);\n }\n if (item.edit !== undefined) {\n throw new Error(`VS Code code actions can only be converted to a protocol code action without an edit.`);\n }\n if (item.command !== undefined) {\n result.command = asCommand(item.command);\n }\n if (item.isPreferred !== undefined) {\n result.isPreferred = item.isPreferred;\n }\n if (item.disabled !== undefined) {\n result.disabled = { reason: item.disabled.reason };\n }\n return result;\n }\n async function asCodeActionContext(context, token) {\n if (context === undefined || context === null) {\n return context;\n }\n let only;\n if (context.only && Is.string(context.only.value)) {\n only = [context.only.value];\n }\n return proto.CodeActionContext.create(await asDiagnostics(context.diagnostics, token), only, asCodeActionTriggerKind(context.triggerKind));\n }\n function asCodeActionContextSync(context) {\n if (context === undefined || context === null) {\n return context;\n }\n let only;\n if (context.only && Is.string(context.only.value)) {\n only = [context.only.value];\n }\n return proto.CodeActionContext.create(asDiagnosticsSync(context.diagnostics), only, asCodeActionTriggerKind(context.triggerKind));\n }\n function asCodeActionTriggerKind(kind) {\n switch (kind) {\n case code.CodeActionTriggerKind.Invoke:\n return proto.CodeActionTriggerKind.Invoked;\n case code.CodeActionTriggerKind.Automatic:\n return proto.CodeActionTriggerKind.Automatic;\n default:\n return undefined;\n }\n }\n function asCodeActionKind(item) {\n if (item === undefined || item === null) {\n return undefined;\n }\n return item.value;\n }\n function asInlineValueContext(context) {\n if (context === undefined || context === null) {\n return context;\n }\n return proto.InlineValueContext.create(context.frameId, asRange(context.stoppedLocation));\n }\n function asInlineCompletionParams(document, position, context) {\n return { context: proto.InlineCompletionContext.create(context.triggerKind, context.selectedCompletionInfo),\n textDocument: asTextDocumentIdentifier(document), position: asPosition(position) };\n }\n function asCommand(item) {\n let result = proto.Command.create(item.title, item.command);\n if (item.arguments) {\n result.arguments = item.arguments;\n }\n return result;\n }\n function asCodeLens(item) {\n let result = proto.CodeLens.create(asRange(item.range));\n if (item.command) {\n result.command = asCommand(item.command);\n }\n if (item instanceof protocolCodeLens_1.default) {\n if (item.data) {\n result.data = item.data;\n }\n }\n return result;\n }\n function asFormattingOptions(options, fileOptions) {\n const result = { tabSize: options.tabSize, insertSpaces: options.insertSpaces };\n if (fileOptions.trimTrailingWhitespace) {\n result.trimTrailingWhitespace = true;\n }\n if (fileOptions.trimFinalNewlines) {\n result.trimFinalNewlines = true;\n }\n if (fileOptions.insertFinalNewline) {\n result.insertFinalNewline = true;\n }\n return result;\n }\n function asDocumentSymbolParams(textDocument) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument)\n };\n }\n function asCodeLensParams(textDocument) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument)\n };\n }\n function asDocumentLink(item) {\n let result = proto.DocumentLink.create(asRange(item.range));\n if (item.target) {\n result.target = asUri(item.target);\n }\n if (item.tooltip !== undefined) {\n result.tooltip = item.tooltip;\n }\n let protocolItem = item instanceof protocolDocumentLink_1.default ? item : undefined;\n if (protocolItem && protocolItem.data) {\n result.data = protocolItem.data;\n }\n return result;\n }\n function asDocumentLinkParams(textDocument) {\n return {\n textDocument: asTextDocumentIdentifier(textDocument)\n };\n }\n function asCallHierarchyItem(value) {\n const result = {\n name: value.name,\n kind: asSymbolKind(value.kind),\n uri: asUri(value.uri),\n range: asRange(value.range),\n selectionRange: asRange(value.selectionRange)\n };\n if (value.detail !== undefined && value.detail.length > 0) {\n result.detail = value.detail;\n }\n if (value.tags !== undefined) {\n result.tags = asSymbolTags(value.tags);\n }\n if (value instanceof protocolCallHierarchyItem_1.default && value.data !== undefined) {\n result.data = value.data;\n }\n return result;\n }\n function asTypeHierarchyItem(value) {\n const result = {\n name: value.name,\n kind: asSymbolKind(value.kind),\n uri: asUri(value.uri),\n range: asRange(value.range),\n selectionRange: asRange(value.selectionRange),\n };\n if (value.detail !== undefined && value.detail.length > 0) {\n result.detail = value.detail;\n }\n if (value.tags !== undefined) {\n result.tags = asSymbolTags(value.tags);\n }\n if (value instanceof protocolTypeHierarchyItem_1.default && value.data !== undefined) {\n result.data = value.data;\n }\n return result;\n }\n function asWorkspaceSymbol(item) {\n const result = item instanceof protocolWorkspaceSymbol_1.default\n ? { name: item.name, kind: asSymbolKind(item.kind), location: item.hasRange ? asLocation(item.location) : { uri: _uriConverter(item.location.uri) }, data: item.data }\n : { name: item.name, kind: asSymbolKind(item.kind), location: asLocation(item.location) };\n if (item.tags !== undefined) {\n result.tags = asSymbolTags(item.tags);\n }\n if (item.containerName !== '') {\n result.containerName = item.containerName;\n }\n return result;\n }\n function asInlayHint(item) {\n const label = typeof item.label === 'string'\n ? item.label\n : item.label.map(asInlayHintLabelPart);\n const result = proto.InlayHint.create(asPosition(item.position), label);\n if (item.kind !== undefined) {\n result.kind = item.kind;\n }\n if (item.textEdits !== undefined) {\n result.textEdits = asTextEdits(item.textEdits);\n }\n if (item.tooltip !== undefined) {\n result.tooltip = asTooltip(item.tooltip);\n }\n if (item.paddingLeft !== undefined) {\n result.paddingLeft = item.paddingLeft;\n }\n if (item.paddingRight !== undefined) {\n result.paddingRight = item.paddingRight;\n }\n if (item instanceof protocolInlayHint_1.default && item.data !== undefined) {\n result.data = item.data;\n }\n return result;\n }\n function asInlayHintLabelPart(item) {\n const result = proto.InlayHintLabelPart.create(item.value);\n if (item.location !== undefined) {\n result.location = asLocation(item.location);\n }\n if (item.command !== undefined) {\n result.command = asCommand(item.command);\n }\n if (item.tooltip !== undefined) {\n result.tooltip = asTooltip(item.tooltip);\n }\n return result;\n }\n function asTooltip(value) {\n if (typeof value === 'string') {\n return value;\n }\n const result = {\n kind: proto.MarkupKind.Markdown,\n value: value.value\n };\n return result;\n }\n return {\n asUri,\n asTextDocumentIdentifier,\n asTextDocumentItem,\n asVersionedTextDocumentIdentifier,\n asOpenTextDocumentParams,\n asChangeTextDocumentParams,\n asCloseTextDocumentParams,\n asSaveTextDocumentParams,\n asWillSaveTextDocumentParams,\n asDidCreateFilesParams,\n asDidRenameFilesParams,\n asDidDeleteFilesParams,\n asWillCreateFilesParams,\n asWillRenameFilesParams,\n asWillDeleteFilesParams,\n asTextDocumentPositionParams,\n asCompletionParams,\n asSignatureHelpParams,\n asWorkerPosition,\n asRange,\n asRanges,\n asPosition,\n asPositions,\n asPositionsSync,\n asLocation,\n asDiagnosticSeverity,\n asDiagnosticTag,\n asDiagnostic,\n asDiagnostics,\n asDiagnosticsSync,\n asCompletionItem,\n asTextEdit,\n asSymbolKind,\n asSymbolTag,\n asSymbolTags,\n asReferenceParams,\n asCodeAction,\n asCodeActionSync,\n asCodeActionContext,\n asCodeActionContextSync,\n asInlineValueContext,\n asCommand,\n asCodeLens,\n asFormattingOptions,\n asDocumentSymbolParams,\n asCodeLensParams,\n asDocumentLink,\n asDocumentLinkParams,\n asCallHierarchyItem,\n asTypeHierarchyItem,\n asInlayHint,\n asWorkspaceSymbol,\n asInlineCompletionParams\n };\n}\nexports.createConverter = createConverter;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createConverter = void 0;\nconst code = require(\"vscode\");\nconst ls = require(\"vscode-languageserver-protocol\");\nconst Is = require(\"./utils/is\");\nconst async = require(\"./utils/async\");\nconst protocolCompletionItem_1 = require(\"./protocolCompletionItem\");\nconst protocolCodeLens_1 = require(\"./protocolCodeLens\");\nconst protocolDocumentLink_1 = require(\"./protocolDocumentLink\");\nconst protocolCodeAction_1 = require(\"./protocolCodeAction\");\nconst protocolDiagnostic_1 = require(\"./protocolDiagnostic\");\nconst protocolCallHierarchyItem_1 = require(\"./protocolCallHierarchyItem\");\nconst protocolTypeHierarchyItem_1 = require(\"./protocolTypeHierarchyItem\");\nconst protocolWorkspaceSymbol_1 = require(\"./protocolWorkspaceSymbol\");\nconst protocolInlayHint_1 = require(\"./protocolInlayHint\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nvar CodeBlock;\n(function (CodeBlock) {\n function is(value) {\n let candidate = value;\n return candidate && Is.string(candidate.language) && Is.string(candidate.value);\n }\n CodeBlock.is = is;\n})(CodeBlock || (CodeBlock = {}));\nfunction createConverter(uriConverter, trustMarkdown, supportHtml) {\n const nullConverter = (value) => code.Uri.parse(value);\n const _uriConverter = uriConverter || nullConverter;\n function asUri(value) {\n return _uriConverter(value);\n }\n function asDocumentSelector(selector) {\n const result = [];\n for (const filter of selector) {\n if (typeof filter === 'string') {\n result.push(filter);\n }\n else if (vscode_languageserver_protocol_1.NotebookCellTextDocumentFilter.is(filter)) {\n // We first need to check for the notebook cell filter since a TextDocumentFilter would\n // match both (e.g. the notebook is optional).\n if (typeof filter.notebook === 'string') {\n result.push({ notebookType: filter.notebook, language: filter.language });\n }\n else {\n const notebookType = filter.notebook.notebookType ?? '*';\n result.push({ notebookType: notebookType, scheme: filter.notebook.scheme, pattern: filter.notebook.pattern, language: filter.language });\n }\n }\n else if (vscode_languageserver_protocol_1.TextDocumentFilter.is(filter)) {\n result.push({ language: filter.language, scheme: filter.scheme, pattern: filter.pattern });\n }\n }\n return result;\n }\n async function asDiagnostics(diagnostics, token) {\n return async.map(diagnostics, asDiagnostic, token);\n }\n function asDiagnosticsSync(diagnostics) {\n const result = new Array(diagnostics.length);\n for (let i = 0; i < diagnostics.length; i++) {\n result[i] = asDiagnostic(diagnostics[i]);\n }\n return result;\n }\n function asDiagnostic(diagnostic) {\n let result = new protocolDiagnostic_1.ProtocolDiagnostic(asRange(diagnostic.range), diagnostic.message, asDiagnosticSeverity(diagnostic.severity), diagnostic.data);\n if (diagnostic.code !== undefined) {\n if (typeof diagnostic.code === 'string' || typeof diagnostic.code === 'number') {\n if (ls.CodeDescription.is(diagnostic.codeDescription)) {\n result.code = {\n value: diagnostic.code,\n target: asUri(diagnostic.codeDescription.href)\n };\n }\n else {\n result.code = diagnostic.code;\n }\n }\n else if (protocolDiagnostic_1.DiagnosticCode.is(diagnostic.code)) {\n // This is for backwards compatibility of a proposed API.\n // We should remove this at some point.\n result.hasDiagnosticCode = true;\n const diagnosticCode = diagnostic.code;\n result.code = {\n value: diagnosticCode.value,\n target: asUri(diagnosticCode.target)\n };\n }\n }\n if (diagnostic.source) {\n result.source = diagnostic.source;\n }\n if (diagnostic.relatedInformation) {\n result.relatedInformation = asRelatedInformation(diagnostic.relatedInformation);\n }\n if (Array.isArray(diagnostic.tags)) {\n result.tags = asDiagnosticTags(diagnostic.tags);\n }\n return result;\n }\n function asRelatedInformation(relatedInformation) {\n const result = new Array(relatedInformation.length);\n for (let i = 0; i < relatedInformation.length; i++) {\n const info = relatedInformation[i];\n result[i] = new code.DiagnosticRelatedInformation(asLocation(info.location), info.message);\n }\n return result;\n }\n function asDiagnosticTags(tags) {\n if (!tags) {\n return undefined;\n }\n let result = [];\n for (let tag of tags) {\n let converted = asDiagnosticTag(tag);\n if (converted !== undefined) {\n result.push(converted);\n }\n }\n return result.length > 0 ? result : undefined;\n }\n function asDiagnosticTag(tag) {\n switch (tag) {\n case ls.DiagnosticTag.Unnecessary:\n return code.DiagnosticTag.Unnecessary;\n case ls.DiagnosticTag.Deprecated:\n return code.DiagnosticTag.Deprecated;\n default:\n return undefined;\n }\n }\n function asPosition(value) {\n return value ? new code.Position(value.line, value.character) : undefined;\n }\n function asRange(value) {\n return value ? new code.Range(value.start.line, value.start.character, value.end.line, value.end.character) : undefined;\n }\n async function asRanges(items, token) {\n return async.map(items, (range) => {\n return new code.Range(range.start.line, range.start.character, range.end.line, range.end.character);\n }, token);\n }\n function asDiagnosticSeverity(value) {\n if (value === undefined || value === null) {\n return code.DiagnosticSeverity.Error;\n }\n switch (value) {\n case ls.DiagnosticSeverity.Error:\n return code.DiagnosticSeverity.Error;\n case ls.DiagnosticSeverity.Warning:\n return code.DiagnosticSeverity.Warning;\n case ls.DiagnosticSeverity.Information:\n return code.DiagnosticSeverity.Information;\n case ls.DiagnosticSeverity.Hint:\n return code.DiagnosticSeverity.Hint;\n }\n return code.DiagnosticSeverity.Error;\n }\n function asHoverContent(value) {\n if (Is.string(value)) {\n return asMarkdownString(value);\n }\n else if (CodeBlock.is(value)) {\n let result = asMarkdownString();\n return result.appendCodeblock(value.value, value.language);\n }\n else if (Array.isArray(value)) {\n let result = [];\n for (let element of value) {\n let item = asMarkdownString();\n if (CodeBlock.is(element)) {\n item.appendCodeblock(element.value, element.language);\n }\n else {\n item.appendMarkdown(element);\n }\n result.push(item);\n }\n return result;\n }\n else {\n return asMarkdownString(value);\n }\n }\n function asDocumentation(value) {\n if (Is.string(value)) {\n return value;\n }\n else {\n switch (value.kind) {\n case ls.MarkupKind.Markdown:\n return asMarkdownString(value.value);\n case ls.MarkupKind.PlainText:\n return value.value;\n default:\n return `Unsupported Markup content received. Kind is: ${value.kind}`;\n }\n }\n }\n function asMarkdownString(value) {\n let result;\n if (value === undefined || typeof value === 'string') {\n result = new code.MarkdownString(value);\n }\n else {\n switch (value.kind) {\n case ls.MarkupKind.Markdown:\n result = new code.MarkdownString(value.value);\n break;\n case ls.MarkupKind.PlainText:\n result = new code.MarkdownString();\n result.appendText(value.value);\n break;\n default:\n result = new code.MarkdownString();\n result.appendText(`Unsupported Markup content received. Kind is: ${value.kind}`);\n break;\n }\n }\n result.isTrusted = trustMarkdown;\n result.supportHtml = supportHtml;\n return result;\n }\n function asHover(hover) {\n if (!hover) {\n return undefined;\n }\n return new code.Hover(asHoverContent(hover.contents), asRange(hover.range));\n }\n async function asCompletionResult(value, allCommitCharacters, token) {\n if (!value) {\n return undefined;\n }\n if (Array.isArray(value)) {\n return async.map(value, (item) => asCompletionItem(item, allCommitCharacters), token);\n }\n const list = value;\n const { defaultRange, commitCharacters } = getCompletionItemDefaults(list, allCommitCharacters);\n const converted = await async.map(list.items, (item) => {\n return asCompletionItem(item, commitCharacters, defaultRange, list.itemDefaults?.insertTextMode, list.itemDefaults?.insertTextFormat, list.itemDefaults?.data);\n }, token);\n return new code.CompletionList(converted, list.isIncomplete);\n }\n function getCompletionItemDefaults(list, allCommitCharacters) {\n const rangeDefaults = list.itemDefaults?.editRange;\n const commitCharacters = list.itemDefaults?.commitCharacters ?? allCommitCharacters;\n return ls.Range.is(rangeDefaults)\n ? { defaultRange: asRange(rangeDefaults), commitCharacters }\n : rangeDefaults !== undefined\n ? { defaultRange: { inserting: asRange(rangeDefaults.insert), replacing: asRange(rangeDefaults.replace) }, commitCharacters }\n : { defaultRange: undefined, commitCharacters };\n }\n function asCompletionItemKind(value) {\n // Protocol item kind is 1 based, codes item kind is zero based.\n if (ls.CompletionItemKind.Text <= value && value <= ls.CompletionItemKind.TypeParameter) {\n return [value - 1, undefined];\n }\n return [code.CompletionItemKind.Text, value];\n }\n function asCompletionItemTag(tag) {\n switch (tag) {\n case ls.CompletionItemTag.Deprecated:\n return code.CompletionItemTag.Deprecated;\n }\n return undefined;\n }\n function asCompletionItemTags(tags) {\n if (tags === undefined || tags === null) {\n return [];\n }\n const result = [];\n for (const tag of tags) {\n const converted = asCompletionItemTag(tag);\n if (converted !== undefined) {\n result.push(converted);\n }\n }\n return result;\n }\n function asCompletionItem(item, defaultCommitCharacters, defaultRange, defaultInsertTextMode, defaultInsertTextFormat, defaultData) {\n const tags = asCompletionItemTags(item.tags);\n const label = asCompletionItemLabel(item);\n const result = new protocolCompletionItem_1.default(label);\n if (item.detail) {\n result.detail = item.detail;\n }\n if (item.documentation) {\n result.documentation = asDocumentation(item.documentation);\n result.documentationFormat = Is.string(item.documentation) ? '$string' : item.documentation.kind;\n }\n if (item.filterText) {\n result.filterText = item.filterText;\n }\n const insertText = asCompletionInsertText(item, defaultRange, defaultInsertTextFormat);\n if (insertText) {\n result.insertText = insertText.text;\n result.range = insertText.range;\n result.fromEdit = insertText.fromEdit;\n }\n if (Is.number(item.kind)) {\n let [itemKind, original] = asCompletionItemKind(item.kind);\n result.kind = itemKind;\n if (original) {\n result.originalItemKind = original;\n }\n }\n if (item.sortText) {\n result.sortText = item.sortText;\n }\n if (item.additionalTextEdits) {\n result.additionalTextEdits = asTextEditsSync(item.additionalTextEdits);\n }\n const commitCharacters = item.commitCharacters !== undefined\n ? Is.stringArray(item.commitCharacters) ? item.commitCharacters : undefined\n : defaultCommitCharacters;\n if (commitCharacters) {\n result.commitCharacters = commitCharacters.slice();\n }\n if (item.command) {\n result.command = asCommand(item.command);\n }\n if (item.deprecated === true || item.deprecated === false) {\n result.deprecated = item.deprecated;\n if (item.deprecated === true) {\n tags.push(code.CompletionItemTag.Deprecated);\n }\n }\n if (item.preselect === true || item.preselect === false) {\n result.preselect = item.preselect;\n }\n const data = item.data ?? defaultData;\n if (data !== undefined) {\n result.data = data;\n }\n if (tags.length > 0) {\n result.tags = tags;\n }\n const insertTextMode = item.insertTextMode ?? defaultInsertTextMode;\n if (insertTextMode !== undefined) {\n result.insertTextMode = insertTextMode;\n if (insertTextMode === ls.InsertTextMode.asIs) {\n result.keepWhitespace = true;\n }\n }\n return result;\n }\n function asCompletionItemLabel(item) {\n if (ls.CompletionItemLabelDetails.is(item.labelDetails)) {\n return {\n label: item.label,\n detail: item.labelDetails.detail,\n description: item.labelDetails.description\n };\n }\n else {\n return item.label;\n }\n }\n function asCompletionInsertText(item, defaultRange, defaultInsertTextFormat) {\n const insertTextFormat = item.insertTextFormat ?? defaultInsertTextFormat;\n if (item.textEdit !== undefined || defaultRange !== undefined) {\n const [range, newText] = item.textEdit !== undefined\n ? getCompletionRangeAndText(item.textEdit)\n : [defaultRange, item.textEditText ?? item.label];\n if (insertTextFormat === ls.InsertTextFormat.Snippet) {\n return { text: new code.SnippetString(newText), range: range, fromEdit: true };\n }\n else {\n return { text: newText, range: range, fromEdit: true };\n }\n }\n else if (item.insertText) {\n if (insertTextFormat === ls.InsertTextFormat.Snippet) {\n return { text: new code.SnippetString(item.insertText), fromEdit: false };\n }\n else {\n return { text: item.insertText, fromEdit: false };\n }\n }\n else {\n return undefined;\n }\n }\n function getCompletionRangeAndText(value) {\n if (ls.InsertReplaceEdit.is(value)) {\n return [{ inserting: asRange(value.insert), replacing: asRange(value.replace) }, value.newText];\n }\n else {\n return [asRange(value.range), value.newText];\n }\n }\n function asTextEdit(edit) {\n if (!edit) {\n return undefined;\n }\n return new code.TextEdit(asRange(edit.range), edit.newText);\n }\n async function asTextEdits(items, token) {\n if (!items) {\n return undefined;\n }\n return async.map(items, asTextEdit, token);\n }\n function asTextEditsSync(items) {\n if (!items) {\n return undefined;\n }\n const result = new Array(items.length);\n for (let i = 0; i < items.length; i++) {\n result[i] = asTextEdit(items[i]);\n }\n return result;\n }\n async function asSignatureHelp(item, token) {\n if (!item) {\n return undefined;\n }\n let result = new code.SignatureHelp();\n if (Is.number(item.activeSignature)) {\n result.activeSignature = item.activeSignature;\n }\n else {\n // activeSignature was optional in the past\n result.activeSignature = 0;\n }\n if (Is.number(item.activeParameter)) {\n result.activeParameter = item.activeParameter;\n }\n else {\n // activeParameter was optional in the past\n result.activeParameter = 0;\n }\n if (item.signatures) {\n result.signatures = await asSignatureInformations(item.signatures, token);\n }\n return result;\n }\n async function asSignatureInformations(items, token) {\n return async.mapAsync(items, asSignatureInformation, token);\n }\n async function asSignatureInformation(item, token) {\n let result = new code.SignatureInformation(item.label);\n if (item.documentation !== undefined) {\n result.documentation = asDocumentation(item.documentation);\n }\n if (item.parameters !== undefined) {\n result.parameters = await asParameterInformations(item.parameters, token);\n }\n if (item.activeParameter !== undefined) {\n result.activeParameter = item.activeParameter;\n }\n {\n return result;\n }\n }\n function asParameterInformations(items, token) {\n return async.map(items, asParameterInformation, token);\n }\n function asParameterInformation(item) {\n let result = new code.ParameterInformation(item.label);\n if (item.documentation) {\n result.documentation = asDocumentation(item.documentation);\n }\n return result;\n }\n function asLocation(item) {\n return item ? new code.Location(_uriConverter(item.uri), asRange(item.range)) : undefined;\n }\n async function asDeclarationResult(item, token) {\n if (!item) {\n return undefined;\n }\n return asLocationResult(item, token);\n }\n async function asDefinitionResult(item, token) {\n if (!item) {\n return undefined;\n }\n return asLocationResult(item, token);\n }\n function asLocationLink(item) {\n if (!item) {\n return undefined;\n }\n let result = {\n targetUri: _uriConverter(item.targetUri),\n targetRange: asRange(item.targetRange),\n originSelectionRange: asRange(item.originSelectionRange),\n targetSelectionRange: asRange(item.targetSelectionRange)\n };\n if (!result.targetSelectionRange) {\n throw new Error(`targetSelectionRange must not be undefined or null`);\n }\n return result;\n }\n async function asLocationResult(item, token) {\n if (!item) {\n return undefined;\n }\n if (Is.array(item)) {\n if (item.length === 0) {\n return [];\n }\n else if (ls.LocationLink.is(item[0])) {\n const links = item;\n return async.map(links, asLocationLink, token);\n }\n else {\n const locations = item;\n return async.map(locations, asLocation, token);\n }\n }\n else if (ls.LocationLink.is(item)) {\n return [asLocationLink(item)];\n }\n else {\n return asLocation(item);\n }\n }\n async function asReferences(values, token) {\n if (!values) {\n return undefined;\n }\n return async.map(values, asLocation, token);\n }\n async function asDocumentHighlights(values, token) {\n if (!values) {\n return undefined;\n }\n return async.map(values, asDocumentHighlight, token);\n }\n function asDocumentHighlight(item) {\n let result = new code.DocumentHighlight(asRange(item.range));\n if (Is.number(item.kind)) {\n result.kind = asDocumentHighlightKind(item.kind);\n }\n return result;\n }\n function asDocumentHighlightKind(item) {\n switch (item) {\n case ls.DocumentHighlightKind.Text:\n return code.DocumentHighlightKind.Text;\n case ls.DocumentHighlightKind.Read:\n return code.DocumentHighlightKind.Read;\n case ls.DocumentHighlightKind.Write:\n return code.DocumentHighlightKind.Write;\n }\n return code.DocumentHighlightKind.Text;\n }\n async function asSymbolInformations(values, token) {\n if (!values) {\n return undefined;\n }\n return async.map(values, asSymbolInformation, token);\n }\n function asSymbolKind(item) {\n if (item <= ls.SymbolKind.TypeParameter) {\n // Symbol kind is one based in the protocol and zero based in code.\n return item - 1;\n }\n return code.SymbolKind.Property;\n }\n function asSymbolTag(value) {\n switch (value) {\n case ls.SymbolTag.Deprecated:\n return code.SymbolTag.Deprecated;\n default:\n return undefined;\n }\n }\n function asSymbolTags(items) {\n if (items === undefined || items === null) {\n return undefined;\n }\n const result = [];\n for (const item of items) {\n const converted = asSymbolTag(item);\n if (converted !== undefined) {\n result.push(converted);\n }\n }\n return result.length === 0 ? undefined : result;\n }\n function asSymbolInformation(item) {\n const data = item.data;\n const location = item.location;\n const result = location.range === undefined || data !== undefined\n ? new protocolWorkspaceSymbol_1.default(item.name, asSymbolKind(item.kind), item.containerName ?? '', location.range === undefined ? _uriConverter(location.uri) : new code.Location(_uriConverter(item.location.uri), asRange(location.range)), data)\n : new code.SymbolInformation(item.name, asSymbolKind(item.kind), item.containerName ?? '', new code.Location(_uriConverter(item.location.uri), asRange(location.range)));\n fillTags(result, item);\n return result;\n }\n async function asDocumentSymbols(values, token) {\n if (values === undefined || values === null) {\n return undefined;\n }\n return async.map(values, asDocumentSymbol, token);\n }\n function asDocumentSymbol(value) {\n let result = new code.DocumentSymbol(value.name, value.detail || '', asSymbolKind(value.kind), asRange(value.range), asRange(value.selectionRange));\n fillTags(result, value);\n if (value.children !== undefined && value.children.length > 0) {\n let children = [];\n for (let child of value.children) {\n children.push(asDocumentSymbol(child));\n }\n result.children = children;\n }\n return result;\n }\n function fillTags(result, value) {\n result.tags = asSymbolTags(value.tags);\n if (value.deprecated) {\n if (!result.tags) {\n result.tags = [code.SymbolTag.Deprecated];\n }\n else {\n if (!result.tags.includes(code.SymbolTag.Deprecated)) {\n result.tags = result.tags.concat(code.SymbolTag.Deprecated);\n }\n }\n }\n }\n function asCommand(item) {\n let result = { title: item.title, command: item.command };\n if (item.arguments) {\n result.arguments = item.arguments;\n }\n return result;\n }\n async function asCommands(items, token) {\n if (!items) {\n return undefined;\n }\n return async.map(items, asCommand, token);\n }\n const kindMapping = new Map();\n kindMapping.set(ls.CodeActionKind.Empty, code.CodeActionKind.Empty);\n kindMapping.set(ls.CodeActionKind.QuickFix, code.CodeActionKind.QuickFix);\n kindMapping.set(ls.CodeActionKind.Refactor, code.CodeActionKind.Refactor);\n kindMapping.set(ls.CodeActionKind.RefactorExtract, code.CodeActionKind.RefactorExtract);\n kindMapping.set(ls.CodeActionKind.RefactorInline, code.CodeActionKind.RefactorInline);\n kindMapping.set(ls.CodeActionKind.RefactorRewrite, code.CodeActionKind.RefactorRewrite);\n kindMapping.set(ls.CodeActionKind.Source, code.CodeActionKind.Source);\n kindMapping.set(ls.CodeActionKind.SourceOrganizeImports, code.CodeActionKind.SourceOrganizeImports);\n function asCodeActionKind(item) {\n if (item === undefined || item === null) {\n return undefined;\n }\n let result = kindMapping.get(item);\n if (result) {\n return result;\n }\n let parts = item.split('.');\n result = code.CodeActionKind.Empty;\n for (let part of parts) {\n result = result.append(part);\n }\n return result;\n }\n function asCodeActionKinds(items) {\n if (items === undefined || items === null) {\n return undefined;\n }\n return items.map(kind => asCodeActionKind(kind));\n }\n async function asCodeAction(item, token) {\n if (item === undefined || item === null) {\n return undefined;\n }\n let result = new protocolCodeAction_1.default(item.title, item.data);\n if (item.kind !== undefined) {\n result.kind = asCodeActionKind(item.kind);\n }\n if (item.diagnostics !== undefined) {\n result.diagnostics = asDiagnosticsSync(item.diagnostics);\n }\n if (item.edit !== undefined) {\n result.edit = await asWorkspaceEdit(item.edit, token);\n }\n if (item.command !== undefined) {\n result.command = asCommand(item.command);\n }\n if (item.isPreferred !== undefined) {\n result.isPreferred = item.isPreferred;\n }\n if (item.disabled !== undefined) {\n result.disabled = { reason: item.disabled.reason };\n }\n return result;\n }\n function asCodeActionResult(items, token) {\n return async.mapAsync(items, async (item) => {\n if (ls.Command.is(item)) {\n return asCommand(item);\n }\n else {\n return asCodeAction(item, token);\n }\n }, token);\n }\n function asCodeLens(item) {\n if (!item) {\n return undefined;\n }\n let result = new protocolCodeLens_1.default(asRange(item.range));\n if (item.command) {\n result.command = asCommand(item.command);\n }\n if (item.data !== undefined && item.data !== null) {\n result.data = item.data;\n }\n return result;\n }\n async function asCodeLenses(items, token) {\n if (!items) {\n return undefined;\n }\n return async.map(items, asCodeLens, token);\n }\n async function asWorkspaceEdit(item, token) {\n if (!item) {\n return undefined;\n }\n const sharedMetadata = new Map();\n if (item.changeAnnotations !== undefined) {\n const changeAnnotations = item.changeAnnotations;\n await async.forEach(Object.keys(changeAnnotations), (key) => {\n const metaData = asWorkspaceEditEntryMetadata(changeAnnotations[key]);\n sharedMetadata.set(key, metaData);\n }, token);\n }\n const asMetadata = (annotation) => {\n if (annotation === undefined) {\n return undefined;\n }\n else {\n return sharedMetadata.get(annotation);\n }\n };\n const result = new code.WorkspaceEdit();\n if (item.documentChanges) {\n const documentChanges = item.documentChanges;\n await async.forEach(documentChanges, (change) => {\n if (ls.CreateFile.is(change)) {\n result.createFile(_uriConverter(change.uri), change.options, asMetadata(change.annotationId));\n }\n else if (ls.RenameFile.is(change)) {\n result.renameFile(_uriConverter(change.oldUri), _uriConverter(change.newUri), change.options, asMetadata(change.annotationId));\n }\n else if (ls.DeleteFile.is(change)) {\n result.deleteFile(_uriConverter(change.uri), change.options, asMetadata(change.annotationId));\n }\n else if (ls.TextDocumentEdit.is(change)) {\n const uri = _uriConverter(change.textDocument.uri);\n for (const edit of change.edits) {\n if (ls.AnnotatedTextEdit.is(edit)) {\n result.replace(uri, asRange(edit.range), edit.newText, asMetadata(edit.annotationId));\n }\n else {\n result.replace(uri, asRange(edit.range), edit.newText);\n }\n }\n }\n else {\n throw new Error(`Unknown workspace edit change received:\\n${JSON.stringify(change, undefined, 4)}`);\n }\n }, token);\n }\n else if (item.changes) {\n const changes = item.changes;\n await async.forEach(Object.keys(changes), (key) => {\n result.set(_uriConverter(key), asTextEditsSync(changes[key]));\n }, token);\n }\n return result;\n }\n function asWorkspaceEditEntryMetadata(annotation) {\n if (annotation === undefined) {\n return undefined;\n }\n return { label: annotation.label, needsConfirmation: !!annotation.needsConfirmation, description: annotation.description };\n }\n function asDocumentLink(item) {\n let range = asRange(item.range);\n let target = item.target ? asUri(item.target) : undefined;\n // target must be optional in DocumentLink\n let link = new protocolDocumentLink_1.default(range, target);\n if (item.tooltip !== undefined) {\n link.tooltip = item.tooltip;\n }\n if (item.data !== undefined && item.data !== null) {\n link.data = item.data;\n }\n return link;\n }\n async function asDocumentLinks(items, token) {\n if (!items) {\n return undefined;\n }\n return async.map(items, asDocumentLink, token);\n }\n function asColor(color) {\n return new code.Color(color.red, color.green, color.blue, color.alpha);\n }\n function asColorInformation(ci) {\n return new code.ColorInformation(asRange(ci.range), asColor(ci.color));\n }\n async function asColorInformations(colorInformation, token) {\n if (!colorInformation) {\n return undefined;\n }\n return async.map(colorInformation, asColorInformation, token);\n }\n function asColorPresentation(cp) {\n let presentation = new code.ColorPresentation(cp.label);\n presentation.additionalTextEdits = asTextEditsSync(cp.additionalTextEdits);\n if (cp.textEdit) {\n presentation.textEdit = asTextEdit(cp.textEdit);\n }\n return presentation;\n }\n async function asColorPresentations(colorPresentations, token) {\n if (!colorPresentations) {\n return undefined;\n }\n return async.map(colorPresentations, asColorPresentation, token);\n }\n function asFoldingRangeKind(kind) {\n if (kind) {\n switch (kind) {\n case ls.FoldingRangeKind.Comment:\n return code.FoldingRangeKind.Comment;\n case ls.FoldingRangeKind.Imports:\n return code.FoldingRangeKind.Imports;\n case ls.FoldingRangeKind.Region:\n return code.FoldingRangeKind.Region;\n }\n }\n return undefined;\n }\n function asFoldingRange(r) {\n return new code.FoldingRange(r.startLine, r.endLine, asFoldingRangeKind(r.kind));\n }\n async function asFoldingRanges(foldingRanges, token) {\n if (!foldingRanges) {\n return undefined;\n }\n return async.map(foldingRanges, asFoldingRange, token);\n }\n function asSelectionRange(selectionRange) {\n return new code.SelectionRange(asRange(selectionRange.range), selectionRange.parent ? asSelectionRange(selectionRange.parent) : undefined);\n }\n async function asSelectionRanges(selectionRanges, token) {\n if (!Array.isArray(selectionRanges)) {\n return [];\n }\n return async.map(selectionRanges, asSelectionRange, token);\n }\n function asInlineValue(inlineValue) {\n if (ls.InlineValueText.is(inlineValue)) {\n return new code.InlineValueText(asRange(inlineValue.range), inlineValue.text);\n }\n else if (ls.InlineValueVariableLookup.is(inlineValue)) {\n return new code.InlineValueVariableLookup(asRange(inlineValue.range), inlineValue.variableName, inlineValue.caseSensitiveLookup);\n }\n else {\n return new code.InlineValueEvaluatableExpression(asRange(inlineValue.range), inlineValue.expression);\n }\n }\n async function asInlineValues(inlineValues, token) {\n if (!Array.isArray(inlineValues)) {\n return [];\n }\n return async.map(inlineValues, asInlineValue, token);\n }\n async function asInlayHint(value, token) {\n const label = typeof value.label === 'string'\n ? value.label\n : await async.map(value.label, asInlayHintLabelPart, token);\n const result = new protocolInlayHint_1.default(asPosition(value.position), label);\n if (value.kind !== undefined) {\n result.kind = value.kind;\n }\n if (value.textEdits !== undefined) {\n result.textEdits = await asTextEdits(value.textEdits, token);\n }\n if (value.tooltip !== undefined) {\n result.tooltip = asTooltip(value.tooltip);\n }\n if (value.paddingLeft !== undefined) {\n result.paddingLeft = value.paddingLeft;\n }\n if (value.paddingRight !== undefined) {\n result.paddingRight = value.paddingRight;\n }\n if (value.data !== undefined) {\n result.data = value.data;\n }\n return result;\n }\n function asInlayHintLabelPart(part) {\n const result = new code.InlayHintLabelPart(part.value);\n if (part.location !== undefined) {\n result.location = asLocation(part.location);\n }\n if (part.tooltip !== undefined) {\n result.tooltip = asTooltip(part.tooltip);\n }\n if (part.command !== undefined) {\n result.command = asCommand(part.command);\n }\n return result;\n }\n function asTooltip(value) {\n if (typeof value === 'string') {\n return value;\n }\n return asMarkdownString(value);\n }\n async function asInlayHints(values, token) {\n if (!Array.isArray(values)) {\n return undefined;\n }\n return async.mapAsync(values, asInlayHint, token);\n }\n function asCallHierarchyItem(item) {\n if (item === null) {\n return undefined;\n }\n const result = new protocolCallHierarchyItem_1.default(asSymbolKind(item.kind), item.name, item.detail || '', asUri(item.uri), asRange(item.range), asRange(item.selectionRange), item.data);\n if (item.tags !== undefined) {\n result.tags = asSymbolTags(item.tags);\n }\n return result;\n }\n async function asCallHierarchyItems(items, token) {\n if (items === null) {\n return undefined;\n }\n return async.map(items, asCallHierarchyItem, token);\n }\n async function asCallHierarchyIncomingCall(item, token) {\n return new code.CallHierarchyIncomingCall(asCallHierarchyItem(item.from), await asRanges(item.fromRanges, token));\n }\n async function asCallHierarchyIncomingCalls(items, token) {\n if (items === null) {\n return undefined;\n }\n return async.mapAsync(items, asCallHierarchyIncomingCall, token);\n }\n async function asCallHierarchyOutgoingCall(item, token) {\n return new code.CallHierarchyOutgoingCall(asCallHierarchyItem(item.to), await asRanges(item.fromRanges, token));\n }\n async function asCallHierarchyOutgoingCalls(items, token) {\n if (items === null) {\n return undefined;\n }\n return async.mapAsync(items, asCallHierarchyOutgoingCall, token);\n }\n async function asSemanticTokens(value, _token) {\n if (value === undefined || value === null) {\n return undefined;\n }\n return new code.SemanticTokens(new Uint32Array(value.data), value.resultId);\n }\n function asSemanticTokensEdit(value) {\n return new code.SemanticTokensEdit(value.start, value.deleteCount, value.data !== undefined ? new Uint32Array(value.data) : undefined);\n }\n async function asSemanticTokensEdits(value, _token) {\n if (value === undefined || value === null) {\n return undefined;\n }\n return new code.SemanticTokensEdits(value.edits.map(asSemanticTokensEdit), value.resultId);\n }\n function asSemanticTokensLegend(value) {\n return value;\n }\n async function asLinkedEditingRanges(value, token) {\n if (value === null || value === undefined) {\n return undefined;\n }\n return new code.LinkedEditingRanges(await asRanges(value.ranges, token), asRegularExpression(value.wordPattern));\n }\n function asRegularExpression(value) {\n if (value === null || value === undefined) {\n return undefined;\n }\n return new RegExp(value);\n }\n function asTypeHierarchyItem(item) {\n if (item === null) {\n return undefined;\n }\n let result = new protocolTypeHierarchyItem_1.default(asSymbolKind(item.kind), item.name, item.detail || '', asUri(item.uri), asRange(item.range), asRange(item.selectionRange), item.data);\n if (item.tags !== undefined) {\n result.tags = asSymbolTags(item.tags);\n }\n return result;\n }\n async function asTypeHierarchyItems(items, token) {\n if (items === null) {\n return undefined;\n }\n return async.map(items, asTypeHierarchyItem, token);\n }\n function asGlobPattern(pattern) {\n if (Is.string(pattern)) {\n return pattern;\n }\n if (ls.RelativePattern.is(pattern)) {\n if (ls.URI.is(pattern.baseUri)) {\n return new code.RelativePattern(asUri(pattern.baseUri), pattern.pattern);\n }\n else if (ls.WorkspaceFolder.is(pattern.baseUri)) {\n const workspaceFolder = code.workspace.getWorkspaceFolder(asUri(pattern.baseUri.uri));\n return workspaceFolder !== undefined ? new code.RelativePattern(workspaceFolder, pattern.pattern) : undefined;\n }\n }\n return undefined;\n }\n async function asInlineCompletionResult(value, token) {\n if (!value) {\n return undefined;\n }\n if (Array.isArray(value)) {\n return async.map(value, (item) => asInlineCompletionItem(item), token);\n }\n const list = value;\n const converted = await async.map(list.items, (item) => {\n return asInlineCompletionItem(item);\n }, token);\n return new code.InlineCompletionList(converted);\n }\n function asInlineCompletionItem(item) {\n let insertText;\n if (typeof item.insertText === 'string') {\n insertText = item.insertText;\n }\n else {\n insertText = new code.SnippetString(item.insertText.value);\n }\n let command = undefined;\n if (item.command) {\n command = asCommand(item.command);\n }\n const inlineCompletionItem = new code.InlineCompletionItem(insertText, asRange(item.range), command);\n if (item.filterText) {\n inlineCompletionItem.filterText = item.filterText;\n }\n return inlineCompletionItem;\n }\n return {\n asUri,\n asDocumentSelector,\n asDiagnostics,\n asDiagnostic,\n asRange,\n asRanges,\n asPosition,\n asDiagnosticSeverity,\n asDiagnosticTag,\n asHover,\n asCompletionResult,\n asCompletionItem,\n asTextEdit,\n asTextEdits,\n asSignatureHelp,\n asSignatureInformations,\n asSignatureInformation,\n asParameterInformations,\n asParameterInformation,\n asDeclarationResult,\n asDefinitionResult,\n asLocation,\n asReferences,\n asDocumentHighlights,\n asDocumentHighlight,\n asDocumentHighlightKind,\n asSymbolKind,\n asSymbolTag,\n asSymbolTags,\n asSymbolInformations,\n asSymbolInformation,\n asDocumentSymbols,\n asDocumentSymbol,\n asCommand,\n asCommands,\n asCodeAction,\n asCodeActionKind,\n asCodeActionKinds,\n asCodeActionResult,\n asCodeLens,\n asCodeLenses,\n asWorkspaceEdit,\n asDocumentLink,\n asDocumentLinks,\n asFoldingRangeKind,\n asFoldingRange,\n asFoldingRanges,\n asColor,\n asColorInformation,\n asColorInformations,\n asColorPresentation,\n asColorPresentations,\n asSelectionRange,\n asSelectionRanges,\n asInlineValue,\n asInlineValues,\n asInlayHint,\n asInlayHints,\n asSemanticTokensLegend,\n asSemanticTokens,\n asSemanticTokensEdit,\n asSemanticTokensEdits,\n asCallHierarchyItem,\n asCallHierarchyItems,\n asCallHierarchyIncomingCall,\n asCallHierarchyIncomingCalls,\n asCallHierarchyOutgoingCall,\n asCallHierarchyOutgoingCalls,\n asLinkedEditingRanges: asLinkedEditingRanges,\n asTypeHierarchyItem,\n asTypeHierarchyItems,\n asGlobPattern,\n asInlineCompletionResult,\n asInlineCompletionItem\n };\n}\nexports.createConverter = createConverter;\n","\"use strict\";\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateUuid = exports.parse = exports.isUUID = exports.v4 = exports.empty = void 0;\nclass ValueUUID {\n constructor(_value) {\n this._value = _value;\n // empty\n }\n asHex() {\n return this._value;\n }\n equals(other) {\n return this.asHex() === other.asHex();\n }\n}\nclass V4UUID extends ValueUUID {\n static _oneOf(array) {\n return array[Math.floor(array.length * Math.random())];\n }\n static _randomHex() {\n return V4UUID._oneOf(V4UUID._chars);\n }\n constructor() {\n super([\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n '-',\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n '-',\n '4',\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n '-',\n V4UUID._oneOf(V4UUID._timeHighBits),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n '-',\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n V4UUID._randomHex(),\n ].join(''));\n }\n}\nV4UUID._chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];\nV4UUID._timeHighBits = ['8', '9', 'a', 'b'];\n/**\n * An empty UUID that contains only zeros.\n */\nexports.empty = new ValueUUID('00000000-0000-0000-0000-000000000000');\nfunction v4() {\n return new V4UUID();\n}\nexports.v4 = v4;\nconst _UUIDPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\nfunction isUUID(value) {\n return _UUIDPattern.test(value);\n}\nexports.isUUID = isUUID;\n/**\n * Parses a UUID that is of the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.\n * @param value A uuid string.\n */\nfunction parse(value) {\n if (!isUUID(value)) {\n throw new Error('invalid uuid');\n }\n return new ValueUUID(value);\n}\nexports.parse = parse;\nfunction generateUuid() {\n return v4().asHex();\n}\nexports.generateUuid = generateUuid;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProgressPart = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst Is = require(\"./utils/is\");\nclass ProgressPart {\n constructor(_client, _token, done) {\n this._client = _client;\n this._token = _token;\n this._reported = 0;\n this._infinite = false;\n this._lspProgressDisposable = this._client.onProgress(vscode_languageserver_protocol_1.WorkDoneProgress.type, this._token, (value) => {\n switch (value.kind) {\n case 'begin':\n this.begin(value);\n break;\n case 'report':\n this.report(value);\n break;\n case 'end':\n this.done();\n done && done(this);\n break;\n }\n });\n }\n begin(params) {\n this._infinite = params.percentage === undefined;\n // the progress as already been marked as done / canceled. Ignore begin call\n if (this._lspProgressDisposable === undefined) {\n return;\n }\n // Since we don't use commands this will be a silent window progress with a hidden notification.\n void vscode_1.window.withProgress({ location: vscode_1.ProgressLocation.Window, cancellable: params.cancellable, title: params.title }, async (progress, cancellationToken) => {\n // the progress as already been marked as done / canceled. Ignore begin call\n if (this._lspProgressDisposable === undefined) {\n return;\n }\n this._progress = progress;\n this._cancellationToken = cancellationToken;\n this._tokenDisposable = this._cancellationToken.onCancellationRequested(() => {\n this._client.sendNotification(vscode_languageserver_protocol_1.WorkDoneProgressCancelNotification.type, { token: this._token });\n });\n this.report(params);\n return new Promise((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n });\n }\n report(params) {\n if (this._infinite && Is.string(params.message)) {\n this._progress !== undefined && this._progress.report({ message: params.message });\n }\n else if (Is.number(params.percentage)) {\n const percentage = Math.max(0, Math.min(params.percentage, 100));\n const delta = Math.max(0, percentage - this._reported);\n this._reported += delta;\n this._progress !== undefined && this._progress.report({ message: params.message, increment: delta });\n }\n }\n cancel() {\n this.cleanup();\n if (this._reject !== undefined) {\n this._reject();\n this._resolve = undefined;\n this._reject = undefined;\n }\n }\n done() {\n this.cleanup();\n if (this._resolve !== undefined) {\n this._resolve();\n this._resolve = undefined;\n this._reject = undefined;\n }\n }\n cleanup() {\n if (this._lspProgressDisposable !== undefined) {\n this._lspProgressDisposable.dispose();\n this._lspProgressDisposable = undefined;\n }\n if (this._tokenDisposable !== undefined) {\n this._tokenDisposable.dispose();\n this._tokenDisposable = undefined;\n }\n this._progress = undefined;\n this._cancellationToken = undefined;\n }\n}\nexports.ProgressPart = ProgressPart;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkspaceFeature = exports.TextDocumentLanguageFeature = exports.TextDocumentEventFeature = exports.DynamicDocumentFeature = exports.DynamicFeature = exports.StaticFeature = exports.ensure = exports.LSPCancellationError = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst Is = require(\"./utils/is\");\nconst UUID = require(\"./utils/uuid\");\nclass LSPCancellationError extends vscode_1.CancellationError {\n constructor(data) {\n super();\n this.data = data;\n }\n}\nexports.LSPCancellationError = LSPCancellationError;\nfunction ensure(target, key) {\n if (target[key] === undefined) {\n target[key] = {};\n }\n return target[key];\n}\nexports.ensure = ensure;\nvar StaticFeature;\n(function (StaticFeature) {\n function is(value) {\n const candidate = value;\n return candidate !== undefined && candidate !== null &&\n Is.func(candidate.fillClientCapabilities) && Is.func(candidate.initialize) && Is.func(candidate.getState) && Is.func(candidate.clear) &&\n (candidate.fillInitializeParams === undefined || Is.func(candidate.fillInitializeParams));\n }\n StaticFeature.is = is;\n})(StaticFeature || (exports.StaticFeature = StaticFeature = {}));\nvar DynamicFeature;\n(function (DynamicFeature) {\n function is(value) {\n const candidate = value;\n return candidate !== undefined && candidate !== null &&\n Is.func(candidate.fillClientCapabilities) && Is.func(candidate.initialize) && Is.func(candidate.getState) && Is.func(candidate.clear) &&\n (candidate.fillInitializeParams === undefined || Is.func(candidate.fillInitializeParams)) && Is.func(candidate.register) &&\n Is.func(candidate.unregister) && candidate.registrationType !== undefined;\n }\n DynamicFeature.is = is;\n})(DynamicFeature || (exports.DynamicFeature = DynamicFeature = {}));\n/**\n * An abstract dynamic feature implementation that operates on documents (e.g. text\n * documents or notebooks).\n */\nclass DynamicDocumentFeature {\n constructor(client) {\n this._client = client;\n }\n /**\n * Returns the state the feature is in.\n */\n getState() {\n const selectors = this.getDocumentSelectors();\n let count = 0;\n for (const selector of selectors) {\n count++;\n for (const document of vscode_1.workspace.textDocuments) {\n if (vscode_1.languages.match(selector, document) > 0) {\n return { kind: 'document', id: this.registrationType.method, registrations: true, matches: true };\n }\n }\n }\n const registrations = count > 0;\n return { kind: 'document', id: this.registrationType.method, registrations, matches: false };\n }\n}\nexports.DynamicDocumentFeature = DynamicDocumentFeature;\n/**\n * An abstract base class to implement features that react to events\n * emitted from text documents.\n */\nclass TextDocumentEventFeature extends DynamicDocumentFeature {\n static textDocumentFilter(selectors, textDocument) {\n for (const selector of selectors) {\n if (vscode_1.languages.match(selector, textDocument) > 0) {\n return true;\n }\n }\n return false;\n }\n constructor(client, event, type, middleware, createParams, textDocument, selectorFilter) {\n super(client);\n this._event = event;\n this._type = type;\n this._middleware = middleware;\n this._createParams = createParams;\n this._textDocument = textDocument;\n this._selectorFilter = selectorFilter;\n this._selectors = new Map();\n this._onNotificationSent = new vscode_1.EventEmitter();\n }\n getStateInfo() {\n return [this._selectors.values(), false];\n }\n getDocumentSelectors() {\n return this._selectors.values();\n }\n register(data) {\n if (!data.registerOptions.documentSelector) {\n return;\n }\n if (!this._listener) {\n this._listener = this._event((data) => {\n this.callback(data).catch((error) => {\n this._client.error(`Sending document notification ${this._type.method} failed.`, error);\n });\n });\n }\n this._selectors.set(data.id, this._client.protocol2CodeConverter.asDocumentSelector(data.registerOptions.documentSelector));\n }\n async callback(data) {\n const doSend = async (data) => {\n const params = this._createParams(data);\n await this._client.sendNotification(this._type, params);\n this.notificationSent(this.getTextDocument(data), this._type, params);\n };\n if (this.matches(data)) {\n const middleware = this._middleware();\n return middleware ? middleware(data, (data) => doSend(data)) : doSend(data);\n }\n }\n matches(data) {\n if (this._client.hasDedicatedTextSynchronizationFeature(this._textDocument(data))) {\n return false;\n }\n return !this._selectorFilter || this._selectorFilter(this._selectors.values(), data);\n }\n get onNotificationSent() {\n return this._onNotificationSent.event;\n }\n notificationSent(textDocument, type, params) {\n this._onNotificationSent.fire({ textDocument, type, params });\n }\n unregister(id) {\n this._selectors.delete(id);\n if (this._selectors.size === 0 && this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n }\n clear() {\n this._selectors.clear();\n this._onNotificationSent.dispose();\n if (this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n }\n getProvider(document) {\n for (const selector of this._selectors.values()) {\n if (vscode_1.languages.match(selector, document) > 0) {\n return {\n send: (data) => {\n return this.callback(data);\n }\n };\n }\n }\n return undefined;\n }\n}\nexports.TextDocumentEventFeature = TextDocumentEventFeature;\n/**\n * A abstract feature implementation that registers language providers\n * for text documents using a given document selector.\n */\nclass TextDocumentLanguageFeature extends DynamicDocumentFeature {\n constructor(client, registrationType) {\n super(client);\n this._registrationType = registrationType;\n this._registrations = new Map();\n }\n *getDocumentSelectors() {\n for (const registration of this._registrations.values()) {\n const selector = registration.data.registerOptions.documentSelector;\n if (selector === null) {\n continue;\n }\n yield this._client.protocol2CodeConverter.asDocumentSelector(selector);\n }\n }\n get registrationType() {\n return this._registrationType;\n }\n register(data) {\n if (!data.registerOptions.documentSelector) {\n return;\n }\n let registration = this.registerLanguageProvider(data.registerOptions, data.id);\n this._registrations.set(data.id, { disposable: registration[0], data, provider: registration[1] });\n }\n unregister(id) {\n let registration = this._registrations.get(id);\n if (registration !== undefined) {\n registration.disposable.dispose();\n }\n }\n clear() {\n this._registrations.forEach((value) => {\n value.disposable.dispose();\n });\n this._registrations.clear();\n }\n getRegistration(documentSelector, capability) {\n if (!capability) {\n return [undefined, undefined];\n }\n else if (vscode_languageserver_protocol_1.TextDocumentRegistrationOptions.is(capability)) {\n const id = vscode_languageserver_protocol_1.StaticRegistrationOptions.hasId(capability) ? capability.id : UUID.generateUuid();\n const selector = capability.documentSelector ?? documentSelector;\n if (selector) {\n return [id, Object.assign({}, capability, { documentSelector: selector })];\n }\n }\n else if (Is.boolean(capability) && capability === true || vscode_languageserver_protocol_1.WorkDoneProgressOptions.is(capability)) {\n if (!documentSelector) {\n return [undefined, undefined];\n }\n const options = (Is.boolean(capability) && capability === true ? { documentSelector } : Object.assign({}, capability, { documentSelector }));\n return [UUID.generateUuid(), options];\n }\n return [undefined, undefined];\n }\n getRegistrationOptions(documentSelector, capability) {\n if (!documentSelector || !capability) {\n return undefined;\n }\n return (Is.boolean(capability) && capability === true ? { documentSelector } : Object.assign({}, capability, { documentSelector }));\n }\n getProvider(textDocument) {\n for (const registration of this._registrations.values()) {\n let selector = registration.data.registerOptions.documentSelector;\n if (selector !== null && vscode_1.languages.match(this._client.protocol2CodeConverter.asDocumentSelector(selector), textDocument) > 0) {\n return registration.provider;\n }\n }\n return undefined;\n }\n getAllProviders() {\n const result = [];\n for (const item of this._registrations.values()) {\n result.push(item.provider);\n }\n return result;\n }\n}\nexports.TextDocumentLanguageFeature = TextDocumentLanguageFeature;\nclass WorkspaceFeature {\n constructor(client, registrationType) {\n this._client = client;\n this._registrationType = registrationType;\n this._registrations = new Map();\n }\n getState() {\n const registrations = this._registrations.size > 0;\n return { kind: 'workspace', id: this._registrationType.method, registrations };\n }\n get registrationType() {\n return this._registrationType;\n }\n register(data) {\n const registration = this.registerLanguageProvider(data.registerOptions);\n this._registrations.set(data.id, { disposable: registration[0], provider: registration[1] });\n }\n unregister(id) {\n let registration = this._registrations.get(id);\n if (registration !== undefined) {\n registration.disposable.dispose();\n }\n }\n clear() {\n this._registrations.forEach((registration) => {\n registration.disposable.dispose();\n });\n this._registrations.clear();\n }\n getProviders() {\n const result = [];\n for (const registration of this._registrations.values()) {\n result.push(registration.provider);\n }\n return result;\n }\n}\nexports.WorkspaceFeature = WorkspaceFeature;\n","const isWindows = typeof process === 'object' &&\n process &&\n process.platform === 'win32'\nmodule.exports = isWindows ? { sep: '\\\\' } : { sep: '/' }\n","'use strict';\nmodule.exports = balanced;\nfunction balanced(a, b, str) {\n if (a instanceof RegExp) a = maybeMatch(a, str);\n if (b instanceof RegExp) b = maybeMatch(b, str);\n\n var r = range(a, b, str);\n\n return r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + a.length, r[1]),\n post: str.slice(r[1] + b.length)\n };\n}\n\nfunction maybeMatch(reg, str) {\n var m = str.match(reg);\n return m ? m[0] : null;\n}\n\nbalanced.range = range;\nfunction range(a, b, str) {\n var begs, beg, left, right, result;\n var ai = str.indexOf(a);\n var bi = str.indexOf(b, ai + 1);\n var i = ai;\n\n if (ai >= 0 && bi > 0) {\n if(a===b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n\n while (i >= 0 && !result) {\n if (i == ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n } else if (begs.length == 1) {\n result = [ begs.pop(), bi ];\n } else {\n beg = begs.pop();\n if (beg < left) {\n left = beg;\n right = bi;\n }\n\n bi = str.indexOf(b, i + 1);\n }\n\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n\n if (begs.length) {\n result = [ left, right ];\n }\n }\n\n return result;\n}\n","var balanced = require('balanced-match');\n\nmodule.exports = expandTop;\n\nvar escSlash = '\\0SLASH'+Math.random()+'\\0';\nvar escOpen = '\\0OPEN'+Math.random()+'\\0';\nvar escClose = '\\0CLOSE'+Math.random()+'\\0';\nvar escComma = '\\0COMMA'+Math.random()+'\\0';\nvar escPeriod = '\\0PERIOD'+Math.random()+'\\0';\n\nfunction numeric(str) {\n return parseInt(str, 10) == str\n ? parseInt(str, 10)\n : str.charCodeAt(0);\n}\n\nfunction escapeBraces(str) {\n return str.split('\\\\\\\\').join(escSlash)\n .split('\\\\{').join(escOpen)\n .split('\\\\}').join(escClose)\n .split('\\\\,').join(escComma)\n .split('\\\\.').join(escPeriod);\n}\n\nfunction unescapeBraces(str) {\n return str.split(escSlash).join('\\\\')\n .split(escOpen).join('{')\n .split(escClose).join('}')\n .split(escComma).join(',')\n .split(escPeriod).join('.');\n}\n\n\n// Basically just str.split(\",\"), but handling cases\n// where we have nested braced sections, which should be\n// treated as individual members, like {a,{b,c},d}\nfunction parseCommaParts(str) {\n if (!str)\n return [''];\n\n var parts = [];\n var m = balanced('{', '}', str);\n\n if (!m)\n return str.split(',');\n\n var pre = m.pre;\n var body = m.body;\n var post = m.post;\n var p = pre.split(',');\n\n p[p.length-1] += '{' + body + '}';\n var postParts = parseCommaParts(post);\n if (post.length) {\n p[p.length-1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n\n parts.push.apply(parts, p);\n\n return parts;\n}\n\nfunction expandTop(str, options) {\n if (!str)\n return [];\n\n options = options || {};\n var max = options.max == null ? Infinity : options.max;\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.substr(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.substr(2);\n }\n\n return expand(escapeBraces(str), max, true).map(unescapeBraces);\n}\n\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\n\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\n\nfunction expand(str, max, isTop) {\n var expansions = [];\n\n var m = balanced('{', '}', str);\n if (!m) return [str];\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n var pre = m.pre;\n var post = m.post.length\n ? expand(m.post, max, false)\n : [''];\n\n if (/\\$$/.test(m.pre)) { \n for (var k = 0; k < post.length && k < max; k++) {\n var expansion = pre+ '{' + m.body + '}' + post[k];\n expansions.push(expansion);\n }\n } else {\n var isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n var isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n var isSequence = isNumericSequence || isAlphaSequence;\n var isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand(str, max, true);\n }\n return [str];\n }\n\n var n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n } else {\n n = parseCommaParts(m.body);\n if (n.length === 1) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand(n[0], max, false).map(embrace);\n if (n.length === 1) {\n return post.map(function(p) {\n return m.pre + n[0] + p;\n });\n }\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n var N;\n\n if (isSequence) {\n var x = numeric(n[0]);\n var y = numeric(n[1]);\n var width = Math.max(n[0].length, n[1].length)\n var incr = n.length == 3\n ? Math.max(Math.abs(numeric(n[2])), 1)\n : 1;\n var test = lte;\n var reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n var pad = n.some(isPadded);\n\n N = [];\n\n for (var i = x; test(i, y); i += incr) {\n var c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\')\n c = '';\n } else {\n c = String(i);\n if (pad) {\n var need = width - c.length;\n if (need > 0) {\n var z = new Array(need + 1).join('0');\n if (i < 0)\n c = '-' + z + c.slice(1);\n else\n c = z + c;\n }\n }\n }\n N.push(c);\n }\n } else {\n N = [];\n\n for (var j = 0; j < n.length; j++) {\n N.push.apply(N, expand(n[j], max, false));\n }\n }\n\n for (var j = 0; j < N.length; j++) {\n for (var k = 0; k < post.length && expansions.length < max; k++) {\n var expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion)\n expansions.push(expansion);\n }\n }\n }\n\n return expansions;\n}\n","const minimatch = module.exports = (p, pattern, options = {}) => {\n assertValidPattern(pattern)\n\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false\n }\n\n return new Minimatch(pattern, options).match(p)\n}\n\nmodule.exports = minimatch\n\nconst path = require('./lib/path.js')\nminimatch.sep = path.sep\n\nconst GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\nconst expand = require('brace-expansion')\n\nconst plTypes = {\n '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},\n '?': { open: '(?:', close: ')?' },\n '+': { open: '(?:', close: ')+' },\n '*': { open: '(?:', close: ')*' },\n '@': { open: '(?:', close: ')' }\n}\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\\\/|^)(?:\\\\.{1,2})($|\\\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\\\/|^)\\\\.).)*?'\n\n// \"abc\" -> { a:true, b:true, c:true }\nconst charSet = s => s.split('').reduce((set, c) => {\n set[c] = true\n return set\n}, {})\n\n// characters that need to be escaped in RegExp.\nconst reSpecials = charSet('().*{}+?[]^$\\\\!')\n\n// characters that indicate we have to add the pattern start\nconst addPatternStartSet = charSet('[.(')\n\n// normalizes slashes.\nconst slashSplit = /\\/+/\n\nminimatch.filter = (pattern, options = {}) =>\n (p, i, list) => minimatch(p, pattern, options)\n\nconst ext = (a, b = {}) => {\n const t = {}\n Object.keys(a).forEach(k => t[k] = a[k])\n Object.keys(b).forEach(k => t[k] = b[k])\n return t\n}\n\nminimatch.defaults = def => {\n if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n return minimatch\n }\n\n const orig = minimatch\n\n const m = (p, pattern, options) => orig(p, pattern, ext(def, options))\n m.Minimatch = class Minimatch extends orig.Minimatch {\n constructor (pattern, options) {\n super(pattern, ext(def, options))\n }\n }\n m.Minimatch.defaults = options => orig.defaults(ext(def, options)).Minimatch\n m.filter = (pattern, options) => orig.filter(pattern, ext(def, options))\n m.defaults = options => orig.defaults(ext(def, options))\n m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options))\n m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options))\n m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options))\n\n return m\n}\n\n\n\n\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nminimatch.braceExpand = (pattern, options) => braceExpand(pattern, options)\n\nconst braceExpand = (pattern, options = {}) => {\n assertValidPattern(pattern)\n\n // Thanks to Yeting Li for\n // improving this regexp to avoid a ReDOS vulnerability.\n if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n // shortcut. no need to expand.\n return [pattern]\n }\n\n return expand(pattern)\n}\n\nconst MAX_PATTERN_LENGTH = 1024 * 64\nconst assertValidPattern = pattern => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nconst SUBPARSE = Symbol('subparse')\n\nminimatch.makeRe = (pattern, options) =>\n new Minimatch(pattern, options || {}).makeRe()\n\nminimatch.match = (list, pattern, options = {}) => {\n const mm = new Minimatch(pattern, options)\n list = list.filter(f => mm.match(f))\n if (mm.options.nonull && !list.length) {\n list.push(pattern)\n }\n return list\n}\n\n// replace stuff like \\* with *\nconst globUnescape = s => s.replace(/\\\\(.)/g, '$1')\nconst charUnescape = s => s.replace(/\\\\([^-\\]])/g, '$1')\nconst regExpEscape = s => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\nconst braExpEscape = s => s.replace(/[[\\]\\\\]/g, '\\\\$&')\n\nclass Minimatch {\n constructor (pattern, options) {\n assertValidPattern(pattern)\n\n if (!options) options = {}\n\n this.options = options\n this.maxGlobstarRecursion = options.maxGlobstarRecursion !== undefined\n ? options.maxGlobstarRecursion : 200\n this.set = []\n this.pattern = pattern\n this.windowsPathsNoEscape = !!options.windowsPathsNoEscape ||\n options.allowWindowsEscape === false\n if (this.windowsPathsNoEscape) {\n this.pattern = this.pattern.replace(/\\\\/g, '/')\n }\n this.regexp = null\n this.negate = false\n this.comment = false\n this.empty = false\n this.partial = !!options.partial\n\n // make the set of regexps etc.\n this.make()\n }\n\n debug () {}\n\n make () {\n const pattern = this.pattern\n const options = this.options\n\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true\n return\n }\n if (!pattern) {\n this.empty = true\n return\n }\n\n // step 1: figure out negation, etc.\n this.parseNegate()\n\n // step 2: expand braces\n let set = this.globSet = this.braceExpand()\n\n if (options.debug) this.debug = (...args) => console.error(...args)\n\n this.debug(this.pattern, set)\n\n // step 3: now we have a set, so turn each one into a series of path-portion\n // matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n set = this.globParts = set.map(s => s.split(slashSplit))\n\n this.debug(this.pattern, set)\n\n // glob --> regexps\n set = set.map((s, si, set) => s.map(this.parse, this))\n\n this.debug(this.pattern, set)\n\n // filter out everything that didn't compile properly.\n set = set.filter(s => s.indexOf(false) === -1)\n\n this.debug(this.pattern, set)\n\n this.set = set\n }\n\n parseNegate () {\n if (this.options.nonegate) return\n\n const pattern = this.pattern\n let negate = false\n let negateOffset = 0\n\n for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n negate = !negate\n negateOffset++\n }\n\n if (negateOffset) this.pattern = pattern.slice(negateOffset)\n this.negate = negate\n }\n\n // set partial to true to test if, for example,\n // \"/a/b\" matches the start of \"/*/b/*/d\"\n // Partial means, if you run out of file before you run\n // out of pattern, then that's fine, as long as all\n // the parts match.\n matchOne (file, pattern, partial) {\n if (pattern.indexOf(GLOBSTAR) !== -1) {\n return this._matchGlobstar(file, pattern, partial, 0, 0)\n }\n return this._matchOne(file, pattern, partial, 0, 0)\n }\n\n _matchGlobstar (file, pattern, partial, fileIndex, patternIndex) {\n // find first globstar from patternIndex\n let firstgs = -1\n for (let i = patternIndex; i < pattern.length; i++) {\n if (pattern[i] === GLOBSTAR) { firstgs = i; break }\n }\n\n // find last globstar\n let lastgs = -1\n for (let i = pattern.length - 1; i >= 0; i--) {\n if (pattern[i] === GLOBSTAR) { lastgs = i; break }\n }\n\n const head = pattern.slice(patternIndex, firstgs)\n const body = partial ? pattern.slice(firstgs + 1) : pattern.slice(firstgs + 1, lastgs)\n const tail = partial ? [] : pattern.slice(lastgs + 1)\n\n // check the head\n if (head.length) {\n const fileHead = file.slice(fileIndex, fileIndex + head.length)\n if (!this._matchOne(fileHead, head, partial, 0, 0)) {\n return false\n }\n fileIndex += head.length\n }\n\n // check the tail\n let fileTailMatch = 0\n if (tail.length) {\n if (tail.length + fileIndex > file.length) return false\n\n const tailStart = file.length - tail.length\n if (this._matchOne(file, tail, partial, tailStart, 0)) {\n fileTailMatch = tail.length\n } else {\n // affordance for stuff like a/**/* matching a/b/\n if (file[file.length - 1] !== '' ||\n fileIndex + tail.length === file.length) {\n return false\n }\n if (!this._matchOne(file, tail, partial, tailStart - 1, 0)) {\n return false\n }\n fileTailMatch = tail.length + 1\n }\n }\n\n // if body is empty (single ** between head and tail)\n if (!body.length) {\n let sawSome = !!fileTailMatch\n for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n const f = String(file[i])\n sawSome = true\n if (f === '.' || f === '..' ||\n (!this.options.dot && f.charAt(0) === '.')) {\n return false\n }\n }\n return partial || sawSome\n }\n\n // split body into segments at each GLOBSTAR\n const bodySegments = [[[], 0]]\n let currentBody = bodySegments[0]\n let nonGsParts = 0\n const nonGsPartsSums = [0]\n for (const b of body) {\n if (b === GLOBSTAR) {\n nonGsPartsSums.push(nonGsParts)\n currentBody = [[], 0]\n bodySegments.push(currentBody)\n } else {\n currentBody[0].push(b)\n nonGsParts++\n }\n }\n\n let idx = bodySegments.length - 1\n const fileLength = file.length - fileTailMatch\n for (const b of bodySegments) {\n b[1] = fileLength - (nonGsPartsSums[idx--] + b[0].length)\n }\n\n return !!this._matchGlobStarBodySections(\n file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch\n )\n }\n\n // return false for \"nope, not matching\"\n // return null for \"not matching, cannot keep trying\"\n _matchGlobStarBodySections (\n file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail\n ) {\n const bs = bodySegments[bodyIndex]\n if (!bs) {\n // just make sure there are no bad dots\n for (let i = fileIndex; i < file.length; i++) {\n sawTail = true\n const f = file[i]\n if (f === '.' || f === '..' ||\n (!this.options.dot && f.charAt(0) === '.')) {\n return false\n }\n }\n return sawTail\n }\n\n const [body, after] = bs\n while (fileIndex <= after) {\n const m = this._matchOne(\n file.slice(0, fileIndex + body.length),\n body,\n partial,\n fileIndex,\n 0\n )\n // if limit exceeded, no match. intentional false negative,\n // acceptable break in correctness for security.\n if (m && globStarDepth < this.maxGlobstarRecursion) {\n const sub = this._matchGlobStarBodySections(\n file, bodySegments,\n fileIndex + body.length, bodyIndex + 1,\n partial, globStarDepth + 1, sawTail\n )\n if (sub !== false) {\n return sub\n }\n }\n const f = file[fileIndex]\n if (f === '.' || f === '..' ||\n (!this.options.dot && f.charAt(0) === '.')) {\n return false\n }\n fileIndex++\n }\n return partial || null\n }\n\n _matchOne (file, pattern, partial, fileIndex, patternIndex) {\n let fi, pi, fl, pl\n for (\n fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length\n ; (fi < fl) && (pi < pl)\n ; fi++, pi++\n ) {\n this.debug('matchOne loop')\n const p = pattern[pi]\n const f = file[fi]\n\n this.debug(pattern, p, f)\n\n // should be impossible.\n // some invalid regexp stuff in the set.\n /* istanbul ignore if */\n if (p === false || p === GLOBSTAR) return false\n\n // something other than **\n // non-magic patterns just have to match exactly\n // patterns with magic have been turned into regexps.\n let hit\n if (typeof p === 'string') {\n hit = f === p\n this.debug('string match', p, f, hit)\n } else {\n hit = f.match(p)\n this.debug('pattern match', p, f, hit)\n }\n\n if (!hit) return false\n }\n\n // now either we fell off the end of the pattern, or we're done.\n if (fi === fl && pi === pl) {\n // ran out of pattern and filename at the same time.\n // an exact hit!\n return true\n } else if (fi === fl) {\n // ran out of file, but still had pattern left.\n // this is ok if we're doing the match as part of\n // a glob fs traversal.\n return partial\n } else /* istanbul ignore else */ if (pi === pl) {\n // ran out of pattern, still have file left.\n // this is only acceptable if we're on the very last\n // empty segment of a file with a trailing slash.\n // a/* should match a/b/\n return (fi === fl - 1) && (file[fi] === '')\n }\n\n // should be unreachable.\n /* istanbul ignore next */\n throw new Error('wtf?')\n }\n\n braceExpand () {\n return braceExpand(this.pattern, this.options)\n }\n\n parse (pattern, isSub) {\n assertValidPattern(pattern)\n\n const options = this.options\n\n // shortcuts\n if (pattern === '**') {\n if (!options.noglobstar)\n return GLOBSTAR\n else\n pattern = '*'\n }\n if (pattern === '') return ''\n\n let re = ''\n let hasMagic = false\n let escaping = false\n // ? => one single character\n const patternListStack = []\n const negativeLists = []\n let stateChar\n let inClass = false\n let reClassStart = -1\n let classStart = -1\n let cs\n let pl\n let sp\n // . and .. never match anything that doesn't start with .,\n // even when options.dot is set. However, if the pattern\n // starts with ., then traversal patterns can match.\n let dotTravAllowed = pattern.charAt(0) === '.'\n let dotFileAllowed = options.dot || dotTravAllowed\n const patternStart = () =>\n dotTravAllowed\n ? ''\n : dotFileAllowed\n ? '(?!(?:^|\\\\/)\\\\.{1,2}(?:$|\\\\/))'\n : '(?!\\\\.)'\n const subPatternStart = (p) =>\n p.charAt(0) === '.'\n ? ''\n : options.dot\n ? '(?!(?:^|\\\\/)\\\\.{1,2}(?:$|\\\\/))'\n : '(?!\\\\.)'\n\n\n const clearStateChar = () => {\n if (stateChar) {\n // we had some state-tracking character\n // that wasn't consumed by this pass.\n switch (stateChar) {\n case '*':\n re += star\n hasMagic = true\n break\n case '?':\n re += qmark\n hasMagic = true\n break\n default:\n re += '\\\\' + stateChar\n break\n }\n this.debug('clearStateChar %j %j', stateChar, re)\n stateChar = false\n }\n }\n\n for (let i = 0, c; (i < pattern.length) && (c = pattern.charAt(i)); i++) {\n this.debug('%s\\t%s %s %j', pattern, i, re, c)\n\n // skip over any that are escaped.\n if (escaping) {\n /* istanbul ignore next - completely not allowed, even escaped. */\n if (c === '/') {\n return false\n }\n\n if (reSpecials[c]) {\n re += '\\\\'\n }\n re += c\n escaping = false\n continue\n }\n\n switch (c) {\n /* istanbul ignore next */\n case '/': {\n // Should already be path-split by now.\n return false\n }\n\n case '\\\\':\n if (inClass && pattern.charAt(i + 1) === '-') {\n re += c\n continue\n }\n\n clearStateChar()\n escaping = true\n continue\n\n // the various stateChar values\n // for the \"extglob\" stuff.\n case '?':\n case '*':\n case '+':\n case '@':\n case '!':\n this.debug('%s\\t%s %s %j <-- stateChar', pattern, i, re, c)\n\n // all of those are literals inside a class, except that\n // the glob [!a] means [^a] in regexp\n if (inClass) {\n this.debug(' in class')\n if (c === '!' && i === classStart + 1) c = '^'\n re += c\n continue\n }\n\n // coalesce consecutive non-globstar * characters\n if (c === '*' && stateChar === '*') continue\n\n // if we already have a stateChar, then it means\n // that there was something like ** or +? in there.\n // Handle the stateChar, then proceed with this one.\n this.debug('call clearStateChar %j', stateChar)\n clearStateChar()\n stateChar = c\n // if extglob is disabled, then +(asdf|foo) isn't a thing.\n // just clear the statechar *now*, rather than even diving into\n // the patternList stuff.\n if (options.noext) clearStateChar()\n continue\n\n case '(': {\n if (inClass) {\n re += '('\n continue\n }\n\n if (!stateChar) {\n re += '\\\\('\n continue\n }\n\n const plEntry = {\n type: stateChar,\n start: i - 1,\n reStart: re.length,\n open: plTypes[stateChar].open,\n close: plTypes[stateChar].close,\n }\n this.debug(this.pattern, '\\t', plEntry)\n patternListStack.push(plEntry)\n // negation is (?:(?!(?:js)(?:))[^/]*)\n re += plEntry.open\n // next entry starts with a dot maybe?\n if (plEntry.start === 0 && plEntry.type !== '!') {\n dotTravAllowed = true\n re += subPatternStart(pattern.slice(i + 1))\n }\n this.debug('plType %j %j', stateChar, re)\n stateChar = false\n continue\n }\n\n case ')': {\n const plEntry = patternListStack[patternListStack.length - 1]\n if (inClass || !plEntry) {\n re += '\\\\)'\n continue\n }\n patternListStack.pop()\n\n // closing an extglob\n clearStateChar()\n hasMagic = true\n pl = plEntry\n // negation is (?:(?!js)[^/]*)\n // The others are (?:)\n re += pl.close\n if (pl.type === '!') {\n negativeLists.push(Object.assign(pl, { reEnd: re.length }))\n }\n continue\n }\n\n case '|': {\n const plEntry = patternListStack[patternListStack.length - 1]\n if (inClass || !plEntry) {\n re += '\\\\|'\n continue\n }\n\n clearStateChar()\n re += '|'\n // next subpattern can start with a dot?\n if (plEntry.start === 0 && plEntry.type !== '!') {\n dotTravAllowed = true\n re += subPatternStart(pattern.slice(i + 1))\n }\n continue\n }\n\n // these are mostly the same in regexp and glob\n case '[':\n // swallow any state-tracking char before the [\n clearStateChar()\n\n if (inClass) {\n re += '\\\\' + c\n continue\n }\n\n inClass = true\n classStart = i\n reClassStart = re.length\n re += c\n continue\n\n case ']':\n // a right bracket shall lose its special\n // meaning and represent itself in\n // a bracket expression if it occurs\n // first in the list. -- POSIX.2 2.8.3.2\n if (i === classStart + 1 || !inClass) {\n re += '\\\\' + c\n continue\n }\n\n // split where the last [ was, make sure we don't have\n // an invalid re. if so, re-walk the contents of the\n // would-be class to re-translate any characters that\n // were passed through as-is\n // TODO: It would probably be faster to determine this\n // without a try/catch and a new RegExp, but it's tricky\n // to do safely. For now, this is safe and works.\n cs = pattern.substring(classStart + 1, i)\n try {\n RegExp('[' + braExpEscape(charUnescape(cs)) + ']')\n // looks good, finish up the class.\n re += c\n } catch (er) {\n // out of order ranges in JS are errors, but in glob syntax,\n // they're just a range that matches nothing.\n re = re.substring(0, reClassStart) + '(?:$.)' // match nothing ever\n }\n hasMagic = true\n inClass = false\n continue\n\n default:\n // swallow any state char that wasn't consumed\n clearStateChar()\n\n if (reSpecials[c] && !(c === '^' && inClass)) {\n re += '\\\\'\n }\n\n re += c\n break\n\n } // switch\n } // for\n\n // handle the case where we left a class open.\n // \"[abc\" is valid, equivalent to \"\\[abc\"\n if (inClass) {\n // split where the last [ was, and escape it\n // this is a huge pita. We now have to re-walk\n // the contents of the would-be class to re-translate\n // any characters that were passed through as-is\n cs = pattern.slice(classStart + 1)\n sp = this.parse(cs, SUBPARSE)\n re = re.substring(0, reClassStart) + '\\\\[' + sp[0]\n hasMagic = hasMagic || sp[1]\n }\n\n // handle the case where we had a +( thing at the *end*\n // of the pattern.\n // each pattern list stack adds 3 chars, and we need to go through\n // and escape any | chars that were passed through as-is for the regexp.\n // Go through and escape them, taking care not to double-escape any\n // | chars that were already escaped.\n for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {\n let tail\n tail = re.slice(pl.reStart + pl.open.length)\n this.debug('setting tail', re, pl)\n // maybe some even number of \\, then maybe 1 \\, followed by a |\n tail = tail.replace(/((?:\\\\{2}){0,64})(\\\\?)\\|/g, (_, $1, $2) => {\n /* istanbul ignore else - should already be done */\n if (!$2) {\n // the | isn't already escaped, so escape it.\n $2 = '\\\\'\n }\n\n // need to escape all those slashes *again*, without escaping the\n // one that we need for escaping the | character. As it works out,\n // escaping an even number of slashes can be done by simply repeating\n // it exactly after itself. That's why this trick works.\n //\n // I am sorry that you have to see this.\n return $1 + $1 + $2 + '|'\n })\n\n this.debug('tail=%j\\n %s', tail, tail, pl, re)\n const t = pl.type === '*' ? star\n : pl.type === '?' ? qmark\n : '\\\\' + pl.type\n\n hasMagic = true\n re = re.slice(0, pl.reStart) + t + '\\\\(' + tail\n }\n\n // handle trailing things that only matter at the very end.\n clearStateChar()\n if (escaping) {\n // trailing \\\\\n re += '\\\\\\\\'\n }\n\n // only need to apply the nodot start if the re starts with\n // something that could conceivably capture a dot\n const addPatternStart = addPatternStartSet[re.charAt(0)]\n\n // Hack to work around lack of negative lookbehind in JS\n // A pattern like: *.!(x).!(y|z) needs to ensure that a name\n // like 'a.xyz.yz' doesn't match. So, the first negative\n // lookahead, has to look ALL the way ahead, to the end of\n // the pattern.\n for (let n = negativeLists.length - 1; n > -1; n--) {\n const nl = negativeLists[n]\n\n const nlBefore = re.slice(0, nl.reStart)\n const nlFirst = re.slice(nl.reStart, nl.reEnd - 8)\n let nlAfter = re.slice(nl.reEnd)\n const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter\n\n // Handle nested stuff like *(*.js|!(*.json)), where open parens\n // mean that we should *not* include the ) in the bit that is considered\n // \"after\" the negated section.\n const closeParensBefore = nlBefore.split(')').length\n const openParensBefore = nlBefore.split('(').length - closeParensBefore\n let cleanAfter = nlAfter\n for (let i = 0; i < openParensBefore; i++) {\n cleanAfter = cleanAfter.replace(/\\)[+*?]?/, '')\n }\n nlAfter = cleanAfter\n\n const dollar = nlAfter === '' && isSub !== SUBPARSE ? '(?:$|\\\\/)' : ''\n\n re = nlBefore + nlFirst + nlAfter + dollar + nlLast\n }\n\n // if the re is not \"\" at this point, then we need to make sure\n // it doesn't match against an empty path part.\n // Otherwise a/* will match a/, which it should not.\n if (re !== '' && hasMagic) {\n re = '(?=.)' + re\n }\n\n if (addPatternStart) {\n re = patternStart() + re\n }\n\n // parsing just a piece of a larger pattern.\n if (isSub === SUBPARSE) {\n return [re, hasMagic]\n }\n\n // if it's nocase, and the lcase/uppercase don't match, it's magic\n if (options.nocase && !hasMagic) {\n hasMagic = pattern.toUpperCase() !== pattern.toLowerCase()\n }\n\n // skip the regexp for non-magical patterns\n // unescape anything in it, though, so that it'll be\n // an exact match against a file etc.\n if (!hasMagic) {\n return globUnescape(pattern)\n }\n\n const flags = options.nocase ? 'i' : ''\n try {\n return Object.assign(new RegExp('^' + re + '$', flags), {\n _glob: pattern,\n _src: re,\n })\n } catch (er) /* istanbul ignore next - should be impossible */ {\n // If it was an invalid regular expression, then it can't match\n // anything. This trick looks for a character after the end of\n // the string, which is of course impossible, except in multi-line\n // mode, but it's not a /m regex.\n return new RegExp('$.')\n }\n }\n\n makeRe () {\n if (this.regexp || this.regexp === false) return this.regexp\n\n // at this point, this.set is a 2d array of partial\n // pattern strings, or \"**\".\n //\n // It's better to use .match(). This function shouldn't\n // be used, really, but it's pretty convenient sometimes,\n // when you just want to work with a regex.\n const set = this.set\n\n if (!set.length) {\n this.regexp = false\n return this.regexp\n }\n const options = this.options\n\n const twoStar = options.noglobstar ? star\n : options.dot ? twoStarDot\n : twoStarNoDot\n const flags = options.nocase ? 'i' : ''\n\n // coalesce globstars and regexpify non-globstar patterns\n // if it's the only item, then we just do one twoStar\n // if it's the first, and there are more, prepend (\\/|twoStar\\/)? to next\n // if it's the last, append (\\/twoStar|) to previous\n // if it's in the middle, append (\\/|\\/twoStar\\/) to previous\n // then filter out GLOBSTAR symbols\n let re = set.map(pattern => {\n pattern = pattern.map(p =>\n typeof p === 'string' ? regExpEscape(p)\n : p === GLOBSTAR ? GLOBSTAR\n : p._src\n ).reduce((set, p) => {\n if (!(set[set.length - 1] === GLOBSTAR && p === GLOBSTAR)) {\n set.push(p)\n }\n return set\n }, [])\n pattern.forEach((p, i) => {\n if (p !== GLOBSTAR || pattern[i-1] === GLOBSTAR) {\n return\n }\n if (i === 0) {\n if (pattern.length > 1) {\n pattern[i+1] = '(?:\\\\\\/|' + twoStar + '\\\\\\/)?' + pattern[i+1]\n } else {\n pattern[i] = twoStar\n }\n } else if (i === pattern.length - 1) {\n pattern[i-1] += '(?:\\\\\\/|' + twoStar + ')?'\n } else {\n pattern[i-1] += '(?:\\\\\\/|\\\\\\/' + twoStar + '\\\\\\/)' + pattern[i+1]\n pattern[i+1] = GLOBSTAR\n }\n })\n return pattern.filter(p => p !== GLOBSTAR).join('/')\n }).join('|')\n\n // must match entire pattern\n // ending in a * or ** will make it less strict.\n re = '^(?:' + re + ')$'\n\n // can match anything, as long as it's not this.\n if (this.negate) re = '^(?!' + re + ').*$'\n\n try {\n this.regexp = new RegExp(re, flags)\n } catch (ex) /* istanbul ignore next - should be impossible */ {\n this.regexp = false\n }\n return this.regexp\n }\n\n match (f, partial = this.partial) {\n this.debug('match', f, this.pattern)\n // short-circuit in the case of busted things.\n // comments, etc.\n if (this.comment) return false\n if (this.empty) return f === ''\n\n if (f === '/' && partial) return true\n\n const options = this.options\n\n // windows: need to use /, not \\\n if (path.sep !== '/') {\n f = f.split(path.sep).join('/')\n }\n\n // treat the test path as a set of pathparts.\n f = f.split(slashSplit)\n this.debug(this.pattern, 'split', f)\n\n // just ONE of the pattern sets in this.set needs to match\n // in order for it to be valid. If negating, then just one\n // match means that we have failed.\n // Either way, return on the first hit.\n\n const set = this.set\n this.debug(this.pattern, 'set', set)\n\n // Find the basename of the path by looking for the last non-empty segment\n let filename\n for (let i = f.length - 1; i >= 0; i--) {\n filename = f[i]\n if (filename) break\n }\n\n for (let i = 0; i < set.length; i++) {\n const pattern = set[i]\n let file = f\n if (options.matchBase && pattern.length === 1) {\n file = [filename]\n }\n const hit = this.matchOne(file, pattern, partial)\n if (hit) {\n if (options.flipNegate) return true\n return !this.negate\n }\n }\n\n // didn't get any hits. this is success if it's a negative\n // pattern, failure otherwise.\n if (options.flipNegate) return false\n return this.negate\n }\n\n static defaults (def) {\n return minimatch.defaults(def).Minimatch\n }\n}\n\nminimatch.Minimatch = Minimatch\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagnosticFeature = exports.DiagnosticPullMode = exports.vsdiag = void 0;\nconst minimatch = require(\"minimatch\");\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst uuid_1 = require(\"./utils/uuid\");\nconst features_1 = require(\"./features\");\nfunction ensure(target, key) {\n if (target[key] === void 0) {\n target[key] = {};\n }\n return target[key];\n}\nvar vsdiag;\n(function (vsdiag) {\n let DocumentDiagnosticReportKind;\n (function (DocumentDiagnosticReportKind) {\n DocumentDiagnosticReportKind[\"full\"] = \"full\";\n DocumentDiagnosticReportKind[\"unChanged\"] = \"unChanged\";\n })(DocumentDiagnosticReportKind = vsdiag.DocumentDiagnosticReportKind || (vsdiag.DocumentDiagnosticReportKind = {}));\n})(vsdiag || (exports.vsdiag = vsdiag = {}));\nvar DiagnosticPullMode;\n(function (DiagnosticPullMode) {\n DiagnosticPullMode[\"onType\"] = \"onType\";\n DiagnosticPullMode[\"onSave\"] = \"onSave\";\n})(DiagnosticPullMode || (exports.DiagnosticPullMode = DiagnosticPullMode = {}));\nvar RequestStateKind;\n(function (RequestStateKind) {\n RequestStateKind[\"active\"] = \"open\";\n RequestStateKind[\"reschedule\"] = \"reschedule\";\n RequestStateKind[\"outDated\"] = \"drop\";\n})(RequestStateKind || (RequestStateKind = {}));\n/**\n * Manages the open tabs. We don't directly use the tab API since for\n * diagnostics we need to de-dupe tabs that show the same resources since\n * we pull on the model not the UI.\n */\nclass Tabs {\n constructor() {\n this.open = new Set();\n this._onOpen = new vscode_1.EventEmitter();\n this._onClose = new vscode_1.EventEmitter();\n Tabs.fillTabResources(this.open);\n const openTabsHandler = (event) => {\n if (event.closed.length === 0 && event.opened.length === 0) {\n return;\n }\n const oldTabs = this.open;\n const currentTabs = new Set();\n Tabs.fillTabResources(currentTabs);\n const closed = new Set();\n const opened = new Set(currentTabs);\n for (const tab of oldTabs.values()) {\n if (currentTabs.has(tab)) {\n opened.delete(tab);\n }\n else {\n closed.add(tab);\n }\n }\n this.open = currentTabs;\n if (closed.size > 0) {\n const toFire = new Set();\n for (const item of closed) {\n toFire.add(vscode_1.Uri.parse(item));\n }\n this._onClose.fire(toFire);\n }\n if (opened.size > 0) {\n const toFire = new Set();\n for (const item of opened) {\n toFire.add(vscode_1.Uri.parse(item));\n }\n this._onOpen.fire(toFire);\n }\n };\n if (vscode_1.window.tabGroups.onDidChangeTabs !== undefined) {\n this.disposable = vscode_1.window.tabGroups.onDidChangeTabs(openTabsHandler);\n }\n else {\n this.disposable = { dispose: () => { } };\n }\n }\n get onClose() {\n return this._onClose.event;\n }\n get onOpen() {\n return this._onOpen.event;\n }\n dispose() {\n this.disposable.dispose();\n }\n isActive(document) {\n return document instanceof vscode_1.Uri\n ? vscode_1.window.activeTextEditor?.document.uri === document\n : vscode_1.window.activeTextEditor?.document === document;\n }\n isVisible(document) {\n const uri = document instanceof vscode_1.Uri ? document : document.uri;\n return this.open.has(uri.toString());\n }\n getTabResources() {\n const result = new Set();\n Tabs.fillTabResources(new Set(), result);\n return result;\n }\n static fillTabResources(strings, uris) {\n const seen = strings ?? new Set();\n for (const group of vscode_1.window.tabGroups.all) {\n for (const tab of group.tabs) {\n const input = tab.input;\n let uri;\n if (input instanceof vscode_1.TabInputText) {\n uri = input.uri;\n }\n else if (input instanceof vscode_1.TabInputTextDiff) {\n uri = input.modified;\n }\n else if (input instanceof vscode_1.TabInputCustom) {\n uri = input.uri;\n }\n if (uri !== undefined && !seen.has(uri.toString())) {\n seen.add(uri.toString());\n uris !== undefined && uris.add(uri);\n }\n }\n }\n }\n}\nvar PullState;\n(function (PullState) {\n PullState[PullState[\"document\"] = 1] = \"document\";\n PullState[PullState[\"workspace\"] = 2] = \"workspace\";\n})(PullState || (PullState = {}));\nvar DocumentOrUri;\n(function (DocumentOrUri) {\n function asKey(document) {\n return document instanceof vscode_1.Uri ? document.toString() : document.uri.toString();\n }\n DocumentOrUri.asKey = asKey;\n})(DocumentOrUri || (DocumentOrUri = {}));\nclass DocumentPullStateTracker {\n constructor() {\n this.documentPullStates = new Map();\n this.workspacePullStates = new Map();\n }\n track(kind, document, arg1) {\n const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;\n const [key, uri, version] = document instanceof vscode_1.Uri\n ? [document.toString(), document, arg1]\n : [document.uri.toString(), document.uri, document.version];\n let state = states.get(key);\n if (state === undefined) {\n state = { document: uri, pulledVersion: version, resultId: undefined };\n states.set(key, state);\n }\n return state;\n }\n update(kind, document, arg1, arg2) {\n const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;\n const [key, uri, version, resultId] = document instanceof vscode_1.Uri\n ? [document.toString(), document, arg1, arg2]\n : [document.uri.toString(), document.uri, document.version, arg1];\n let state = states.get(key);\n if (state === undefined) {\n state = { document: uri, pulledVersion: version, resultId };\n states.set(key, state);\n }\n else {\n state.pulledVersion = version;\n state.resultId = resultId;\n }\n }\n unTrack(kind, document) {\n const key = DocumentOrUri.asKey(document);\n const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;\n states.delete(key);\n }\n tracks(kind, document) {\n const key = DocumentOrUri.asKey(document);\n const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;\n return states.has(key);\n }\n getResultId(kind, document) {\n const key = DocumentOrUri.asKey(document);\n const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;\n return states.get(key)?.resultId;\n }\n getAllResultIds() {\n const result = [];\n for (let [uri, value] of this.workspacePullStates) {\n if (this.documentPullStates.has(uri)) {\n value = this.documentPullStates.get(uri);\n }\n if (value.resultId !== undefined) {\n result.push({ uri, value: value.resultId });\n }\n }\n return result;\n }\n}\nclass DiagnosticRequestor {\n constructor(client, tabs, options) {\n this.client = client;\n this.tabs = tabs;\n this.options = options;\n this.isDisposed = false;\n this.onDidChangeDiagnosticsEmitter = new vscode_1.EventEmitter();\n this.provider = this.createProvider();\n this.diagnostics = vscode_1.languages.createDiagnosticCollection(options.identifier);\n this.openRequests = new Map();\n this.documentStates = new DocumentPullStateTracker();\n this.workspaceErrorCounter = 0;\n }\n knows(kind, document) {\n const uri = document instanceof vscode_1.Uri ? document : document.uri;\n return this.documentStates.tracks(kind, document) || this.openRequests.has(uri.toString());\n }\n forget(kind, document) {\n this.documentStates.unTrack(kind, document);\n }\n pull(document, cb) {\n if (this.isDisposed) {\n return;\n }\n const uri = document instanceof vscode_1.Uri ? document : document.uri;\n this.pullAsync(document).then(() => {\n if (cb) {\n cb();\n }\n }, (error) => {\n this.client.error(`Document pull failed for text document ${uri.toString()}`, error, false);\n });\n }\n async pullAsync(document, version) {\n if (this.isDisposed) {\n return;\n }\n const isUri = document instanceof vscode_1.Uri;\n const uri = isUri ? document : document.uri;\n const key = uri.toString();\n version = isUri ? version : document.version;\n const currentRequestState = this.openRequests.get(key);\n const documentState = isUri\n ? this.documentStates.track(PullState.document, document, version)\n : this.documentStates.track(PullState.document, document);\n if (currentRequestState === undefined) {\n const tokenSource = new vscode_1.CancellationTokenSource();\n this.openRequests.set(key, { state: RequestStateKind.active, document: document, version: version, tokenSource });\n let report;\n let afterState;\n try {\n report = await this.provider.provideDiagnostics(document, documentState.resultId, tokenSource.token) ?? { kind: vsdiag.DocumentDiagnosticReportKind.full, items: [] };\n }\n catch (error) {\n if (error instanceof features_1.LSPCancellationError && vscode_languageserver_protocol_1.DiagnosticServerCancellationData.is(error.data) && error.data.retriggerRequest === false) {\n afterState = { state: RequestStateKind.outDated, document };\n }\n if (afterState === undefined && error instanceof vscode_1.CancellationError) {\n afterState = { state: RequestStateKind.reschedule, document };\n }\n else {\n throw error;\n }\n }\n afterState = afterState ?? this.openRequests.get(key);\n if (afterState === undefined) {\n // This shouldn't happen. Log it\n this.client.error(`Lost request state in diagnostic pull model. Clearing diagnostics for ${key}`);\n this.diagnostics.delete(uri);\n return;\n }\n this.openRequests.delete(key);\n if (!this.tabs.isVisible(document)) {\n this.documentStates.unTrack(PullState.document, document);\n return;\n }\n if (afterState.state === RequestStateKind.outDated) {\n return;\n }\n // report is only undefined if the request has thrown.\n if (report !== undefined) {\n if (report.kind === vsdiag.DocumentDiagnosticReportKind.full) {\n this.diagnostics.set(uri, report.items);\n }\n documentState.pulledVersion = version;\n documentState.resultId = report.resultId;\n }\n if (afterState.state === RequestStateKind.reschedule) {\n this.pull(document);\n }\n }\n else {\n if (currentRequestState.state === RequestStateKind.active) {\n // Cancel the current request and reschedule a new one when the old one returned.\n currentRequestState.tokenSource.cancel();\n this.openRequests.set(key, { state: RequestStateKind.reschedule, document: currentRequestState.document });\n }\n else if (currentRequestState.state === RequestStateKind.outDated) {\n this.openRequests.set(key, { state: RequestStateKind.reschedule, document: currentRequestState.document });\n }\n }\n }\n forgetDocument(document) {\n const uri = document instanceof vscode_1.Uri ? document : document.uri;\n const key = uri.toString();\n const request = this.openRequests.get(key);\n if (this.options.workspaceDiagnostics) {\n // If we run workspace diagnostic pull a last time for the diagnostics\n // and the rely on getting them from the workspace result.\n if (request !== undefined) {\n this.openRequests.set(key, { state: RequestStateKind.reschedule, document: document });\n }\n else {\n this.pull(document, () => {\n this.forget(PullState.document, document);\n });\n }\n }\n else {\n // We have normal pull or inter file dependencies. In this case we\n // clear the diagnostics (to have the same start as after startup).\n // We also cancel outstanding requests.\n if (request !== undefined) {\n if (request.state === RequestStateKind.active) {\n request.tokenSource.cancel();\n }\n this.openRequests.set(key, { state: RequestStateKind.outDated, document: document });\n }\n this.diagnostics.delete(uri);\n this.forget(PullState.document, document);\n }\n }\n pullWorkspace() {\n if (this.isDisposed) {\n return;\n }\n this.pullWorkspaceAsync().then(() => {\n this.workspaceTimeout = (0, vscode_languageserver_protocol_1.RAL)().timer.setTimeout(() => {\n this.pullWorkspace();\n }, 2000);\n }, (error) => {\n if (!(error instanceof features_1.LSPCancellationError) && !vscode_languageserver_protocol_1.DiagnosticServerCancellationData.is(error.data)) {\n this.client.error(`Workspace diagnostic pull failed.`, error, false);\n this.workspaceErrorCounter++;\n }\n if (this.workspaceErrorCounter <= 5) {\n this.workspaceTimeout = (0, vscode_languageserver_protocol_1.RAL)().timer.setTimeout(() => {\n this.pullWorkspace();\n }, 2000);\n }\n });\n }\n async pullWorkspaceAsync() {\n if (!this.provider.provideWorkspaceDiagnostics || this.isDisposed) {\n return;\n }\n if (this.workspaceCancellation !== undefined) {\n this.workspaceCancellation.cancel();\n this.workspaceCancellation = undefined;\n }\n this.workspaceCancellation = new vscode_1.CancellationTokenSource();\n const previousResultIds = this.documentStates.getAllResultIds().map((item) => {\n return {\n uri: this.client.protocol2CodeConverter.asUri(item.uri),\n value: item.value\n };\n });\n await this.provider.provideWorkspaceDiagnostics(previousResultIds, this.workspaceCancellation.token, (chunk) => {\n if (!chunk || this.isDisposed) {\n return;\n }\n for (const item of chunk.items) {\n if (item.kind === vsdiag.DocumentDiagnosticReportKind.full) {\n // Favour document pull result over workspace results. So skip if it is tracked\n // as a document result.\n if (!this.documentStates.tracks(PullState.document, item.uri)) {\n this.diagnostics.set(item.uri, item.items);\n }\n }\n this.documentStates.update(PullState.workspace, item.uri, item.version ?? undefined, item.resultId);\n }\n });\n }\n createProvider() {\n const result = {\n onDidChangeDiagnostics: this.onDidChangeDiagnosticsEmitter.event,\n provideDiagnostics: (document, previousResultId, token) => {\n const provideDiagnostics = (document, previousResultId, token) => {\n const params = {\n identifier: this.options.identifier,\n textDocument: { uri: this.client.code2ProtocolConverter.asUri(document instanceof vscode_1.Uri ? document : document.uri) },\n previousResultId: previousResultId\n };\n if (this.isDisposed === true || !this.client.isRunning()) {\n return { kind: vsdiag.DocumentDiagnosticReportKind.full, items: [] };\n }\n return this.client.sendRequest(vscode_languageserver_protocol_1.DocumentDiagnosticRequest.type, params, token).then(async (result) => {\n if (result === undefined || result === null || this.isDisposed || token.isCancellationRequested) {\n return { kind: vsdiag.DocumentDiagnosticReportKind.full, items: [] };\n }\n if (result.kind === vscode_languageserver_protocol_1.DocumentDiagnosticReportKind.Full) {\n return { kind: vsdiag.DocumentDiagnosticReportKind.full, resultId: result.resultId, items: await this.client.protocol2CodeConverter.asDiagnostics(result.items, token) };\n }\n else {\n return { kind: vsdiag.DocumentDiagnosticReportKind.unChanged, resultId: result.resultId };\n }\n }, (error) => {\n return this.client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentDiagnosticRequest.type, token, error, { kind: vsdiag.DocumentDiagnosticReportKind.full, items: [] });\n });\n };\n const middleware = this.client.middleware;\n return middleware.provideDiagnostics\n ? middleware.provideDiagnostics(document, previousResultId, token, provideDiagnostics)\n : provideDiagnostics(document, previousResultId, token);\n }\n };\n if (this.options.workspaceDiagnostics) {\n result.provideWorkspaceDiagnostics = (resultIds, token, resultReporter) => {\n const convertReport = async (report) => {\n if (report.kind === vscode_languageserver_protocol_1.DocumentDiagnosticReportKind.Full) {\n return {\n kind: vsdiag.DocumentDiagnosticReportKind.full,\n uri: this.client.protocol2CodeConverter.asUri(report.uri),\n resultId: report.resultId,\n version: report.version,\n items: await this.client.protocol2CodeConverter.asDiagnostics(report.items, token)\n };\n }\n else {\n return {\n kind: vsdiag.DocumentDiagnosticReportKind.unChanged,\n uri: this.client.protocol2CodeConverter.asUri(report.uri),\n resultId: report.resultId,\n version: report.version\n };\n }\n };\n const convertPreviousResultIds = (resultIds) => {\n const converted = [];\n for (const item of resultIds) {\n converted.push({ uri: this.client.code2ProtocolConverter.asUri(item.uri), value: item.value });\n }\n return converted;\n };\n const provideDiagnostics = (resultIds, token) => {\n const partialResultToken = (0, uuid_1.generateUuid)();\n const disposable = this.client.onProgress(vscode_languageserver_protocol_1.WorkspaceDiagnosticRequest.partialResult, partialResultToken, async (partialResult) => {\n if (partialResult === undefined || partialResult === null) {\n resultReporter(null);\n return;\n }\n const converted = {\n items: []\n };\n for (const item of partialResult.items) {\n try {\n converted.items.push(await convertReport(item));\n }\n catch (error) {\n this.client.error(`Converting workspace diagnostics failed.`, error);\n }\n }\n resultReporter(converted);\n });\n const params = {\n identifier: this.options.identifier,\n previousResultIds: convertPreviousResultIds(resultIds),\n partialResultToken: partialResultToken\n };\n if (this.isDisposed === true || !this.client.isRunning()) {\n return { items: [] };\n }\n return this.client.sendRequest(vscode_languageserver_protocol_1.WorkspaceDiagnosticRequest.type, params, token).then(async (result) => {\n if (token.isCancellationRequested) {\n return { items: [] };\n }\n const converted = {\n items: []\n };\n for (const item of result.items) {\n converted.items.push(await convertReport(item));\n }\n disposable.dispose();\n resultReporter(converted);\n return { items: [] };\n }, (error) => {\n disposable.dispose();\n return this.client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentDiagnosticRequest.type, token, error, { items: [] });\n });\n };\n const middleware = this.client.middleware;\n return middleware.provideWorkspaceDiagnostics\n ? middleware.provideWorkspaceDiagnostics(resultIds, token, resultReporter, provideDiagnostics)\n : provideDiagnostics(resultIds, token, resultReporter);\n };\n }\n return result;\n }\n dispose() {\n this.isDisposed = true;\n // Cancel and clear workspace pull if present.\n this.workspaceCancellation?.cancel();\n this.workspaceTimeout?.dispose();\n // Cancel all request and mark open requests as outdated.\n for (const [key, request] of this.openRequests) {\n if (request.state === RequestStateKind.active) {\n request.tokenSource.cancel();\n }\n this.openRequests.set(key, { state: RequestStateKind.outDated, document: request.document });\n }\n // cleanup old diagnostics\n this.diagnostics.dispose();\n }\n}\nclass BackgroundScheduler {\n constructor(diagnosticRequestor) {\n this.diagnosticRequestor = diagnosticRequestor;\n this.documents = new vscode_languageserver_protocol_1.LinkedMap();\n this.isDisposed = false;\n }\n add(document) {\n if (this.isDisposed === true) {\n return;\n }\n const key = DocumentOrUri.asKey(document);\n if (this.documents.has(key)) {\n return;\n }\n this.documents.set(key, document, vscode_languageserver_protocol_1.Touch.Last);\n this.trigger();\n }\n remove(document) {\n const key = DocumentOrUri.asKey(document);\n this.documents.delete(key);\n // No more documents. Stop background activity.\n if (this.documents.size === 0) {\n this.stop();\n }\n else if (key === this.endDocumentKey()) {\n // Make sure we have a correct last document. It could have\n this.endDocument = this.documents.last;\n }\n }\n trigger() {\n if (this.isDisposed === true) {\n return;\n }\n // We have a round running. So simply make sure we run up to the\n // last document\n if (this.intervalHandle !== undefined) {\n this.endDocument = this.documents.last;\n return;\n }\n this.endDocument = this.documents.last;\n this.intervalHandle = (0, vscode_languageserver_protocol_1.RAL)().timer.setInterval(() => {\n const document = this.documents.first;\n if (document !== undefined) {\n const key = DocumentOrUri.asKey(document);\n this.diagnosticRequestor.pull(document);\n this.documents.set(key, document, vscode_languageserver_protocol_1.Touch.Last);\n if (key === this.endDocumentKey()) {\n this.stop();\n }\n }\n }, 200);\n }\n dispose() {\n this.isDisposed = true;\n this.stop();\n this.documents.clear();\n }\n stop() {\n this.intervalHandle?.dispose();\n this.intervalHandle = undefined;\n this.endDocument = undefined;\n }\n endDocumentKey() {\n return this.endDocument !== undefined ? DocumentOrUri.asKey(this.endDocument) : undefined;\n }\n}\nclass DiagnosticFeatureProviderImpl {\n constructor(client, tabs, options) {\n const diagnosticPullOptions = client.clientOptions.diagnosticPullOptions ?? { onChange: true, onSave: false };\n const documentSelector = client.protocol2CodeConverter.asDocumentSelector(options.documentSelector);\n const disposables = [];\n const matchResource = (resource) => {\n const selector = options.documentSelector;\n if (diagnosticPullOptions.match !== undefined) {\n return diagnosticPullOptions.match(selector, resource);\n }\n for (const filter of selector) {\n if (!vscode_languageserver_protocol_1.TextDocumentFilter.is(filter)) {\n continue;\n }\n // The filter is a language id. We can't determine if it matches\n // so we return false.\n if (typeof filter === 'string') {\n return false;\n }\n if (filter.language !== undefined && filter.language !== '*') {\n return false;\n }\n if (filter.scheme !== undefined && filter.scheme !== '*' && filter.scheme !== resource.scheme) {\n return false;\n }\n if (filter.pattern !== undefined) {\n const matcher = new minimatch.Minimatch(filter.pattern, { noext: true });\n if (!matcher.makeRe()) {\n return false;\n }\n if (!matcher.match(resource.fsPath)) {\n return false;\n }\n }\n }\n return true;\n };\n const matches = (document) => {\n return document instanceof vscode_1.Uri\n ? matchResource(document)\n : vscode_1.languages.match(documentSelector, document) > 0 && tabs.isVisible(document);\n };\n const isActiveDocument = (document) => {\n return document instanceof vscode_1.Uri\n ? this.activeTextDocument?.uri.toString() === document.toString()\n : this.activeTextDocument === document;\n };\n this.diagnosticRequestor = new DiagnosticRequestor(client, tabs, options);\n this.backgroundScheduler = new BackgroundScheduler(this.diagnosticRequestor);\n const addToBackgroundIfNeeded = (document) => {\n if (!matches(document) || !options.interFileDependencies || isActiveDocument(document)) {\n return;\n }\n this.backgroundScheduler.add(document);\n };\n this.activeTextDocument = vscode_1.window.activeTextEditor?.document;\n vscode_1.window.onDidChangeActiveTextEditor((editor) => {\n const oldActive = this.activeTextDocument;\n this.activeTextDocument = editor?.document;\n if (oldActive !== undefined) {\n addToBackgroundIfNeeded(oldActive);\n }\n if (this.activeTextDocument !== undefined) {\n this.backgroundScheduler.remove(this.activeTextDocument);\n }\n });\n // For pull model diagnostics we pull for documents visible in the UI.\n // From an eventing point of view we still rely on open document events\n // and filter the documents that are not visible in the UI instead of\n // listening to Tab events. Major reason is event timing since we need\n // to ensure that the pull is send after the document open has reached\n // the server.\n // We always pull on open.\n const openFeature = client.getFeature(vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.method);\n disposables.push(openFeature.onNotificationSent((event) => {\n const textDocument = event.textDocument;\n // We already know about this document. This can happen via a tab open.\n if (this.diagnosticRequestor.knows(PullState.document, textDocument)) {\n return;\n }\n if (matches(textDocument)) {\n this.diagnosticRequestor.pull(textDocument, () => { addToBackgroundIfNeeded(textDocument); });\n }\n }));\n disposables.push(tabs.onOpen((opened) => {\n for (const resource of opened) {\n // We already know about this document. This can happen via a document open.\n if (this.diagnosticRequestor.knows(PullState.document, resource)) {\n continue;\n }\n const uriStr = resource.toString();\n let textDocument;\n for (const item of vscode_1.workspace.textDocuments) {\n if (uriStr === item.uri.toString()) {\n textDocument = item;\n break;\n }\n }\n // In VS Code the event timing is as follows:\n // 1. tab events are fired.\n // 2. open document events are fired and internal data structures like\n // workspace.textDocuments and Window.activeTextEditor are updated.\n //\n // This means: for newly created tab/editors we don't find the underlying\n // document yet. So we do nothing an rely on the underlying open document event\n // to be fired.\n if (textDocument !== undefined && matches(textDocument)) {\n this.diagnosticRequestor.pull(textDocument, () => { addToBackgroundIfNeeded(textDocument); });\n }\n }\n }));\n // Pull all diagnostics for documents that are already open\n const pulledTextDocuments = new Set();\n for (const textDocument of vscode_1.workspace.textDocuments) {\n if (matches(textDocument)) {\n this.diagnosticRequestor.pull(textDocument, () => { addToBackgroundIfNeeded(textDocument); });\n pulledTextDocuments.add(textDocument.uri.toString());\n }\n }\n // Pull all tabs if not already pulled as text document\n if (diagnosticPullOptions.onTabs === true) {\n for (const resource of tabs.getTabResources()) {\n if (!pulledTextDocuments.has(resource.toString()) && matches(resource)) {\n this.diagnosticRequestor.pull(resource, () => { addToBackgroundIfNeeded(resource); });\n }\n }\n }\n // We don't need to pull on tab open since we will receive a document open as well later on\n // and that event allows us to use a document for a match check which will have a set\n // language id.\n if (diagnosticPullOptions.onChange === true) {\n const changeFeature = client.getFeature(vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.method);\n disposables.push(changeFeature.onNotificationSent(async (event) => {\n const textDocument = event.textDocument;\n if ((diagnosticPullOptions.filter === undefined || !diagnosticPullOptions.filter(textDocument, DiagnosticPullMode.onType)) && this.diagnosticRequestor.knows(PullState.document, textDocument)) {\n this.diagnosticRequestor.pull(textDocument, () => { this.backgroundScheduler.trigger(); });\n }\n }));\n }\n if (diagnosticPullOptions.onSave === true) {\n const saveFeature = client.getFeature(vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.method);\n disposables.push(saveFeature.onNotificationSent((event) => {\n const textDocument = event.textDocument;\n if ((diagnosticPullOptions.filter === undefined || !diagnosticPullOptions.filter(textDocument, DiagnosticPullMode.onSave)) && this.diagnosticRequestor.knows(PullState.document, textDocument)) {\n this.diagnosticRequestor.pull(event.textDocument, () => { this.backgroundScheduler.trigger(); });\n }\n }));\n }\n // When the document closes clear things up\n const closeFeature = client.getFeature(vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.method);\n disposables.push(closeFeature.onNotificationSent((event) => {\n this.cleanUpDocument(event.textDocument);\n }));\n // Same when a tabs closes.\n tabs.onClose((closed) => {\n for (const document of closed) {\n this.cleanUpDocument(document);\n }\n });\n // We received a did change from the server.\n this.diagnosticRequestor.onDidChangeDiagnosticsEmitter.event(() => {\n for (const textDocument of vscode_1.workspace.textDocuments) {\n if (matches(textDocument)) {\n this.diagnosticRequestor.pull(textDocument);\n }\n }\n });\n // da348dc5-c30a-4515-9d98-31ff3be38d14 is the test UUID to test the middle ware. So don't auto trigger pulls.\n if (options.workspaceDiagnostics === true && options.identifier !== 'da348dc5-c30a-4515-9d98-31ff3be38d14') {\n this.diagnosticRequestor.pullWorkspace();\n }\n this.disposable = vscode_1.Disposable.from(...disposables, this.backgroundScheduler, this.diagnosticRequestor);\n }\n get onDidChangeDiagnosticsEmitter() {\n return this.diagnosticRequestor.onDidChangeDiagnosticsEmitter;\n }\n get diagnostics() {\n return this.diagnosticRequestor.provider;\n }\n cleanUpDocument(document) {\n if (this.diagnosticRequestor.knows(PullState.document, document)) {\n this.diagnosticRequestor.forgetDocument(document);\n this.backgroundScheduler.remove(document);\n }\n }\n}\nclass DiagnosticFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentDiagnosticRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let capability = ensure(ensure(capabilities, 'textDocument'), 'diagnostic');\n capability.dynamicRegistration = true;\n // We first need to decide how a UI will look with related documents.\n // An easy implementation would be to only show related diagnostics for\n // the active editor.\n capability.relatedDocumentSupport = false;\n ensure(ensure(capabilities, 'workspace'), 'diagnostics').refreshSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const client = this._client;\n client.onRequest(vscode_languageserver_protocol_1.DiagnosticRefreshRequest.type, async () => {\n for (const provider of this.getAllProviders()) {\n provider.onDidChangeDiagnosticsEmitter.fire();\n }\n });\n let [id, options] = this.getRegistration(documentSelector, capabilities.diagnosticProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n clear() {\n if (this.tabs !== undefined) {\n this.tabs.dispose();\n this.tabs = undefined;\n }\n super.clear();\n }\n registerLanguageProvider(options) {\n if (this.tabs === undefined) {\n this.tabs = new Tabs();\n }\n const provider = new DiagnosticFeatureProviderImpl(this._client, this.tabs, options);\n return [provider.disposable, provider];\n }\n}\nexports.DiagnosticFeature = DiagnosticFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NotebookDocumentSyncFeature = void 0;\nconst vscode = require(\"vscode\");\nconst minimatch = require(\"minimatch\");\nconst proto = require(\"vscode-languageserver-protocol\");\nconst UUID = require(\"./utils/uuid\");\nconst Is = require(\"./utils/is\");\nfunction ensure(target, key) {\n if (target[key] === void 0) {\n target[key] = {};\n }\n return target[key];\n}\nvar Converter;\n(function (Converter) {\n let c2p;\n (function (c2p) {\n function asVersionedNotebookDocumentIdentifier(notebookDocument, base) {\n return {\n version: notebookDocument.version,\n uri: base.asUri(notebookDocument.uri)\n };\n }\n c2p.asVersionedNotebookDocumentIdentifier = asVersionedNotebookDocumentIdentifier;\n function asNotebookDocument(notebookDocument, cells, base) {\n const result = proto.NotebookDocument.create(base.asUri(notebookDocument.uri), notebookDocument.notebookType, notebookDocument.version, asNotebookCells(cells, base));\n if (Object.keys(notebookDocument.metadata).length > 0) {\n result.metadata = asMetadata(notebookDocument.metadata);\n }\n return result;\n }\n c2p.asNotebookDocument = asNotebookDocument;\n function asNotebookCells(cells, base) {\n return cells.map(cell => asNotebookCell(cell, base));\n }\n c2p.asNotebookCells = asNotebookCells;\n function asMetadata(metadata) {\n const seen = new Set();\n return deepCopy(seen, metadata);\n }\n c2p.asMetadata = asMetadata;\n function asNotebookCell(cell, base) {\n const result = proto.NotebookCell.create(asNotebookCellKind(cell.kind), base.asUri(cell.document.uri));\n if (Object.keys(cell.metadata).length > 0) {\n result.metadata = asMetadata(cell.metadata);\n }\n if (cell.executionSummary !== undefined && (Is.number(cell.executionSummary.executionOrder) && Is.boolean(cell.executionSummary.success))) {\n result.executionSummary = {\n executionOrder: cell.executionSummary.executionOrder,\n success: cell.executionSummary.success\n };\n }\n return result;\n }\n c2p.asNotebookCell = asNotebookCell;\n function asNotebookCellKind(kind) {\n switch (kind) {\n case vscode.NotebookCellKind.Markup:\n return proto.NotebookCellKind.Markup;\n case vscode.NotebookCellKind.Code:\n return proto.NotebookCellKind.Code;\n }\n }\n function deepCopy(seen, value) {\n if (seen.has(value)) {\n throw new Error(`Can't deep copy cyclic structures.`);\n }\n if (Array.isArray(value)) {\n const result = [];\n for (const elem of value) {\n if (elem !== null && typeof elem === 'object' || Array.isArray(elem)) {\n result.push(deepCopy(seen, elem));\n }\n else {\n if (elem instanceof RegExp) {\n throw new Error(`Can't transfer regular expressions to the server`);\n }\n result.push(elem);\n }\n }\n return result;\n }\n else {\n const props = Object.keys(value);\n const result = Object.create(null);\n for (const prop of props) {\n const elem = value[prop];\n if (elem !== null && typeof elem === 'object' || Array.isArray(elem)) {\n result[prop] = deepCopy(seen, elem);\n }\n else {\n if (elem instanceof RegExp) {\n throw new Error(`Can't transfer regular expressions to the server`);\n }\n result[prop] = elem;\n }\n }\n return result;\n }\n }\n function asTextContentChange(event, base) {\n const params = base.asChangeTextDocumentParams(event, event.document.uri, event.document.version);\n return { document: params.textDocument, changes: params.contentChanges };\n }\n c2p.asTextContentChange = asTextContentChange;\n function asNotebookDocumentChangeEvent(event, base) {\n const result = Object.create(null);\n if (event.metadata) {\n result.metadata = Converter.c2p.asMetadata(event.metadata);\n }\n if (event.cells !== undefined) {\n const cells = Object.create(null);\n const changedCells = event.cells;\n if (changedCells.structure) {\n cells.structure = {\n array: {\n start: changedCells.structure.array.start,\n deleteCount: changedCells.structure.array.deleteCount,\n cells: changedCells.structure.array.cells !== undefined ? changedCells.structure.array.cells.map(cell => Converter.c2p.asNotebookCell(cell, base)) : undefined\n },\n didOpen: changedCells.structure.didOpen !== undefined\n ? changedCells.structure.didOpen.map(cell => base.asOpenTextDocumentParams(cell.document).textDocument)\n : undefined,\n didClose: changedCells.structure.didClose !== undefined\n ? changedCells.structure.didClose.map(cell => base.asCloseTextDocumentParams(cell.document).textDocument)\n : undefined\n };\n }\n if (changedCells.data !== undefined) {\n cells.data = changedCells.data.map(cell => Converter.c2p.asNotebookCell(cell, base));\n }\n if (changedCells.textContent !== undefined) {\n cells.textContent = changedCells.textContent.map(event => Converter.c2p.asTextContentChange(event, base));\n }\n if (Object.keys(cells).length > 0) {\n result.cells = cells;\n }\n }\n return result;\n }\n c2p.asNotebookDocumentChangeEvent = asNotebookDocumentChangeEvent;\n })(c2p = Converter.c2p || (Converter.c2p = {}));\n})(Converter || (Converter = {}));\nvar $NotebookCell;\n(function ($NotebookCell) {\n function computeDiff(originalCells, modifiedCells, compareMetadata) {\n const originalLength = originalCells.length;\n const modifiedLength = modifiedCells.length;\n let startIndex = 0;\n while (startIndex < modifiedLength && startIndex < originalLength && equals(originalCells[startIndex], modifiedCells[startIndex], compareMetadata)) {\n startIndex++;\n }\n if (startIndex < modifiedLength && startIndex < originalLength) {\n let originalEndIndex = originalLength - 1;\n let modifiedEndIndex = modifiedLength - 1;\n while (originalEndIndex >= 0 && modifiedEndIndex >= 0 && equals(originalCells[originalEndIndex], modifiedCells[modifiedEndIndex], compareMetadata)) {\n originalEndIndex--;\n modifiedEndIndex--;\n }\n const deleteCount = (originalEndIndex + 1) - startIndex;\n const newCells = startIndex === modifiedEndIndex + 1 ? undefined : modifiedCells.slice(startIndex, modifiedEndIndex + 1);\n return newCells !== undefined ? { start: startIndex, deleteCount, cells: newCells } : { start: startIndex, deleteCount };\n }\n else if (startIndex < modifiedLength) {\n return { start: startIndex, deleteCount: 0, cells: modifiedCells.slice(startIndex) };\n }\n else if (startIndex < originalLength) {\n return { start: startIndex, deleteCount: originalLength - startIndex };\n }\n else {\n // The two arrays are the same.\n return undefined;\n }\n }\n $NotebookCell.computeDiff = computeDiff;\n /**\n * We only sync kind, document, execution and metadata to the server. So we only need to compare those.\n */\n function equals(one, other, compareMetaData = true) {\n if (one.kind !== other.kind || one.document.uri.toString() !== other.document.uri.toString() || one.document.languageId !== other.document.languageId ||\n !equalsExecution(one.executionSummary, other.executionSummary)) {\n return false;\n }\n return !compareMetaData || (compareMetaData && equalsMetadata(one.metadata, other.metadata));\n }\n function equalsExecution(one, other) {\n if (one === other) {\n return true;\n }\n if (one === undefined || other === undefined) {\n return false;\n }\n return one.executionOrder === other.executionOrder && one.success === other.success && equalsTiming(one.timing, other.timing);\n }\n function equalsTiming(one, other) {\n if (one === other) {\n return true;\n }\n if (one === undefined || other === undefined) {\n return false;\n }\n return one.startTime === other.startTime && one.endTime === other.endTime;\n }\n function equalsMetadata(one, other) {\n if (one === other) {\n return true;\n }\n if (one === null || one === undefined || other === null || other === undefined) {\n return false;\n }\n if (typeof one !== typeof other) {\n return false;\n }\n if (typeof one !== 'object') {\n return false;\n }\n const oneArray = Array.isArray(one);\n const otherArray = Array.isArray(other);\n if (oneArray !== otherArray) {\n return false;\n }\n if (oneArray && otherArray) {\n if (one.length !== other.length) {\n return false;\n }\n for (let i = 0; i < one.length; i++) {\n if (!equalsMetadata(one[i], other[i])) {\n return false;\n }\n }\n }\n if (isObjectLiteral(one) && isObjectLiteral(other)) {\n const oneKeys = Object.keys(one);\n const otherKeys = Object.keys(other);\n if (oneKeys.length !== otherKeys.length) {\n return false;\n }\n oneKeys.sort();\n otherKeys.sort();\n if (!equalsMetadata(oneKeys, otherKeys)) {\n return false;\n }\n for (let i = 0; i < oneKeys.length; i++) {\n const prop = oneKeys[i];\n if (!equalsMetadata(one[prop], other[prop])) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n function isObjectLiteral(value) {\n return value !== null && typeof value === 'object';\n }\n $NotebookCell.isObjectLiteral = isObjectLiteral;\n})($NotebookCell || ($NotebookCell = {}));\nvar $NotebookDocumentFilter;\n(function ($NotebookDocumentFilter) {\n function matchNotebook(filter, notebookDocument) {\n if (typeof filter === 'string') {\n return filter === '*' || notebookDocument.notebookType === filter;\n }\n if (filter.notebookType !== undefined && filter.notebookType !== '*' && notebookDocument.notebookType !== filter.notebookType) {\n return false;\n }\n const uri = notebookDocument.uri;\n if (filter.scheme !== undefined && filter.scheme !== '*' && uri.scheme !== filter.scheme) {\n return false;\n }\n if (filter.pattern !== undefined) {\n const matcher = new minimatch.Minimatch(filter.pattern, { noext: true });\n if (!matcher.makeRe()) {\n return false;\n }\n if (!matcher.match(uri.fsPath)) {\n return false;\n }\n }\n return true;\n }\n $NotebookDocumentFilter.matchNotebook = matchNotebook;\n})($NotebookDocumentFilter || ($NotebookDocumentFilter = {}));\nvar $NotebookDocumentSyncOptions;\n(function ($NotebookDocumentSyncOptions) {\n function asDocumentSelector(options) {\n const selector = options.notebookSelector;\n const result = [];\n for (const element of selector) {\n const notebookType = (typeof element.notebook === 'string' ? element.notebook : element.notebook?.notebookType) ?? '*';\n const scheme = (typeof element.notebook === 'string') ? undefined : element.notebook?.scheme;\n const pattern = (typeof element.notebook === 'string') ? undefined : element.notebook?.pattern;\n if (element.cells !== undefined) {\n for (const cell of element.cells) {\n result.push(asDocumentFilter(notebookType, scheme, pattern, cell.language));\n }\n }\n else {\n result.push(asDocumentFilter(notebookType, scheme, pattern, undefined));\n }\n }\n return result;\n }\n $NotebookDocumentSyncOptions.asDocumentSelector = asDocumentSelector;\n function asDocumentFilter(notebookType, scheme, pattern, language) {\n return scheme === undefined && pattern === undefined\n ? { notebook: notebookType, language }\n : { notebook: { notebookType, scheme, pattern }, language };\n }\n})($NotebookDocumentSyncOptions || ($NotebookDocumentSyncOptions = {}));\nvar SyncInfo;\n(function (SyncInfo) {\n function create(cells) {\n return {\n cells,\n uris: new Set(cells.map(cell => cell.document.uri.toString()))\n };\n }\n SyncInfo.create = create;\n})(SyncInfo || (SyncInfo = {}));\nclass NotebookDocumentSyncFeatureProvider {\n constructor(client, options) {\n this.client = client;\n this.options = options;\n this.notebookSyncInfo = new Map();\n this.notebookDidOpen = new Set();\n this.disposables = [];\n this.selector = client.protocol2CodeConverter.asDocumentSelector($NotebookDocumentSyncOptions.asDocumentSelector(options));\n // open\n vscode.workspace.onDidOpenNotebookDocument((notebookDocument) => {\n this.notebookDidOpen.add(notebookDocument.uri.toString());\n this.didOpen(notebookDocument);\n }, undefined, this.disposables);\n for (const notebookDocument of vscode.workspace.notebookDocuments) {\n this.notebookDidOpen.add(notebookDocument.uri.toString());\n this.didOpen(notebookDocument);\n }\n // Notebook document changed.\n vscode.workspace.onDidChangeNotebookDocument(event => this.didChangeNotebookDocument(event), undefined, this.disposables);\n //save\n if (this.options.save === true) {\n vscode.workspace.onDidSaveNotebookDocument(notebookDocument => this.didSave(notebookDocument), undefined, this.disposables);\n }\n // close\n vscode.workspace.onDidCloseNotebookDocument((notebookDocument) => {\n this.didClose(notebookDocument);\n this.notebookDidOpen.delete(notebookDocument.uri.toString());\n }, undefined, this.disposables);\n }\n getState() {\n for (const notebook of vscode.workspace.notebookDocuments) {\n const matchingCells = this.getMatchingCells(notebook);\n if (matchingCells !== undefined) {\n return { kind: 'document', id: '$internal', registrations: true, matches: true };\n }\n }\n return { kind: 'document', id: '$internal', registrations: true, matches: false };\n }\n get mode() {\n return 'notebook';\n }\n handles(textDocument) {\n return vscode.languages.match(this.selector, textDocument) > 0;\n }\n didOpenNotebookCellTextDocument(notebookDocument, cell) {\n if (vscode.languages.match(this.selector, cell.document) === 0) {\n return;\n }\n if (!this.notebookDidOpen.has(notebookDocument.uri.toString())) {\n // We have never received an open notification for the notebook document.\n // VS Code guarantees that we first get cell document open and then\n // notebook open. So simply wait for the notebook open.\n return;\n }\n const syncInfo = this.notebookSyncInfo.get(notebookDocument.uri.toString());\n // In VS Code we receive a notebook open before a cell document open.\n // The document and the cell is synced.\n const cellMatches = this.cellMatches(notebookDocument, cell);\n if (syncInfo !== undefined) {\n const cellIsSynced = syncInfo.uris.has(cell.document.uri.toString());\n if ((cellMatches && cellIsSynced) || (!cellMatches && !cellIsSynced)) {\n // The cell doesn't match and was not synced or it matches and is synced.\n // In both cases nothing to do.\n //\n // Note that if the language mode of a document changes we remove the\n // cell and add it back to update the language mode on the server side.\n return;\n }\n if (cellMatches) {\n // don't use cells from above since there might be more matching cells in the notebook\n // Since we had a matching cell above we will have matching cells now.\n const matchingCells = this.getMatchingCells(notebookDocument);\n if (matchingCells !== undefined) {\n const event = this.asNotebookDocumentChangeEvent(notebookDocument, undefined, syncInfo, matchingCells);\n if (event !== undefined) {\n this.doSendChange(event, matchingCells).catch(() => { });\n }\n }\n }\n }\n else {\n // No sync info. But we have a open event for the notebook document\n // itself. If the cell matches then we need to send an open with\n // exactly that cell.\n if (cellMatches) {\n this.doSendOpen(notebookDocument, [cell]).catch(() => { });\n }\n }\n }\n didChangeNotebookCellTextDocument(notebookDocument, event) {\n // No match with the selector\n if (vscode.languages.match(this.selector, event.document) === 0) {\n return;\n }\n this.doSendChange({\n notebook: notebookDocument,\n cells: { textContent: [event] }\n }, undefined).catch(() => { });\n }\n didCloseNotebookCellTextDocument(notebookDocument, cell) {\n const syncInfo = this.notebookSyncInfo.get(notebookDocument.uri.toString());\n if (syncInfo === undefined) {\n // The notebook document got never synced. So it doesn't matter if a cell\n // document closes.\n return;\n }\n const cellUri = cell.document.uri;\n const index = syncInfo.cells.findIndex((item) => item.document.uri.toString() === cellUri.toString());\n if (index === -1) {\n // The cell never got synced or it got deleted and we now received the document\n // close event.\n return;\n }\n if (index === 0 && syncInfo.cells.length === 1) {\n // The last cell. Close the notebook document in the server.\n this.doSendClose(notebookDocument, syncInfo.cells).catch(() => { });\n }\n else {\n const newCells = syncInfo.cells.slice();\n const deleted = newCells.splice(index, 1);\n this.doSendChange({\n notebook: notebookDocument,\n cells: {\n structure: {\n array: { start: index, deleteCount: 1 },\n didClose: deleted\n }\n }\n }, newCells).catch(() => { });\n }\n }\n dispose() {\n for (const disposable of this.disposables) {\n disposable.dispose();\n }\n }\n didOpen(notebookDocument, matchingCells = this.getMatchingCells(notebookDocument), syncInfo = this.notebookSyncInfo.get(notebookDocument.uri.toString())) {\n if (syncInfo !== undefined) {\n if (matchingCells !== undefined) {\n const event = this.asNotebookDocumentChangeEvent(notebookDocument, undefined, syncInfo, matchingCells);\n if (event !== undefined) {\n this.doSendChange(event, matchingCells).catch(() => { });\n }\n }\n else {\n this.doSendClose(notebookDocument, []).catch(() => { });\n }\n }\n else {\n // Check if we need to sync the notebook document.\n if (matchingCells === undefined) {\n return;\n }\n this.doSendOpen(notebookDocument, matchingCells).catch(() => { });\n }\n }\n didChangeNotebookDocument(event) {\n const notebookDocument = event.notebook;\n const syncInfo = this.notebookSyncInfo.get(notebookDocument.uri.toString());\n if (syncInfo === undefined) {\n // We have no changes to the cells. Since the notebook wasn't synced\n // it will not be synced now.\n if (event.contentChanges.length === 0) {\n return;\n }\n // Check if we have new matching cells.\n const cells = this.getMatchingCells(notebookDocument);\n // No matching cells and the notebook never synced. So still no need\n // to sync it.\n if (cells === undefined) {\n return;\n }\n // Open the notebook document and ignore the rest of the changes\n // this the notebooks will be synced with the correct settings.\n this.didOpen(notebookDocument, cells, syncInfo);\n }\n else {\n // The notebook is synced. First check if we have no matching\n // cells anymore and if so close the notebook\n const cells = this.getMatchingCells(notebookDocument);\n if (cells === undefined) {\n this.didClose(notebookDocument, syncInfo);\n return;\n }\n const newEvent = this.asNotebookDocumentChangeEvent(event.notebook, event, syncInfo, cells);\n if (newEvent !== undefined) {\n this.doSendChange(newEvent, cells).catch(() => { });\n }\n }\n }\n didSave(notebookDocument) {\n const syncInfo = this.notebookSyncInfo.get(notebookDocument.uri.toString());\n if (syncInfo === undefined) {\n return;\n }\n this.doSendSave(notebookDocument).catch(() => { });\n }\n didClose(notebookDocument, syncInfo = this.notebookSyncInfo.get(notebookDocument.uri.toString())) {\n if (syncInfo === undefined) {\n return;\n }\n const syncedCells = notebookDocument.getCells().filter(cell => syncInfo.uris.has(cell.document.uri.toString()));\n this.doSendClose(notebookDocument, syncedCells).catch(() => { });\n }\n async sendDidOpenNotebookDocument(notebookDocument) {\n const cells = this.getMatchingCells(notebookDocument);\n if (cells === undefined) {\n return;\n }\n return this.doSendOpen(notebookDocument, cells);\n }\n async doSendOpen(notebookDocument, cells) {\n const send = async (notebookDocument, cells) => {\n const nb = Converter.c2p.asNotebookDocument(notebookDocument, cells, this.client.code2ProtocolConverter);\n const cellDocuments = cells.map(cell => this.client.code2ProtocolConverter.asTextDocumentItem(cell.document));\n try {\n await this.client.sendNotification(proto.DidOpenNotebookDocumentNotification.type, {\n notebookDocument: nb,\n cellTextDocuments: cellDocuments\n });\n }\n catch (error) {\n this.client.error('Sending DidOpenNotebookDocumentNotification failed', error);\n throw error;\n }\n };\n const middleware = this.client.middleware?.notebooks;\n this.notebookSyncInfo.set(notebookDocument.uri.toString(), SyncInfo.create(cells));\n return middleware?.didOpen !== undefined ? middleware.didOpen(notebookDocument, cells, send) : send(notebookDocument, cells);\n }\n async sendDidChangeNotebookDocument(event) {\n return this.doSendChange(event, undefined);\n }\n async doSendChange(event, cells = this.getMatchingCells(event.notebook)) {\n const send = async (event) => {\n try {\n await this.client.sendNotification(proto.DidChangeNotebookDocumentNotification.type, {\n notebookDocument: Converter.c2p.asVersionedNotebookDocumentIdentifier(event.notebook, this.client.code2ProtocolConverter),\n change: Converter.c2p.asNotebookDocumentChangeEvent(event, this.client.code2ProtocolConverter)\n });\n }\n catch (error) {\n this.client.error('Sending DidChangeNotebookDocumentNotification failed', error);\n throw error;\n }\n };\n const middleware = this.client.middleware?.notebooks;\n if (event.cells?.structure !== undefined) {\n this.notebookSyncInfo.set(event.notebook.uri.toString(), SyncInfo.create(cells ?? []));\n }\n return middleware?.didChange !== undefined ? middleware?.didChange(event, send) : send(event);\n }\n async sendDidSaveNotebookDocument(notebookDocument) {\n return this.doSendSave(notebookDocument);\n }\n async doSendSave(notebookDocument) {\n const send = async (notebookDocument) => {\n try {\n await this.client.sendNotification(proto.DidSaveNotebookDocumentNotification.type, {\n notebookDocument: { uri: this.client.code2ProtocolConverter.asUri(notebookDocument.uri) }\n });\n }\n catch (error) {\n this.client.error('Sending DidSaveNotebookDocumentNotification failed', error);\n throw error;\n }\n };\n const middleware = this.client.middleware?.notebooks;\n return middleware?.didSave !== undefined ? middleware.didSave(notebookDocument, send) : send(notebookDocument);\n }\n async sendDidCloseNotebookDocument(notebookDocument) {\n return this.doSendClose(notebookDocument, this.getMatchingCells(notebookDocument) ?? []);\n }\n async doSendClose(notebookDocument, cells) {\n const send = async (notebookDocument, cells) => {\n try {\n await this.client.sendNotification(proto.DidCloseNotebookDocumentNotification.type, {\n notebookDocument: { uri: this.client.code2ProtocolConverter.asUri(notebookDocument.uri) },\n cellTextDocuments: cells.map(cell => this.client.code2ProtocolConverter.asTextDocumentIdentifier(cell.document))\n });\n }\n catch (error) {\n this.client.error('Sending DidCloseNotebookDocumentNotification failed', error);\n throw error;\n }\n };\n const middleware = this.client.middleware?.notebooks;\n this.notebookSyncInfo.delete(notebookDocument.uri.toString());\n return middleware?.didClose !== undefined ? middleware.didClose(notebookDocument, cells, send) : send(notebookDocument, cells);\n }\n asNotebookDocumentChangeEvent(notebook, event, syncInfo, matchingCells) {\n if (event !== undefined && event.notebook !== notebook) {\n throw new Error('Notebook must be identical');\n }\n const result = {\n notebook: notebook\n };\n if (event?.metadata !== undefined) {\n result.metadata = Converter.c2p.asMetadata(event.metadata);\n }\n let matchingCellsSet;\n if (event?.cellChanges !== undefined && event.cellChanges.length > 0) {\n const data = [];\n // Only consider the new matching cells.\n matchingCellsSet = new Set(matchingCells.map(cell => cell.document.uri.toString()));\n for (const cellChange of event.cellChanges) {\n if (matchingCellsSet.has(cellChange.cell.document.uri.toString()) && (cellChange.executionSummary !== undefined || cellChange.metadata !== undefined)) {\n data.push(cellChange.cell);\n }\n }\n if (data.length > 0) {\n result.cells = result.cells ?? {};\n result.cells.data = data;\n }\n }\n if (((event?.contentChanges !== undefined && event.contentChanges.length > 0) || event === undefined) && syncInfo !== undefined && matchingCells !== undefined) {\n // We still have matching cells. Check if the cell changes\n // affect the notebook on the server side.\n const oldCells = syncInfo.cells;\n const newCells = matchingCells;\n // meta data changes are reported using on the cell itself. So we can ignore comparing\n // it which has a positive effect on performance.\n const diff = $NotebookCell.computeDiff(oldCells, newCells, false);\n let addedCells;\n let removedCells;\n if (diff !== undefined) {\n addedCells = diff.cells === undefined\n ? new Map()\n : new Map(diff.cells.map(cell => [cell.document.uri.toString(), cell]));\n removedCells = diff.deleteCount === 0\n ? new Map()\n : new Map(oldCells.slice(diff.start, diff.start + diff.deleteCount).map(cell => [cell.document.uri.toString(), cell]));\n // Remove the onces that got deleted and inserted again.\n for (const key of Array.from(removedCells.keys())) {\n if (addedCells.has(key)) {\n removedCells.delete(key);\n addedCells.delete(key);\n }\n }\n result.cells = result.cells ?? {};\n const didOpen = [];\n const didClose = [];\n if (addedCells.size > 0 || removedCells.size > 0) {\n for (const cell of addedCells.values()) {\n didOpen.push(cell);\n }\n for (const cell of removedCells.values()) {\n didClose.push(cell);\n }\n }\n result.cells.structure = {\n array: diff,\n didOpen,\n didClose\n };\n }\n }\n // The notebook is a property as well.\n return Object.keys(result).length > 1 ? result : undefined;\n }\n getMatchingCells(notebookDocument, cells = notebookDocument.getCells()) {\n if (this.options.notebookSelector === undefined) {\n return undefined;\n }\n for (const item of this.options.notebookSelector) {\n if (item.notebook === undefined || $NotebookDocumentFilter.matchNotebook(item.notebook, notebookDocument)) {\n const filtered = this.filterCells(notebookDocument, cells, item.cells);\n return filtered.length === 0 ? undefined : filtered;\n }\n }\n return undefined;\n }\n cellMatches(notebookDocument, cell) {\n const cells = this.getMatchingCells(notebookDocument, [cell]);\n return cells !== undefined && cells[0] === cell;\n }\n filterCells(notebookDocument, cells, cellSelector) {\n const filtered = cellSelector !== undefined ? cells.filter((cell) => {\n const cellLanguage = cell.document.languageId;\n return cellSelector.some((filter => (filter.language === '*' || cellLanguage === filter.language)));\n }) : cells;\n return typeof this.client.clientOptions.notebookDocumentOptions?.filterCells === 'function'\n ? this.client.clientOptions.notebookDocumentOptions.filterCells(notebookDocument, filtered)\n : filtered;\n }\n}\nclass NotebookDocumentSyncFeature {\n constructor(client) {\n this.client = client;\n this.registrations = new Map();\n this.registrationType = proto.NotebookDocumentSyncRegistrationType.type;\n // We don't receive an event for cells where the document changes its language mode\n // Since we allow servers to filter on the language mode we fire such an event ourselves.\n vscode.workspace.onDidOpenTextDocument((textDocument) => {\n if (textDocument.uri.scheme !== NotebookDocumentSyncFeature.CellScheme) {\n return;\n }\n const [notebookDocument, notebookCell] = this.findNotebookDocumentAndCell(textDocument);\n if (notebookDocument === undefined || notebookCell === undefined) {\n return;\n }\n for (const provider of this.registrations.values()) {\n if (provider instanceof NotebookDocumentSyncFeatureProvider) {\n provider.didOpenNotebookCellTextDocument(notebookDocument, notebookCell);\n }\n }\n });\n vscode.workspace.onDidChangeTextDocument((event) => {\n if (event.contentChanges.length === 0) {\n return;\n }\n const textDocument = event.document;\n if (textDocument.uri.scheme !== NotebookDocumentSyncFeature.CellScheme) {\n return;\n }\n const [notebookDocument,] = this.findNotebookDocumentAndCell(textDocument);\n if (notebookDocument === undefined) {\n return;\n }\n for (const provider of this.registrations.values()) {\n if (provider instanceof NotebookDocumentSyncFeatureProvider) {\n provider.didChangeNotebookCellTextDocument(notebookDocument, event);\n }\n }\n });\n vscode.workspace.onDidCloseTextDocument((textDocument) => {\n if (textDocument.uri.scheme !== NotebookDocumentSyncFeature.CellScheme) {\n return;\n }\n // There are two cases when we receive a close for a text document\n // 1: the cell got removed. This is handled in `onDidChangeNotebookCells`\n // 2: the language mode of a cell changed. This keeps the URI stable so\n // we will still find the cell and the notebook document.\n const [notebookDocument, notebookCell] = this.findNotebookDocumentAndCell(textDocument);\n if (notebookDocument === undefined || notebookCell === undefined) {\n return;\n }\n for (const provider of this.registrations.values()) {\n if (provider instanceof NotebookDocumentSyncFeatureProvider) {\n provider.didCloseNotebookCellTextDocument(notebookDocument, notebookCell);\n }\n }\n });\n }\n getState() {\n if (this.registrations.size === 0) {\n return { kind: 'document', id: this.registrationType.method, registrations: false, matches: false };\n }\n for (const provider of this.registrations.values()) {\n const state = provider.getState();\n if (state.kind === 'document' && state.registrations === true && state.matches === true) {\n return { kind: 'document', id: this.registrationType.method, registrations: true, matches: true };\n }\n }\n return { kind: 'document', id: this.registrationType.method, registrations: true, matches: false };\n }\n fillClientCapabilities(capabilities) {\n const synchronization = ensure(ensure(capabilities, 'notebookDocument'), 'synchronization');\n synchronization.dynamicRegistration = true;\n synchronization.executionSummarySupport = true;\n }\n preInitialize(capabilities) {\n const options = capabilities.notebookDocumentSync;\n if (options === undefined) {\n return;\n }\n this.dedicatedChannel = this.client.protocol2CodeConverter.asDocumentSelector($NotebookDocumentSyncOptions.asDocumentSelector(options));\n }\n initialize(capabilities) {\n const options = capabilities.notebookDocumentSync;\n if (options === undefined) {\n return;\n }\n const id = options.id ?? UUID.generateUuid();\n this.register({ id, registerOptions: options });\n }\n register(data) {\n const provider = new NotebookDocumentSyncFeatureProvider(this.client, data.registerOptions);\n this.registrations.set(data.id, provider);\n }\n unregister(id) {\n const provider = this.registrations.get(id);\n provider && provider.dispose();\n }\n clear() {\n for (const provider of this.registrations.values()) {\n provider.dispose();\n }\n this.registrations.clear();\n }\n handles(textDocument) {\n if (textDocument.uri.scheme !== NotebookDocumentSyncFeature.CellScheme) {\n return false;\n }\n if (this.dedicatedChannel !== undefined && vscode.languages.match(this.dedicatedChannel, textDocument) > 0) {\n return true;\n }\n for (const provider of this.registrations.values()) {\n if (provider.handles(textDocument)) {\n return true;\n }\n }\n return false;\n }\n getProvider(notebookCell) {\n for (const provider of this.registrations.values()) {\n if (provider.handles(notebookCell.document)) {\n return provider;\n }\n }\n return undefined;\n }\n findNotebookDocumentAndCell(textDocument) {\n const uri = textDocument.uri.toString();\n for (const notebookDocument of vscode.workspace.notebookDocuments) {\n for (const cell of notebookDocument.getCells()) {\n if (cell.document.uri.toString() === uri) {\n return [notebookDocument, cell];\n }\n }\n }\n return [undefined, undefined];\n }\n}\nexports.NotebookDocumentSyncFeature = NotebookDocumentSyncFeature;\nNotebookDocumentSyncFeature.CellScheme = 'vscode-notebook-cell';\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SyncConfigurationFeature = exports.toJSONObject = exports.ConfigurationFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst Is = require(\"./utils/is\");\nconst UUID = require(\"./utils/uuid\");\nconst features_1 = require(\"./features\");\n/**\n * Configuration pull model. From server to client.\n */\nclass ConfigurationFeature {\n constructor(client) {\n this._client = client;\n }\n getState() {\n return { kind: 'static' };\n }\n fillClientCapabilities(capabilities) {\n capabilities.workspace = capabilities.workspace || {};\n capabilities.workspace.configuration = true;\n }\n initialize() {\n let client = this._client;\n client.onRequest(vscode_languageserver_protocol_1.ConfigurationRequest.type, (params, token) => {\n let configuration = (params) => {\n let result = [];\n for (let item of params.items) {\n let resource = item.scopeUri !== void 0 && item.scopeUri !== null ? this._client.protocol2CodeConverter.asUri(item.scopeUri) : undefined;\n result.push(this.getConfiguration(resource, item.section !== null ? item.section : undefined));\n }\n return result;\n };\n let middleware = client.middleware.workspace;\n return middleware && middleware.configuration\n ? middleware.configuration(params, token, configuration)\n : configuration(params, token);\n });\n }\n getConfiguration(resource, section) {\n let result = null;\n if (section) {\n let index = section.lastIndexOf('.');\n if (index === -1) {\n result = toJSONObject(vscode_1.workspace.getConfiguration(undefined, resource).get(section));\n }\n else {\n let config = vscode_1.workspace.getConfiguration(section.substr(0, index), resource);\n if (config) {\n result = toJSONObject(config.get(section.substr(index + 1)));\n }\n }\n }\n else {\n let config = vscode_1.workspace.getConfiguration(undefined, resource);\n result = {};\n for (let key of Object.keys(config)) {\n if (config.has(key)) {\n result[key] = toJSONObject(config.get(key));\n }\n }\n }\n if (result === undefined) {\n result = null;\n }\n return result;\n }\n clear() {\n }\n}\nexports.ConfigurationFeature = ConfigurationFeature;\nfunction toJSONObject(obj) {\n if (obj) {\n if (Array.isArray(obj)) {\n return obj.map(toJSONObject);\n }\n else if (typeof obj === 'object') {\n const res = Object.create(null);\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n res[key] = toJSONObject(obj[key]);\n }\n }\n return res;\n }\n }\n return obj;\n}\nexports.toJSONObject = toJSONObject;\nclass SyncConfigurationFeature {\n constructor(_client) {\n this._client = _client;\n this.isCleared = false;\n this._listeners = new Map();\n }\n getState() {\n return { kind: 'workspace', id: this.registrationType.method, registrations: this._listeners.size > 0 };\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.DidChangeConfigurationNotification.type;\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'didChangeConfiguration').dynamicRegistration = true;\n }\n initialize() {\n this.isCleared = false;\n let section = this._client.clientOptions.synchronize?.configurationSection;\n if (section !== undefined) {\n this.register({\n id: UUID.generateUuid(),\n registerOptions: {\n section: section\n }\n });\n }\n }\n register(data) {\n let disposable = vscode_1.workspace.onDidChangeConfiguration((event) => {\n this.onDidChangeConfiguration(data.registerOptions.section, event);\n });\n this._listeners.set(data.id, disposable);\n if (data.registerOptions.section !== undefined) {\n this.onDidChangeConfiguration(data.registerOptions.section, undefined);\n }\n }\n unregister(id) {\n let disposable = this._listeners.get(id);\n if (disposable) {\n this._listeners.delete(id);\n disposable.dispose();\n }\n }\n clear() {\n for (const disposable of this._listeners.values()) {\n disposable.dispose();\n }\n this._listeners.clear();\n this.isCleared = true;\n }\n onDidChangeConfiguration(configurationSection, event) {\n if (this.isCleared) {\n return;\n }\n let sections;\n if (Is.string(configurationSection)) {\n sections = [configurationSection];\n }\n else {\n sections = configurationSection;\n }\n if (sections !== undefined && event !== undefined) {\n let affected = sections.some((section) => event.affectsConfiguration(section));\n if (!affected) {\n return;\n }\n }\n const didChangeConfiguration = async (sections) => {\n if (sections === undefined) {\n return this._client.sendNotification(vscode_languageserver_protocol_1.DidChangeConfigurationNotification.type, { settings: null });\n }\n else {\n return this._client.sendNotification(vscode_languageserver_protocol_1.DidChangeConfigurationNotification.type, { settings: this.extractSettingsInformation(sections) });\n }\n };\n let middleware = this._client.middleware.workspace?.didChangeConfiguration;\n (middleware ? middleware(sections, didChangeConfiguration) : didChangeConfiguration(sections)).catch((error) => {\n this._client.error(`Sending notification ${vscode_languageserver_protocol_1.DidChangeConfigurationNotification.type.method} failed`, error);\n });\n }\n extractSettingsInformation(keys) {\n function ensurePath(config, path) {\n let current = config;\n for (let i = 0; i < path.length - 1; i++) {\n let obj = current[path[i]];\n if (!obj) {\n obj = Object.create(null);\n current[path[i]] = obj;\n }\n current = obj;\n }\n return current;\n }\n let resource = this._client.clientOptions.workspaceFolder\n ? this._client.clientOptions.workspaceFolder.uri\n : undefined;\n let result = Object.create(null);\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i];\n let index = key.indexOf('.');\n let config = null;\n if (index >= 0) {\n config = vscode_1.workspace.getConfiguration(key.substr(0, index), resource).get(key.substr(index + 1));\n }\n else {\n config = vscode_1.workspace.getConfiguration(undefined, resource).get(key);\n }\n if (config) {\n let path = keys[i].split('.');\n ensurePath(result, path)[path[path.length - 1]] = toJSONObject(config);\n }\n }\n return result;\n }\n}\nexports.SyncConfigurationFeature = SyncConfigurationFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DidSaveTextDocumentFeature = exports.WillSaveWaitUntilFeature = exports.WillSaveFeature = exports.DidChangeTextDocumentFeature = exports.DidCloseTextDocumentFeature = exports.DidOpenTextDocumentFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass DidOpenTextDocumentFeature extends features_1.TextDocumentEventFeature {\n constructor(client, syncedDocuments) {\n super(client, vscode_1.workspace.onDidOpenTextDocument, vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.type, () => client.middleware.didOpen, (textDocument) => client.code2ProtocolConverter.asOpenTextDocumentParams(textDocument), (data) => data, features_1.TextDocumentEventFeature.textDocumentFilter);\n this._syncedDocuments = syncedDocuments;\n }\n get openDocuments() {\n return this._syncedDocuments.values();\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'synchronization').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const textDocumentSyncOptions = capabilities.resolvedTextDocumentSync;\n if (documentSelector && textDocumentSyncOptions && textDocumentSyncOptions.openClose) {\n this.register({ id: UUID.generateUuid(), registerOptions: { documentSelector: documentSelector } });\n }\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.type;\n }\n register(data) {\n super.register(data);\n if (!data.registerOptions.documentSelector) {\n return;\n }\n const documentSelector = this._client.protocol2CodeConverter.asDocumentSelector(data.registerOptions.documentSelector);\n vscode_1.workspace.textDocuments.forEach((textDocument) => {\n const uri = textDocument.uri.toString();\n if (this._syncedDocuments.has(uri)) {\n return;\n }\n if (vscode_1.languages.match(documentSelector, textDocument) > 0 && !this._client.hasDedicatedTextSynchronizationFeature(textDocument)) {\n const middleware = this._client.middleware;\n const didOpen = (textDocument) => {\n return this._client.sendNotification(this._type, this._createParams(textDocument));\n };\n (middleware.didOpen ? middleware.didOpen(textDocument, didOpen) : didOpen(textDocument)).catch((error) => {\n this._client.error(`Sending document notification ${this._type.method} failed`, error);\n });\n this._syncedDocuments.set(uri, textDocument);\n }\n });\n }\n getTextDocument(data) {\n return data;\n }\n notificationSent(textDocument, type, params) {\n this._syncedDocuments.set(textDocument.uri.toString(), textDocument);\n super.notificationSent(textDocument, type, params);\n }\n}\nexports.DidOpenTextDocumentFeature = DidOpenTextDocumentFeature;\nclass DidCloseTextDocumentFeature extends features_1.TextDocumentEventFeature {\n constructor(client, syncedDocuments, pendingTextDocumentChanges) {\n super(client, vscode_1.workspace.onDidCloseTextDocument, vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.type, () => client.middleware.didClose, (textDocument) => client.code2ProtocolConverter.asCloseTextDocumentParams(textDocument), (data) => data, features_1.TextDocumentEventFeature.textDocumentFilter);\n this._syncedDocuments = syncedDocuments;\n this._pendingTextDocumentChanges = pendingTextDocumentChanges;\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.type;\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'synchronization').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n let textDocumentSyncOptions = capabilities.resolvedTextDocumentSync;\n if (documentSelector && textDocumentSyncOptions && textDocumentSyncOptions.openClose) {\n this.register({ id: UUID.generateUuid(), registerOptions: { documentSelector: documentSelector } });\n }\n }\n async callback(data) {\n await super.callback(data);\n this._pendingTextDocumentChanges.delete(data.uri.toString());\n }\n getTextDocument(data) {\n return data;\n }\n notificationSent(textDocument, type, params) {\n this._syncedDocuments.delete(textDocument.uri.toString());\n super.notificationSent(textDocument, type, params);\n }\n unregister(id) {\n const selector = this._selectors.get(id);\n // The super call removed the selector from the map\n // of selectors.\n super.unregister(id);\n const selectors = this._selectors.values();\n this._syncedDocuments.forEach((textDocument) => {\n if (vscode_1.languages.match(selector, textDocument) > 0 && !this._selectorFilter(selectors, textDocument) && !this._client.hasDedicatedTextSynchronizationFeature(textDocument)) {\n let middleware = this._client.middleware;\n let didClose = (textDocument) => {\n return this._client.sendNotification(this._type, this._createParams(textDocument));\n };\n this._syncedDocuments.delete(textDocument.uri.toString());\n (middleware.didClose ? middleware.didClose(textDocument, didClose) : didClose(textDocument)).catch((error) => {\n this._client.error(`Sending document notification ${this._type.method} failed`, error);\n });\n }\n });\n }\n}\nexports.DidCloseTextDocumentFeature = DidCloseTextDocumentFeature;\nclass DidChangeTextDocumentFeature extends features_1.DynamicDocumentFeature {\n constructor(client, pendingTextDocumentChanges) {\n super(client);\n this._changeData = new Map();\n this._onNotificationSent = new vscode_1.EventEmitter();\n this._onPendingChangeAdded = new vscode_1.EventEmitter();\n this._pendingTextDocumentChanges = pendingTextDocumentChanges;\n this._syncKind = vscode_languageserver_protocol_1.TextDocumentSyncKind.None;\n }\n get onNotificationSent() {\n return this._onNotificationSent.event;\n }\n get onPendingChangeAdded() {\n return this._onPendingChangeAdded.event;\n }\n get syncKind() {\n return this._syncKind;\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type;\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'synchronization').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n let textDocumentSyncOptions = capabilities.resolvedTextDocumentSync;\n if (documentSelector && textDocumentSyncOptions && textDocumentSyncOptions.change !== undefined && textDocumentSyncOptions.change !== vscode_languageserver_protocol_1.TextDocumentSyncKind.None) {\n this.register({\n id: UUID.generateUuid(),\n registerOptions: Object.assign({}, { documentSelector: documentSelector }, { syncKind: textDocumentSyncOptions.change })\n });\n }\n }\n register(data) {\n if (!data.registerOptions.documentSelector) {\n return;\n }\n if (!this._listener) {\n this._listener = vscode_1.workspace.onDidChangeTextDocument(this.callback, this);\n }\n this._changeData.set(data.id, {\n syncKind: data.registerOptions.syncKind,\n documentSelector: this._client.protocol2CodeConverter.asDocumentSelector(data.registerOptions.documentSelector),\n });\n this.updateSyncKind(data.registerOptions.syncKind);\n }\n *getDocumentSelectors() {\n for (const data of this._changeData.values()) {\n yield data.documentSelector;\n }\n }\n async callback(event) {\n // Text document changes are send for dirty changes as well. We don't\n // have dirty / un-dirty events in the LSP so we ignore content changes\n // with length zero.\n if (event.contentChanges.length === 0) {\n return;\n }\n // We need to capture the URI and version here since they might change on the text document\n // until we reach did `didChange` call since the middleware support async execution.\n const uri = event.document.uri;\n const version = event.document.version;\n const promises = [];\n for (const changeData of this._changeData.values()) {\n if (vscode_1.languages.match(changeData.documentSelector, event.document) > 0 && !this._client.hasDedicatedTextSynchronizationFeature(event.document)) {\n const middleware = this._client.middleware;\n if (changeData.syncKind === vscode_languageserver_protocol_1.TextDocumentSyncKind.Incremental) {\n const didChange = async (event) => {\n const params = this._client.code2ProtocolConverter.asChangeTextDocumentParams(event, uri, version);\n await this._client.sendNotification(vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type, params);\n this.notificationSent(event.document, vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type, params);\n };\n promises.push(middleware.didChange ? middleware.didChange(event, event => didChange(event)) : didChange(event));\n }\n else if (changeData.syncKind === vscode_languageserver_protocol_1.TextDocumentSyncKind.Full) {\n const didChange = async (event) => {\n const eventUri = event.document.uri.toString();\n this._pendingTextDocumentChanges.set(eventUri, event.document);\n this._onPendingChangeAdded.fire();\n };\n promises.push(middleware.didChange ? middleware.didChange(event, event => didChange(event)) : didChange(event));\n }\n }\n }\n return Promise.all(promises).then(undefined, (error) => {\n this._client.error(`Sending document notification ${vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type.method} failed`, error);\n throw error;\n });\n }\n notificationSent(textDocument, type, params) {\n this._onNotificationSent.fire({ textDocument, type, params });\n }\n unregister(id) {\n this._changeData.delete(id);\n if (this._changeData.size === 0) {\n if (this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n this._syncKind = vscode_languageserver_protocol_1.TextDocumentSyncKind.None;\n }\n else {\n this._syncKind = vscode_languageserver_protocol_1.TextDocumentSyncKind.None;\n for (const changeData of this._changeData.values()) {\n this.updateSyncKind(changeData.syncKind);\n if (this._syncKind === vscode_languageserver_protocol_1.TextDocumentSyncKind.Full) {\n break;\n }\n }\n }\n }\n clear() {\n this._pendingTextDocumentChanges.clear();\n this._changeData.clear();\n this._syncKind = vscode_languageserver_protocol_1.TextDocumentSyncKind.None;\n if (this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n }\n getPendingDocumentChanges(excludes) {\n if (this._pendingTextDocumentChanges.size === 0) {\n return [];\n }\n let result;\n if (excludes.size === 0) {\n result = Array.from(this._pendingTextDocumentChanges.values());\n this._pendingTextDocumentChanges.clear();\n }\n else {\n result = [];\n for (const entry of this._pendingTextDocumentChanges) {\n if (!excludes.has(entry[0])) {\n result.push(entry[1]);\n this._pendingTextDocumentChanges.delete(entry[0]);\n }\n }\n }\n return result;\n }\n getProvider(document) {\n for (const changeData of this._changeData.values()) {\n if (vscode_1.languages.match(changeData.documentSelector, document) > 0) {\n return {\n send: (event) => {\n return this.callback(event);\n }\n };\n }\n }\n return undefined;\n }\n updateSyncKind(syncKind) {\n if (this._syncKind === vscode_languageserver_protocol_1.TextDocumentSyncKind.Full) {\n return;\n }\n switch (syncKind) {\n case vscode_languageserver_protocol_1.TextDocumentSyncKind.Full:\n this._syncKind = syncKind;\n break;\n case vscode_languageserver_protocol_1.TextDocumentSyncKind.Incremental:\n if (this._syncKind === vscode_languageserver_protocol_1.TextDocumentSyncKind.None) {\n this._syncKind = vscode_languageserver_protocol_1.TextDocumentSyncKind.Incremental;\n }\n break;\n }\n }\n}\nexports.DidChangeTextDocumentFeature = DidChangeTextDocumentFeature;\nclass WillSaveFeature extends features_1.TextDocumentEventFeature {\n constructor(client) {\n super(client, vscode_1.workspace.onWillSaveTextDocument, vscode_languageserver_protocol_1.WillSaveTextDocumentNotification.type, () => client.middleware.willSave, (willSaveEvent) => client.code2ProtocolConverter.asWillSaveTextDocumentParams(willSaveEvent), (event) => event.document, (selectors, willSaveEvent) => features_1.TextDocumentEventFeature.textDocumentFilter(selectors, willSaveEvent.document));\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.WillSaveTextDocumentNotification.type;\n }\n fillClientCapabilities(capabilities) {\n let value = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'synchronization');\n value.willSave = true;\n }\n initialize(capabilities, documentSelector) {\n let textDocumentSyncOptions = capabilities.resolvedTextDocumentSync;\n if (documentSelector && textDocumentSyncOptions && textDocumentSyncOptions.willSave) {\n this.register({\n id: UUID.generateUuid(),\n registerOptions: { documentSelector: documentSelector }\n });\n }\n }\n getTextDocument(data) {\n return data.document;\n }\n}\nexports.WillSaveFeature = WillSaveFeature;\nclass WillSaveWaitUntilFeature extends features_1.DynamicDocumentFeature {\n constructor(client) {\n super(client);\n this._selectors = new Map();\n }\n getDocumentSelectors() {\n return this._selectors.values();\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.WillSaveTextDocumentWaitUntilRequest.type;\n }\n fillClientCapabilities(capabilities) {\n let value = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'synchronization');\n value.willSaveWaitUntil = true;\n }\n initialize(capabilities, documentSelector) {\n let textDocumentSyncOptions = capabilities.resolvedTextDocumentSync;\n if (documentSelector && textDocumentSyncOptions && textDocumentSyncOptions.willSaveWaitUntil) {\n this.register({\n id: UUID.generateUuid(),\n registerOptions: { documentSelector: documentSelector }\n });\n }\n }\n register(data) {\n if (!data.registerOptions.documentSelector) {\n return;\n }\n if (!this._listener) {\n this._listener = vscode_1.workspace.onWillSaveTextDocument(this.callback, this);\n }\n this._selectors.set(data.id, this._client.protocol2CodeConverter.asDocumentSelector(data.registerOptions.documentSelector));\n }\n callback(event) {\n if (features_1.TextDocumentEventFeature.textDocumentFilter(this._selectors.values(), event.document) && !this._client.hasDedicatedTextSynchronizationFeature(event.document)) {\n let middleware = this._client.middleware;\n let willSaveWaitUntil = (event) => {\n return this._client.sendRequest(vscode_languageserver_protocol_1.WillSaveTextDocumentWaitUntilRequest.type, this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(event)).then(async (edits) => {\n let vEdits = await this._client.protocol2CodeConverter.asTextEdits(edits);\n return vEdits === undefined ? [] : vEdits;\n });\n };\n event.waitUntil(middleware.willSaveWaitUntil\n ? middleware.willSaveWaitUntil(event, willSaveWaitUntil)\n : willSaveWaitUntil(event));\n }\n }\n unregister(id) {\n this._selectors.delete(id);\n if (this._selectors.size === 0 && this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n }\n clear() {\n this._selectors.clear();\n if (this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n }\n}\nexports.WillSaveWaitUntilFeature = WillSaveWaitUntilFeature;\nclass DidSaveTextDocumentFeature extends features_1.TextDocumentEventFeature {\n constructor(client) {\n super(client, vscode_1.workspace.onDidSaveTextDocument, vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.type, () => client.middleware.didSave, (textDocument) => client.code2ProtocolConverter.asSaveTextDocumentParams(textDocument, this._includeText), (data) => data, features_1.TextDocumentEventFeature.textDocumentFilter);\n this._includeText = false;\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.type;\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'synchronization').didSave = true;\n }\n initialize(capabilities, documentSelector) {\n const textDocumentSyncOptions = capabilities.resolvedTextDocumentSync;\n if (documentSelector && textDocumentSyncOptions && textDocumentSyncOptions.save) {\n const saveOptions = typeof textDocumentSyncOptions.save === 'boolean'\n ? { includeText: false }\n : { includeText: !!textDocumentSyncOptions.save.includeText };\n this.register({\n id: UUID.generateUuid(),\n registerOptions: Object.assign({}, { documentSelector: documentSelector }, saveOptions)\n });\n }\n }\n register(data) {\n this._includeText = !!data.registerOptions.includeText;\n super.register(data);\n }\n getTextDocument(data) {\n return data;\n }\n}\nexports.DidSaveTextDocumentFeature = DidSaveTextDocumentFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CompletionItemFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nconst SupportedCompletionItemKinds = [\n vscode_languageserver_protocol_1.CompletionItemKind.Text,\n vscode_languageserver_protocol_1.CompletionItemKind.Method,\n vscode_languageserver_protocol_1.CompletionItemKind.Function,\n vscode_languageserver_protocol_1.CompletionItemKind.Constructor,\n vscode_languageserver_protocol_1.CompletionItemKind.Field,\n vscode_languageserver_protocol_1.CompletionItemKind.Variable,\n vscode_languageserver_protocol_1.CompletionItemKind.Class,\n vscode_languageserver_protocol_1.CompletionItemKind.Interface,\n vscode_languageserver_protocol_1.CompletionItemKind.Module,\n vscode_languageserver_protocol_1.CompletionItemKind.Property,\n vscode_languageserver_protocol_1.CompletionItemKind.Unit,\n vscode_languageserver_protocol_1.CompletionItemKind.Value,\n vscode_languageserver_protocol_1.CompletionItemKind.Enum,\n vscode_languageserver_protocol_1.CompletionItemKind.Keyword,\n vscode_languageserver_protocol_1.CompletionItemKind.Snippet,\n vscode_languageserver_protocol_1.CompletionItemKind.Color,\n vscode_languageserver_protocol_1.CompletionItemKind.File,\n vscode_languageserver_protocol_1.CompletionItemKind.Reference,\n vscode_languageserver_protocol_1.CompletionItemKind.Folder,\n vscode_languageserver_protocol_1.CompletionItemKind.EnumMember,\n vscode_languageserver_protocol_1.CompletionItemKind.Constant,\n vscode_languageserver_protocol_1.CompletionItemKind.Struct,\n vscode_languageserver_protocol_1.CompletionItemKind.Event,\n vscode_languageserver_protocol_1.CompletionItemKind.Operator,\n vscode_languageserver_protocol_1.CompletionItemKind.TypeParameter\n];\nclass CompletionItemFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.CompletionRequest.type);\n this.labelDetailsSupport = new Map();\n }\n fillClientCapabilities(capabilities) {\n let completion = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'completion');\n completion.dynamicRegistration = true;\n completion.contextSupport = true;\n completion.completionItem = {\n snippetSupport: true,\n commitCharactersSupport: true,\n documentationFormat: [vscode_languageserver_protocol_1.MarkupKind.Markdown, vscode_languageserver_protocol_1.MarkupKind.PlainText],\n deprecatedSupport: true,\n preselectSupport: true,\n tagSupport: { valueSet: [vscode_languageserver_protocol_1.CompletionItemTag.Deprecated] },\n insertReplaceSupport: true,\n resolveSupport: {\n properties: ['documentation', 'detail', 'additionalTextEdits']\n },\n insertTextModeSupport: { valueSet: [vscode_languageserver_protocol_1.InsertTextMode.asIs, vscode_languageserver_protocol_1.InsertTextMode.adjustIndentation] },\n labelDetailsSupport: true\n };\n completion.insertTextMode = vscode_languageserver_protocol_1.InsertTextMode.adjustIndentation;\n completion.completionItemKind = { valueSet: SupportedCompletionItemKinds };\n completion.completionList = {\n itemDefaults: [\n 'commitCharacters', 'editRange', 'insertTextFormat', 'insertTextMode', 'data'\n ]\n };\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.completionProvider);\n if (!options) {\n return;\n }\n this.register({\n id: UUID.generateUuid(),\n registerOptions: options\n });\n }\n registerLanguageProvider(options, id) {\n this.labelDetailsSupport.set(id, !!options.completionItem?.labelDetailsSupport);\n const triggerCharacters = options.triggerCharacters ?? [];\n const defaultCommitCharacters = options.allCommitCharacters;\n const selector = options.documentSelector;\n const provider = {\n provideCompletionItems: (document, position, token, context) => {\n const client = this._client;\n const middleware = this._client.middleware;\n const provideCompletionItems = (document, position, context, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.CompletionRequest.type, client.code2ProtocolConverter.asCompletionParams(document, position, context), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asCompletionResult(result, defaultCommitCharacters, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CompletionRequest.type, token, error, null);\n });\n };\n return middleware.provideCompletionItem\n ? middleware.provideCompletionItem(document, position, context, token, provideCompletionItems)\n : provideCompletionItems(document, position, context, token);\n },\n resolveCompletionItem: options.resolveProvider\n ? (item, token) => {\n const client = this._client;\n const middleware = this._client.middleware;\n const resolveCompletionItem = (item, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.CompletionResolveRequest.type, client.code2ProtocolConverter.asCompletionItem(item, !!this.labelDetailsSupport.get(id)), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asCompletionItem(result);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CompletionResolveRequest.type, token, error, item);\n });\n };\n return middleware.resolveCompletionItem\n ? middleware.resolveCompletionItem(item, token, resolveCompletionItem)\n : resolveCompletionItem(item, token);\n }\n : undefined\n };\n return [vscode_1.languages.registerCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider, ...triggerCharacters), provider];\n }\n}\nexports.CompletionItemFeature = CompletionItemFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HoverFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass HoverFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.HoverRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const hoverCapability = ((0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'hover'));\n hoverCapability.dynamicRegistration = true;\n hoverCapability.contentFormat = [vscode_languageserver_protocol_1.MarkupKind.Markdown, vscode_languageserver_protocol_1.MarkupKind.PlainText];\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.hoverProvider);\n if (!options) {\n return;\n }\n this.register({\n id: UUID.generateUuid(),\n registerOptions: options\n });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideHover: (document, position, token) => {\n const client = this._client;\n const provideHover = (document, position, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.HoverRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asHover(result);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.HoverRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideHover\n ? middleware.provideHover(document, position, token, provideHover)\n : provideHover(document, position, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerHoverProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.HoverFeature = HoverFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefinitionFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass DefinitionFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DefinitionRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let definitionSupport = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'definition');\n definitionSupport.dynamicRegistration = true;\n definitionSupport.linkSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.definitionProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideDefinition: (document, position, token) => {\n const client = this._client;\n const provideDefinition = (document, position, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.DefinitionRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asDefinitionResult(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DefinitionRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDefinition\n ? middleware.provideDefinition(document, position, token, provideDefinition)\n : provideDefinition(document, position, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.DefinitionFeature = DefinitionFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SignatureHelpFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass SignatureHelpFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.SignatureHelpRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let config = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'signatureHelp');\n config.dynamicRegistration = true;\n config.signatureInformation = { documentationFormat: [vscode_languageserver_protocol_1.MarkupKind.Markdown, vscode_languageserver_protocol_1.MarkupKind.PlainText] };\n config.signatureInformation.parameterInformation = { labelOffsetSupport: true };\n config.signatureInformation.activeParameterSupport = true;\n config.contextSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.signatureHelpProvider);\n if (!options) {\n return;\n }\n this.register({\n id: UUID.generateUuid(),\n registerOptions: options\n });\n }\n registerLanguageProvider(options) {\n const provider = {\n provideSignatureHelp: (document, position, token, context) => {\n const client = this._client;\n const providerSignatureHelp = (document, position, context, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.SignatureHelpRequest.type, client.code2ProtocolConverter.asSignatureHelpParams(document, position, context), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asSignatureHelp(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.SignatureHelpRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideSignatureHelp\n ? middleware.provideSignatureHelp(document, position, context, token, providerSignatureHelp)\n : providerSignatureHelp(document, position, context, token);\n }\n };\n return [this.registerProvider(options, provider), provider];\n }\n registerProvider(options, provider) {\n const selector = this._client.protocol2CodeConverter.asDocumentSelector(options.documentSelector);\n if (options.retriggerCharacters === undefined) {\n const triggerCharacters = options.triggerCharacters || [];\n return vscode_1.languages.registerSignatureHelpProvider(selector, provider, ...triggerCharacters);\n }\n else {\n const metaData = {\n triggerCharacters: options.triggerCharacters || [],\n retriggerCharacters: options.retriggerCharacters || []\n };\n return vscode_1.languages.registerSignatureHelpProvider(selector, provider, metaData);\n }\n }\n}\nexports.SignatureHelpFeature = SignatureHelpFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DocumentHighlightFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass DocumentHighlightFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentHighlightRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'documentHighlight').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.documentHighlightProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideDocumentHighlights: (document, position, token) => {\n const client = this._client;\n const _provideDocumentHighlights = (document, position, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentHighlightRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asDocumentHighlights(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentHighlightRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDocumentHighlights\n ? middleware.provideDocumentHighlights(document, position, token, _provideDocumentHighlights)\n : _provideDocumentHighlights(document, position, token);\n }\n };\n return [vscode_1.languages.registerDocumentHighlightProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), provider];\n }\n}\nexports.DocumentHighlightFeature = DocumentHighlightFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DocumentSymbolFeature = exports.SupportedSymbolTags = exports.SupportedSymbolKinds = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nexports.SupportedSymbolKinds = [\n vscode_languageserver_protocol_1.SymbolKind.File,\n vscode_languageserver_protocol_1.SymbolKind.Module,\n vscode_languageserver_protocol_1.SymbolKind.Namespace,\n vscode_languageserver_protocol_1.SymbolKind.Package,\n vscode_languageserver_protocol_1.SymbolKind.Class,\n vscode_languageserver_protocol_1.SymbolKind.Method,\n vscode_languageserver_protocol_1.SymbolKind.Property,\n vscode_languageserver_protocol_1.SymbolKind.Field,\n vscode_languageserver_protocol_1.SymbolKind.Constructor,\n vscode_languageserver_protocol_1.SymbolKind.Enum,\n vscode_languageserver_protocol_1.SymbolKind.Interface,\n vscode_languageserver_protocol_1.SymbolKind.Function,\n vscode_languageserver_protocol_1.SymbolKind.Variable,\n vscode_languageserver_protocol_1.SymbolKind.Constant,\n vscode_languageserver_protocol_1.SymbolKind.String,\n vscode_languageserver_protocol_1.SymbolKind.Number,\n vscode_languageserver_protocol_1.SymbolKind.Boolean,\n vscode_languageserver_protocol_1.SymbolKind.Array,\n vscode_languageserver_protocol_1.SymbolKind.Object,\n vscode_languageserver_protocol_1.SymbolKind.Key,\n vscode_languageserver_protocol_1.SymbolKind.Null,\n vscode_languageserver_protocol_1.SymbolKind.EnumMember,\n vscode_languageserver_protocol_1.SymbolKind.Struct,\n vscode_languageserver_protocol_1.SymbolKind.Event,\n vscode_languageserver_protocol_1.SymbolKind.Operator,\n vscode_languageserver_protocol_1.SymbolKind.TypeParameter\n];\nexports.SupportedSymbolTags = [\n vscode_languageserver_protocol_1.SymbolTag.Deprecated\n];\nclass DocumentSymbolFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentSymbolRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let symbolCapabilities = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'documentSymbol');\n symbolCapabilities.dynamicRegistration = true;\n symbolCapabilities.symbolKind = {\n valueSet: exports.SupportedSymbolKinds\n };\n symbolCapabilities.hierarchicalDocumentSymbolSupport = true;\n symbolCapabilities.tagSupport = {\n valueSet: exports.SupportedSymbolTags\n };\n symbolCapabilities.labelSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.documentSymbolProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideDocumentSymbols: (document, token) => {\n const client = this._client;\n const _provideDocumentSymbols = async (document, token) => {\n try {\n const data = await client.sendRequest(vscode_languageserver_protocol_1.DocumentSymbolRequest.type, client.code2ProtocolConverter.asDocumentSymbolParams(document), token);\n if (token.isCancellationRequested || data === undefined || data === null) {\n return null;\n }\n if (data.length === 0) {\n return [];\n }\n else {\n const first = data[0];\n if (vscode_languageserver_protocol_1.DocumentSymbol.is(first)) {\n return await client.protocol2CodeConverter.asDocumentSymbols(data, token);\n }\n else {\n return await client.protocol2CodeConverter.asSymbolInformations(data, token);\n }\n }\n }\n catch (error) {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentSymbolRequest.type, token, error, null);\n }\n };\n const middleware = client.middleware;\n return middleware.provideDocumentSymbols\n ? middleware.provideDocumentSymbols(document, token, _provideDocumentSymbols)\n : _provideDocumentSymbols(document, token);\n }\n };\n const metaData = options.label !== undefined ? { label: options.label } : undefined;\n return [vscode_1.languages.registerDocumentSymbolProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider, metaData), provider];\n }\n}\nexports.DocumentSymbolFeature = DocumentSymbolFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkspaceSymbolFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst documentSymbol_1 = require(\"./documentSymbol\");\nconst UUID = require(\"./utils/uuid\");\nclass WorkspaceSymbolFeature extends features_1.WorkspaceFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let symbolCapabilities = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'symbol');\n symbolCapabilities.dynamicRegistration = true;\n symbolCapabilities.symbolKind = {\n valueSet: documentSymbol_1.SupportedSymbolKinds\n };\n symbolCapabilities.tagSupport = {\n valueSet: documentSymbol_1.SupportedSymbolTags\n };\n symbolCapabilities.resolveSupport = { properties: ['location.range'] };\n }\n initialize(capabilities) {\n if (!capabilities.workspaceSymbolProvider) {\n return;\n }\n this.register({\n id: UUID.generateUuid(),\n registerOptions: capabilities.workspaceSymbolProvider === true ? { workDoneProgress: false } : capabilities.workspaceSymbolProvider\n });\n }\n registerLanguageProvider(options) {\n const provider = {\n provideWorkspaceSymbols: (query, token) => {\n const client = this._client;\n const provideWorkspaceSymbols = (query, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type, { query }, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asSymbolInformations(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideWorkspaceSymbols\n ? middleware.provideWorkspaceSymbols(query, token, provideWorkspaceSymbols)\n : provideWorkspaceSymbols(query, token);\n },\n resolveWorkspaceSymbol: options.resolveProvider === true\n ? (item, token) => {\n const client = this._client;\n const resolveWorkspaceSymbol = (item, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.WorkspaceSymbolResolveRequest.type, client.code2ProtocolConverter.asWorkspaceSymbol(item), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asSymbolInformation(result);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.WorkspaceSymbolResolveRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.resolveWorkspaceSymbol\n ? middleware.resolveWorkspaceSymbol(item, token, resolveWorkspaceSymbol)\n : resolveWorkspaceSymbol(item, token);\n }\n : undefined\n };\n return [vscode_1.languages.registerWorkspaceSymbolProvider(provider), provider];\n }\n}\nexports.WorkspaceSymbolFeature = WorkspaceSymbolFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ReferencesFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass ReferencesFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.ReferencesRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'references').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.referencesProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideReferences: (document, position, options, token) => {\n const client = this._client;\n const _providerReferences = (document, position, options, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.ReferencesRequest.type, client.code2ProtocolConverter.asReferenceParams(document, position, options), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asReferences(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.ReferencesRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideReferences\n ? middleware.provideReferences(document, position, options, token, _providerReferences)\n : _providerReferences(document, position, options, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerReferenceProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.ReferencesFeature = ReferencesFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CodeActionFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst UUID = require(\"./utils/uuid\");\nconst features_1 = require(\"./features\");\nclass CodeActionFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.CodeActionRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const cap = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'codeAction');\n cap.dynamicRegistration = true;\n cap.isPreferredSupport = true;\n cap.disabledSupport = true;\n cap.dataSupport = true;\n // We can only resolve the edit property.\n cap.resolveSupport = {\n properties: ['edit']\n };\n cap.codeActionLiteralSupport = {\n codeActionKind: {\n valueSet: [\n vscode_languageserver_protocol_1.CodeActionKind.Empty,\n vscode_languageserver_protocol_1.CodeActionKind.QuickFix,\n vscode_languageserver_protocol_1.CodeActionKind.Refactor,\n vscode_languageserver_protocol_1.CodeActionKind.RefactorExtract,\n vscode_languageserver_protocol_1.CodeActionKind.RefactorInline,\n vscode_languageserver_protocol_1.CodeActionKind.RefactorRewrite,\n vscode_languageserver_protocol_1.CodeActionKind.Source,\n vscode_languageserver_protocol_1.CodeActionKind.SourceOrganizeImports\n ]\n }\n };\n cap.honorsChangeAnnotations = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.codeActionProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideCodeActions: (document, range, context, token) => {\n const client = this._client;\n const _provideCodeActions = async (document, range, context, token) => {\n const params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n range: client.code2ProtocolConverter.asRange(range),\n context: client.code2ProtocolConverter.asCodeActionContextSync(context)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.CodeActionRequest.type, params, token).then((values) => {\n if (token.isCancellationRequested || values === null || values === undefined) {\n return null;\n }\n return client.protocol2CodeConverter.asCodeActionResult(values, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CodeActionRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideCodeActions\n ? middleware.provideCodeActions(document, range, context, token, _provideCodeActions)\n : _provideCodeActions(document, range, context, token);\n },\n resolveCodeAction: options.resolveProvider\n ? (item, token) => {\n const client = this._client;\n const middleware = this._client.middleware;\n const resolveCodeAction = async (item, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.CodeActionResolveRequest.type, client.code2ProtocolConverter.asCodeActionSync(item), token).then((result) => {\n if (token.isCancellationRequested) {\n return item;\n }\n return client.protocol2CodeConverter.asCodeAction(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CodeActionResolveRequest.type, token, error, item);\n });\n };\n return middleware.resolveCodeAction\n ? middleware.resolveCodeAction(item, token, resolveCodeAction)\n : resolveCodeAction(item, token);\n }\n : undefined\n };\n return [vscode_1.languages.registerCodeActionsProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider, (options.codeActionKinds\n ? { providedCodeActionKinds: this._client.protocol2CodeConverter.asCodeActionKinds(options.codeActionKinds) }\n : undefined)), provider];\n }\n}\nexports.CodeActionFeature = CodeActionFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CodeLensFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst UUID = require(\"./utils/uuid\");\nconst features_1 = require(\"./features\");\nclass CodeLensFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.CodeLensRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'codeLens').dynamicRegistration = true;\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'codeLens').refreshSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const client = this._client;\n client.onRequest(vscode_languageserver_protocol_1.CodeLensRefreshRequest.type, async () => {\n for (const provider of this.getAllProviders()) {\n provider.onDidChangeCodeLensEmitter.fire();\n }\n });\n const options = this.getRegistrationOptions(documentSelector, capabilities.codeLensProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const eventEmitter = new vscode_1.EventEmitter();\n const provider = {\n onDidChangeCodeLenses: eventEmitter.event,\n provideCodeLenses: (document, token) => {\n const client = this._client;\n const provideCodeLenses = (document, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.CodeLensRequest.type, client.code2ProtocolConverter.asCodeLensParams(document), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asCodeLenses(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CodeLensRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideCodeLenses\n ? middleware.provideCodeLenses(document, token, provideCodeLenses)\n : provideCodeLenses(document, token);\n },\n resolveCodeLens: (options.resolveProvider)\n ? (codeLens, token) => {\n const client = this._client;\n const resolveCodeLens = (codeLens, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.CodeLensResolveRequest.type, client.code2ProtocolConverter.asCodeLens(codeLens), token).then((result) => {\n if (token.isCancellationRequested) {\n return codeLens;\n }\n return client.protocol2CodeConverter.asCodeLens(result);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CodeLensResolveRequest.type, token, error, codeLens);\n });\n };\n const middleware = client.middleware;\n return middleware.resolveCodeLens\n ? middleware.resolveCodeLens(codeLens, token, resolveCodeLens)\n : resolveCodeLens(codeLens, token);\n }\n : undefined\n };\n return [vscode_1.languages.registerCodeLensProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), { provider, onDidChangeCodeLensEmitter: eventEmitter }];\n }\n}\nexports.CodeLensFeature = CodeLensFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DocumentOnTypeFormattingFeature = exports.DocumentRangeFormattingFeature = exports.DocumentFormattingFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst UUID = require(\"./utils/uuid\");\nconst features_1 = require(\"./features\");\nvar FileFormattingOptions;\n(function (FileFormattingOptions) {\n function fromConfiguration(document) {\n const filesConfig = vscode_1.workspace.getConfiguration('files', document);\n return {\n trimTrailingWhitespace: filesConfig.get('trimTrailingWhitespace'),\n trimFinalNewlines: filesConfig.get('trimFinalNewlines'),\n insertFinalNewline: filesConfig.get('insertFinalNewline'),\n };\n }\n FileFormattingOptions.fromConfiguration = fromConfiguration;\n})(FileFormattingOptions || (FileFormattingOptions = {}));\nclass DocumentFormattingFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentFormattingRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'formatting').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.documentFormattingProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideDocumentFormattingEdits: (document, options, token) => {\n const client = this._client;\n const provideDocumentFormattingEdits = (document, options, token) => {\n const params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n options: client.code2ProtocolConverter.asFormattingOptions(options, FileFormattingOptions.fromConfiguration(document))\n };\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentFormattingRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asTextEdits(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentFormattingRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDocumentFormattingEdits\n ? middleware.provideDocumentFormattingEdits(document, options, token, provideDocumentFormattingEdits)\n : provideDocumentFormattingEdits(document, options, token);\n }\n };\n return [vscode_1.languages.registerDocumentFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), provider];\n }\n}\nexports.DocumentFormattingFeature = DocumentFormattingFeature;\nclass DocumentRangeFormattingFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'rangeFormatting');\n capability.dynamicRegistration = true;\n capability.rangesSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.documentRangeFormattingProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideDocumentRangeFormattingEdits: (document, range, options, token) => {\n const client = this._client;\n const provideDocumentRangeFormattingEdits = (document, range, options, token) => {\n const params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n range: client.code2ProtocolConverter.asRange(range),\n options: client.code2ProtocolConverter.asFormattingOptions(options, FileFormattingOptions.fromConfiguration(document))\n };\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asTextEdits(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDocumentRangeFormattingEdits\n ? middleware.provideDocumentRangeFormattingEdits(document, range, options, token, provideDocumentRangeFormattingEdits)\n : provideDocumentRangeFormattingEdits(document, range, options, token);\n }\n };\n if (options.rangesSupport) {\n provider.provideDocumentRangesFormattingEdits = (document, ranges, options, token) => {\n const client = this._client;\n const provideDocumentRangesFormattingEdits = (document, ranges, options, token) => {\n const params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n ranges: client.code2ProtocolConverter.asRanges(ranges),\n options: client.code2ProtocolConverter.asFormattingOptions(options, FileFormattingOptions.fromConfiguration(document))\n };\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentRangesFormattingRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asTextEdits(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentRangesFormattingRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDocumentRangesFormattingEdits\n ? middleware.provideDocumentRangesFormattingEdits(document, ranges, options, token, provideDocumentRangesFormattingEdits)\n : provideDocumentRangesFormattingEdits(document, ranges, options, token);\n };\n }\n return [vscode_1.languages.registerDocumentRangeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), provider];\n }\n}\nexports.DocumentRangeFormattingFeature = DocumentRangeFormattingFeature;\nclass DocumentOnTypeFormattingFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'onTypeFormatting').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.documentOnTypeFormattingProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideOnTypeFormattingEdits: (document, position, ch, options, token) => {\n const client = this._client;\n const provideOnTypeFormattingEdits = (document, position, ch, options, token) => {\n let params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n position: client.code2ProtocolConverter.asPosition(position),\n ch: ch,\n options: client.code2ProtocolConverter.asFormattingOptions(options, FileFormattingOptions.fromConfiguration(document))\n };\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asTextEdits(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideOnTypeFormattingEdits\n ? middleware.provideOnTypeFormattingEdits(document, position, ch, options, token, provideOnTypeFormattingEdits)\n : provideOnTypeFormattingEdits(document, position, ch, options, token);\n }\n };\n const moreTriggerCharacter = options.moreTriggerCharacter || [];\n return [vscode_1.languages.registerOnTypeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider, options.firstTriggerCharacter, ...moreTriggerCharacter), provider];\n }\n}\nexports.DocumentOnTypeFormattingFeature = DocumentOnTypeFormattingFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RenameFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst UUID = require(\"./utils/uuid\");\nconst Is = require(\"./utils/is\");\nconst features_1 = require(\"./features\");\nclass RenameFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.RenameRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let rename = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'rename');\n rename.dynamicRegistration = true;\n rename.prepareSupport = true;\n rename.prepareSupportDefaultBehavior = vscode_languageserver_protocol_1.PrepareSupportDefaultBehavior.Identifier;\n rename.honorsChangeAnnotations = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.renameProvider);\n if (!options) {\n return;\n }\n if (Is.boolean(capabilities.renameProvider)) {\n options.prepareProvider = false;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideRenameEdits: (document, position, newName, token) => {\n const client = this._client;\n const provideRenameEdits = (document, position, newName, token) => {\n let params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n position: client.code2ProtocolConverter.asPosition(position),\n newName: newName\n };\n return client.sendRequest(vscode_languageserver_protocol_1.RenameRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asWorkspaceEdit(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.RenameRequest.type, token, error, null, false);\n });\n };\n const middleware = client.middleware;\n return middleware.provideRenameEdits\n ? middleware.provideRenameEdits(document, position, newName, token, provideRenameEdits)\n : provideRenameEdits(document, position, newName, token);\n },\n prepareRename: options.prepareProvider\n ? (document, position, token) => {\n const client = this._client;\n const prepareRename = (document, position, token) => {\n let params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n position: client.code2ProtocolConverter.asPosition(position),\n };\n return client.sendRequest(vscode_languageserver_protocol_1.PrepareRenameRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n if (vscode_languageserver_protocol_1.Range.is(result)) {\n return client.protocol2CodeConverter.asRange(result);\n }\n else if (this.isDefaultBehavior(result)) {\n return result.defaultBehavior === true\n ? null\n : Promise.reject(new Error(`The element can't be renamed.`));\n }\n else if (result && vscode_languageserver_protocol_1.Range.is(result.range)) {\n return {\n range: client.protocol2CodeConverter.asRange(result.range),\n placeholder: result.placeholder\n };\n }\n // To cancel the rename vscode API expects a rejected promise.\n return Promise.reject(new Error(`The element can't be renamed.`));\n }, (error) => {\n if (typeof error.message === 'string') {\n throw new Error(error.message);\n }\n else {\n throw new Error(`The element can't be renamed.`);\n }\n });\n };\n const middleware = client.middleware;\n return middleware.prepareRename\n ? middleware.prepareRename(document, position, token, prepareRename)\n : prepareRename(document, position, token);\n }\n : undefined\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerRenameProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n isDefaultBehavior(value) {\n const candidate = value;\n return candidate && Is.boolean(candidate.defaultBehavior);\n }\n}\nexports.RenameFeature = RenameFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DocumentLinkFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass DocumentLinkFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentLinkRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const documentLinkCapabilities = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'documentLink');\n documentLinkCapabilities.dynamicRegistration = true;\n documentLinkCapabilities.tooltipSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.documentLinkProvider);\n if (!options) {\n return;\n }\n this.register({ id: UUID.generateUuid(), registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideDocumentLinks: (document, token) => {\n const client = this._client;\n const provideDocumentLinks = (document, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentLinkRequest.type, client.code2ProtocolConverter.asDocumentLinkParams(document), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asDocumentLinks(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentLinkRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDocumentLinks\n ? middleware.provideDocumentLinks(document, token, provideDocumentLinks)\n : provideDocumentLinks(document, token);\n },\n resolveDocumentLink: options.resolveProvider\n ? (link, token) => {\n const client = this._client;\n let resolveDocumentLink = (link, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentLinkResolveRequest.type, client.code2ProtocolConverter.asDocumentLink(link), token).then((result) => {\n if (token.isCancellationRequested) {\n return link;\n }\n return client.protocol2CodeConverter.asDocumentLink(result);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentLinkResolveRequest.type, token, error, link);\n });\n };\n const middleware = client.middleware;\n return middleware.resolveDocumentLink\n ? middleware.resolveDocumentLink(link, token, resolveDocumentLink)\n : resolveDocumentLink(link, token);\n }\n : undefined\n };\n return [vscode_1.languages.registerDocumentLinkProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), provider];\n }\n}\nexports.DocumentLinkFeature = DocumentLinkFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExecuteCommandFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst UUID = require(\"./utils/uuid\");\nconst features_1 = require(\"./features\");\nclass ExecuteCommandFeature {\n constructor(client) {\n this._client = client;\n this._commands = new Map();\n }\n getState() {\n return { kind: 'workspace', id: this.registrationType.method, registrations: this._commands.size > 0 };\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.ExecuteCommandRequest.type;\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'executeCommand').dynamicRegistration = true;\n }\n initialize(capabilities) {\n if (!capabilities.executeCommandProvider) {\n return;\n }\n this.register({\n id: UUID.generateUuid(),\n registerOptions: Object.assign({}, capabilities.executeCommandProvider)\n });\n }\n register(data) {\n const client = this._client;\n const middleware = client.middleware;\n const executeCommand = (command, args) => {\n let params = {\n command,\n arguments: args\n };\n return client.sendRequest(vscode_languageserver_protocol_1.ExecuteCommandRequest.type, params).then(undefined, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.ExecuteCommandRequest.type, undefined, error, undefined);\n });\n };\n if (data.registerOptions.commands) {\n const disposables = [];\n for (const command of data.registerOptions.commands) {\n disposables.push(vscode_1.commands.registerCommand(command, (...args) => {\n return middleware.executeCommand\n ? middleware.executeCommand(command, args, executeCommand)\n : executeCommand(command, args);\n }));\n }\n this._commands.set(data.id, disposables);\n }\n }\n unregister(id) {\n let disposables = this._commands.get(id);\n if (disposables) {\n disposables.forEach(disposable => disposable.dispose());\n }\n }\n clear() {\n this._commands.forEach((value) => {\n value.forEach(disposable => disposable.dispose());\n });\n this._commands.clear();\n }\n}\nexports.ExecuteCommandFeature = ExecuteCommandFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FileSystemWatcherFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass FileSystemWatcherFeature {\n constructor(client, notifyFileEvent) {\n this._client = client;\n this._notifyFileEvent = notifyFileEvent;\n this._watchers = new Map();\n }\n getState() {\n return { kind: 'workspace', id: this.registrationType.method, registrations: this._watchers.size > 0 };\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.DidChangeWatchedFilesNotification.type;\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'didChangeWatchedFiles').dynamicRegistration = true;\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'didChangeWatchedFiles').relativePatternSupport = true;\n }\n initialize(_capabilities, _documentSelector) {\n }\n register(data) {\n if (!Array.isArray(data.registerOptions.watchers)) {\n return;\n }\n const disposables = [];\n for (const watcher of data.registerOptions.watchers) {\n const globPattern = this._client.protocol2CodeConverter.asGlobPattern(watcher.globPattern);\n if (globPattern === undefined) {\n continue;\n }\n let watchCreate = true, watchChange = true, watchDelete = true;\n if (watcher.kind !== undefined && watcher.kind !== null) {\n watchCreate = (watcher.kind & vscode_languageserver_protocol_1.WatchKind.Create) !== 0;\n watchChange = (watcher.kind & vscode_languageserver_protocol_1.WatchKind.Change) !== 0;\n watchDelete = (watcher.kind & vscode_languageserver_protocol_1.WatchKind.Delete) !== 0;\n }\n const fileSystemWatcher = vscode_1.workspace.createFileSystemWatcher(globPattern, !watchCreate, !watchChange, !watchDelete);\n this.hookListeners(fileSystemWatcher, watchCreate, watchChange, watchDelete, disposables);\n disposables.push(fileSystemWatcher);\n }\n this._watchers.set(data.id, disposables);\n }\n registerRaw(id, fileSystemWatchers) {\n let disposables = [];\n for (let fileSystemWatcher of fileSystemWatchers) {\n this.hookListeners(fileSystemWatcher, true, true, true, disposables);\n }\n this._watchers.set(id, disposables);\n }\n hookListeners(fileSystemWatcher, watchCreate, watchChange, watchDelete, listeners) {\n if (watchCreate) {\n fileSystemWatcher.onDidCreate((resource) => this._notifyFileEvent({\n uri: this._client.code2ProtocolConverter.asUri(resource),\n type: vscode_languageserver_protocol_1.FileChangeType.Created\n }), null, listeners);\n }\n if (watchChange) {\n fileSystemWatcher.onDidChange((resource) => this._notifyFileEvent({\n uri: this._client.code2ProtocolConverter.asUri(resource),\n type: vscode_languageserver_protocol_1.FileChangeType.Changed\n }), null, listeners);\n }\n if (watchDelete) {\n fileSystemWatcher.onDidDelete((resource) => this._notifyFileEvent({\n uri: this._client.code2ProtocolConverter.asUri(resource),\n type: vscode_languageserver_protocol_1.FileChangeType.Deleted\n }), null, listeners);\n }\n }\n unregister(id) {\n let disposables = this._watchers.get(id);\n if (disposables) {\n for (let disposable of disposables) {\n disposable.dispose();\n }\n }\n }\n clear() {\n this._watchers.forEach((disposables) => {\n for (let disposable of disposables) {\n disposable.dispose();\n }\n });\n this._watchers.clear();\n }\n}\nexports.FileSystemWatcherFeature = FileSystemWatcherFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ColorProviderFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass ColorProviderFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DocumentColorRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'colorProvider').dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n let [id, options] = this.getRegistration(documentSelector, capabilities.colorProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideColorPresentations: (color, context, token) => {\n const client = this._client;\n const provideColorPresentations = (color, context, token) => {\n const requestParams = {\n color,\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(context.document),\n range: client.code2ProtocolConverter.asRange(context.range)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, requestParams, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return this._client.protocol2CodeConverter.asColorPresentations(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideColorPresentations\n ? middleware.provideColorPresentations(color, context, token, provideColorPresentations)\n : provideColorPresentations(color, context, token);\n },\n provideDocumentColors: (document, token) => {\n const client = this._client;\n const provideDocumentColors = (document, token) => {\n const requestParams = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.DocumentColorRequest.type, requestParams, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return this._client.protocol2CodeConverter.asColorInformations(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentColorRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDocumentColors\n ? middleware.provideDocumentColors(document, token, provideDocumentColors)\n : provideDocumentColors(document, token);\n }\n };\n return [vscode_1.languages.registerColorProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), provider];\n }\n}\nexports.ColorProviderFeature = ColorProviderFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ImplementationFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass ImplementationFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.ImplementationRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let implementationSupport = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'implementation');\n implementationSupport.dynamicRegistration = true;\n implementationSupport.linkSupport = true;\n }\n initialize(capabilities, documentSelector) {\n let [id, options] = this.getRegistration(documentSelector, capabilities.implementationProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideImplementation: (document, position, token) => {\n const client = this._client;\n const provideImplementation = (document, position, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asDefinitionResult(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideImplementation\n ? middleware.provideImplementation(document, position, token, provideImplementation)\n : provideImplementation(document, position, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerImplementationProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.ImplementationFeature = ImplementationFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TypeDefinitionFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass TypeDefinitionFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.TypeDefinitionRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'typeDefinition').dynamicRegistration = true;\n let typeDefinitionSupport = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'typeDefinition');\n typeDefinitionSupport.dynamicRegistration = true;\n typeDefinitionSupport.linkSupport = true;\n }\n initialize(capabilities, documentSelector) {\n let [id, options] = this.getRegistration(documentSelector, capabilities.typeDefinitionProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideTypeDefinition: (document, position, token) => {\n const client = this._client;\n const provideTypeDefinition = (document, position, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asDefinitionResult(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideTypeDefinition\n ? middleware.provideTypeDefinition(document, position, token, provideTypeDefinition)\n : provideTypeDefinition(document, position, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerTypeDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.TypeDefinitionFeature = TypeDefinitionFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkspaceFoldersFeature = exports.arrayDiff = void 0;\nconst UUID = require(\"./utils/uuid\");\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nfunction access(target, key) {\n if (target === undefined || target === null) {\n return undefined;\n }\n return target[key];\n}\nfunction arrayDiff(left, right) {\n return left.filter(element => right.indexOf(element) < 0);\n}\nexports.arrayDiff = arrayDiff;\nclass WorkspaceFoldersFeature {\n constructor(client) {\n this._client = client;\n this._listeners = new Map();\n }\n getState() {\n return { kind: 'workspace', id: this.registrationType.method, registrations: this._listeners.size > 0 };\n }\n get registrationType() {\n return vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type;\n }\n fillInitializeParams(params) {\n const folders = vscode_1.workspace.workspaceFolders;\n this.initializeWithFolders(folders);\n if (folders === void 0) {\n params.workspaceFolders = null;\n }\n else {\n params.workspaceFolders = folders.map(folder => this.asProtocol(folder));\n }\n }\n initializeWithFolders(currentWorkspaceFolders) {\n this._initialFolders = currentWorkspaceFolders;\n }\n fillClientCapabilities(capabilities) {\n capabilities.workspace = capabilities.workspace || {};\n capabilities.workspace.workspaceFolders = true;\n }\n initialize(capabilities) {\n const client = this._client;\n client.onRequest(vscode_languageserver_protocol_1.WorkspaceFoldersRequest.type, (token) => {\n const workspaceFolders = () => {\n const folders = vscode_1.workspace.workspaceFolders;\n if (folders === undefined) {\n return null;\n }\n const result = folders.map((folder) => {\n return this.asProtocol(folder);\n });\n return result;\n };\n const middleware = client.middleware.workspace;\n return middleware && middleware.workspaceFolders\n ? middleware.workspaceFolders(token, workspaceFolders)\n : workspaceFolders(token);\n });\n const value = access(access(access(capabilities, 'workspace'), 'workspaceFolders'), 'changeNotifications');\n let id;\n if (typeof value === 'string') {\n id = value;\n }\n else if (value === true) {\n id = UUID.generateUuid();\n }\n if (id) {\n this.register({ id: id, registerOptions: undefined });\n }\n }\n sendInitialEvent(currentWorkspaceFolders) {\n let promise;\n if (this._initialFolders && currentWorkspaceFolders) {\n const removed = arrayDiff(this._initialFolders, currentWorkspaceFolders);\n const added = arrayDiff(currentWorkspaceFolders, this._initialFolders);\n if (added.length > 0 || removed.length > 0) {\n promise = this.doSendEvent(added, removed);\n }\n }\n else if (this._initialFolders) {\n promise = this.doSendEvent([], this._initialFolders);\n }\n else if (currentWorkspaceFolders) {\n promise = this.doSendEvent(currentWorkspaceFolders, []);\n }\n if (promise !== undefined) {\n promise.catch((error) => {\n this._client.error(`Sending notification ${vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type.method} failed`, error);\n });\n }\n }\n doSendEvent(addedFolders, removedFolders) {\n let params = {\n event: {\n added: addedFolders.map(folder => this.asProtocol(folder)),\n removed: removedFolders.map(folder => this.asProtocol(folder))\n }\n };\n return this._client.sendNotification(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type, params);\n }\n register(data) {\n let id = data.id;\n let client = this._client;\n let disposable = vscode_1.workspace.onDidChangeWorkspaceFolders((event) => {\n let didChangeWorkspaceFolders = (event) => {\n return this.doSendEvent(event.added, event.removed);\n };\n let middleware = client.middleware.workspace;\n const promise = middleware && middleware.didChangeWorkspaceFolders\n ? middleware.didChangeWorkspaceFolders(event, didChangeWorkspaceFolders)\n : didChangeWorkspaceFolders(event);\n promise.catch((error) => {\n this._client.error(`Sending notification ${vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type.method} failed`, error);\n });\n });\n this._listeners.set(id, disposable);\n this.sendInitialEvent(vscode_1.workspace.workspaceFolders);\n }\n unregister(id) {\n let disposable = this._listeners.get(id);\n if (disposable === void 0) {\n return;\n }\n this._listeners.delete(id);\n disposable.dispose();\n }\n clear() {\n for (let disposable of this._listeners.values()) {\n disposable.dispose();\n }\n this._listeners.clear();\n }\n asProtocol(workspaceFolder) {\n if (workspaceFolder === void 0) {\n return null;\n }\n return { uri: this._client.code2ProtocolConverter.asUri(workspaceFolder.uri), name: workspaceFolder.name };\n }\n}\nexports.WorkspaceFoldersFeature = WorkspaceFoldersFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FoldingRangeFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass FoldingRangeFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.FoldingRangeRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'foldingRange');\n capability.dynamicRegistration = true;\n capability.rangeLimit = 5000;\n capability.lineFoldingOnly = true;\n capability.foldingRangeKind = { valueSet: [vscode_languageserver_protocol_1.FoldingRangeKind.Comment, vscode_languageserver_protocol_1.FoldingRangeKind.Imports, vscode_languageserver_protocol_1.FoldingRangeKind.Region] };\n capability.foldingRange = { collapsedText: false };\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'foldingRange').refreshSupport = true;\n }\n initialize(capabilities, documentSelector) {\n this._client.onRequest(vscode_languageserver_protocol_1.FoldingRangeRefreshRequest.type, async () => {\n for (const provider of this.getAllProviders()) {\n provider.onDidChangeFoldingRange.fire();\n }\n });\n let [id, options] = this.getRegistration(documentSelector, capabilities.foldingRangeProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const eventEmitter = new vscode_1.EventEmitter();\n const provider = {\n onDidChangeFoldingRanges: eventEmitter.event,\n provideFoldingRanges: (document, context, token) => {\n const client = this._client;\n const provideFoldingRanges = (document, _, token) => {\n const requestParams = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, requestParams, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asFoldingRanges(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideFoldingRanges\n ? middleware.provideFoldingRanges(document, context, token, provideFoldingRanges)\n : provideFoldingRanges(document, context, token);\n }\n };\n return [vscode_1.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), { provider: provider, onDidChangeFoldingRange: eventEmitter }];\n }\n}\nexports.FoldingRangeFeature = FoldingRangeFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DeclarationFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass DeclarationFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.DeclarationRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const declarationSupport = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'declaration');\n declarationSupport.dynamicRegistration = true;\n declarationSupport.linkSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const [id, options] = this.getRegistration(documentSelector, capabilities.declarationProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideDeclaration: (document, position, token) => {\n const client = this._client;\n const provideDeclaration = (document, position, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asDeclarationResult(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideDeclaration\n ? middleware.provideDeclaration(document, position, token, provideDeclaration)\n : provideDeclaration(document, position, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerDeclarationProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.DeclarationFeature = DeclarationFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SelectionRangeFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass SelectionRangeFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.SelectionRangeRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'selectionRange');\n capability.dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const [id, options] = this.getRegistration(documentSelector, capabilities.selectionRangeProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideSelectionRanges: (document, positions, token) => {\n const client = this._client;\n const provideSelectionRanges = async (document, positions, token) => {\n const requestParams = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n positions: client.code2ProtocolConverter.asPositionsSync(positions, token)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.SelectionRangeRequest.type, requestParams, token).then((ranges) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asSelectionRanges(ranges, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.SelectionRangeRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideSelectionRanges\n ? middleware.provideSelectionRanges(document, positions, token, provideSelectionRanges)\n : provideSelectionRanges(document, positions, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerSelectionRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.SelectionRangeFeature = SelectionRangeFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProgressFeature = void 0;\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst progressPart_1 = require(\"./progressPart\");\nfunction ensure(target, key) {\n if (target[key] === void 0) {\n target[key] = Object.create(null);\n }\n return target[key];\n}\nclass ProgressFeature {\n constructor(_client) {\n this._client = _client;\n this.activeParts = new Set();\n }\n getState() {\n return { kind: 'window', id: vscode_languageserver_protocol_1.WorkDoneProgressCreateRequest.method, registrations: this.activeParts.size > 0 };\n }\n fillClientCapabilities(capabilities) {\n ensure(capabilities, 'window').workDoneProgress = true;\n }\n initialize() {\n const client = this._client;\n const deleteHandler = (part) => {\n this.activeParts.delete(part);\n };\n const createHandler = (params) => {\n this.activeParts.add(new progressPart_1.ProgressPart(this._client, params.token, deleteHandler));\n };\n client.onRequest(vscode_languageserver_protocol_1.WorkDoneProgressCreateRequest.type, createHandler);\n }\n clear() {\n for (const part of this.activeParts) {\n part.done();\n }\n this.activeParts.clear();\n }\n}\nexports.ProgressFeature = ProgressFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CallHierarchyFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass CallHierarchyProvider {\n constructor(client) {\n this.client = client;\n this.middleware = client.middleware;\n }\n prepareCallHierarchy(document, position, token) {\n const client = this.client;\n const middleware = this.middleware;\n const prepareCallHierarchy = (document, position, token) => {\n const params = client.code2ProtocolConverter.asTextDocumentPositionParams(document, position);\n return client.sendRequest(vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asCallHierarchyItems(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type, token, error, null);\n });\n };\n return middleware.prepareCallHierarchy\n ? middleware.prepareCallHierarchy(document, position, token, prepareCallHierarchy)\n : prepareCallHierarchy(document, position, token);\n }\n provideCallHierarchyIncomingCalls(item, token) {\n const client = this.client;\n const middleware = this.middleware;\n const provideCallHierarchyIncomingCalls = (item, token) => {\n const params = {\n item: client.code2ProtocolConverter.asCallHierarchyItem(item)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.CallHierarchyIncomingCallsRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asCallHierarchyIncomingCalls(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyIncomingCallsRequest.type, token, error, null);\n });\n };\n return middleware.provideCallHierarchyIncomingCalls\n ? middleware.provideCallHierarchyIncomingCalls(item, token, provideCallHierarchyIncomingCalls)\n : provideCallHierarchyIncomingCalls(item, token);\n }\n provideCallHierarchyOutgoingCalls(item, token) {\n const client = this.client;\n const middleware = this.middleware;\n const provideCallHierarchyOutgoingCalls = (item, token) => {\n const params = {\n item: client.code2ProtocolConverter.asCallHierarchyItem(item)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.CallHierarchyOutgoingCallsRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asCallHierarchyOutgoingCalls(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyOutgoingCallsRequest.type, token, error, null);\n });\n };\n return middleware.provideCallHierarchyOutgoingCalls\n ? middleware.provideCallHierarchyOutgoingCalls(item, token, provideCallHierarchyOutgoingCalls)\n : provideCallHierarchyOutgoingCalls(item, token);\n }\n}\nclass CallHierarchyFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type);\n }\n fillClientCapabilities(cap) {\n const capabilities = cap;\n const capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'callHierarchy');\n capability.dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const [id, options] = this.getRegistration(documentSelector, capabilities.callHierarchyProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const client = this._client;\n const provider = new CallHierarchyProvider(client);\n return [vscode_1.languages.registerCallHierarchyProvider(this._client.protocol2CodeConverter.asDocumentSelector(options.documentSelector), provider), provider];\n }\n}\nexports.CallHierarchyFeature = CallHierarchyFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SemanticTokensFeature = void 0;\nconst vscode = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst Is = require(\"./utils/is\");\nclass SemanticTokensFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.SemanticTokensRegistrationType.type);\n }\n fillClientCapabilities(capabilities) {\n const capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'semanticTokens');\n capability.dynamicRegistration = true;\n capability.tokenTypes = [\n vscode_languageserver_protocol_1.SemanticTokenTypes.namespace,\n vscode_languageserver_protocol_1.SemanticTokenTypes.type,\n vscode_languageserver_protocol_1.SemanticTokenTypes.class,\n vscode_languageserver_protocol_1.SemanticTokenTypes.enum,\n vscode_languageserver_protocol_1.SemanticTokenTypes.interface,\n vscode_languageserver_protocol_1.SemanticTokenTypes.struct,\n vscode_languageserver_protocol_1.SemanticTokenTypes.typeParameter,\n vscode_languageserver_protocol_1.SemanticTokenTypes.parameter,\n vscode_languageserver_protocol_1.SemanticTokenTypes.variable,\n vscode_languageserver_protocol_1.SemanticTokenTypes.property,\n vscode_languageserver_protocol_1.SemanticTokenTypes.enumMember,\n vscode_languageserver_protocol_1.SemanticTokenTypes.event,\n vscode_languageserver_protocol_1.SemanticTokenTypes.function,\n vscode_languageserver_protocol_1.SemanticTokenTypes.method,\n vscode_languageserver_protocol_1.SemanticTokenTypes.macro,\n vscode_languageserver_protocol_1.SemanticTokenTypes.keyword,\n vscode_languageserver_protocol_1.SemanticTokenTypes.modifier,\n vscode_languageserver_protocol_1.SemanticTokenTypes.comment,\n vscode_languageserver_protocol_1.SemanticTokenTypes.string,\n vscode_languageserver_protocol_1.SemanticTokenTypes.number,\n vscode_languageserver_protocol_1.SemanticTokenTypes.regexp,\n vscode_languageserver_protocol_1.SemanticTokenTypes.operator,\n vscode_languageserver_protocol_1.SemanticTokenTypes.decorator\n ];\n capability.tokenModifiers = [\n vscode_languageserver_protocol_1.SemanticTokenModifiers.declaration,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.definition,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.readonly,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.static,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.deprecated,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.abstract,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.async,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.modification,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.documentation,\n vscode_languageserver_protocol_1.SemanticTokenModifiers.defaultLibrary\n ];\n capability.formats = [vscode_languageserver_protocol_1.TokenFormat.Relative];\n capability.requests = {\n range: true,\n full: {\n delta: true\n }\n };\n capability.multilineTokenSupport = false;\n capability.overlappingTokenSupport = false;\n capability.serverCancelSupport = true;\n capability.augmentsSyntaxTokens = true;\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'semanticTokens').refreshSupport = true;\n }\n initialize(capabilities, documentSelector) {\n const client = this._client;\n client.onRequest(vscode_languageserver_protocol_1.SemanticTokensRefreshRequest.type, async () => {\n for (const provider of this.getAllProviders()) {\n provider.onDidChangeSemanticTokensEmitter.fire();\n }\n });\n const [id, options] = this.getRegistration(documentSelector, capabilities.semanticTokensProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const fullProvider = Is.boolean(options.full) ? options.full : options.full !== undefined;\n const hasEditProvider = options.full !== undefined && typeof options.full !== 'boolean' && options.full.delta === true;\n const eventEmitter = new vscode.EventEmitter();\n const documentProvider = fullProvider\n ? {\n onDidChangeSemanticTokens: eventEmitter.event,\n provideDocumentSemanticTokens: (document, token) => {\n const client = this._client;\n const middleware = client.middleware;\n const provideDocumentSemanticTokens = (document, token) => {\n const params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.SemanticTokensRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asSemanticTokens(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensRequest.type, token, error, null);\n });\n };\n return middleware.provideDocumentSemanticTokens\n ? middleware.provideDocumentSemanticTokens(document, token, provideDocumentSemanticTokens)\n : provideDocumentSemanticTokens(document, token);\n },\n provideDocumentSemanticTokensEdits: hasEditProvider\n ? (document, previousResultId, token) => {\n const client = this._client;\n const middleware = client.middleware;\n const provideDocumentSemanticTokensEdits = (document, previousResultId, token) => {\n const params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n previousResultId\n };\n return client.sendRequest(vscode_languageserver_protocol_1.SemanticTokensDeltaRequest.type, params, token).then(async (result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n if (vscode_languageserver_protocol_1.SemanticTokens.is(result)) {\n return await client.protocol2CodeConverter.asSemanticTokens(result, token);\n }\n else {\n return await client.protocol2CodeConverter.asSemanticTokensEdits(result, token);\n }\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensDeltaRequest.type, token, error, null);\n });\n };\n return middleware.provideDocumentSemanticTokensEdits\n ? middleware.provideDocumentSemanticTokensEdits(document, previousResultId, token, provideDocumentSemanticTokensEdits)\n : provideDocumentSemanticTokensEdits(document, previousResultId, token);\n }\n : undefined\n }\n : undefined;\n const hasRangeProvider = options.range === true;\n const rangeProvider = hasRangeProvider\n ? {\n provideDocumentRangeSemanticTokens: (document, range, token) => {\n const client = this._client;\n const middleware = client.middleware;\n const provideDocumentRangeSemanticTokens = (document, range, token) => {\n const params = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n range: client.code2ProtocolConverter.asRange(range)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.SemanticTokensRangeRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asSemanticTokens(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensRangeRequest.type, token, error, null);\n });\n };\n return middleware.provideDocumentRangeSemanticTokens\n ? middleware.provideDocumentRangeSemanticTokens(document, range, token, provideDocumentRangeSemanticTokens)\n : provideDocumentRangeSemanticTokens(document, range, token);\n }\n }\n : undefined;\n const disposables = [];\n const client = this._client;\n const legend = client.protocol2CodeConverter.asSemanticTokensLegend(options.legend);\n const documentSelector = client.protocol2CodeConverter.asDocumentSelector(selector);\n if (documentProvider !== undefined) {\n disposables.push(vscode.languages.registerDocumentSemanticTokensProvider(documentSelector, documentProvider, legend));\n }\n if (rangeProvider !== undefined) {\n disposables.push(vscode.languages.registerDocumentRangeSemanticTokensProvider(documentSelector, rangeProvider, legend));\n }\n return [new vscode.Disposable(() => disposables.forEach(item => item.dispose())), { range: rangeProvider, full: documentProvider, onDidChangeSemanticTokensEmitter: eventEmitter }];\n }\n}\nexports.SemanticTokensFeature = SemanticTokensFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WillDeleteFilesFeature = exports.WillRenameFilesFeature = exports.WillCreateFilesFeature = exports.DidDeleteFilesFeature = exports.DidRenameFilesFeature = exports.DidCreateFilesFeature = void 0;\nconst code = require(\"vscode\");\nconst minimatch = require(\"minimatch\");\nconst proto = require(\"vscode-languageserver-protocol\");\nconst UUID = require(\"./utils/uuid\");\nfunction ensure(target, key) {\n if (target[key] === void 0) {\n target[key] = {};\n }\n return target[key];\n}\nfunction access(target, key) {\n return target[key];\n}\nfunction assign(target, key, value) {\n target[key] = value;\n}\nclass FileOperationFeature {\n constructor(client, event, registrationType, clientCapability, serverCapability) {\n this._client = client;\n this._event = event;\n this._registrationType = registrationType;\n this._clientCapability = clientCapability;\n this._serverCapability = serverCapability;\n this._filters = new Map();\n }\n getState() {\n return { kind: 'workspace', id: this._registrationType.method, registrations: this._filters.size > 0 };\n }\n filterSize() {\n return this._filters.size;\n }\n get registrationType() {\n return this._registrationType;\n }\n fillClientCapabilities(capabilities) {\n const value = ensure(ensure(capabilities, 'workspace'), 'fileOperations');\n // this happens n times but it is the same value so we tolerate this.\n assign(value, 'dynamicRegistration', true);\n assign(value, this._clientCapability, true);\n }\n initialize(capabilities) {\n const options = capabilities.workspace?.fileOperations;\n const capability = options !== undefined ? access(options, this._serverCapability) : undefined;\n if (capability?.filters !== undefined) {\n try {\n this.register({\n id: UUID.generateUuid(),\n registerOptions: { filters: capability.filters }\n });\n }\n catch (e) {\n this._client.warn(`Ignoring invalid glob pattern for ${this._serverCapability} registration: ${e}`);\n }\n }\n }\n register(data) {\n if (!this._listener) {\n this._listener = this._event(this.send, this);\n }\n const minimatchFilter = data.registerOptions.filters.map((filter) => {\n const matcher = new minimatch.Minimatch(filter.pattern.glob, FileOperationFeature.asMinimatchOptions(filter.pattern.options));\n if (!matcher.makeRe()) {\n throw new Error(`Invalid pattern ${filter.pattern.glob}!`);\n }\n return { scheme: filter.scheme, matcher, kind: filter.pattern.matches };\n });\n this._filters.set(data.id, minimatchFilter);\n }\n unregister(id) {\n this._filters.delete(id);\n if (this._filters.size === 0 && this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n }\n clear() {\n this._filters.clear();\n if (this._listener) {\n this._listener.dispose();\n this._listener = undefined;\n }\n }\n getFileType(uri) {\n return FileOperationFeature.getFileType(uri);\n }\n async filter(event, prop) {\n // (Asynchronously) map each file onto a boolean of whether it matches\n // any of the globs.\n const fileMatches = await Promise.all(event.files.map(async (item) => {\n const uri = prop(item);\n // Use fsPath to make this consistent with file system watchers but help\n // minimatch to use '/' instead of `\\\\` if present.\n const path = uri.fsPath.replace(/\\\\/g, '/');\n for (const filters of this._filters.values()) {\n for (const filter of filters) {\n if (filter.scheme !== undefined && filter.scheme !== uri.scheme) {\n continue;\n }\n if (filter.matcher.match(path)) {\n // The pattern matches. If kind is undefined then everything is ok\n if (filter.kind === undefined) {\n return true;\n }\n const fileType = await this.getFileType(uri);\n // If we can't determine the file type than we treat it as a match.\n // Dropping it would be another alternative.\n if (fileType === undefined) {\n this._client.error(`Failed to determine file type for ${uri.toString()}.`);\n return true;\n }\n if ((fileType === code.FileType.File && filter.kind === proto.FileOperationPatternKind.file) || (fileType === code.FileType.Directory && filter.kind === proto.FileOperationPatternKind.folder)) {\n return true;\n }\n }\n else if (filter.kind === proto.FileOperationPatternKind.folder) {\n const fileType = await FileOperationFeature.getFileType(uri);\n if (fileType === code.FileType.Directory && filter.matcher.match(`${path}/`)) {\n return true;\n }\n }\n }\n }\n return false;\n }));\n // Filter the files to those that matched.\n const files = event.files.filter((_, index) => fileMatches[index]);\n return { ...event, files };\n }\n static async getFileType(uri) {\n try {\n return (await code.workspace.fs.stat(uri)).type;\n }\n catch (e) {\n return undefined;\n }\n }\n static asMinimatchOptions(options) {\n // The spec doesn't state that dot files don't match. So we make\n // matching those the default.\n const result = { dot: true };\n if (options?.ignoreCase === true) {\n result.nocase = true;\n }\n return result;\n }\n}\nclass NotificationFileOperationFeature extends FileOperationFeature {\n constructor(client, event, notificationType, clientCapability, serverCapability, accessUri, createParams) {\n super(client, event, notificationType, clientCapability, serverCapability);\n this._notificationType = notificationType;\n this._accessUri = accessUri;\n this._createParams = createParams;\n }\n async send(originalEvent) {\n // Create a copy of the event that has the files filtered to match what the\n // server wants.\n const filteredEvent = await this.filter(originalEvent, this._accessUri);\n if (filteredEvent.files.length) {\n const next = async (event) => {\n return this._client.sendNotification(this._notificationType, this._createParams(event));\n };\n return this.doSend(filteredEvent, next);\n }\n }\n}\nclass CachingNotificationFileOperationFeature extends NotificationFileOperationFeature {\n constructor() {\n super(...arguments);\n this._fsPathFileTypes = new Map();\n }\n async getFileType(uri) {\n const fsPath = uri.fsPath;\n if (this._fsPathFileTypes.has(fsPath)) {\n return this._fsPathFileTypes.get(fsPath);\n }\n const type = await FileOperationFeature.getFileType(uri);\n if (type) {\n this._fsPathFileTypes.set(fsPath, type);\n }\n return type;\n }\n async cacheFileTypes(event, prop) {\n // Calling filter will force the matching logic to run. For any item\n // that requires a getFileType lookup, the overriden getFileType will\n // be called that will cache the result so that when onDidRename fires,\n // it can still be checked even though the item no longer exists on disk\n // in its original location.\n await this.filter(event, prop);\n }\n clearFileTypeCache() {\n this._fsPathFileTypes.clear();\n }\n unregister(id) {\n super.unregister(id);\n if (this.filterSize() === 0 && this._willListener) {\n this._willListener.dispose();\n this._willListener = undefined;\n }\n }\n clear() {\n super.clear();\n if (this._willListener) {\n this._willListener.dispose();\n this._willListener = undefined;\n }\n }\n}\nclass DidCreateFilesFeature extends NotificationFileOperationFeature {\n constructor(client) {\n super(client, code.workspace.onDidCreateFiles, proto.DidCreateFilesNotification.type, 'didCreate', 'didCreate', (i) => i, client.code2ProtocolConverter.asDidCreateFilesParams);\n }\n doSend(event, next) {\n const middleware = this._client.middleware.workspace;\n return middleware?.didCreateFiles\n ? middleware.didCreateFiles(event, next)\n : next(event);\n }\n}\nexports.DidCreateFilesFeature = DidCreateFilesFeature;\nclass DidRenameFilesFeature extends CachingNotificationFileOperationFeature {\n constructor(client) {\n super(client, code.workspace.onDidRenameFiles, proto.DidRenameFilesNotification.type, 'didRename', 'didRename', (i) => i.oldUri, client.code2ProtocolConverter.asDidRenameFilesParams);\n }\n register(data) {\n if (!this._willListener) {\n this._willListener = code.workspace.onWillRenameFiles(this.willRename, this);\n }\n super.register(data);\n }\n willRename(e) {\n e.waitUntil(this.cacheFileTypes(e, (i) => i.oldUri));\n }\n doSend(event, next) {\n this.clearFileTypeCache();\n const middleware = this._client.middleware.workspace;\n return middleware?.didRenameFiles\n ? middleware.didRenameFiles(event, next)\n : next(event);\n }\n}\nexports.DidRenameFilesFeature = DidRenameFilesFeature;\nclass DidDeleteFilesFeature extends CachingNotificationFileOperationFeature {\n constructor(client) {\n super(client, code.workspace.onDidDeleteFiles, proto.DidDeleteFilesNotification.type, 'didDelete', 'didDelete', (i) => i, client.code2ProtocolConverter.asDidDeleteFilesParams);\n }\n register(data) {\n if (!this._willListener) {\n this._willListener = code.workspace.onWillDeleteFiles(this.willDelete, this);\n }\n super.register(data);\n }\n willDelete(e) {\n e.waitUntil(this.cacheFileTypes(e, (i) => i));\n }\n doSend(event, next) {\n this.clearFileTypeCache();\n const middleware = this._client.middleware.workspace;\n return middleware?.didDeleteFiles\n ? middleware.didDeleteFiles(event, next)\n : next(event);\n }\n}\nexports.DidDeleteFilesFeature = DidDeleteFilesFeature;\nclass RequestFileOperationFeature extends FileOperationFeature {\n constructor(client, event, requestType, clientCapability, serverCapability, accessUri, createParams) {\n super(client, event, requestType, clientCapability, serverCapability);\n this._requestType = requestType;\n this._accessUri = accessUri;\n this._createParams = createParams;\n }\n async send(originalEvent) {\n const waitUntil = this.waitUntil(originalEvent);\n originalEvent.waitUntil(waitUntil);\n }\n async waitUntil(originalEvent) {\n // Create a copy of the event that has the files filtered to match what the\n // server wants.\n const filteredEvent = await this.filter(originalEvent, this._accessUri);\n if (filteredEvent.files.length) {\n const next = (event) => {\n return this._client.sendRequest(this._requestType, this._createParams(event), event.token)\n .then(this._client.protocol2CodeConverter.asWorkspaceEdit);\n };\n return this.doSend(filteredEvent, next);\n }\n else {\n return undefined;\n }\n }\n}\nclass WillCreateFilesFeature extends RequestFileOperationFeature {\n constructor(client) {\n super(client, code.workspace.onWillCreateFiles, proto.WillCreateFilesRequest.type, 'willCreate', 'willCreate', (i) => i, client.code2ProtocolConverter.asWillCreateFilesParams);\n }\n doSend(event, next) {\n const middleware = this._client.middleware.workspace;\n return middleware?.willCreateFiles\n ? middleware.willCreateFiles(event, next)\n : next(event);\n }\n}\nexports.WillCreateFilesFeature = WillCreateFilesFeature;\nclass WillRenameFilesFeature extends RequestFileOperationFeature {\n constructor(client) {\n super(client, code.workspace.onWillRenameFiles, proto.WillRenameFilesRequest.type, 'willRename', 'willRename', (i) => i.oldUri, client.code2ProtocolConverter.asWillRenameFilesParams);\n }\n doSend(event, next) {\n const middleware = this._client.middleware.workspace;\n return middleware?.willRenameFiles\n ? middleware.willRenameFiles(event, next)\n : next(event);\n }\n}\nexports.WillRenameFilesFeature = WillRenameFilesFeature;\nclass WillDeleteFilesFeature extends RequestFileOperationFeature {\n constructor(client) {\n super(client, code.workspace.onWillDeleteFiles, proto.WillDeleteFilesRequest.type, 'willDelete', 'willDelete', (i) => i, client.code2ProtocolConverter.asWillDeleteFilesParams);\n }\n doSend(event, next) {\n const middleware = this._client.middleware.workspace;\n return middleware?.willDeleteFiles\n ? middleware.willDeleteFiles(event, next)\n : next(event);\n }\n}\nexports.WillDeleteFilesFeature = WillDeleteFilesFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LinkedEditingFeature = void 0;\nconst code = require(\"vscode\");\nconst proto = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass LinkedEditingFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, proto.LinkedEditingRangeRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const linkedEditingSupport = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'linkedEditingRange');\n linkedEditingSupport.dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n let [id, options] = this.getRegistration(documentSelector, capabilities.linkedEditingRangeProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideLinkedEditingRanges: (document, position, token) => {\n const client = this._client;\n const provideLinkedEditing = (document, position, token) => {\n return client.sendRequest(proto.LinkedEditingRangeRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asLinkedEditingRanges(result, token);\n }, (error) => {\n return client.handleFailedRequest(proto.LinkedEditingRangeRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideLinkedEditingRange\n ? middleware.provideLinkedEditingRange(document, position, token, provideLinkedEditing)\n : provideLinkedEditing(document, position, token);\n }\n };\n return [this.registerProvider(selector, provider), provider];\n }\n registerProvider(selector, provider) {\n return code.languages.registerLinkedEditingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.LinkedEditingFeature = LinkedEditingFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TypeHierarchyFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass TypeHierarchyProvider {\n constructor(client) {\n this.client = client;\n this.middleware = client.middleware;\n }\n prepareTypeHierarchy(document, position, token) {\n const client = this.client;\n const middleware = this.middleware;\n const prepareTypeHierarchy = (document, position, token) => {\n const params = client.code2ProtocolConverter.asTextDocumentPositionParams(document, position);\n return client.sendRequest(vscode_languageserver_protocol_1.TypeHierarchyPrepareRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asTypeHierarchyItems(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.TypeHierarchyPrepareRequest.type, token, error, null);\n });\n };\n return middleware.prepareTypeHierarchy\n ? middleware.prepareTypeHierarchy(document, position, token, prepareTypeHierarchy)\n : prepareTypeHierarchy(document, position, token);\n }\n provideTypeHierarchySupertypes(item, token) {\n const client = this.client;\n const middleware = this.middleware;\n const provideTypeHierarchySupertypes = (item, token) => {\n const params = {\n item: client.code2ProtocolConverter.asTypeHierarchyItem(item)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.TypeHierarchySupertypesRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asTypeHierarchyItems(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.TypeHierarchySupertypesRequest.type, token, error, null);\n });\n };\n return middleware.provideTypeHierarchySupertypes\n ? middleware.provideTypeHierarchySupertypes(item, token, provideTypeHierarchySupertypes)\n : provideTypeHierarchySupertypes(item, token);\n }\n provideTypeHierarchySubtypes(item, token) {\n const client = this.client;\n const middleware = this.middleware;\n const provideTypeHierarchySubtypes = (item, token) => {\n const params = {\n item: client.code2ProtocolConverter.asTypeHierarchyItem(item)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.TypeHierarchySubtypesRequest.type, params, token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asTypeHierarchyItems(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.TypeHierarchySubtypesRequest.type, token, error, null);\n });\n };\n return middleware.provideTypeHierarchySubtypes\n ? middleware.provideTypeHierarchySubtypes(item, token, provideTypeHierarchySubtypes)\n : provideTypeHierarchySubtypes(item, token);\n }\n}\nclass TypeHierarchyFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.TypeHierarchyPrepareRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'typeHierarchy');\n capability.dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const [id, options] = this.getRegistration(documentSelector, capabilities.typeHierarchyProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const client = this._client;\n const provider = new TypeHierarchyProvider(client);\n return [vscode_1.languages.registerTypeHierarchyProvider(client.protocol2CodeConverter.asDocumentSelector(options.documentSelector), provider), provider];\n }\n}\nexports.TypeHierarchyFeature = TypeHierarchyFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlineValueFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass InlineValueFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.InlineValueRequest.type);\n }\n fillClientCapabilities(capabilities) {\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'inlineValue').dynamicRegistration = true;\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'inlineValue').refreshSupport = true;\n }\n initialize(capabilities, documentSelector) {\n this._client.onRequest(vscode_languageserver_protocol_1.InlineValueRefreshRequest.type, async () => {\n for (const provider of this.getAllProviders()) {\n provider.onDidChangeInlineValues.fire();\n }\n });\n const [id, options] = this.getRegistration(documentSelector, capabilities.inlineValueProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const eventEmitter = new vscode_1.EventEmitter();\n const provider = {\n onDidChangeInlineValues: eventEmitter.event,\n provideInlineValues: (document, viewPort, context, token) => {\n const client = this._client;\n const provideInlineValues = (document, viewPort, context, token) => {\n const requestParams = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n range: client.code2ProtocolConverter.asRange(viewPort),\n context: client.code2ProtocolConverter.asInlineValueContext(context)\n };\n return client.sendRequest(vscode_languageserver_protocol_1.InlineValueRequest.type, requestParams, token).then((values) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asInlineValues(values, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.InlineValueRequest.type, token, error, null);\n });\n };\n const middleware = client.middleware;\n return middleware.provideInlineValues\n ? middleware.provideInlineValues(document, viewPort, context, token, provideInlineValues)\n : provideInlineValues(document, viewPort, context, token);\n }\n };\n return [this.registerProvider(selector, provider), { provider: provider, onDidChangeInlineValues: eventEmitter }];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerInlineValuesProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.InlineValueFeature = InlineValueFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlayHintsFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nclass InlayHintsFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.InlayHintRequest.type);\n }\n fillClientCapabilities(capabilities) {\n const inlayHint = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'inlayHint');\n inlayHint.dynamicRegistration = true;\n inlayHint.resolveSupport = {\n properties: ['tooltip', 'textEdits', 'label.tooltip', 'label.location', 'label.command']\n };\n (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'inlayHint').refreshSupport = true;\n }\n initialize(capabilities, documentSelector) {\n this._client.onRequest(vscode_languageserver_protocol_1.InlayHintRefreshRequest.type, async () => {\n for (const provider of this.getAllProviders()) {\n provider.onDidChangeInlayHints.fire();\n }\n });\n const [id, options] = this.getRegistration(documentSelector, capabilities.inlayHintProvider);\n if (!id || !options) {\n return;\n }\n this.register({ id: id, registerOptions: options });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const eventEmitter = new vscode_1.EventEmitter();\n const provider = {\n onDidChangeInlayHints: eventEmitter.event,\n provideInlayHints: (document, viewPort, token) => {\n const client = this._client;\n const provideInlayHints = async (document, viewPort, token) => {\n const requestParams = {\n textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),\n range: client.code2ProtocolConverter.asRange(viewPort)\n };\n try {\n const values = await client.sendRequest(vscode_languageserver_protocol_1.InlayHintRequest.type, requestParams, token);\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asInlayHints(values, token);\n }\n catch (error) {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.InlayHintRequest.type, token, error, null);\n }\n };\n const middleware = client.middleware;\n return middleware.provideInlayHints\n ? middleware.provideInlayHints(document, viewPort, token, provideInlayHints)\n : provideInlayHints(document, viewPort, token);\n }\n };\n provider.resolveInlayHint = options.resolveProvider === true\n ? (hint, token) => {\n const client = this._client;\n const resolveInlayHint = async (item, token) => {\n try {\n const value = await client.sendRequest(vscode_languageserver_protocol_1.InlayHintResolveRequest.type, client.code2ProtocolConverter.asInlayHint(item), token);\n if (token.isCancellationRequested) {\n return null;\n }\n const result = client.protocol2CodeConverter.asInlayHint(value, token);\n return token.isCancellationRequested ? null : result;\n }\n catch (error) {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.InlayHintResolveRequest.type, token, error, null);\n }\n };\n const middleware = client.middleware;\n return middleware.resolveInlayHint\n ? middleware.resolveInlayHint(hint, token, resolveInlayHint)\n : resolveInlayHint(hint, token);\n }\n : undefined;\n return [this.registerProvider(selector, provider), { provider: provider, onDidChangeInlayHints: eventEmitter }];\n }\n registerProvider(selector, provider) {\n return vscode_1.languages.registerInlayHintsProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);\n }\n}\nexports.InlayHintsFeature = InlayHintsFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InlineCompletionItemFeature = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst features_1 = require(\"./features\");\nconst UUID = require(\"./utils/uuid\");\nclass InlineCompletionItemFeature extends features_1.TextDocumentLanguageFeature {\n constructor(client) {\n super(client, vscode_languageserver_protocol_1.InlineCompletionRequest.type);\n }\n fillClientCapabilities(capabilities) {\n let inlineCompletion = (0, features_1.ensure)((0, features_1.ensure)(capabilities, 'textDocument'), 'inlineCompletion');\n inlineCompletion.dynamicRegistration = true;\n }\n initialize(capabilities, documentSelector) {\n const options = this.getRegistrationOptions(documentSelector, capabilities.inlineCompletionProvider);\n if (!options) {\n return;\n }\n this.register({\n id: UUID.generateUuid(),\n registerOptions: options\n });\n }\n registerLanguageProvider(options) {\n const selector = options.documentSelector;\n const provider = {\n provideInlineCompletionItems: (document, position, context, token) => {\n const client = this._client;\n const middleware = this._client.middleware;\n const provideInlineCompletionItems = (document, position, context, token) => {\n return client.sendRequest(vscode_languageserver_protocol_1.InlineCompletionRequest.type, client.code2ProtocolConverter.asInlineCompletionParams(document, position, context), token).then((result) => {\n if (token.isCancellationRequested) {\n return null;\n }\n return client.protocol2CodeConverter.asInlineCompletionResult(result, token);\n }, (error) => {\n return client.handleFailedRequest(vscode_languageserver_protocol_1.InlineCompletionRequest.type, token, error, null);\n });\n };\n return middleware.provideInlineCompletionItems\n ? middleware.provideInlineCompletionItems(document, position, context, token, provideInlineCompletionItems)\n : provideInlineCompletionItems(document, position, context, token);\n }\n };\n return [vscode_1.languages.registerInlineCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), provider];\n }\n}\nexports.InlineCompletionItemFeature = InlineCompletionItemFeature;\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProposedFeatures = exports.BaseLanguageClient = exports.MessageTransports = exports.SuspendMode = exports.State = exports.CloseAction = exports.ErrorAction = exports.RevealOutputChannelOn = void 0;\nconst vscode_1 = require(\"vscode\");\nconst vscode_languageserver_protocol_1 = require(\"vscode-languageserver-protocol\");\nconst c2p = require(\"./codeConverter\");\nconst p2c = require(\"./protocolConverter\");\nconst Is = require(\"./utils/is\");\nconst async_1 = require(\"./utils/async\");\nconst UUID = require(\"./utils/uuid\");\nconst progressPart_1 = require(\"./progressPart\");\nconst features_1 = require(\"./features\");\nconst diagnostic_1 = require(\"./diagnostic\");\nconst notebook_1 = require(\"./notebook\");\nconst configuration_1 = require(\"./configuration\");\nconst textSynchronization_1 = require(\"./textSynchronization\");\nconst completion_1 = require(\"./completion\");\nconst hover_1 = require(\"./hover\");\nconst definition_1 = require(\"./definition\");\nconst signatureHelp_1 = require(\"./signatureHelp\");\nconst documentHighlight_1 = require(\"./documentHighlight\");\nconst documentSymbol_1 = require(\"./documentSymbol\");\nconst workspaceSymbol_1 = require(\"./workspaceSymbol\");\nconst reference_1 = require(\"./reference\");\nconst codeAction_1 = require(\"./codeAction\");\nconst codeLens_1 = require(\"./codeLens\");\nconst formatting_1 = require(\"./formatting\");\nconst rename_1 = require(\"./rename\");\nconst documentLink_1 = require(\"./documentLink\");\nconst executeCommand_1 = require(\"./executeCommand\");\nconst fileSystemWatcher_1 = require(\"./fileSystemWatcher\");\nconst colorProvider_1 = require(\"./colorProvider\");\nconst implementation_1 = require(\"./implementation\");\nconst typeDefinition_1 = require(\"./typeDefinition\");\nconst workspaceFolder_1 = require(\"./workspaceFolder\");\nconst foldingRange_1 = require(\"./foldingRange\");\nconst declaration_1 = require(\"./declaration\");\nconst selectionRange_1 = require(\"./selectionRange\");\nconst progress_1 = require(\"./progress\");\nconst callHierarchy_1 = require(\"./callHierarchy\");\nconst semanticTokens_1 = require(\"./semanticTokens\");\nconst fileOperations_1 = require(\"./fileOperations\");\nconst linkedEditingRange_1 = require(\"./linkedEditingRange\");\nconst typeHierarchy_1 = require(\"./typeHierarchy\");\nconst inlineValue_1 = require(\"./inlineValue\");\nconst inlayHint_1 = require(\"./inlayHint\");\nconst inlineCompletion_1 = require(\"./inlineCompletion\");\n/**\n * Controls when the output channel is revealed.\n */\nvar RevealOutputChannelOn;\n(function (RevealOutputChannelOn) {\n RevealOutputChannelOn[RevealOutputChannelOn[\"Debug\"] = 0] = \"Debug\";\n RevealOutputChannelOn[RevealOutputChannelOn[\"Info\"] = 1] = \"Info\";\n RevealOutputChannelOn[RevealOutputChannelOn[\"Warn\"] = 2] = \"Warn\";\n RevealOutputChannelOn[RevealOutputChannelOn[\"Error\"] = 3] = \"Error\";\n RevealOutputChannelOn[RevealOutputChannelOn[\"Never\"] = 4] = \"Never\";\n})(RevealOutputChannelOn || (exports.RevealOutputChannelOn = RevealOutputChannelOn = {}));\n/**\n * An action to be performed when the connection is producing errors.\n */\nvar ErrorAction;\n(function (ErrorAction) {\n /**\n * Continue running the server.\n */\n ErrorAction[ErrorAction[\"Continue\"] = 1] = \"Continue\";\n /**\n * Shutdown the server.\n */\n ErrorAction[ErrorAction[\"Shutdown\"] = 2] = \"Shutdown\";\n})(ErrorAction || (exports.ErrorAction = ErrorAction = {}));\n/**\n * An action to be performed when the connection to a server got closed.\n */\nvar CloseAction;\n(function (CloseAction) {\n /**\n * Don't restart the server. The connection stays closed.\n */\n CloseAction[CloseAction[\"DoNotRestart\"] = 1] = \"DoNotRestart\";\n /**\n * Restart the server.\n */\n CloseAction[CloseAction[\"Restart\"] = 2] = \"Restart\";\n})(CloseAction || (exports.CloseAction = CloseAction = {}));\n/**\n * Signals in which state the language client is in.\n */\nvar State;\n(function (State) {\n /**\n * The client is stopped or got never started.\n */\n State[State[\"Stopped\"] = 1] = \"Stopped\";\n /**\n * The client is starting but not ready yet.\n */\n State[State[\"Starting\"] = 3] = \"Starting\";\n /**\n * The client is running and ready.\n */\n State[State[\"Running\"] = 2] = \"Running\";\n})(State || (exports.State = State = {}));\nvar SuspendMode;\n(function (SuspendMode) {\n /**\n * Don't allow suspend mode.\n */\n SuspendMode[\"off\"] = \"off\";\n /**\n * Support suspend mode even if not all\n * registered providers have a corresponding\n * activation listener.\n */\n SuspendMode[\"on\"] = \"on\";\n})(SuspendMode || (exports.SuspendMode = SuspendMode = {}));\nvar ResolvedClientOptions;\n(function (ResolvedClientOptions) {\n function sanitizeIsTrusted(isTrusted) {\n if (isTrusted === undefined || isTrusted === null) {\n return false;\n }\n if ((typeof isTrusted === 'boolean') || (typeof isTrusted === 'object' && isTrusted !== null && Is.stringArray(isTrusted.enabledCommands))) {\n return isTrusted;\n }\n return false;\n }\n ResolvedClientOptions.sanitizeIsTrusted = sanitizeIsTrusted;\n})(ResolvedClientOptions || (ResolvedClientOptions = {}));\nclass DefaultErrorHandler {\n constructor(client, maxRestartCount) {\n this.client = client;\n this.maxRestartCount = maxRestartCount;\n this.restarts = [];\n }\n error(_error, _message, count) {\n if (count && count <= 3) {\n return { action: ErrorAction.Continue };\n }\n return { action: ErrorAction.Shutdown };\n }\n closed() {\n this.restarts.push(Date.now());\n if (this.restarts.length <= this.maxRestartCount) {\n return { action: CloseAction.Restart };\n }\n else {\n let diff = this.restarts[this.restarts.length - 1] - this.restarts[0];\n if (diff <= 3 * 60 * 1000) {\n return { action: CloseAction.DoNotRestart, message: `The ${this.client.name} server crashed ${this.maxRestartCount + 1} times in the last 3 minutes. The server will not be restarted. See the output for more information.` };\n }\n else {\n this.restarts.shift();\n return { action: CloseAction.Restart };\n }\n }\n }\n}\nvar ClientState;\n(function (ClientState) {\n ClientState[\"Initial\"] = \"initial\";\n ClientState[\"Starting\"] = \"starting\";\n ClientState[\"StartFailed\"] = \"startFailed\";\n ClientState[\"Running\"] = \"running\";\n ClientState[\"Stopping\"] = \"stopping\";\n ClientState[\"Stopped\"] = \"stopped\";\n})(ClientState || (ClientState = {}));\nvar MessageTransports;\n(function (MessageTransports) {\n function is(value) {\n let candidate = value;\n return candidate && vscode_languageserver_protocol_1.MessageReader.is(value.reader) && vscode_languageserver_protocol_1.MessageWriter.is(value.writer);\n }\n MessageTransports.is = is;\n})(MessageTransports || (exports.MessageTransports = MessageTransports = {}));\nclass BaseLanguageClient {\n constructor(id, name, clientOptions) {\n this._traceFormat = vscode_languageserver_protocol_1.TraceFormat.Text;\n this._diagnosticQueue = new Map();\n this._diagnosticQueueState = { state: 'idle' };\n this._features = [];\n this._dynamicFeatures = new Map();\n this.workspaceEditLock = new async_1.Semaphore(1);\n this._id = id;\n this._name = name;\n clientOptions = clientOptions || {};\n const markdown = { isTrusted: false, supportHtml: false };\n if (clientOptions.markdown !== undefined) {\n markdown.isTrusted = ResolvedClientOptions.sanitizeIsTrusted(clientOptions.markdown.isTrusted);\n markdown.supportHtml = clientOptions.markdown.supportHtml === true;\n }\n // const defaultInterval = (clientOptions as TestOptions).$testMode ? 50 : 60000;\n this._clientOptions = {\n documentSelector: clientOptions.documentSelector ?? [],\n synchronize: clientOptions.synchronize ?? {},\n diagnosticCollectionName: clientOptions.diagnosticCollectionName,\n outputChannelName: clientOptions.outputChannelName ?? this._name,\n revealOutputChannelOn: clientOptions.revealOutputChannelOn ?? RevealOutputChannelOn.Error,\n stdioEncoding: clientOptions.stdioEncoding ?? 'utf8',\n initializationOptions: clientOptions.initializationOptions,\n initializationFailedHandler: clientOptions.initializationFailedHandler,\n progressOnInitialization: !!clientOptions.progressOnInitialization,\n errorHandler: clientOptions.errorHandler ?? this.createDefaultErrorHandler(clientOptions.connectionOptions?.maxRestartCount),\n middleware: clientOptions.middleware ?? {},\n uriConverters: clientOptions.uriConverters,\n workspaceFolder: clientOptions.workspaceFolder,\n connectionOptions: clientOptions.connectionOptions,\n markdown,\n // suspend: {\n // \tmode: clientOptions.suspend?.mode ?? SuspendMode.off,\n // \tcallback: clientOptions.suspend?.callback ?? (() => Promise.resolve(true)),\n // \tinterval: clientOptions.suspend?.interval ? Math.max(clientOptions.suspend.interval, defaultInterval) : defaultInterval\n // },\n diagnosticPullOptions: clientOptions.diagnosticPullOptions ?? { onChange: true, onSave: false },\n notebookDocumentOptions: clientOptions.notebookDocumentOptions ?? {}\n };\n this._clientOptions.synchronize = this._clientOptions.synchronize || {};\n this._state = ClientState.Initial;\n this._ignoredRegistrations = new Set();\n this._listeners = [];\n this._notificationHandlers = new Map();\n this._pendingNotificationHandlers = new Map();\n this._notificationDisposables = new Map();\n this._requestHandlers = new Map();\n this._pendingRequestHandlers = new Map();\n this._requestDisposables = new Map();\n this._progressHandlers = new Map();\n this._pendingProgressHandlers = new Map();\n this._progressDisposables = new Map();\n this._connection = undefined;\n // this._idleStart = undefined;\n this._initializeResult = undefined;\n if (clientOptions.outputChannel) {\n this._outputChannel = clientOptions.outputChannel;\n this._disposeOutputChannel = false;\n }\n else {\n this._outputChannel = undefined;\n this._disposeOutputChannel = true;\n }\n this._traceOutputChannel = clientOptions.traceOutputChannel;\n this._diagnostics = undefined;\n this._pendingOpenNotifications = new Set();\n this._pendingChangeSemaphore = new async_1.Semaphore(1);\n this._pendingChangeDelayer = new async_1.Delayer(250);\n this._fileEvents = [];\n this._fileEventDelayer = new async_1.Delayer(250);\n this._onStop = undefined;\n this._telemetryEmitter = new vscode_languageserver_protocol_1.Emitter();\n this._stateChangeEmitter = new vscode_languageserver_protocol_1.Emitter();\n this._trace = vscode_languageserver_protocol_1.Trace.Off;\n this._tracer = {\n log: (messageOrDataObject, data) => {\n if (Is.string(messageOrDataObject)) {\n this.logTrace(messageOrDataObject, data);\n }\n else {\n this.logObjectTrace(messageOrDataObject);\n }\n },\n };\n this._c2p = c2p.createConverter(clientOptions.uriConverters ? clientOptions.uriConverters.code2Protocol : undefined);\n this._p2c = p2c.createConverter(clientOptions.uriConverters ? clientOptions.uriConverters.protocol2Code : undefined, this._clientOptions.markdown.isTrusted, this._clientOptions.markdown.supportHtml);\n this._syncedDocuments = new Map();\n this.registerBuiltinFeatures();\n }\n get name() {\n return this._name;\n }\n get middleware() {\n return this._clientOptions.middleware ?? Object.create(null);\n }\n get clientOptions() {\n return this._clientOptions;\n }\n get protocol2CodeConverter() {\n return this._p2c;\n }\n get code2ProtocolConverter() {\n return this._c2p;\n }\n get onTelemetry() {\n return this._telemetryEmitter.event;\n }\n get onDidChangeState() {\n return this._stateChangeEmitter.event;\n }\n get outputChannel() {\n if (!this._outputChannel) {\n this._outputChannel = vscode_1.window.createOutputChannel(this._clientOptions.outputChannelName ? this._clientOptions.outputChannelName : this._name);\n }\n return this._outputChannel;\n }\n get traceOutputChannel() {\n if (this._traceOutputChannel) {\n return this._traceOutputChannel;\n }\n return this.outputChannel;\n }\n get diagnostics() {\n return this._diagnostics;\n }\n get state() {\n return this.getPublicState();\n }\n get $state() {\n return this._state;\n }\n set $state(value) {\n let oldState = this.getPublicState();\n this._state = value;\n let newState = this.getPublicState();\n if (newState !== oldState) {\n this._stateChangeEmitter.fire({ oldState, newState });\n }\n }\n getPublicState() {\n switch (this.$state) {\n case ClientState.Starting:\n return State.Starting;\n case ClientState.Running:\n return State.Running;\n default:\n return State.Stopped;\n }\n }\n get initializeResult() {\n return this._initializeResult;\n }\n async sendRequest(type, ...params) {\n if (this.$state === ClientState.StartFailed || this.$state === ClientState.Stopping || this.$state === ClientState.Stopped) {\n return Promise.reject(new vscode_languageserver_protocol_1.ResponseError(vscode_languageserver_protocol_1.ErrorCodes.ConnectionInactive, `Client is not running`));\n }\n // Ensure we have a connection before we force the document sync.\n const connection = await this.$start();\n // If any document is synced in full mode make sure we flush any pending\n // full document syncs.\n if (this._didChangeTextDocumentFeature.syncKind === vscode_languageserver_protocol_1.TextDocumentSyncKind.Full) {\n await this.sendPendingFullTextDocumentChanges(connection);\n }\n const _sendRequest = this._clientOptions.middleware?.sendRequest;\n if (_sendRequest !== undefined) {\n let param = undefined;\n let token = undefined;\n // Separate cancellation tokens from other parameters for a better client interface\n if (params.length === 1) {\n // CancellationToken is an interface, so we need to check if the first param complies to it\n if (vscode_languageserver_protocol_1.CancellationToken.is(params[0])) {\n token = params[0];\n }\n else {\n param = params[0];\n }\n }\n else if (params.length === 2) {\n param = params[0];\n token = params[1];\n }\n // Return the general middleware invocation defining `next` as a utility function that reorganizes parameters to\n // pass them to the original sendRequest function.\n return _sendRequest(type, param, token, (type, param, token) => {\n const params = [];\n // Add the parameters if there are any\n if (param !== undefined) {\n params.push(param);\n }\n // Add the cancellation token if there is one\n if (token !== undefined) {\n params.push(token);\n }\n return connection.sendRequest(type, ...params);\n });\n }\n else {\n return connection.sendRequest(type, ...params);\n }\n }\n onRequest(type, handler) {\n const method = typeof type === 'string' ? type : type.method;\n this._requestHandlers.set(method, handler);\n const connection = this.activeConnection();\n let disposable;\n if (connection !== undefined) {\n this._requestDisposables.set(method, connection.onRequest(type, handler));\n disposable = {\n dispose: () => {\n const disposable = this._requestDisposables.get(method);\n if (disposable !== undefined) {\n disposable.dispose();\n this._requestDisposables.delete(method);\n }\n }\n };\n }\n else {\n this._pendingRequestHandlers.set(method, handler);\n disposable = {\n dispose: () => {\n this._pendingRequestHandlers.delete(method);\n const disposable = this._requestDisposables.get(method);\n if (disposable !== undefined) {\n disposable.dispose();\n this._requestDisposables.delete(method);\n }\n }\n };\n }\n return {\n dispose: () => {\n this._requestHandlers.delete(method);\n disposable.dispose();\n }\n };\n }\n async sendNotification(type, params) {\n if (this.$state === ClientState.StartFailed || this.$state === ClientState.Stopping || this.$state === ClientState.Stopped) {\n return Promise.reject(new vscode_languageserver_protocol_1.ResponseError(vscode_languageserver_protocol_1.ErrorCodes.ConnectionInactive, `Client is not running`));\n }\n const needsPendingFullTextDocumentSync = this._didChangeTextDocumentFeature.syncKind === vscode_languageserver_protocol_1.TextDocumentSyncKind.Full;\n let openNotification;\n if (needsPendingFullTextDocumentSync && typeof type !== 'string' && type.method === vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.method) {\n openNotification = params?.textDocument.uri;\n this._pendingOpenNotifications.add(openNotification);\n }\n // Ensure we have a connection before we force the document sync.\n const connection = await this.$start();\n // If any document is synced in full mode make sure we flush any pending\n // full document syncs.\n if (needsPendingFullTextDocumentSync) {\n await this.sendPendingFullTextDocumentChanges(connection);\n }\n // We need to remove the pending open notification before we actually\n // send the notification over the connection. Otherwise there could be\n // a request coming in that although the open notification got already put\n // onto the wire will ignore pending document changes.\n //\n // Since the code path of connection.sendNotification is actually sync\n // until the message is handed of to the writer and the writer as a semaphore\n // lock with a capacity of 1 no additional async scheduling can happen until\n // the message is actually handed of.\n if (openNotification !== undefined) {\n this._pendingOpenNotifications.delete(openNotification);\n }\n const _sendNotification = this._clientOptions.middleware?.sendNotification;\n return _sendNotification\n ? _sendNotification(type, connection.sendNotification.bind(connection), params)\n : connection.sendNotification(type, params);\n }\n onNotification(type, handler) {\n const method = typeof type === 'string' ? type : type.method;\n this._notificationHandlers.set(method, handler);\n const connection = this.activeConnection();\n let disposable;\n if (connection !== undefined) {\n this._notificationDisposables.set(method, connection.onNotification(type, handler));\n disposable = {\n dispose: () => {\n const disposable = this._notificationDisposables.get(method);\n if (disposable !== undefined) {\n disposable.dispose();\n this._notificationDisposables.delete(method);\n }\n }\n };\n }\n else {\n this._pendingNotificationHandlers.set(method, handler);\n disposable = {\n dispose: () => {\n this._pendingNotificationHandlers.delete(method);\n const disposable = this._notificationDisposables.get(method);\n if (disposable !== undefined) {\n disposable.dispose();\n this._notificationDisposables.delete(method);\n }\n }\n };\n }\n return {\n dispose: () => {\n this._notificationHandlers.delete(method);\n disposable.dispose();\n }\n };\n }\n async sendProgress(type, token, value) {\n if (this.$state === ClientState.StartFailed || this.$state === ClientState.Stopping || this.$state === ClientState.Stopped) {\n return Promise.reject(new vscode_languageserver_protocol_1.ResponseError(vscode_languageserver_protocol_1.ErrorCodes.ConnectionInactive, `Client is not running`));\n }\n try {\n // Ensure we have a connection before we force the document sync.\n const connection = await this.$start();\n return connection.sendProgress(type, token, value);\n }\n catch (error) {\n this.error(`Sending progress for token ${token} failed.`, error);\n throw error;\n }\n }\n onProgress(type, token, handler) {\n this._progressHandlers.set(token, { type, handler });\n const connection = this.activeConnection();\n let disposable;\n const handleWorkDoneProgress = this._clientOptions.middleware?.handleWorkDoneProgress;\n const realHandler = vscode_languageserver_protocol_1.WorkDoneProgress.is(type) && handleWorkDoneProgress !== undefined\n ? (params) => {\n handleWorkDoneProgress(token, params, () => handler(params));\n }\n : handler;\n if (connection !== undefined) {\n this._progressDisposables.set(token, connection.onProgress(type, token, realHandler));\n disposable = {\n dispose: () => {\n const disposable = this._progressDisposables.get(token);\n if (disposable !== undefined) {\n disposable.dispose();\n this._progressDisposables.delete(token);\n }\n }\n };\n }\n else {\n this._pendingProgressHandlers.set(token, { type, handler });\n disposable = {\n dispose: () => {\n this._pendingProgressHandlers.delete(token);\n const disposable = this._progressDisposables.get(token);\n if (disposable !== undefined) {\n disposable.dispose();\n this._progressDisposables.delete(token);\n }\n }\n };\n }\n return {\n dispose: () => {\n this._progressHandlers.delete(token);\n disposable.dispose();\n }\n };\n }\n createDefaultErrorHandler(maxRestartCount) {\n if (maxRestartCount !== undefined && maxRestartCount < 0) {\n throw new Error(`Invalid maxRestartCount: ${maxRestartCount}`);\n }\n return new DefaultErrorHandler(this, maxRestartCount ?? 4);\n }\n async setTrace(value) {\n this._trace = value;\n const connection = this.activeConnection();\n if (connection !== undefined) {\n await connection.trace(this._trace, this._tracer, {\n sendNotification: false,\n traceFormat: this._traceFormat\n });\n }\n }\n data2String(data) {\n if (data instanceof vscode_languageserver_protocol_1.ResponseError) {\n const responseError = data;\n return ` Message: ${responseError.message}\\n Code: ${responseError.code} ${responseError.data ? '\\n' + responseError.data.toString() : ''}`;\n }\n if (data instanceof Error) {\n if (Is.string(data.stack)) {\n return data.stack;\n }\n return data.message;\n }\n if (Is.string(data)) {\n return data;\n }\n return data.toString();\n }\n debug(message, data, showNotification = true) {\n this.logOutputMessage(vscode_languageserver_protocol_1.MessageType.Debug, RevealOutputChannelOn.Debug, 'Debug', message, data, showNotification);\n }\n info(message, data, showNotification = true) {\n this.logOutputMessage(vscode_languageserver_protocol_1.MessageType.Info, RevealOutputChannelOn.Info, 'Info', message, data, showNotification);\n }\n warn(message, data, showNotification = true) {\n this.logOutputMessage(vscode_languageserver_protocol_1.MessageType.Warning, RevealOutputChannelOn.Warn, 'Warn', message, data, showNotification);\n }\n error(message, data, showNotification = true) {\n this.logOutputMessage(vscode_languageserver_protocol_1.MessageType.Error, RevealOutputChannelOn.Error, 'Error', message, data, showNotification);\n }\n logOutputMessage(type, reveal, name, message, data, showNotification) {\n this.outputChannel.appendLine(`[${name.padEnd(5)} - ${(new Date().toLocaleTimeString())}] ${message}`);\n if (data !== null && data !== undefined) {\n this.outputChannel.appendLine(this.data2String(data));\n }\n if (showNotification === 'force' || (showNotification && this._clientOptions.revealOutputChannelOn <= reveal)) {\n this.showNotificationMessage(type, message);\n }\n }\n showNotificationMessage(type, message) {\n message = message ?? 'A request has failed. See the output for more information.';\n const messageFunc = type === vscode_languageserver_protocol_1.MessageType.Error\n ? vscode_1.window.showErrorMessage\n : type === vscode_languageserver_protocol_1.MessageType.Warning\n ? vscode_1.window.showWarningMessage\n : vscode_1.window.showInformationMessage;\n void messageFunc(message, 'Go to output').then((selection) => {\n if (selection !== undefined) {\n this.outputChannel.show(true);\n }\n });\n }\n logTrace(message, data) {\n this.traceOutputChannel.appendLine(`[Trace - ${(new Date().toLocaleTimeString())}] ${message}`);\n if (data) {\n this.traceOutputChannel.appendLine(this.data2String(data));\n }\n }\n logObjectTrace(data) {\n if (data.isLSPMessage && data.type) {\n this.traceOutputChannel.append(`[LSP - ${(new Date().toLocaleTimeString())}] `);\n }\n else {\n this.traceOutputChannel.append(`[Trace - ${(new Date().toLocaleTimeString())}] `);\n }\n if (data) {\n this.traceOutputChannel.appendLine(`${JSON.stringify(data)}`);\n }\n }\n needsStart() {\n return this.$state === ClientState.Initial || this.$state === ClientState.Stopping || this.$state === ClientState.Stopped;\n }\n needsStop() {\n return this.$state === ClientState.Starting || this.$state === ClientState.Running;\n }\n activeConnection() {\n return this.$state === ClientState.Running && this._connection !== undefined ? this._connection : undefined;\n }\n isRunning() {\n return this.$state === ClientState.Running;\n }\n async start() {\n if (this._disposed === 'disposing' || this._disposed === 'disposed') {\n throw new Error(`Client got disposed and can't be restarted.`);\n }\n if (this.$state === ClientState.Stopping) {\n throw new Error(`Client is currently stopping. Can only restart a full stopped client`);\n }\n // We are already running or are in the process of getting up\n // to speed.\n if (this._onStart !== undefined) {\n return this._onStart;\n }\n const [promise, resolve, reject] = this.createOnStartPromise();\n this._onStart = promise;\n // If we restart then the diagnostics collection is reused.\n if (this._diagnostics === undefined) {\n this._diagnostics = this._clientOptions.diagnosticCollectionName\n ? vscode_1.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName)\n : vscode_1.languages.createDiagnosticCollection();\n }\n // When we start make all buffer handlers pending so that they\n // get added.\n for (const [method, handler] of this._notificationHandlers) {\n if (!this._pendingNotificationHandlers.has(method)) {\n this._pendingNotificationHandlers.set(method, handler);\n }\n }\n for (const [method, handler] of this._requestHandlers) {\n if (!this._pendingRequestHandlers.has(method)) {\n this._pendingRequestHandlers.set(method, handler);\n }\n }\n for (const [token, data] of this._progressHandlers) {\n if (!this._pendingProgressHandlers.has(token)) {\n this._pendingProgressHandlers.set(token, data);\n }\n }\n this.$state = ClientState.Starting;\n try {\n const connection = await this.createConnection();\n connection.onNotification(vscode_languageserver_protocol_1.LogMessageNotification.type, (message) => {\n switch (message.type) {\n case vscode_languageserver_protocol_1.MessageType.Error:\n this.error(message.message, undefined, false);\n break;\n case vscode_languageserver_protocol_1.MessageType.Warning:\n this.warn(message.message, undefined, false);\n break;\n case vscode_languageserver_protocol_1.MessageType.Info:\n this.info(message.message, undefined, false);\n break;\n case vscode_languageserver_protocol_1.MessageType.Debug:\n this.debug(message.message, undefined, false);\n break;\n default:\n this.outputChannel.appendLine(message.message);\n }\n });\n connection.onNotification(vscode_languageserver_protocol_1.ShowMessageNotification.type, (message) => {\n switch (message.type) {\n case vscode_languageserver_protocol_1.MessageType.Error:\n void vscode_1.window.showErrorMessage(message.message);\n break;\n case vscode_languageserver_protocol_1.MessageType.Warning:\n void vscode_1.window.showWarningMessage(message.message);\n break;\n case vscode_languageserver_protocol_1.MessageType.Info:\n void vscode_1.window.showInformationMessage(message.message);\n break;\n default:\n void vscode_1.window.showInformationMessage(message.message);\n }\n });\n connection.onRequest(vscode_languageserver_protocol_1.ShowMessageRequest.type, (params) => {\n let messageFunc;\n switch (params.type) {\n case vscode_languageserver_protocol_1.MessageType.Error:\n messageFunc = vscode_1.window.showErrorMessage;\n break;\n case vscode_languageserver_protocol_1.MessageType.Warning:\n messageFunc = vscode_1.window.showWarningMessage;\n break;\n case vscode_languageserver_protocol_1.MessageType.Info:\n messageFunc = vscode_1.window.showInformationMessage;\n break;\n default:\n messageFunc = vscode_1.window.showInformationMessage;\n }\n let actions = params.actions || [];\n return messageFunc(params.message, ...actions);\n });\n connection.onNotification(vscode_languageserver_protocol_1.TelemetryEventNotification.type, (data) => {\n this._telemetryEmitter.fire(data);\n });\n connection.onRequest(vscode_languageserver_protocol_1.ShowDocumentRequest.type, async (params) => {\n const showDocument = async (params) => {\n const uri = this.protocol2CodeConverter.asUri(params.uri);\n try {\n if (params.external === true) {\n const success = await vscode_1.env.openExternal(uri);\n return { success };\n }\n else {\n const options = {};\n if (params.selection !== undefined) {\n options.selection = this.protocol2CodeConverter.asRange(params.selection);\n }\n if (params.takeFocus === undefined || params.takeFocus === false) {\n options.preserveFocus = true;\n }\n else if (params.takeFocus === true) {\n options.preserveFocus = false;\n }\n await vscode_1.window.showTextDocument(uri, options);\n return { success: true };\n }\n }\n catch (error) {\n return { success: false };\n }\n };\n const middleware = this._clientOptions.middleware.window?.showDocument;\n if (middleware !== undefined) {\n return middleware(params, showDocument);\n }\n else {\n return showDocument(params);\n }\n });\n connection.listen();\n await this.initialize(connection);\n resolve();\n }\n catch (error) {\n this.$state = ClientState.StartFailed;\n this.error(`${this._name} client: couldn't create connection to server.`, error, 'force');\n reject(error);\n }\n return this._onStart;\n }\n createOnStartPromise() {\n let resolve;\n let reject;\n const promise = new Promise((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n return [promise, resolve, reject];\n }\n async initialize(connection) {\n this.refreshTrace(connection, false);\n const initOption = this._clientOptions.initializationOptions;\n // If the client is locked to a workspace folder use it. In this case the workspace folder\n // feature is not registered and we need to initialize the value here.\n const [rootPath, workspaceFolders] = this._clientOptions.workspaceFolder !== undefined\n ? [this._clientOptions.workspaceFolder.uri.fsPath, [{ uri: this._c2p.asUri(this._clientOptions.workspaceFolder.uri), name: this._clientOptions.workspaceFolder.name }]]\n : [this._clientGetRootPath(), null];\n const initParams = {\n processId: null,\n clientInfo: {\n name: vscode_1.env.appName,\n version: vscode_1.version\n },\n locale: this.getLocale(),\n rootPath: rootPath ? rootPath : null,\n rootUri: rootPath ? this._c2p.asUri(vscode_1.Uri.file(rootPath)) : null,\n capabilities: this.computeClientCapabilities(),\n initializationOptions: Is.func(initOption) ? initOption() : initOption,\n trace: vscode_languageserver_protocol_1.Trace.toString(this._trace),\n workspaceFolders: workspaceFolders\n };\n this.fillInitializeParams(initParams);\n if (this._clientOptions.progressOnInitialization) {\n const token = UUID.generateUuid();\n const part = new progressPart_1.ProgressPart(connection, token);\n initParams.workDoneToken = token;\n try {\n const result = await this.doInitialize(connection, initParams);\n part.done();\n return result;\n }\n catch (error) {\n part.cancel();\n throw error;\n }\n }\n else {\n return this.doInitialize(connection, initParams);\n }\n }\n async doInitialize(connection, initParams) {\n try {\n const result = await connection.initialize(initParams);\n if (result.capabilities.positionEncoding !== undefined && result.capabilities.positionEncoding !== vscode_languageserver_protocol_1.PositionEncodingKind.UTF16) {\n throw new Error(`Unsupported position encoding (${result.capabilities.positionEncoding}) received from server ${this.name}`);\n }\n this._initializeResult = result;\n this.$state = ClientState.Running;\n let textDocumentSyncOptions = undefined;\n if (Is.number(result.capabilities.textDocumentSync)) {\n if (result.capabilities.textDocumentSync === vscode_languageserver_protocol_1.TextDocumentSyncKind.None) {\n textDocumentSyncOptions = {\n openClose: false,\n change: vscode_languageserver_protocol_1.TextDocumentSyncKind.None,\n save: undefined\n };\n }\n else {\n textDocumentSyncOptions = {\n openClose: true,\n change: result.capabilities.textDocumentSync,\n save: {\n includeText: false\n }\n };\n }\n }\n else if (result.capabilities.textDocumentSync !== undefined && result.capabilities.textDocumentSync !== null) {\n textDocumentSyncOptions = result.capabilities.textDocumentSync;\n }\n this._capabilities = Object.assign({}, result.capabilities, { resolvedTextDocumentSync: textDocumentSyncOptions });\n connection.onNotification(vscode_languageserver_protocol_1.PublishDiagnosticsNotification.type, params => this.handleDiagnostics(params));\n connection.onRequest(vscode_languageserver_protocol_1.RegistrationRequest.type, params => this.handleRegistrationRequest(params));\n // See https://github.com/Microsoft/vscode-languageserver-node/issues/199\n connection.onRequest('client/registerFeature', params => this.handleRegistrationRequest(params));\n connection.onRequest(vscode_languageserver_protocol_1.UnregistrationRequest.type, params => this.handleUnregistrationRequest(params));\n // See https://github.com/Microsoft/vscode-languageserver-node/issues/199\n connection.onRequest('client/unregisterFeature', params => this.handleUnregistrationRequest(params));\n connection.onRequest(vscode_languageserver_protocol_1.ApplyWorkspaceEditRequest.type, params => this.handleApplyWorkspaceEdit(params));\n // Add pending notification, request and progress handlers.\n for (const [method, handler] of this._pendingNotificationHandlers) {\n this._notificationDisposables.set(method, connection.onNotification(method, handler));\n }\n this._pendingNotificationHandlers.clear();\n for (const [method, handler] of this._pendingRequestHandlers) {\n this._requestDisposables.set(method, connection.onRequest(method, handler));\n }\n this._pendingRequestHandlers.clear();\n for (const [token, data] of this._pendingProgressHandlers) {\n this._progressDisposables.set(token, connection.onProgress(data.type, token, data.handler));\n }\n this._pendingProgressHandlers.clear();\n // if (this._clientOptions.suspend.mode !== SuspendMode.off) {\n // \tthis._idleInterval = RAL().timer.setInterval(() => this.checkSuspend(), this._clientOptions.suspend.interval);\n // }\n await connection.sendNotification(vscode_languageserver_protocol_1.InitializedNotification.type, {});\n this.hookFileEvents(connection);\n this.hookConfigurationChanged(connection);\n this.initializeFeatures(connection);\n return result;\n }\n catch (error) {\n if (this._clientOptions.initializationFailedHandler) {\n if (this._clientOptions.initializationFailedHandler(error)) {\n void this.initialize(connection);\n }\n else {\n void this.stop();\n }\n }\n else if (error instanceof vscode_languageserver_protocol_1.ResponseError && error.data && error.data.retry) {\n void vscode_1.window.showErrorMessage(error.message, { title: 'Retry', id: 'retry' }).then(item => {\n if (item && item.id === 'retry') {\n void this.initialize(connection);\n }\n else {\n void this.stop();\n }\n });\n }\n else {\n if (error && error.message) {\n void vscode_1.window.showErrorMessage(error.message);\n }\n this.error('Server initialization failed.', error);\n void this.stop();\n }\n throw error;\n }\n }\n _clientGetRootPath() {\n let folders = vscode_1.workspace.workspaceFolders;\n if (!folders || folders.length === 0) {\n return undefined;\n }\n let folder = folders[0];\n if (folder.uri.scheme === 'file') {\n return folder.uri.fsPath;\n }\n return undefined;\n }\n stop(timeout = 2000) {\n // Wait 2 seconds on stop\n return this.shutdown('stop', timeout);\n }\n dispose(timeout = 2000) {\n try {\n this._disposed = 'disposing';\n return this.stop(timeout);\n }\n finally {\n this._disposed = 'disposed';\n }\n }\n async shutdown(mode, timeout) {\n // If the client is stopped or in its initial state return.\n if (this.$state === ClientState.Stopped || this.$state === ClientState.Initial) {\n return;\n }\n // If we are stopping the client and have a stop promise return it.\n if (this.$state === ClientState.Stopping) {\n if (this._onStop !== undefined) {\n return this._onStop;\n }\n else {\n throw new Error(`Client is stopping but no stop promise available.`);\n }\n }\n const connection = this.activeConnection();\n // We can't stop a client that is not running (e.g. has no connection). Especially not\n // on that us starting since it can't be correctly synchronized.\n if (connection === undefined || this.$state !== ClientState.Running) {\n throw new Error(`Client is not running and can't be stopped. It's current state is: ${this.$state}`);\n }\n this._initializeResult = undefined;\n this.$state = ClientState.Stopping;\n this.cleanUp(mode);\n const tp = new Promise(c => { (0, vscode_languageserver_protocol_1.RAL)().timer.setTimeout(c, timeout); });\n const shutdown = (async (connection) => {\n await connection.shutdown();\n await connection.exit();\n return connection;\n })(connection);\n return this._onStop = Promise.race([tp, shutdown]).then((connection) => {\n // The connection won the race with the timeout.\n if (connection !== undefined) {\n connection.end();\n connection.dispose();\n }\n else {\n this.error(`Stopping server timed out`, undefined, false);\n throw new Error(`Stopping the server timed out`);\n }\n }, (error) => {\n this.error(`Stopping server failed`, error, false);\n throw error;\n }).finally(() => {\n this.$state = ClientState.Stopped;\n mode === 'stop' && this.cleanUpChannel();\n this._onStart = undefined;\n this._onStop = undefined;\n this._connection = undefined;\n this._ignoredRegistrations.clear();\n });\n }\n cleanUp(mode) {\n // purge outstanding file events.\n this._fileEvents = [];\n this._fileEventDelayer.cancel();\n const disposables = this._listeners.splice(0, this._listeners.length);\n for (const disposable of disposables) {\n disposable.dispose();\n }\n if (this._syncedDocuments) {\n this._syncedDocuments.clear();\n }\n // Clear features in reverse order;\n for (const feature of Array.from(this._features.entries()).map(entry => entry[1]).reverse()) {\n feature.clear();\n }\n if (mode === 'stop' && this._diagnostics !== undefined) {\n this._diagnostics.dispose();\n this._diagnostics = undefined;\n }\n if (this._idleInterval !== undefined) {\n this._idleInterval.dispose();\n this._idleInterval = undefined;\n }\n // this._idleStart = undefined;\n }\n cleanUpChannel() {\n if (this._outputChannel !== undefined && this._disposeOutputChannel) {\n this._outputChannel.dispose();\n this._outputChannel = undefined;\n }\n }\n notifyFileEvent(event) {\n const client = this;\n async function didChangeWatchedFile(event) {\n client._fileEvents.push(event);\n return client._fileEventDelayer.trigger(async () => {\n await client.sendNotification(vscode_languageserver_protocol_1.DidChangeWatchedFilesNotification.type, { changes: client._fileEvents });\n client._fileEvents = [];\n });\n }\n const workSpaceMiddleware = this.clientOptions.middleware?.workspace;\n (workSpaceMiddleware?.didChangeWatchedFile ? workSpaceMiddleware.didChangeWatchedFile(event, didChangeWatchedFile) : didChangeWatchedFile(event)).catch((error) => {\n client.error(`Notify file events failed.`, error);\n });\n }\n async sendPendingFullTextDocumentChanges(connection) {\n return this._pendingChangeSemaphore.lock(async () => {\n try {\n const changes = this._didChangeTextDocumentFeature.getPendingDocumentChanges(this._pendingOpenNotifications);\n if (changes.length === 0) {\n return;\n }\n for (const document of changes) {\n const params = this.code2ProtocolConverter.asChangeTextDocumentParams(document);\n // We await the send and not the delivery since it is more or less the same for\n // notifications.\n await connection.sendNotification(vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type, params);\n this._didChangeTextDocumentFeature.notificationSent(document, vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type, params);\n }\n }\n catch (error) {\n this.error(`Sending pending changes failed`, error, false);\n throw error;\n }\n });\n }\n triggerPendingChangeDelivery() {\n this._pendingChangeDelayer.trigger(async () => {\n const connection = this.activeConnection();\n if (connection === undefined) {\n this.triggerPendingChangeDelivery();\n return;\n }\n await this.sendPendingFullTextDocumentChanges(connection);\n }).catch((error) => this.error(`Delivering pending changes failed`, error, false));\n }\n handleDiagnostics(params) {\n if (!this._diagnostics) {\n return;\n }\n const key = params.uri;\n if (this._diagnosticQueueState.state === 'busy' && this._diagnosticQueueState.document === key) {\n // Cancel the active run;\n this._diagnosticQueueState.tokenSource.cancel();\n }\n this._diagnosticQueue.set(params.uri, params.diagnostics);\n this.triggerDiagnosticQueue();\n }\n triggerDiagnosticQueue() {\n (0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => { this.workDiagnosticQueue(); });\n }\n workDiagnosticQueue() {\n if (this._diagnosticQueueState.state === 'busy') {\n return;\n }\n const next = this._diagnosticQueue.entries().next();\n if (next.done === true) {\n // Nothing in the queue\n return;\n }\n const [document, diagnostics] = next.value;\n this._diagnosticQueue.delete(document);\n const tokenSource = new vscode_1.CancellationTokenSource();\n this._diagnosticQueueState = { state: 'busy', document: document, tokenSource };\n this._p2c.asDiagnostics(diagnostics, tokenSource.token).then((converted) => {\n if (!tokenSource.token.isCancellationRequested) {\n const uri = this._p2c.asUri(document);\n const middleware = this.clientOptions.middleware;\n if (middleware.handleDiagnostics) {\n middleware.handleDiagnostics(uri, converted, (uri, diagnostics) => this.setDiagnostics(uri, diagnostics));\n }\n else {\n this.setDiagnostics(uri, converted);\n }\n }\n }).finally(() => {\n this._diagnosticQueueState = { state: 'idle' };\n this.triggerDiagnosticQueue();\n });\n }\n setDiagnostics(uri, diagnostics) {\n if (!this._diagnostics) {\n return;\n }\n this._diagnostics.set(uri, diagnostics);\n }\n getLocale() {\n return vscode_1.env.language;\n }\n async $start() {\n if (this.$state === ClientState.StartFailed) {\n throw new Error(`Previous start failed. Can't restart server.`);\n }\n await this.start();\n const connection = this.activeConnection();\n if (connection === undefined) {\n throw new Error(`Starting server failed`);\n }\n return connection;\n }\n async createConnection() {\n let errorHandler = (error, message, count) => {\n this.handleConnectionError(error, message, count).catch((error) => this.error(`Handling connection error failed`, error));\n };\n let closeHandler = () => {\n this.handleConnectionClosed().catch((error) => this.error(`Handling connection close failed`, error));\n };\n const transports = await this.createMessageTransports(this._clientOptions.stdioEncoding || 'utf8');\n this._connection = createConnection(transports.reader, transports.writer, errorHandler, closeHandler, this._clientOptions.connectionOptions);\n return this._connection;\n }\n async handleConnectionClosed() {\n // Check whether this is a normal shutdown in progress or the client stopped normally.\n if (this.$state === ClientState.Stopped) {\n return;\n }\n try {\n if (this._connection !== undefined) {\n this._connection.dispose();\n }\n }\n catch (error) {\n // Disposing a connection could fail if error cases.\n }\n let handlerResult = { action: CloseAction.DoNotRestart };\n if (this.$state !== ClientState.Stopping) {\n try {\n handlerResult = await this._clientOptions.errorHandler.closed();\n }\n catch (error) {\n // Ignore errors coming from the error handler.\n }\n }\n this._connection = undefined;\n if (handlerResult.action === CloseAction.DoNotRestart) {\n this.error(handlerResult.message ?? 'Connection to server got closed. Server will not be restarted.', undefined, handlerResult.handled === true ? false : 'force');\n this.cleanUp('stop');\n if (this.$state === ClientState.Starting) {\n this.$state = ClientState.StartFailed;\n }\n else {\n this.$state = ClientState.Stopped;\n }\n this._onStop = Promise.resolve();\n this._onStart = undefined;\n }\n else if (handlerResult.action === CloseAction.Restart) {\n this.info(handlerResult.message ?? 'Connection to server got closed. Server will restart.', !handlerResult.handled);\n this.cleanUp('restart');\n this.$state = ClientState.Initial;\n this._onStop = Promise.resolve();\n this._onStart = undefined;\n this.start().catch((error) => this.error(`Restarting server failed`, error, 'force'));\n }\n }\n async handleConnectionError(error, message, count) {\n const handlerResult = await this._clientOptions.errorHandler.error(error, message, count);\n if (handlerResult.action === ErrorAction.Shutdown) {\n this.error(handlerResult.message ?? `Client ${this._name}: connection to server is erroring.\\n${error.message}\\nShutting down server.`, undefined, handlerResult.handled === true ? false : 'force');\n this.stop().catch((error) => {\n this.error(`Stopping server failed`, error, false);\n });\n }\n else {\n this.error(handlerResult.message ??\n `Client ${this._name}: connection to server is erroring.\\n${error.message}`, undefined, handlerResult.handled === true ? false : 'force');\n }\n }\n hookConfigurationChanged(connection) {\n this._listeners.push(vscode_1.workspace.onDidChangeConfiguration(() => {\n this.refreshTrace(connection, true);\n }));\n }\n refreshTrace(connection, sendNotification = false) {\n const config = vscode_1.workspace.getConfiguration(this._id);\n let trace = vscode_languageserver_protocol_1.Trace.Off;\n let traceFormat = vscode_languageserver_protocol_1.TraceFormat.Text;\n if (config) {\n const traceConfig = config.get('trace.server', 'off');\n if (typeof traceConfig === 'string') {\n trace = vscode_languageserver_protocol_1.Trace.fromString(traceConfig);\n }\n else {\n trace = vscode_languageserver_protocol_1.Trace.fromString(config.get('trace.server.verbosity', 'off'));\n traceFormat = vscode_languageserver_protocol_1.TraceFormat.fromString(config.get('trace.server.format', 'text'));\n }\n }\n this._trace = trace;\n this._traceFormat = traceFormat;\n connection.trace(this._trace, this._tracer, {\n sendNotification,\n traceFormat: this._traceFormat\n }).catch((error) => { this.error(`Updating trace failed with error`, error, false); });\n }\n hookFileEvents(_connection) {\n let fileEvents = this._clientOptions.synchronize.fileEvents;\n if (!fileEvents) {\n return;\n }\n let watchers;\n if (Is.array(fileEvents)) {\n watchers = fileEvents;\n }\n else {\n watchers = [fileEvents];\n }\n if (!watchers) {\n return;\n }\n this._dynamicFeatures.get(vscode_languageserver_protocol_1.DidChangeWatchedFilesNotification.type.method).registerRaw(UUID.generateUuid(), watchers);\n }\n registerFeatures(features) {\n for (let feature of features) {\n this.registerFeature(feature);\n }\n }\n registerFeature(feature) {\n this._features.push(feature);\n if (features_1.DynamicFeature.is(feature)) {\n const registrationType = feature.registrationType;\n this._dynamicFeatures.set(registrationType.method, feature);\n }\n }\n getFeature(request) {\n return this._dynamicFeatures.get(request);\n }\n hasDedicatedTextSynchronizationFeature(textDocument) {\n const feature = this.getFeature(vscode_languageserver_protocol_1.NotebookDocumentSyncRegistrationType.method);\n if (feature === undefined || !(feature instanceof notebook_1.NotebookDocumentSyncFeature)) {\n return false;\n }\n return feature.handles(textDocument);\n }\n registerBuiltinFeatures() {\n const pendingFullTextDocumentChanges = new Map();\n this.registerFeature(new configuration_1.ConfigurationFeature(this));\n this.registerFeature(new textSynchronization_1.DidOpenTextDocumentFeature(this, this._syncedDocuments));\n this._didChangeTextDocumentFeature = new textSynchronization_1.DidChangeTextDocumentFeature(this, pendingFullTextDocumentChanges);\n this._didChangeTextDocumentFeature.onPendingChangeAdded(() => {\n this.triggerPendingChangeDelivery();\n });\n this.registerFeature(this._didChangeTextDocumentFeature);\n this.registerFeature(new textSynchronization_1.WillSaveFeature(this));\n this.registerFeature(new textSynchronization_1.WillSaveWaitUntilFeature(this));\n this.registerFeature(new textSynchronization_1.DidSaveTextDocumentFeature(this));\n this.registerFeature(new textSynchronization_1.DidCloseTextDocumentFeature(this, this._syncedDocuments, pendingFullTextDocumentChanges));\n this.registerFeature(new fileSystemWatcher_1.FileSystemWatcherFeature(this, (event) => this.notifyFileEvent(event)));\n this.registerFeature(new completion_1.CompletionItemFeature(this));\n this.registerFeature(new hover_1.HoverFeature(this));\n this.registerFeature(new signatureHelp_1.SignatureHelpFeature(this));\n this.registerFeature(new definition_1.DefinitionFeature(this));\n this.registerFeature(new reference_1.ReferencesFeature(this));\n this.registerFeature(new documentHighlight_1.DocumentHighlightFeature(this));\n this.registerFeature(new documentSymbol_1.DocumentSymbolFeature(this));\n this.registerFeature(new workspaceSymbol_1.WorkspaceSymbolFeature(this));\n this.registerFeature(new codeAction_1.CodeActionFeature(this));\n this.registerFeature(new codeLens_1.CodeLensFeature(this));\n this.registerFeature(new formatting_1.DocumentFormattingFeature(this));\n this.registerFeature(new formatting_1.DocumentRangeFormattingFeature(this));\n this.registerFeature(new formatting_1.DocumentOnTypeFormattingFeature(this));\n this.registerFeature(new rename_1.RenameFeature(this));\n this.registerFeature(new documentLink_1.DocumentLinkFeature(this));\n this.registerFeature(new executeCommand_1.ExecuteCommandFeature(this));\n this.registerFeature(new configuration_1.SyncConfigurationFeature(this));\n this.registerFeature(new typeDefinition_1.TypeDefinitionFeature(this));\n this.registerFeature(new implementation_1.ImplementationFeature(this));\n this.registerFeature(new colorProvider_1.ColorProviderFeature(this));\n // We only register the workspace folder feature if the client is not locked\n // to a specific workspace folder.\n if (this.clientOptions.workspaceFolder === undefined) {\n this.registerFeature(new workspaceFolder_1.WorkspaceFoldersFeature(this));\n }\n this.registerFeature(new foldingRange_1.FoldingRangeFeature(this));\n this.registerFeature(new declaration_1.DeclarationFeature(this));\n this.registerFeature(new selectionRange_1.SelectionRangeFeature(this));\n this.registerFeature(new progress_1.ProgressFeature(this));\n this.registerFeature(new callHierarchy_1.CallHierarchyFeature(this));\n this.registerFeature(new semanticTokens_1.SemanticTokensFeature(this));\n this.registerFeature(new linkedEditingRange_1.LinkedEditingFeature(this));\n this.registerFeature(new fileOperations_1.DidCreateFilesFeature(this));\n this.registerFeature(new fileOperations_1.DidRenameFilesFeature(this));\n this.registerFeature(new fileOperations_1.DidDeleteFilesFeature(this));\n this.registerFeature(new fileOperations_1.WillCreateFilesFeature(this));\n this.registerFeature(new fileOperations_1.WillRenameFilesFeature(this));\n this.registerFeature(new fileOperations_1.WillDeleteFilesFeature(this));\n this.registerFeature(new typeHierarchy_1.TypeHierarchyFeature(this));\n this.registerFeature(new inlineValue_1.InlineValueFeature(this));\n this.registerFeature(new inlayHint_1.InlayHintsFeature(this));\n this.registerFeature(new diagnostic_1.DiagnosticFeature(this));\n this.registerFeature(new notebook_1.NotebookDocumentSyncFeature(this));\n }\n registerProposedFeatures() {\n this.registerFeatures(ProposedFeatures.createAll(this));\n }\n fillInitializeParams(params) {\n for (let feature of this._features) {\n if (Is.func(feature.fillInitializeParams)) {\n feature.fillInitializeParams(params);\n }\n }\n }\n computeClientCapabilities() {\n const result = {};\n (0, features_1.ensure)(result, 'workspace').applyEdit = true;\n const workspaceEdit = (0, features_1.ensure)((0, features_1.ensure)(result, 'workspace'), 'workspaceEdit');\n workspaceEdit.documentChanges = true;\n workspaceEdit.resourceOperations = [vscode_languageserver_protocol_1.ResourceOperationKind.Create, vscode_languageserver_protocol_1.ResourceOperationKind.Rename, vscode_languageserver_protocol_1.ResourceOperationKind.Delete];\n workspaceEdit.failureHandling = vscode_languageserver_protocol_1.FailureHandlingKind.TextOnlyTransactional;\n workspaceEdit.normalizesLineEndings = true;\n workspaceEdit.changeAnnotationSupport = {\n groupsOnLabel: true\n };\n const diagnostics = (0, features_1.ensure)((0, features_1.ensure)(result, 'textDocument'), 'publishDiagnostics');\n diagnostics.relatedInformation = true;\n diagnostics.versionSupport = false;\n diagnostics.tagSupport = { valueSet: [vscode_languageserver_protocol_1.DiagnosticTag.Unnecessary, vscode_languageserver_protocol_1.DiagnosticTag.Deprecated] };\n diagnostics.codeDescriptionSupport = true;\n diagnostics.dataSupport = true;\n const windowCapabilities = (0, features_1.ensure)(result, 'window');\n const showMessage = (0, features_1.ensure)(windowCapabilities, 'showMessage');\n showMessage.messageActionItem = { additionalPropertiesSupport: true };\n const showDocument = (0, features_1.ensure)(windowCapabilities, 'showDocument');\n showDocument.support = true;\n const generalCapabilities = (0, features_1.ensure)(result, 'general');\n generalCapabilities.staleRequestSupport = {\n cancel: true,\n retryOnContentModified: Array.from(BaseLanguageClient.RequestsToCancelOnContentModified)\n };\n generalCapabilities.regularExpressions = { engine: 'ECMAScript', version: 'ES2020' };\n generalCapabilities.markdown = {\n parser: 'marked',\n version: '1.1.0',\n };\n generalCapabilities.positionEncodings = ['utf-16'];\n if (this._clientOptions.markdown.supportHtml) {\n generalCapabilities.markdown.allowedTags = ['ul', 'li', 'p', 'code', 'blockquote', 'ol', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'em', 'pre', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'div', 'del', 'a', 'strong', 'br', 'img', 'span'];\n }\n for (let feature of this._features) {\n feature.fillClientCapabilities(result);\n }\n return result;\n }\n initializeFeatures(_connection) {\n const documentSelector = this._clientOptions.documentSelector;\n for (const feature of this._features) {\n if (Is.func(feature.preInitialize)) {\n feature.preInitialize(this._capabilities, documentSelector);\n }\n }\n for (const feature of this._features) {\n feature.initialize(this._capabilities, documentSelector);\n }\n }\n async handleRegistrationRequest(params) {\n const middleware = this.clientOptions.middleware?.handleRegisterCapability;\n if (middleware) {\n return middleware(params, nextParams => this.doRegisterCapability(nextParams));\n }\n else {\n return this.doRegisterCapability(params);\n }\n }\n async doRegisterCapability(params) {\n // We will not receive a registration call before a client is running\n // from a server. However if we stop or shutdown we might which might\n // try to restart the server. So ignore registrations if we are not running\n if (!this.isRunning()) {\n for (const registration of params.registrations) {\n this._ignoredRegistrations.add(registration.id);\n }\n return;\n }\n for (const registration of params.registrations) {\n const feature = this._dynamicFeatures.get(registration.method);\n if (feature === undefined) {\n return Promise.reject(new Error(`No feature implementation for ${registration.method} found. Registration failed.`));\n }\n const options = registration.registerOptions ?? {};\n options.documentSelector = options.documentSelector ?? this._clientOptions.documentSelector;\n const data = {\n id: registration.id,\n registerOptions: options\n };\n try {\n feature.register(data);\n }\n catch (err) {\n return Promise.reject(err);\n }\n }\n }\n async handleUnregistrationRequest(params) {\n const middleware = this.clientOptions.middleware?.handleUnregisterCapability;\n if (middleware) {\n return middleware(params, nextParams => this.doUnregisterCapability(nextParams));\n }\n else {\n return this.doUnregisterCapability(params);\n }\n }\n async doUnregisterCapability(params) {\n for (const unregistration of params.unregisterations) {\n if (this._ignoredRegistrations.has(unregistration.id)) {\n continue;\n }\n const feature = this._dynamicFeatures.get(unregistration.method);\n if (!feature) {\n return Promise.reject(new Error(`No feature implementation for ${unregistration.method} found. Unregistration failed.`));\n }\n feature.unregister(unregistration.id);\n }\n }\n async handleApplyWorkspaceEdit(params) {\n const workspaceEdit = params.edit;\n // Make sure we convert workspace edits one after the other. Otherwise\n // we might execute a workspace edit received first after we received another\n // one since the conversion might race.\n const converted = await this.workspaceEditLock.lock(() => {\n return this._p2c.asWorkspaceEdit(workspaceEdit);\n });\n // This is some sort of workaround since the version check should be done by VS Code in the Workspace.applyEdit.\n // However doing it here adds some safety since the server can lag more behind then an extension.\n const openTextDocuments = new Map();\n vscode_1.workspace.textDocuments.forEach((document) => openTextDocuments.set(document.uri.toString(), document));\n let versionMismatch = false;\n if (workspaceEdit.documentChanges) {\n for (const change of workspaceEdit.documentChanges) {\n if (vscode_languageserver_protocol_1.TextDocumentEdit.is(change) && change.textDocument.version && change.textDocument.version >= 0) {\n const changeUri = this._p2c.asUri(change.textDocument.uri).toString();\n const textDocument = openTextDocuments.get(changeUri);\n if (textDocument && textDocument.version !== change.textDocument.version) {\n versionMismatch = true;\n break;\n }\n }\n }\n }\n if (versionMismatch) {\n return Promise.resolve({ applied: false });\n }\n return Is.asPromise(vscode_1.workspace.applyEdit(converted).then((value) => { return { applied: value }; }));\n }\n handleFailedRequest(type, token, error, defaultValue, showNotification = true) {\n // If we get a request cancel or a content modified don't log anything.\n if (error instanceof vscode_languageserver_protocol_1.ResponseError) {\n // The connection got disposed while we were waiting for a response.\n // Simply return the default value. Is the best we can do.\n if (error.code === vscode_languageserver_protocol_1.ErrorCodes.PendingResponseRejected || error.code === vscode_languageserver_protocol_1.ErrorCodes.ConnectionInactive) {\n return defaultValue;\n }\n if (error.code === vscode_languageserver_protocol_1.LSPErrorCodes.RequestCancelled || error.code === vscode_languageserver_protocol_1.LSPErrorCodes.ServerCancelled) {\n if (token !== undefined && token.isCancellationRequested) {\n return defaultValue;\n }\n else {\n if (error.data !== undefined) {\n throw new features_1.LSPCancellationError(error.data);\n }\n else {\n throw new vscode_1.CancellationError();\n }\n }\n }\n else if (error.code === vscode_languageserver_protocol_1.LSPErrorCodes.ContentModified) {\n if (BaseLanguageClient.RequestsToCancelOnContentModified.has(type.method) || BaseLanguageClient.CancellableResolveCalls.has(type.method)) {\n throw new vscode_1.CancellationError();\n }\n else {\n return defaultValue;\n }\n }\n }\n this.error(`Request ${type.method} failed.`, error, showNotification);\n throw error;\n }\n}\nexports.BaseLanguageClient = BaseLanguageClient;\nBaseLanguageClient.RequestsToCancelOnContentModified = new Set([\n vscode_languageserver_protocol_1.SemanticTokensRequest.method,\n vscode_languageserver_protocol_1.SemanticTokensRangeRequest.method,\n vscode_languageserver_protocol_1.SemanticTokensDeltaRequest.method\n]);\nBaseLanguageClient.CancellableResolveCalls = new Set([\n vscode_languageserver_protocol_1.CompletionResolveRequest.method,\n vscode_languageserver_protocol_1.CodeLensResolveRequest.method,\n vscode_languageserver_protocol_1.CodeActionResolveRequest.method,\n vscode_languageserver_protocol_1.InlayHintResolveRequest.method,\n vscode_languageserver_protocol_1.DocumentLinkResolveRequest.method,\n vscode_languageserver_protocol_1.WorkspaceSymbolResolveRequest.method\n]);\nclass ConsoleLogger {\n error(message) {\n (0, vscode_languageserver_protocol_1.RAL)().console.error(message);\n }\n warn(message) {\n (0, vscode_languageserver_protocol_1.RAL)().console.warn(message);\n }\n info(message) {\n (0, vscode_languageserver_protocol_1.RAL)().console.info(message);\n }\n log(message) {\n (0, vscode_languageserver_protocol_1.RAL)().console.log(message);\n }\n}\nfunction createConnection(input, output, errorHandler, closeHandler, options) {\n const logger = new ConsoleLogger();\n const connection = (0, vscode_languageserver_protocol_1.createProtocolConnection)(input, output, logger, options);\n connection.onError((data) => { errorHandler(data[0], data[1], data[2]); });\n connection.onClose(closeHandler);\n const result = {\n listen: () => connection.listen(),\n sendRequest: connection.sendRequest,\n onRequest: connection.onRequest,\n hasPendingResponse: connection.hasPendingResponse,\n sendNotification: connection.sendNotification,\n onNotification: connection.onNotification,\n onProgress: connection.onProgress,\n sendProgress: connection.sendProgress,\n trace: (value, tracer, sendNotificationOrTraceOptions) => {\n const defaultTraceOptions = {\n sendNotification: false,\n traceFormat: vscode_languageserver_protocol_1.TraceFormat.Text\n };\n if (sendNotificationOrTraceOptions === undefined) {\n return connection.trace(value, tracer, defaultTraceOptions);\n }\n else if (Is.boolean(sendNotificationOrTraceOptions)) {\n return connection.trace(value, tracer, sendNotificationOrTraceOptions);\n }\n else {\n return connection.trace(value, tracer, sendNotificationOrTraceOptions);\n }\n },\n initialize: (params) => {\n // This needs to return and MUST not be await to avoid any async\n // scheduling. Otherwise messages might overtake each other.\n return connection.sendRequest(vscode_languageserver_protocol_1.InitializeRequest.type, params);\n },\n shutdown: () => {\n // This needs to return and MUST not be await to avoid any async\n // scheduling. Otherwise messages might overtake each other.\n return connection.sendRequest(vscode_languageserver_protocol_1.ShutdownRequest.type, undefined);\n },\n exit: () => {\n // This needs to return and MUST not be await to avoid any async\n // scheduling. Otherwise messages might overtake each other.\n return connection.sendNotification(vscode_languageserver_protocol_1.ExitNotification.type);\n },\n end: () => connection.end(),\n dispose: () => connection.dispose()\n };\n return result;\n}\n// Exporting proposed protocol.\nvar ProposedFeatures;\n(function (ProposedFeatures) {\n function createAll(_client) {\n let result = [\n new inlineCompletion_1.InlineCompletionItemFeature(_client)\n ];\n return result;\n }\n ProposedFeatures.createAll = createAll;\n})(ProposedFeatures || (exports.ProposedFeatures = ProposedFeatures = {}));\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.terminate = void 0;\nconst cp = require(\"child_process\");\nconst path_1 = require(\"path\");\nconst isWindows = (process.platform === 'win32');\nconst isMacintosh = (process.platform === 'darwin');\nconst isLinux = (process.platform === 'linux');\nfunction terminate(process, cwd) {\n if (isWindows) {\n try {\n // This we run in Atom execFileSync is available.\n // Ignore stderr since this is otherwise piped to parent.stderr\n // which might be already closed.\n let options = {\n stdio: ['pipe', 'pipe', 'ignore']\n };\n if (cwd) {\n options.cwd = cwd;\n }\n cp.execFileSync('taskkill', ['/T', '/F', '/PID', process.pid.toString()], options);\n return true;\n }\n catch (err) {\n return false;\n }\n }\n else if (isLinux || isMacintosh) {\n try {\n var cmd = (0, path_1.join)(__dirname, 'terminateProcess.sh');\n var result = cp.spawnSync(cmd, [process.pid.toString()]);\n return result.error ? false : true;\n }\n catch (err) {\n return false;\n }\n }\n else {\n process.kill('SIGKILL');\n return true;\n }\n}\nexports.terminate = terminate;\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ----------------------------------------------------------------------------------------- */\n'use strict';\n\nmodule.exports = require('./lib/node/main');","'use strict'\n\nconst debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","'use strict'\n\n// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n/* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\n// Max safe length for a build identifier. The max length minus 6 characters for\n// the shortest version with a build 0.0.0+BUILD.\nconst MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6\n\nconst RELEASE_TYPES = [\n 'major',\n 'premajor',\n 'minor',\n 'preminor',\n 'patch',\n 'prepatch',\n 'prerelease',\n]\n\nmodule.exports = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 0b001,\n FLAG_LOOSE: 0b010,\n}\n","'use strict'\n\nconst {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH,\n} = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst safeRe = exports.safeRe = []\nconst src = exports.src = []\nconst safeSrc = exports.safeSrc = []\nconst t = exports.t = {}\nlet R = 0\n\nconst LETTERDASHNUMBER = '[a-zA-Z0-9-]'\n\n// Replace some greedy regex tokens to prevent regex dos issues. These regex are\n// used internally via the safeRe object since all inputs in this library get\n// normalized first to trim and collapse all extra whitespace. The original\n// regexes are exported for userland consumption and lower level usage. A\n// future breaking change could export the safer regex only with a note that\n// all input should have extra whitespace removed.\nconst safeRegexReplacements = [\n ['\\\\s', 1],\n ['\\\\d', MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],\n]\n\nconst makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value\n .split(`${token}*`).join(`${token}{0,${max}}`)\n .split(`${token}+`).join(`${token}{1,${max}}`)\n }\n return value\n}\n\nconst createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value)\n const index = R++\n debug(name, index, value)\n t[name] = index\n src[index] = value\n safeSrc[index] = safe\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '\\\\d+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n// Non-numeric identifiers include numeric identifiers but can be longer.\n// Therefore non-numeric identifiers must go first.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]\n}|${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]\n}|${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCEPLAIN', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)\ncreateToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\\\d])`)\ncreateToken('COERCEFULL', src[t.COERCEPLAIN] +\n `(?:${src[t.PRERELEASE]})?` +\n `(?:${src[t.BUILD]})?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\ncreateToken('COERCERTLFULL', src[t.COERCEFULL], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$')\n","'use strict'\n\n// parse out just the options we care about\nconst looseOption = Object.freeze({ loose: true })\nconst emptyOpts = Object.freeze({ })\nconst parseOptions = options => {\n if (!options) {\n return emptyOpts\n }\n\n if (typeof options !== 'object') {\n return looseOption\n }\n\n return options\n}\nmodule.exports = parseOptions\n","'use strict'\n\nconst numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n if (typeof a === 'number' && typeof b === 'number') {\n return a === b ? 0 : a < b ? -1 : 1\n }\n\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers,\n}\n","'use strict'\n\nconst debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n if (this.major < other.major) {\n return -1\n }\n if (this.major > other.major) {\n return 1\n }\n if (this.minor < other.minor) {\n return -1\n }\n if (this.minor > other.minor) {\n return 1\n }\n if (this.patch < other.patch) {\n return -1\n }\n if (this.patch > other.patch) {\n return 1\n }\n return 0\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('build compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier, identifierBase) {\n if (release.startsWith('pre')) {\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty')\n }\n // Avoid an invalid semver results\n if (identifier) {\n const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])\n if (!match || match[1] !== identifier) {\n throw new Error(`invalid identifier: ${identifier}`)\n }\n }\n }\n\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier, identifierBase)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier, identifierBase)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier, identifierBase)\n this.inc('pre', identifier, identifierBase)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase)\n }\n this.inc('pre', identifier, identifierBase)\n break\n case 'release':\n if (this.prerelease.length === 0) {\n throw new Error(`version ${this.raw} is not a prerelease`)\n }\n this.prerelease.length = 0\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre': {\n const base = Number(identifierBase) ? 1 : 0\n\n if (this.prerelease.length === 0) {\n this.prerelease = [base]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists')\n }\n this.prerelease.push(base)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base]\n if (identifierBase === false) {\n prerelease = [identifier]\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease\n }\n } else {\n this.prerelease = prerelease\n }\n }\n break\n }\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.raw = this.format()\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`\n }\n return this\n }\n}\n\nmodule.exports = SemVer\n","'use strict'\n\nconst SemVer = require('../classes/semver')\nconst parse = (version, options, throwErrors = false) => {\n if (version instanceof SemVer) {\n return version\n }\n try {\n return new SemVer(version, options)\n } catch (er) {\n if (!throwErrors) {\n return null\n }\n throw er\n }\n}\n\nmodule.exports = parse\n","'use strict'\n\nclass LRUCache {\n constructor () {\n this.max = 1000\n this.map = new Map()\n }\n\n get (key) {\n const value = this.map.get(key)\n if (value === undefined) {\n return undefined\n } else {\n // Remove the key from the map and add it to the end\n this.map.delete(key)\n this.map.set(key, value)\n return value\n }\n }\n\n delete (key) {\n return this.map.delete(key)\n }\n\n set (key, value) {\n const deleted = this.delete(key)\n\n if (!deleted && value !== undefined) {\n // If cache is full, delete the least recently used item\n if (this.map.size >= this.max) {\n const firstKey = this.map.keys().next().value\n this.delete(firstKey)\n }\n\n this.map.set(key, value)\n }\n\n return this\n }\n}\n\nmodule.exports = LRUCache\n","'use strict'\n\nconst SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","'use strict'\n\nconst compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","'use strict'\n\nconst compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","'use strict'\n\nconst compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","'use strict'\n\nconst compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","'use strict'\n\nconst compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","'use strict'\n\nconst compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","'use strict'\n\nconst eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a === b\n\n case '!==':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","'use strict'\n\nconst ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n comp = comp.trim().split(/\\s+/).join(' ')\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n options = parseOptions(options)\n\n // Special cases where nothing can possibly be lower\n if (options.includePrerelease &&\n (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {\n return false\n }\n if (!options.includePrerelease &&\n (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {\n return false\n }\n\n // Same direction increasing (> or >=)\n if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {\n return true\n }\n // Same direction decreasing (< or <=)\n if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {\n return true\n }\n // same SemVer and both sides are inclusive (<= or >=)\n if (\n (this.semver.version === comp.semver.version) &&\n this.operator.includes('=') && comp.operator.includes('=')) {\n return true\n }\n // opposite directions less than\n if (cmp(this.semver, '<', comp.semver, options) &&\n this.operator.startsWith('>') && comp.operator.startsWith('<')) {\n return true\n }\n // opposite directions greater than\n if (cmp(this.semver, '>', comp.semver, options) &&\n this.operator.startsWith('<') && comp.operator.startsWith('>')) {\n return true\n }\n return false\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst { safeRe: re, t } = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","'use strict'\n\nconst SPACE_CHARACTERS = /\\s+/g\n\n// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.formatted = undefined\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First reduce all whitespace as much as possible so we do not have to rely\n // on potentially slow regexes like \\s*. This is then stored and used for\n // future error messages as well.\n this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')\n\n // First, split on ||\n this.set = this.raw\n .split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${this.raw}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0) {\n this.set = [first]\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.formatted = undefined\n }\n\n get range () {\n if (this.formatted === undefined) {\n this.formatted = ''\n for (let i = 0; i < this.set.length; i++) {\n if (i > 0) {\n this.formatted += '||'\n }\n const comps = this.set[i]\n for (let k = 0; k < comps.length; k++) {\n if (k > 0) {\n this.formatted += ' '\n }\n this.formatted += comps[k].toString().trim()\n }\n }\n }\n return this.formatted\n }\n\n format () {\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts =\n (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |\n (this.options.loose && FLAG_LOOSE)\n const memoKey = memoOpts + ':' + range\n const cached = cache.get(memoKey)\n if (cached) {\n return cached\n }\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range)\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n debug('tilde trim', range)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n debug('caret trim', range)\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n let rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options)\n return !!comp.match(re[t.COMPARATORLOOSE])\n })\n }\n debug('range list', rangeList)\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const rangeMap = new Map()\n const comparators = rangeList.map(comp => new Comparator(comp, this.options))\n for (const comp of comparators) {\n if (isNullSet(comp)) {\n return [comp]\n }\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('')\n }\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\n\nmodule.exports = Range\n\nconst LRU = require('../internal/lrucache')\nconst cache = new LRU()\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n safeRe: re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace,\n} = require('../internal/re')\nconst { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n comp = comp.replace(re[t.BUILD], '')\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n// ~0.0.1 --> >=0.0.1 <0.1.0-0\nconst replaceTildes = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceTilde(c, options))\n .join(' ')\n}\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\n// ^0.0.1 --> >=0.0.1 <0.0.2-0\n// ^0.1.0 --> >=0.1.0 <0.2.0-0\nconst replaceCarets = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceCaret(c, options))\n .join(' ')\n}\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp\n .split(/\\s+/)\n .map((c) => replaceXRange(c, options))\n .join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<') {\n pr = '-0'\n }\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp\n .trim()\n .replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp\n .trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n// TODO build?\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return `${from} ${to}`.trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","'use strict'\n\nconst Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagnosticPullMode = exports.vsdiag = void 0;\n__exportStar(require(\"vscode-languageserver-protocol\"), exports);\n__exportStar(require(\"./features\"), exports);\nvar diagnostic_1 = require(\"./diagnostic\");\nObject.defineProperty(exports, \"vsdiag\", { enumerable: true, get: function () { return diagnostic_1.vsdiag; } });\nObject.defineProperty(exports, \"DiagnosticPullMode\", { enumerable: true, get: function () { return diagnostic_1.DiagnosticPullMode; } });\n__exportStar(require(\"./client\"), exports);\n","\"use strict\";\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SettingMonitor = exports.LanguageClient = exports.TransportKind = void 0;\nconst cp = require(\"child_process\");\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nconst vscode_1 = require(\"vscode\");\nconst Is = require(\"../common/utils/is\");\nconst client_1 = require(\"../common/client\");\nconst processes_1 = require(\"./processes\");\nconst node_1 = require(\"vscode-languageserver-protocol/node\");\n// Import SemVer functions individually to avoid circular dependencies in SemVer\nconst semverParse = require(\"semver/functions/parse\");\nconst semverSatisfies = require(\"semver/functions/satisfies\");\n__exportStar(require(\"vscode-languageserver-protocol/node\"), exports);\n__exportStar(require(\"../common/api\"), exports);\nconst REQUIRED_VSCODE_VERSION = '^1.82.0'; // do not change format, updated by `updateVSCode` script\nvar TransportKind;\n(function (TransportKind) {\n TransportKind[TransportKind[\"stdio\"] = 0] = \"stdio\";\n TransportKind[TransportKind[\"ipc\"] = 1] = \"ipc\";\n TransportKind[TransportKind[\"pipe\"] = 2] = \"pipe\";\n TransportKind[TransportKind[\"socket\"] = 3] = \"socket\";\n})(TransportKind || (exports.TransportKind = TransportKind = {}));\nvar Transport;\n(function (Transport) {\n function isSocket(value) {\n const candidate = value;\n return candidate && candidate.kind === TransportKind.socket && Is.number(candidate.port);\n }\n Transport.isSocket = isSocket;\n})(Transport || (Transport = {}));\nvar Executable;\n(function (Executable) {\n function is(value) {\n return Is.string(value.command);\n }\n Executable.is = is;\n})(Executable || (Executable = {}));\nvar NodeModule;\n(function (NodeModule) {\n function is(value) {\n return Is.string(value.module);\n }\n NodeModule.is = is;\n})(NodeModule || (NodeModule = {}));\nvar StreamInfo;\n(function (StreamInfo) {\n function is(value) {\n let candidate = value;\n return candidate && candidate.writer !== undefined && candidate.reader !== undefined;\n }\n StreamInfo.is = is;\n})(StreamInfo || (StreamInfo = {}));\nvar ChildProcessInfo;\n(function (ChildProcessInfo) {\n function is(value) {\n let candidate = value;\n return candidate && candidate.process !== undefined && typeof candidate.detached === 'boolean';\n }\n ChildProcessInfo.is = is;\n})(ChildProcessInfo || (ChildProcessInfo = {}));\nclass LanguageClient extends client_1.BaseLanguageClient {\n constructor(arg1, arg2, arg3, arg4, arg5) {\n let id;\n let name;\n let serverOptions;\n let clientOptions;\n let forceDebug;\n if (Is.string(arg2)) {\n id = arg1;\n name = arg2;\n serverOptions = arg3;\n clientOptions = arg4;\n forceDebug = !!arg5;\n }\n else {\n id = arg1.toLowerCase();\n name = arg1;\n serverOptions = arg2;\n clientOptions = arg3;\n forceDebug = arg4;\n }\n if (forceDebug === undefined) {\n forceDebug = false;\n }\n super(id, name, clientOptions);\n this._serverOptions = serverOptions;\n this._forceDebug = forceDebug;\n this._isInDebugMode = forceDebug;\n try {\n this.checkVersion();\n }\n catch (error) {\n if (Is.string(error.message)) {\n this.outputChannel.appendLine(error.message);\n }\n throw error;\n }\n }\n checkVersion() {\n const codeVersion = semverParse(vscode_1.version);\n if (!codeVersion) {\n throw new Error(`No valid VS Code version detected. Version string is: ${vscode_1.version}`);\n }\n // Remove the insider pre-release since we stay API compatible.\n if (codeVersion.prerelease && codeVersion.prerelease.length > 0) {\n codeVersion.prerelease = [];\n }\n if (!semverSatisfies(codeVersion, REQUIRED_VSCODE_VERSION)) {\n throw new Error(`The language client requires VS Code version ${REQUIRED_VSCODE_VERSION} but received version ${vscode_1.version}`);\n }\n }\n get isInDebugMode() {\n return this._isInDebugMode;\n }\n async restart() {\n await this.stop();\n // We are in debug mode. Wait a little before we restart\n // so that the debug port can be freed. We can safely ignore\n // the disposable returned from start since it will call\n // stop on the same client instance.\n if (this.isInDebugMode) {\n await new Promise((resolve) => setTimeout(resolve, 1000));\n await this.start();\n }\n else {\n await this.start();\n }\n }\n stop(timeout = 2000) {\n return super.stop(timeout).finally(() => {\n if (this._serverProcess) {\n const toCheck = this._serverProcess;\n this._serverProcess = undefined;\n if (this._isDetached === undefined || !this._isDetached) {\n this.checkProcessDied(toCheck);\n }\n this._isDetached = undefined;\n }\n });\n }\n checkProcessDied(childProcess) {\n if (!childProcess || childProcess.pid === undefined) {\n return;\n }\n setTimeout(() => {\n // Test if the process is still alive. Throws an exception if not\n try {\n if (childProcess.pid !== undefined) {\n process.kill(childProcess.pid, 0);\n (0, processes_1.terminate)(childProcess);\n }\n }\n catch (error) {\n // All is fine.\n }\n }, 2000);\n }\n handleConnectionClosed() {\n this._serverProcess = undefined;\n return super.handleConnectionClosed();\n }\n fillInitializeParams(params) {\n super.fillInitializeParams(params);\n if (params.processId === null) {\n params.processId = process.pid;\n }\n }\n createMessageTransports(encoding) {\n function getEnvironment(env, fork) {\n if (!env && !fork) {\n return undefined;\n }\n const result = Object.create(null);\n Object.keys(process.env).forEach(key => result[key] = process.env[key]);\n if (fork) {\n result['ELECTRON_RUN_AS_NODE'] = '1';\n result['ELECTRON_NO_ASAR'] = '1';\n }\n if (env) {\n Object.keys(env).forEach(key => result[key] = env[key]);\n }\n return result;\n }\n const debugStartWith = ['--debug=', '--debug-brk=', '--inspect=', '--inspect-brk='];\n const debugEquals = ['--debug', '--debug-brk', '--inspect', '--inspect-brk'];\n function startedInDebugMode() {\n let args = process.execArgv;\n if (args) {\n return args.some((arg) => {\n return debugStartWith.some(value => arg.startsWith(value)) ||\n debugEquals.some(value => arg === value);\n });\n }\n return false;\n }\n function assertStdio(process) {\n if (process.stdin === null || process.stdout === null || process.stderr === null) {\n throw new Error('Process created without stdio streams');\n }\n }\n const server = this._serverOptions;\n // We got a function.\n if (Is.func(server)) {\n return server().then((result) => {\n if (client_1.MessageTransports.is(result)) {\n this._isDetached = !!result.detached;\n return result;\n }\n else if (StreamInfo.is(result)) {\n this._isDetached = !!result.detached;\n return { reader: new node_1.StreamMessageReader(result.reader), writer: new node_1.StreamMessageWriter(result.writer) };\n }\n else {\n let cp;\n if (ChildProcessInfo.is(result)) {\n cp = result.process;\n this._isDetached = result.detached;\n }\n else {\n cp = result;\n this._isDetached = false;\n }\n cp.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n return { reader: new node_1.StreamMessageReader(cp.stdout), writer: new node_1.StreamMessageWriter(cp.stdin) };\n }\n });\n }\n let json;\n let runDebug = server;\n if (runDebug.run || runDebug.debug) {\n if (this._forceDebug || startedInDebugMode()) {\n json = runDebug.debug;\n this._isInDebugMode = true;\n }\n else {\n json = runDebug.run;\n this._isInDebugMode = false;\n }\n }\n else {\n json = server;\n }\n return this._getServerWorkingDir(json.options).then(serverWorkingDir => {\n if (NodeModule.is(json) && json.module) {\n let node = json;\n let transport = node.transport || TransportKind.stdio;\n if (node.runtime) {\n const args = [];\n const options = node.options ?? Object.create(null);\n if (options.execArgv) {\n options.execArgv.forEach(element => args.push(element));\n }\n args.push(node.module);\n if (node.args) {\n node.args.forEach(element => args.push(element));\n }\n const execOptions = Object.create(null);\n execOptions.cwd = serverWorkingDir;\n execOptions.env = getEnvironment(options.env, false);\n const runtime = this._getRuntimePath(node.runtime, serverWorkingDir);\n let pipeName = undefined;\n if (transport === TransportKind.ipc) {\n // exec options not correctly typed in lib\n execOptions.stdio = [null, null, null, 'ipc'];\n args.push('--node-ipc');\n }\n else if (transport === TransportKind.stdio) {\n args.push('--stdio');\n }\n else if (transport === TransportKind.pipe) {\n pipeName = (0, node_1.generateRandomPipeName)();\n args.push(`--pipe=${pipeName}`);\n }\n else if (Transport.isSocket(transport)) {\n args.push(`--socket=${transport.port}`);\n }\n args.push(`--clientProcessId=${process.pid.toString()}`);\n if (transport === TransportKind.ipc || transport === TransportKind.stdio) {\n const serverProcess = cp.spawn(runtime, args, execOptions);\n if (!serverProcess || !serverProcess.pid) {\n return handleChildProcessStartError(serverProcess, `Launching server using runtime ${runtime} failed.`);\n }\n this._serverProcess = serverProcess;\n serverProcess.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n if (transport === TransportKind.ipc) {\n serverProcess.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n return Promise.resolve({ reader: new node_1.IPCMessageReader(serverProcess), writer: new node_1.IPCMessageWriter(serverProcess) });\n }\n else {\n return Promise.resolve({ reader: new node_1.StreamMessageReader(serverProcess.stdout), writer: new node_1.StreamMessageWriter(serverProcess.stdin) });\n }\n }\n else if (transport === TransportKind.pipe) {\n return (0, node_1.createClientPipeTransport)(pipeName).then((transport) => {\n const process = cp.spawn(runtime, args, execOptions);\n if (!process || !process.pid) {\n return handleChildProcessStartError(process, `Launching server using runtime ${runtime} failed.`);\n }\n this._serverProcess = process;\n process.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n process.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n return transport.onConnected().then((protocol) => {\n return { reader: protocol[0], writer: protocol[1] };\n });\n });\n }\n else if (Transport.isSocket(transport)) {\n return (0, node_1.createClientSocketTransport)(transport.port).then((transport) => {\n const process = cp.spawn(runtime, args, execOptions);\n if (!process || !process.pid) {\n return handleChildProcessStartError(process, `Launching server using runtime ${runtime} failed.`);\n }\n this._serverProcess = process;\n process.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n process.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n return transport.onConnected().then((protocol) => {\n return { reader: protocol[0], writer: protocol[1] };\n });\n });\n }\n }\n else {\n let pipeName = undefined;\n return new Promise((resolve, reject) => {\n const args = (node.args && node.args.slice()) ?? [];\n if (transport === TransportKind.ipc) {\n args.push('--node-ipc');\n }\n else if (transport === TransportKind.stdio) {\n args.push('--stdio');\n }\n else if (transport === TransportKind.pipe) {\n pipeName = (0, node_1.generateRandomPipeName)();\n args.push(`--pipe=${pipeName}`);\n }\n else if (Transport.isSocket(transport)) {\n args.push(`--socket=${transport.port}`);\n }\n args.push(`--clientProcessId=${process.pid.toString()}`);\n const options = node.options ?? Object.create(null);\n options.env = getEnvironment(options.env, true);\n options.execArgv = options.execArgv || [];\n options.cwd = serverWorkingDir;\n options.silent = true;\n if (transport === TransportKind.ipc || transport === TransportKind.stdio) {\n const sp = cp.fork(node.module, args || [], options);\n assertStdio(sp);\n this._serverProcess = sp;\n sp.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n if (transport === TransportKind.ipc) {\n sp.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n resolve({ reader: new node_1.IPCMessageReader(this._serverProcess), writer: new node_1.IPCMessageWriter(this._serverProcess) });\n }\n else {\n resolve({ reader: new node_1.StreamMessageReader(sp.stdout), writer: new node_1.StreamMessageWriter(sp.stdin) });\n }\n }\n else if (transport === TransportKind.pipe) {\n (0, node_1.createClientPipeTransport)(pipeName).then((transport) => {\n const sp = cp.fork(node.module, args || [], options);\n assertStdio(sp);\n this._serverProcess = sp;\n sp.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n sp.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n transport.onConnected().then((protocol) => {\n resolve({ reader: protocol[0], writer: protocol[1] });\n }, reject);\n }, reject);\n }\n else if (Transport.isSocket(transport)) {\n (0, node_1.createClientSocketTransport)(transport.port).then((transport) => {\n const sp = cp.fork(node.module, args || [], options);\n assertStdio(sp);\n this._serverProcess = sp;\n sp.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n sp.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n transport.onConnected().then((protocol) => {\n resolve({ reader: protocol[0], writer: protocol[1] });\n }, reject);\n }, reject);\n }\n });\n }\n }\n else if (Executable.is(json) && json.command) {\n const command = json;\n const args = json.args !== undefined ? json.args.slice(0) : [];\n let pipeName = undefined;\n const transport = json.transport;\n if (transport === TransportKind.stdio) {\n args.push('--stdio');\n }\n else if (transport === TransportKind.pipe) {\n pipeName = (0, node_1.generateRandomPipeName)();\n args.push(`--pipe=${pipeName}`);\n }\n else if (Transport.isSocket(transport)) {\n args.push(`--socket=${transport.port}`);\n }\n else if (transport === TransportKind.ipc) {\n throw new Error(`Transport kind ipc is not support for command executable`);\n }\n const options = Object.assign({}, command.options);\n options.cwd = options.cwd || serverWorkingDir;\n if (transport === undefined || transport === TransportKind.stdio) {\n const serverProcess = cp.spawn(command.command, args, options);\n if (!serverProcess || !serverProcess.pid) {\n return handleChildProcessStartError(serverProcess, `Launching server using command ${command.command} failed.`);\n }\n serverProcess.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n this._serverProcess = serverProcess;\n this._isDetached = !!options.detached;\n return Promise.resolve({ reader: new node_1.StreamMessageReader(serverProcess.stdout), writer: new node_1.StreamMessageWriter(serverProcess.stdin) });\n }\n else if (transport === TransportKind.pipe) {\n return (0, node_1.createClientPipeTransport)(pipeName).then((transport) => {\n const serverProcess = cp.spawn(command.command, args, options);\n if (!serverProcess || !serverProcess.pid) {\n return handleChildProcessStartError(serverProcess, `Launching server using command ${command.command} failed.`);\n }\n this._serverProcess = serverProcess;\n this._isDetached = !!options.detached;\n serverProcess.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n serverProcess.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n return transport.onConnected().then((protocol) => {\n return { reader: protocol[0], writer: protocol[1] };\n });\n });\n }\n else if (Transport.isSocket(transport)) {\n return (0, node_1.createClientSocketTransport)(transport.port).then((transport) => {\n const serverProcess = cp.spawn(command.command, args, options);\n if (!serverProcess || !serverProcess.pid) {\n return handleChildProcessStartError(serverProcess, `Launching server using command ${command.command} failed.`);\n }\n this._serverProcess = serverProcess;\n this._isDetached = !!options.detached;\n serverProcess.stderr.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n serverProcess.stdout.on('data', data => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));\n return transport.onConnected().then((protocol) => {\n return { reader: protocol[0], writer: protocol[1] };\n });\n });\n }\n }\n return Promise.reject(new Error(`Unsupported server configuration ` + JSON.stringify(server, null, 4)));\n }).finally(() => {\n if (this._serverProcess !== undefined) {\n this._serverProcess.on('exit', (code, signal) => {\n if (code !== null) {\n this.error(`Server process exited with code ${code}.`, undefined, false);\n }\n if (signal !== null) {\n this.error(`Server process exited with signal ${signal}.`, undefined, false);\n }\n });\n }\n });\n }\n _getRuntimePath(runtime, serverWorkingDirectory) {\n if (path.isAbsolute(runtime)) {\n return runtime;\n }\n const mainRootPath = this._mainGetRootPath();\n if (mainRootPath !== undefined) {\n const result = path.join(mainRootPath, runtime);\n if (fs.existsSync(result)) {\n return result;\n }\n }\n if (serverWorkingDirectory !== undefined) {\n const result = path.join(serverWorkingDirectory, runtime);\n if (fs.existsSync(result)) {\n return result;\n }\n }\n return runtime;\n }\n _mainGetRootPath() {\n let folders = vscode_1.workspace.workspaceFolders;\n if (!folders || folders.length === 0) {\n return undefined;\n }\n let folder = folders[0];\n if (folder.uri.scheme === 'file') {\n return folder.uri.fsPath;\n }\n return undefined;\n }\n _getServerWorkingDir(options) {\n let cwd = options && options.cwd;\n if (!cwd) {\n cwd = this.clientOptions.workspaceFolder\n ? this.clientOptions.workspaceFolder.uri.fsPath\n : this._mainGetRootPath();\n }\n if (cwd) {\n // make sure the folder exists otherwise creating the process will fail\n return new Promise(s => {\n fs.lstat(cwd, (err, stats) => {\n s(!err && stats.isDirectory() ? cwd : undefined);\n });\n });\n }\n return Promise.resolve(undefined);\n }\n}\nexports.LanguageClient = LanguageClient;\nclass SettingMonitor {\n constructor(_client, _setting) {\n this._client = _client;\n this._setting = _setting;\n this._listeners = [];\n }\n start() {\n vscode_1.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration, this, this._listeners);\n this.onDidChangeConfiguration();\n return new vscode_1.Disposable(() => {\n if (this._client.needsStop()) {\n void this._client.stop();\n }\n });\n }\n onDidChangeConfiguration() {\n let index = this._setting.indexOf('.');\n let primary = index >= 0 ? this._setting.substr(0, index) : this._setting;\n let rest = index >= 0 ? this._setting.substr(index + 1) : undefined;\n let enabled = rest ? vscode_1.workspace.getConfiguration(primary).get(rest, false) : vscode_1.workspace.getConfiguration(primary);\n if (enabled && this._client.needsStart()) {\n this._client.start().catch((error) => this._client.error('Start failed after configuration change', error, 'force'));\n }\n else if (!enabled && this._client.needsStop()) {\n void this._client.stop().catch((error) => this._client.error('Stop failed after configuration change', error, 'force'));\n }\n }\n}\nexports.SettingMonitor = SettingMonitor;\nfunction handleChildProcessStartError(process, message) {\n if (process === null) {\n return Promise.reject(message);\n }\n return new Promise((_, reject) => {\n process.on('error', (err) => {\n reject(`${message} ${err}`);\n });\n // the error event should always be run immediately,\n // but race on it just in case\n setImmediate(() => reject(message));\n });\n}\n","/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ----------------------------------------------------------------------------------------- */\n'use strict';\n\nmodule.exports = require('./lib/node/main');","import * as path from \"node:path\";\n// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport type { DuplicationMode, IssueTypeConfig, TraceLevel } from \"./types.js\";\n\nconst SECTION = \"fallow\";\n\nconst getConfig = (): vscode.WorkspaceConfiguration =>\n vscode.workspace.getConfiguration(SECTION);\n\nexport const getLspPath = (): string => getConfig().get(\"lspPath\", \"\");\n\nconst getConfigPath = (): string =>\n getConfig().get(\"configPath\", \"\").trim();\n\nexport const getResolvedConfigPath = (): string => {\n const configPath = getConfigPath();\n if (!configPath || path.isAbsolute(configPath)) {\n return configPath;\n }\n\n const workspaceRoot = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath;\n return workspaceRoot ? path.resolve(workspaceRoot, configPath) : configPath;\n};\n\nexport const getAutoDownload = (): boolean =>\n getConfig().get(\"autoDownload\", true);\n\nexport const getIssueTypes = (): IssueTypeConfig =>\n getConfig().get(\"issueTypes\", {\n \"unused-files\": true,\n \"unused-exports\": true,\n \"unused-types\": true,\n \"private-type-leaks\": true,\n \"unused-dependencies\": true,\n \"unused-dev-dependencies\": true,\n \"unused-optional-dependencies\": true,\n \"unused-enum-members\": true,\n \"unused-class-members\": true,\n \"unresolved-imports\": true,\n \"unlisted-dependencies\": true,\n \"duplicate-exports\": true,\n \"type-only-dependencies\": true,\n \"test-only-dependencies\": true,\n \"circular-dependencies\": true,\n \"boundary-violation\": true,\n \"stale-suppressions\": true,\n \"unused-catalog-entries\": true,\n \"unresolved-catalog-references\": true,\n \"unused-dependency-overrides\": true,\n \"misconfigured-dependency-overrides\": true,\n });\n\nexport const getDuplicationThreshold = (): number =>\n getConfig().get(\"duplication.threshold\", 5);\n\nexport const getDuplicationMode = (): DuplicationMode =>\n getConfig().get(\"duplication.mode\", \"mild\");\n\nexport const getProduction = (): boolean =>\n getConfig().get(\"production\", false);\n\nexport const getChangedSince = (): string =>\n getConfig().get(\"changedSince\", \"\").trim();\n\nexport const getTraceLevel = (): TraceLevel =>\n getConfig().get(\"trace.server\", \"off\");\n\nexport const onConfigChange = (\n callback: (e: vscode.ConfigurationChangeEvent) => void\n): vscode.Disposable =>\n vscode.workspace.onDidChangeConfiguration((e) => {\n if (e.affectsConfiguration(SECTION)) {\n callback(e);\n }\n });\n","import * as fs from \"node:fs\";\nimport * as os from \"node:os\";\nimport * as path from \"node:path\";\n// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\n\nexport const getExecutableExtension = (): string =>\n os.platform() === \"win32\" ? \".exe\" : \"\";\n\n/**\n * Look for a locally installed binary in the workspace's node_modules/.bin.\n * This allows teams to pin fallow as a devDependency for consistent versions.\n */\nexport const findLocalBinary = (name: string): string | null => {\n const folders = vscode.workspace.workspaceFolders;\n if (!folders || folders.length === 0) {\n return null;\n }\n\n const executableName = `${name}${getExecutableExtension()}`;\n const candidate = path.join(\n folders[0].uri.fsPath,\n \"node_modules\",\n \".bin\",\n executableName\n );\n\n if (fs.existsSync(candidate)) {\n return candidate;\n }\n\n return null;\n};\n\nexport const findBinaryInPath = (name: string): string | null => {\n const executableName = `${name}${getExecutableExtension()}`;\n const pathDirs = (process.env[\"PATH\"] ?? \"\").split(path.delimiter);\n\n for (const dir of pathDirs) {\n const candidate = path.join(dir, executableName);\n if (fs.existsSync(candidate)) {\n return candidate;\n }\n }\n\n return null;\n};\n","// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport type {\n HandleDiagnosticsSignature,\n ProvideDiagnosticSignature,\n vsdiag,\n} from \"vscode-languageclient/node.js\";\n\nconst STATE_KEY = \"fallow.diagnosticFilter.v1\";\nconst FALLOW_SOURCE = \"fallow\";\n\n/**\n * Cap the per-URI cache so a workspace-wide LSP publish on a 50k-file\n * monorepo doesn't grow the heap forever. fallow-lsp publishes diagnostics\n * for every diagnosed file, not just open editors, and `onDidCloseTextDocument`\n * never fires for files that were never opened. When the cap is hit we evict\n * the oldest entry (insertion order, the first key in the Map).\n */\nconst MAX_CACHE_ENTRIES = 5000;\n\nexport interface DiagnosticCategory {\n readonly code: string;\n readonly label: string;\n}\n\n/**\n * Fallback diagnostic categories for older fallow-lsp binaries that do not\n * support `fallow/issueTypes`. Current servers provide the canonical list.\n */\nexport const DIAGNOSTIC_CATEGORIES: ReadonlyArray = [\n { code: \"code-duplication\", label: \"Code Duplication\" },\n { code: \"unused-file\", label: \"Unused Files\" },\n { code: \"unused-export\", label: \"Unused Exports\" },\n { code: \"unused-type\", label: \"Unused Types\" },\n { code: \"private-type-leak\", label: \"Private Type Leaks\" },\n { code: \"unused-dependency\", label: \"Unused Dependencies\" },\n { code: \"unused-dev-dependency\", label: \"Unused Dev Dependencies\" },\n {\n code: \"unused-optional-dependency\",\n label: \"Unused Optional Dependencies\",\n },\n { code: \"unused-enum-member\", label: \"Unused Enum Members\" },\n { code: \"unused-class-member\", label: \"Unused Class Members\" },\n { code: \"unresolved-import\", label: \"Unresolved Imports\" },\n { code: \"unlisted-dependency\", label: \"Unlisted Dependencies\" },\n { code: \"duplicate-export\", label: \"Duplicate Exports\" },\n { code: \"type-only-dependency\", label: \"Type-Only Dependencies\" },\n { code: \"test-only-dependency\", label: \"Test-Only Dependencies\" },\n { code: \"circular-dependency\", label: \"Circular Dependencies\" },\n { code: \"boundary-violation\", label: \"Boundary Violations\" },\n { code: \"stale-suppression\", label: \"Stale Suppressions\" },\n { code: \"unused-catalog-entry\", label: \"Unused Catalog Entries\" },\n {\n code: \"unresolved-catalog-reference\",\n label: \"Unresolved Catalog References\",\n },\n {\n code: \"unused-dependency-override\",\n label: \"Unused Dependency Overrides\",\n },\n {\n code: \"misconfigured-dependency-override\",\n label: \"Misconfigured Dependency Overrides\",\n },\n];\n\nlet activeDiagnosticCategories: ReadonlyArray =\n DIAGNOSTIC_CATEGORIES;\n\nconst isDiagnosticCategory = (value: unknown): value is DiagnosticCategory => {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n const candidate = value as { code?: unknown; label?: unknown };\n return (\n typeof candidate.code === \"string\" &&\n candidate.code.length > 0 &&\n typeof candidate.label === \"string\" &&\n candidate.label.length > 0\n );\n};\n\nexport const parseDiagnosticCategories = (\n value: unknown\n): ReadonlyArray | null => {\n if (!Array.isArray(value)) {\n return null;\n }\n const categories = value.filter(isDiagnosticCategory);\n if (categories.length !== value.length || categories.length === 0) {\n return null;\n }\n return categories.map(({ code, label }) => ({ code, label }));\n};\n\nexport const setDiagnosticCategories = (\n categories: ReadonlyArray\n): void => {\n if (categories.length === 0) {\n return;\n }\n activeDiagnosticCategories = categories.slice();\n};\n\nexport const resetDiagnosticCategories = (): void => {\n activeDiagnosticCategories = DIAGNOSTIC_CATEGORIES;\n};\n\nexport const getDiagnosticCategories =\n (): ReadonlyArray => activeDiagnosticCategories;\n\ninterface PersistedState {\n readonly mutedAll?: boolean;\n readonly mutedCategories?: ReadonlyArray;\n}\n\ninterface FilterClient {\n readonly diagnostics?: vscode.DiagnosticCollection;\n}\n\n/** LSP diagnostics get tagged with `source: \"fallow\"` (see\n * `crates/lsp/src/diagnostics/*.rs`). Anything else flows through\n * the filter untouched so we never affect TypeScript or ESLint. */\nexport const isFallowDiagnostic = (d: vscode.Diagnostic): boolean =>\n d.source === FALLOW_SOURCE;\n\n/** `Diagnostic.code` per VSCode types is `string | number | { value, target }`,\n * and may be absent. Returns `null` when there's nothing to match against. */\nexport const diagnosticCode = (d: vscode.Diagnostic): string | null => {\n const code = d.code;\n if (code === undefined || code === null) {\n return null;\n }\n if (typeof code === \"string\") {\n return code;\n }\n if (typeof code === \"number\") {\n return String(code);\n }\n if (typeof code === \"object\" && \"value\" in code) {\n const value = (code as { value: string | number }).value;\n return typeof value === \"string\" ? value : String(value);\n }\n return null;\n};\n\ninterface DiagnosticFilterStateChange {\n readonly mutedAll: boolean;\n readonly mutedCategories: ReadonlySet;\n}\n\nexport class DiagnosticFilter {\n private mutedAll = false;\n private mutedCategories = new Set();\n private readonly cache = new Map();\n private client: FilterClient | null = null;\n private persistQueue: Promise = Promise.resolve();\n private readonly emitter =\n new vscode.EventEmitter();\n\n public readonly onDidChange = this.emitter.event;\n\n public constructor(private readonly memento: vscode.Memento) {\n const persisted = memento.get(STATE_KEY);\n if (persisted) {\n this.mutedAll = persisted.mutedAll === true;\n const list = persisted.mutedCategories ?? [];\n this.mutedCategories = new Set(list);\n }\n }\n\n public attachClient(client: FilterClient): void {\n this.client = client;\n this.refresh();\n }\n\n public detachClient(): void {\n this.client = null;\n this.cache.clear();\n }\n\n public dispose(): void {\n this.emitter.dispose();\n }\n\n public isMutedAll(): boolean {\n return this.mutedAll;\n }\n\n public isCategoryMuted(code: string): boolean {\n return this.mutedCategories.has(code);\n }\n\n public anythingMuted(): boolean {\n return this.mutedAll || this.mutedCategories.size > 0;\n }\n\n public mutedCategoriesSnapshot(): ReadonlySet {\n return new Set(this.mutedCategories);\n }\n\n public setMutedAll(value: boolean): void {\n if (this.mutedAll === value) {\n return;\n }\n this.mutedAll = value;\n this.persist();\n this.refresh();\n this.emitChange();\n }\n\n public toggleMutedAll(): boolean {\n this.setMutedAll(!this.mutedAll);\n return this.mutedAll;\n }\n\n public setCategoryMuted(code: string, value: boolean): void {\n const had = this.mutedCategories.has(code);\n if (value === had) {\n return;\n }\n if (value) {\n this.mutedCategories.add(code);\n } else {\n this.mutedCategories.delete(code);\n }\n this.persist();\n this.refresh();\n this.emitChange();\n }\n\n public setMutedCategories(codes: ReadonlySet): void {\n let changed = this.mutedCategories.size !== codes.size;\n if (!changed) {\n for (const code of codes) {\n if (!this.mutedCategories.has(code)) {\n changed = true;\n break;\n }\n }\n }\n if (!changed) {\n return;\n }\n\n this.mutedCategories = new Set(codes);\n this.persist();\n this.refresh();\n this.emitChange();\n }\n\n public toggleCategory(code: string): boolean {\n const next = !this.mutedCategories.has(code);\n this.setCategoryMuted(code, next);\n return next;\n }\n\n public clearAllMutes(): void {\n if (!this.anythingMuted()) {\n return;\n }\n this.mutedAll = false;\n this.mutedCategories.clear();\n this.persist();\n this.refresh();\n this.emitChange();\n }\n\n /** Drop the cache entry for a closed document so we don't grow unbounded\n * on large monorepos. The LSP will re-publish if it reopens. */\n public evictUri(uri: vscode.Uri): void {\n this.cache.delete(uri.toString());\n }\n\n public applyFilter(\n diagnostics: ReadonlyArray\n ): vscode.Diagnostic[] {\n if (!this.anythingMuted()) {\n return diagnostics.slice();\n }\n return diagnostics.filter((d) => {\n if (!isFallowDiagnostic(d)) {\n return true;\n }\n if (this.mutedAll) {\n return false;\n }\n const code = diagnosticCode(d);\n if (code === null) {\n return true;\n }\n return !this.mutedCategories.has(code);\n });\n }\n\n /** Push-mode middleware: intercepts `textDocument/publishDiagnostics`. */\n public handleDiagnostics(\n uri: vscode.Uri,\n diagnostics: vscode.Diagnostic[],\n next: HandleDiagnosticsSignature\n ): void {\n const key = uri.toString();\n this.evictIfFull(key);\n this.cache.set(key, diagnostics.slice());\n next(uri, this.applyFilter(diagnostics));\n }\n\n /** Pull-mode middleware: intercepts `textDocument/diagnostic`. The LSP\n * advertises `diagnostic_provider` in `build_server_capabilities()`, so\n * strict 3.17 clients (and a future VSCode pull flip) hit this path. */\n public async provideDiagnostics(\n document: vscode.TextDocument | vscode.Uri,\n previousResultId: string | undefined,\n token: vscode.CancellationToken,\n next: ProvideDiagnosticSignature\n ): Promise {\n const result = await next(document, previousResultId, token);\n if (!result) {\n return result;\n }\n if (result.kind !== \"full\") {\n return result;\n }\n // `document` is `TextDocument | Uri`. TextDocument exposes `.uri`;\n // a bare Uri does not. Structural detection works for both real and\n // mocked Uri objects (mocks aren't `instanceof vscode.Uri`).\n const uri =\n \"uri\" in document && document.uri !== undefined\n ? document.uri\n : (document as vscode.Uri);\n const key = uri.toString();\n this.evictIfFull(key);\n this.cache.set(key, result.items.slice());\n return { ...result, items: this.applyFilter(result.items) };\n }\n\n /** Re-apply current filter to all cached diagnostics via the client's\n * collection. Called on toggle change so squiggles update instantly\n * without an LSP restart or re-analysis. Snapshots entries first to\n * future-proof against async creep in callers. */\n public refresh(): void {\n const collection = this.client?.diagnostics;\n if (!collection) {\n return;\n }\n const entries = Array.from(this.cache.entries());\n for (const [uriStr, diagnostics] of entries) {\n collection.set(vscode.Uri.parse(uriStr), this.applyFilter(diagnostics));\n }\n }\n\n /** Drop the oldest cache entry when at capacity, unless the URI we're\n * about to write was already cached (in-place update doesn't grow size). */\n private evictIfFull(incomingKey: string): void {\n if (this.cache.size < MAX_CACHE_ENTRIES) {\n return;\n }\n if (this.cache.has(incomingKey)) {\n return;\n }\n const oldest = this.cache.keys().next().value;\n if (oldest !== undefined) {\n this.cache.delete(oldest);\n }\n }\n\n private persist(): void {\n const payload: PersistedState = {\n mutedAll: this.mutedAll,\n mutedCategories: Array.from(this.mutedCategories),\n };\n this.persistQueue = this.persistQueue.then(\n () => Promise.resolve(this.memento.update(STATE_KEY, payload)),\n () => Promise.resolve(this.memento.update(STATE_KEY, payload))\n );\n }\n\n private emitChange(): void {\n this.emitter.fire({\n mutedAll: this.mutedAll,\n mutedCategories: this.mutedCategoriesSnapshot(),\n });\n }\n}\n","import { execFileSync } from \"node:child_process\";\nimport { createHash, createPublicKey, verify } from \"node:crypto\";\nimport * as fs from \"node:fs\";\nimport type { IncomingMessage } from \"node:http\";\nimport * as https from \"node:https\";\nimport * as os from \"node:os\";\nimport * as path from \"node:path\";\n// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport { getExecutableExtension } from \"./binary-utils.js\";\n\nconst GITHUB_REPO = \"fallow-rs/fallow\";\nconst LSP_BINARY_NAME = \"fallow-lsp\";\nconst CLI_BINARY_NAME = \"fallow\";\nconst VERSION_FILE = \".fallow-version\";\nconst SIGNATURE_SUFFIX = \".sig\";\nconst SHA256_SUFFIX = \".sha256\";\nconst BINARY_SIGNING_PUBLIC_KEY = Buffer.from([\n 131, 78, 111, 215, 115, 51, 230, 238, 223, 119, 147, 71, 199, 16, 172, 180, 3, 210, 216, 35,\n 77, 85, 159, 94, 215, 200, 126, 85, 42, 222, 11, 209,\n]);\nconst ED25519_SPKI_HEADER = Buffer.from([\n 0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x21, 0x00,\n]);\n\ninterface GithubRelease {\n readonly tag_name: string;\n readonly assets: ReadonlyArray<{\n readonly digest?: string;\n readonly name: string;\n readonly browser_download_url: string;\n }>;\n}\n\nconst REQUEST_HEADERS = { \"User-Agent\": \"fallow-vscode\" };\n\nexport const platformTargetFor = (\n platform: NodeJS.Platform,\n arch: string\n): string | null => {\n if (platform === \"darwin\" && arch === \"arm64\") return \"darwin-arm64\";\n if (platform === \"darwin\" && arch === \"x64\") return \"darwin-x64\";\n if (platform === \"linux\" && arch === \"x64\") return \"linux-x64-gnu\";\n if (platform === \"linux\" && arch === \"arm64\") return \"linux-arm64-gnu\";\n if (platform === \"win32\" && arch === \"arm64\") return \"win32-arm64-msvc\";\n if (platform === \"win32\" && arch === \"x64\") return \"win32-x64-msvc\";\n\n return null;\n};\n\nconst getPlatformTarget = (): string | null =>\n platformTargetFor(os.platform(), os.arch());\n\nconst withRedirects = (\n url: string,\n handleResponse: (response: IncomingMessage) => Promise\n): Promise =>\n new Promise((resolve, reject) => {\n const request = https.get(\n url,\n { headers: REQUEST_HEADERS },\n (response) => {\n if (\n response.statusCode &&\n response.statusCode >= 300 &&\n response.statusCode < 400 &&\n response.headers.location\n ) {\n response.resume();\n withRedirects(response.headers.location, handleResponse).then(\n resolve,\n reject\n );\n return;\n }\n\n if (response.statusCode && response.statusCode >= 400) {\n response.resume();\n reject(new Error(`HTTP ${response.statusCode}`));\n return;\n }\n\n void handleResponse(response).then(resolve, reject);\n }\n );\n\n request.on(\"error\", reject);\n });\n\nconst httpsGet = (url: string): Promise =>\n withRedirects(url, async (response) => {\n const chunks: Buffer[] = [];\n\n return await new Promise((resolve, reject) => {\n response.on(\"data\", (chunk: Buffer) => chunks.push(chunk));\n response.on(\"end\", () => resolve(Buffer.concat(chunks).toString()));\n response.on(\"error\", reject);\n });\n });\n\nconst httpsDownload = (url: string, dest: string): Promise =>\n withRedirects(\n url,\n async (response) =>\n await new Promise((resolve, reject) => {\n const file = fs.createWriteStream(dest);\n response.pipe(file);\n file.on(\"finish\", () => {\n file.close();\n resolve();\n });\n file.on(\"error\", (err) => {\n fs.unlink(dest, () => {});\n reject(err);\n });\n })\n );\n\nconst getInstallDir = (context: vscode.ExtensionContext): string => {\n const dir = path.join(context.globalStorageUri.fsPath, \"bin\");\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true });\n }\n return dir;\n};\n\nconst getSignaturePath = (binaryPath: string): string =>\n `${binaryPath}${SIGNATURE_SUFFIX}`;\n\nconst getDigestPath = (binaryPath: string): string =>\n `${binaryPath}${SHA256_SUFFIX}`;\n\nconst getManagedBinaryPaths = (\n dir: string\n): ReadonlyArray => [\n path.join(dir, `${LSP_BINARY_NAME}${getExecutableExtension()}`),\n path.join(dir, `${CLI_BINARY_NAME}${getExecutableExtension()}`),\n];\n\nconst purgeManagedBinaries = (dir: string): void => {\n for (const binaryPath of getManagedBinaryPaths(dir)) {\n for (const candidate of [\n binaryPath,\n getSignaturePath(binaryPath),\n getDigestPath(binaryPath),\n ]) {\n try {\n if (fs.existsSync(candidate)) {\n fs.unlinkSync(candidate);\n }\n } catch {\n // Best-effort cleanup.\n }\n }\n }\n\n try {\n const versionPath = path.join(dir, VERSION_FILE);\n if (fs.existsSync(versionPath)) {\n fs.unlinkSync(versionPath);\n }\n } catch {\n // Best-effort cleanup.\n }\n};\n\nexport const writeVersionMarker = (dir: string, version: string): void => {\n try {\n fs.writeFileSync(path.join(dir, VERSION_FILE), version, \"utf-8\");\n } catch {\n // Best-effort — next activation falls back to --version\n }\n};\n\nexport const readVersionMarker = (dir: string): string | null => {\n try {\n return fs.readFileSync(path.join(dir, VERSION_FILE), \"utf-8\").trim() || null;\n } catch {\n return null;\n }\n};\n\n/** Query the version of a fallow binary. Returns the version string or null. */\nexport const getBinaryVersion = (binaryPath: string): string | null => {\n try {\n // execFileSync is safe (no shell injection) — binary path is from our own storage dir.\n const output = execFileSync(binaryPath, [\"--version\"], {\n timeout: 5000,\n encoding: \"utf-8\",\n });\n // Output format: \"fallow-lsp 2.18.3\" or \"fallow 2.18.3\"\n const match = output.trim().match(/(\\d+\\.\\d+\\.\\d+)/);\n return match?.[1] ?? null;\n } catch {\n return null;\n }\n};\n\nexport const verifyBinarySignature = (binaryPath: string): boolean => {\n try {\n const signaturePath = getSignaturePath(binaryPath);\n const binaryBytes = fs.readFileSync(binaryPath);\n const signatureBytes = fs.readFileSync(signaturePath);\n\n const publicKey = createPublicKey({\n key: Buffer.concat([ED25519_SPKI_HEADER, BINARY_SIGNING_PUBLIC_KEY]),\n format: \"der\",\n type: \"spki\",\n });\n\n return verify(null, binaryBytes, publicKey, signatureBytes);\n } catch {\n return false;\n }\n};\n\nconst normalizeSha256Digest = (digest: string | undefined): string | null => {\n if (!digest) {\n return null;\n }\n\n const lower = digest.trim().toLowerCase();\n if (!lower.startsWith(\"sha256:\")) {\n return null;\n }\n\n const value = lower.slice(\"sha256:\".length);\n return /^[0-9a-f]{64}$/.test(value) ? value : null;\n};\n\nconst writeDigestMarker = (binaryPath: string, digest: string): void => {\n try {\n fs.writeFileSync(getDigestPath(binaryPath), digest, \"utf-8\");\n } catch {\n // Best-effort — a missing digest marker forces a re-download later.\n }\n};\n\nconst readDigestMarker = (binaryPath: string): string | null => {\n try {\n return normalizeSha256Digest(\n `sha256:${fs.readFileSync(getDigestPath(binaryPath), \"utf-8\").trim()}`\n );\n } catch {\n return null;\n }\n};\n\nexport const verifyBinaryDigest = (\n binaryPath: string,\n expectedDigest: string\n): boolean => {\n try {\n const normalized = normalizeSha256Digest(`sha256:${expectedDigest}`);\n if (!normalized) {\n return false;\n }\n\n const binaryBytes = fs.readFileSync(binaryPath);\n const actual = createHash(\"sha256\").update(binaryBytes).digest(\"hex\");\n return actual === normalized;\n } catch {\n return false;\n }\n};\n\nconst ensureManagedBinaryTrusted = (\n dir: string,\n binaryPath: string,\n label: string,\n outputChannel?: vscode.OutputChannel\n): boolean => {\n const signaturePath = getSignaturePath(binaryPath);\n if (fs.existsSync(signaturePath)) {\n if (verifyBinarySignature(binaryPath)) {\n return true;\n }\n\n outputChannel?.appendLine(\n `Fallow: installed ${label} binary failed Ed25519 signature verification. Re-downloading.`\n );\n purgeManagedBinaries(dir);\n return false;\n }\n\n const expectedDigest = readDigestMarker(binaryPath);\n if (expectedDigest && verifyBinaryDigest(binaryPath, expectedDigest)) {\n outputChannel?.appendLine(\n `Fallow: installed ${label} binary reused via stored SHA-256 digest verification.`\n );\n return true;\n }\n\n outputChannel?.appendLine(\n `Fallow: installed ${label} binary is neither signature-verified nor digest-verified. Re-downloading.`\n );\n purgeManagedBinaries(dir);\n return false;\n};\n\nconst matchesExtensionVersion = (\n dir: string,\n binaryPath: string,\n label: string,\n outputChannel?: vscode.OutputChannel\n): boolean => {\n const extensionVersion =\n vscode.extensions.getExtension(\"fallow-rs.fallow-vscode\")?.packageJSON\n ?.version as string | undefined;\n if (!extensionVersion) {\n return true;\n }\n\n const binaryVersion = readVersionMarker(dir) ?? getBinaryVersion(binaryPath);\n if (binaryVersion === extensionVersion) {\n return true;\n }\n\n outputChannel?.appendLine(\n `Fallow: installed ${label} binary is v${binaryVersion ?? \"unknown\"}, extension is v${extensionVersion}. Re-downloading.`\n );\n purgeManagedBinaries(dir);\n return false;\n};\n\nconst getManagedBinaryPath = (\n context: vscode.ExtensionContext,\n binaryName: string,\n label: string,\n outputChannel?: vscode.OutputChannel\n): string | null => {\n const dir = getInstallDir(context);\n const binaryPath = path.join(\n dir,\n `${binaryName}${getExecutableExtension()}`\n );\n if (!fs.existsSync(binaryPath)) {\n return null;\n }\n\n if (!ensureManagedBinaryTrusted(dir, binaryPath, label, outputChannel)) {\n return null;\n }\n\n if (!matchesExtensionVersion(dir, binaryPath, label, outputChannel)) {\n return null;\n }\n\n return binaryPath;\n};\n\nexport const getInstalledBinaryPath = (\n context: vscode.ExtensionContext,\n outputChannel?: vscode.OutputChannel\n): string | null =>\n getManagedBinaryPath(context, LSP_BINARY_NAME, \"LSP\", outputChannel);\n\nexport const getInstalledCliPath = (\n context: vscode.ExtensionContext,\n outputChannel?: vscode.OutputChannel\n): string | null =>\n getManagedBinaryPath(context, CLI_BINARY_NAME, \"CLI\", outputChannel);\n\n/** Download a single binary asset from a GitHub release. Returns the dest path or null. */\nconst downloadAsset = async (\n release: GithubRelease,\n binaryName: string,\n target: string,\n dir: string\n): Promise => {\n const extension = getExecutableExtension();\n const assetName = `${binaryName}-${target}${extension}`;\n const asset = release.assets.find((a) => a.name === assetName);\n\n if (!asset) {\n return null;\n }\n\n const signatureAsset = release.assets.find(\n (candidate) => candidate.name === `${assetName}${SIGNATURE_SUFFIX}`\n );\n const expectedDigest = normalizeSha256Digest(asset.digest);\n\n const destPath = path.join(dir, `${binaryName}${extension}`);\n const signaturePath = getSignaturePath(destPath);\n const digestPath = getDigestPath(destPath);\n\n try {\n await httpsDownload(asset.browser_download_url, destPath);\n\n if (signatureAsset) {\n await httpsDownload(signatureAsset.browser_download_url, signaturePath);\n\n if (!verifyBinarySignature(destPath)) {\n throw new Error(`${assetName} failed Ed25519 signature verification`);\n }\n\n if (fs.existsSync(digestPath)) {\n fs.unlinkSync(digestPath);\n }\n } else if (expectedDigest) {\n if (!verifyBinaryDigest(destPath, expectedDigest)) {\n throw new Error(`${assetName} failed SHA-256 digest verification`);\n }\n\n writeDigestMarker(destPath, expectedDigest);\n } else {\n throw new Error(\n `${assetName} is missing both a signature asset and a GitHub release digest`\n );\n }\n\n if (os.platform() !== \"win32\") {\n fs.chmodSync(destPath, 0o755);\n }\n } catch (error) {\n for (const candidate of [destPath, signaturePath, digestPath]) {\n try {\n if (fs.existsSync(candidate)) {\n fs.unlinkSync(candidate);\n }\n } catch {\n // Best-effort cleanup on failed downloads.\n }\n }\n throw error;\n }\n\n return destPath;\n};\n\nexport const downloadBinary = async (\n context: vscode.ExtensionContext\n): Promise => {\n const target = getPlatformTarget();\n if (!target) {\n void vscode.window.showErrorMessage(\n `Fallow: unsupported platform ${os.platform()}-${os.arch()}`\n );\n return null;\n }\n\n return vscode.window.withProgress(\n {\n location: vscode.ProgressLocation.Notification,\n title: \"Fallow: Downloading binaries...\",\n cancellable: false,\n },\n async () => {\n try {\n const releaseJson = await httpsGet(\n `https://api.github.com/repos/${GITHUB_REPO}/releases/latest`\n );\n const release: GithubRelease = JSON.parse(releaseJson);\n const dir = getInstallDir(context);\n\n // Download LSP binary (required)\n const lspPath = await downloadAsset(release, LSP_BINARY_NAME, target, dir);\n if (!lspPath) {\n void vscode.window.showErrorMessage(\n `Fallow: no LSP binary found for ${target} in release ${release.tag_name}`\n );\n return null;\n }\n\n // Write version marker so future activations can detect stale binaries\n // without needing to execute them.\n const extensionVersion =\n vscode.extensions.getExtension(\"fallow-rs.fallow-vscode\")?.packageJSON\n ?.version as string | undefined;\n if (extensionVersion) {\n writeVersionMarker(dir, extensionVersion);\n }\n\n // Download CLI binary (best-effort — tree views and commands need it)\n let cliPath: string | null = null;\n try {\n cliPath = await downloadAsset(release, CLI_BINARY_NAME, target, dir);\n } catch (cliErr) {\n const cliMessage =\n cliErr instanceof Error ? cliErr.message : String(cliErr);\n void vscode.window.showWarningMessage(\n `Fallow: CLI download skipped: ${cliMessage}`\n );\n }\n if (cliPath) {\n void vscode.window.showInformationMessage(\n `Fallow: ${release.tag_name} installed (LSP + CLI).`\n );\n } else {\n void vscode.window.showInformationMessage(\n `Fallow: LSP ${release.tag_name} installed. CLI binary not found in release — tree views require the fallow CLI in PATH.`\n );\n }\n\n return lspPath;\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n void vscode.window.showErrorMessage(\n `Fallow: failed to download binaries: ${message}`\n );\n return null;\n }\n }\n );\n};\n","import * as fs from \"node:fs\";\n// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport {\n LanguageClient,\n LanguageClientOptions,\n ServerOptions,\n TransportKind,\n} from \"vscode-languageclient/node.js\";\nimport { Trace } from \"vscode-languageserver-protocol\";\nimport {\n getLspPath,\n getTraceLevel,\n getAutoDownload,\n getIssueTypes,\n getChangedSince,\n getResolvedConfigPath,\n} from \"./config.js\";\nimport { findBinaryInPath, findLocalBinary } from \"./binary-utils.js\";\nimport type { DiagnosticFilter } from \"./diagnosticFilter.js\";\nimport {\n parseDiagnosticCategories,\n resetDiagnosticCategories,\n setDiagnosticCategories,\n} from \"./diagnosticFilter.js\";\nimport {\n downloadBinary,\n getBinaryVersion,\n getInstalledBinaryPath,\n} from \"./download.js\";\n\nlet client: LanguageClient | null = null;\n\nconst warnIfVersionMismatch = (\n binaryPath: string,\n outputChannel?: vscode.OutputChannel\n): void => {\n const extensionVersion =\n vscode.extensions.getExtension(\"fallow-rs.fallow-vscode\")?.packageJSON\n ?.version as string | undefined;\n if (!extensionVersion) return;\n\n const binaryVersion = getBinaryVersion(binaryPath);\n if (binaryVersion && binaryVersion !== extensionVersion) {\n const msg = `Fallow: binary in PATH is v${binaryVersion}, extension is v${extensionVersion}. Update the binary or remove it from PATH to use the bundled version.`;\n outputChannel?.appendLine(msg);\n void vscode.window.showWarningMessage(msg);\n }\n};\n\nconst resolveBinaryPath = async (\n context: vscode.ExtensionContext,\n outputChannel?: vscode.OutputChannel\n): Promise => {\n const configPath = getLspPath();\n if (configPath) {\n if (fs.existsSync(configPath)) {\n outputChannel?.appendLine(`Binary resolution: using fallow.lspPath setting: ${configPath}`);\n return configPath;\n }\n void vscode.window.showWarningMessage(\n `Fallow: configured LSP path \"${configPath}\" does not exist.`\n );\n return null;\n }\n\n const local = findLocalBinary(\"fallow-lsp\");\n if (local) {\n outputChannel?.appendLine(`Binary resolution: using local node_modules/.bin: ${local}`);\n return local;\n }\n outputChannel?.appendLine(\"Binary resolution: no local node_modules/.bin/fallow-lsp found\");\n\n const inPath = findBinaryInPath(\"fallow-lsp\");\n if (inPath) {\n outputChannel?.appendLine(`Binary resolution: using system PATH: ${inPath}`);\n warnIfVersionMismatch(inPath, outputChannel);\n return inPath;\n }\n outputChannel?.appendLine(\"Binary resolution: fallow-lsp not found in PATH\");\n\n const installed = getInstalledBinaryPath(context, outputChannel);\n if (installed) {\n outputChannel?.appendLine(`Binary resolution: using previously downloaded binary: ${installed}`);\n return installed;\n }\n\n if (getAutoDownload()) {\n return downloadBinary(context);\n }\n\n const choice = await vscode.window.showErrorMessage(\n \"Fallow: fallow-lsp binary not found. Would you like to download it?\",\n \"Download\",\n \"Set Path\",\n \"Cancel\"\n );\n\n if (choice === \"Download\") {\n return downloadBinary(context);\n }\n\n if (choice === \"Set Path\") {\n void vscode.commands.executeCommand(\n \"workbench.action.openSettings\",\n \"fallow.lspPath\"\n );\n }\n\n return null;\n};\n\nexport const loadDiagnosticCategories = async (\n lspClient: LanguageClient,\n outputChannel: vscode.OutputChannel\n): Promise => {\n try {\n const response = await lspClient.sendRequest(\"fallow/issueTypes\");\n const categories = parseDiagnosticCategories(response);\n if (!categories) {\n resetDiagnosticCategories();\n outputChannel.appendLine(\n \"fallow/issueTypes returned an invalid response; using bundled diagnostic categories.\"\n );\n return;\n }\n setDiagnosticCategories(categories);\n outputChannel.appendLine(\n `Loaded ${categories.length} diagnostic categories from fallow-lsp.`\n );\n } catch (err) {\n resetDiagnosticCategories();\n const message = err instanceof Error ? err.message : String(err);\n outputChannel.appendLine(\n `fallow/issueTypes unavailable (${message}); using bundled diagnostic categories.`\n );\n }\n};\n\nexport const startClient = async (\n context: vscode.ExtensionContext,\n outputChannel: vscode.OutputChannel,\n diagnosticFilter?: DiagnosticFilter\n): Promise => {\n const binaryPath = await resolveBinaryPath(context, outputChannel);\n if (!binaryPath) {\n return null;\n }\n\n outputChannel.appendLine(`Using fallow-lsp binary: ${binaryPath}`);\n\n const serverOptions: ServerOptions = {\n command: binaryPath,\n transport: TransportKind.stdio,\n };\n\n const traceLevel = getTraceLevel();\n\n const clientOptions: LanguageClientOptions = {\n documentSelector: [\n { scheme: \"file\", language: \"javascript\" },\n { scheme: \"file\", language: \"javascriptreact\" },\n { scheme: \"file\", language: \"typescript\" },\n { scheme: \"file\", language: \"typescriptreact\" },\n { scheme: \"file\", language: \"vue\" },\n { scheme: \"file\", language: \"svelte\" },\n { scheme: \"file\", language: \"astro\" },\n { scheme: \"file\", language: \"mdx\" },\n { scheme: \"file\", language: \"json\" },\n ],\n outputChannel,\n traceOutputChannel: outputChannel,\n initializationOptions: {\n issueTypes: getIssueTypes(),\n changedSince: getChangedSince(),\n configPath: getResolvedConfigPath(),\n },\n middleware: diagnosticFilter\n ? {\n handleDiagnostics: (uri, diagnostics, next) =>\n diagnosticFilter.handleDiagnostics(uri, diagnostics, next),\n provideDiagnostics: (document, previousResultId, token, next) =>\n diagnosticFilter.provideDiagnostics(\n document,\n previousResultId,\n token,\n next\n ),\n }\n : undefined,\n };\n\n client = new LanguageClient(\n \"fallow\",\n \"Fallow Language Server\",\n serverOptions,\n clientOptions\n );\n\n if (traceLevel !== \"off\") {\n void client.setTrace(\n traceLevel === \"verbose\" ? Trace.Verbose : Trace.Messages\n );\n }\n\n try {\n await client.start();\n outputChannel.appendLine(\"Fallow language server started.\");\n await loadDiagnosticCategories(client, outputChannel);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n outputChannel.appendLine(`Failed to start language server: ${message}`);\n void vscode.window.showErrorMessage(\n `Fallow: failed to start language server. Check the output channel for details.`\n );\n client = null;\n return null;\n }\n\n diagnosticFilter?.attachClient(client);\n\n return client;\n};\n\nexport const stopClient = async (): Promise => {\n if (client) {\n await client.stop();\n client = null;\n }\n};\n\nexport const restartClient = async (\n context: vscode.ExtensionContext,\n outputChannel: vscode.OutputChannel,\n diagnosticFilter?: DiagnosticFilter\n): Promise => {\n // Detach BEFORE stop so a user toggle that fires during the gap can't\n // call refresh() against a disposed DiagnosticCollection. startClient\n // re-attaches once the new client is up.\n diagnosticFilter?.detachClient();\n await stopClient();\n return startClient(context, outputChannel, diagnosticFilter);\n};\n","import * as path from \"node:path\";\nimport type { FixAction } from \"./types.js\";\n\ninterface FixPreviewNavigateItem {\n readonly action: \"navigate\";\n readonly label: string;\n readonly description: string;\n readonly detail: string;\n readonly fix: FixAction;\n}\n\ninterface FixPreviewApplyAllItem {\n readonly action: \"apply-all\";\n readonly label: string;\n readonly description: string;\n}\n\ntype FixPreviewItem = FixPreviewNavigateItem | FixPreviewApplyAllItem;\n\nexport const buildFixArgs = (\n dryRun: boolean,\n production: boolean\n): string[] => {\n const args = dryRun\n ? [\"fix\", \"--dry-run\", \"--format\", \"json\", \"--quiet\"]\n : [\"fix\", \"--yes\", \"--format\", \"json\", \"--quiet\"];\n\n if (production) {\n args.push(\"--production\");\n }\n\n return args;\n};\n\nconst getFixLabel = (fix: FixAction): string =>\n fix.name ?? fix.package ?? fix.file ?? \"unknown\";\n\nconst getFixDetail = (fix: FixAction): string =>\n fix.path ? `${fix.path}${fix.line ? `:${fix.line}` : \"\"}` : fix.location ?? \"\";\n\nexport const createFixPreviewItems = (\n fixes: ReadonlyArray\n): FixPreviewItem[] => [\n ...fixes.map((fix) => ({\n label: getFixLabel(fix),\n description: fix.type.replace(/_/g, \" \"),\n detail: getFixDetail(fix),\n action: \"navigate\" as const,\n fix,\n })),\n {\n label: \"Apply all fixes\",\n description: `${fixes.length} fix${fixes.length === 1 ? \"\" : \"es\"}`,\n action: \"apply-all\" as const,\n },\n];\n\nexport const resolveFixLocation = (\n root: string,\n fix: FixAction\n): { absolutePath: string; line: number } | null => {\n const filePath = fix.path ?? fix.file;\n if (!filePath) {\n return null;\n }\n\n return {\n absolutePath: path.isAbsolute(filePath)\n ? filePath\n : path.resolve(root, filePath),\n line: Math.max(0, (fix.line ?? 1) - 1),\n };\n};\n","import * as child_process from \"node:child_process\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport {\n getLspPath,\n getProduction,\n getDuplicationMode,\n getDuplicationThreshold,\n getIssueTypes,\n getChangedSince,\n getResolvedConfigPath,\n} from \"./config.js\";\nimport { countCheckIssues } from \"./analysis-utils.js\";\nimport { findBinaryInPath, findLocalBinary, getExecutableExtension } from \"./binary-utils.js\";\nimport { getInstalledCliPath } from \"./download.js\";\nimport {\n buildFixArgs,\n createFixPreviewItems,\n resolveFixLocation,\n} from \"./fix-utils.js\";\nimport type {\n FallowCheckResult,\n FallowCombinedResult,\n FallowDupesResult,\n FallowFixResult,\n FixAction,\n} from \"./types.js\";\n\nconst findCliBinary = (context: vscode.ExtensionContext): string | null => {\n const lspPath = getLspPath();\n if (lspPath) {\n const dir = path.dirname(lspPath);\n const cliPath = path.join(dir, `fallow${getExecutableExtension()}`);\n if (fs.existsSync(cliPath)) {\n return cliPath;\n }\n }\n\n const local = findLocalBinary(\"fallow\");\n if (local) {\n return local;\n }\n\n const inPath = findBinaryInPath(\"fallow\");\n if (inPath) {\n return inPath;\n }\n\n const installed = getInstalledCliPath(context);\n if (installed) {\n return installed;\n }\n\n return null;\n};\n\nconst execFallow = (\n context: vscode.ExtensionContext,\n args: ReadonlyArray,\n cwd: string\n): Promise =>\n new Promise((resolve, reject) => {\n const binary = findCliBinary(context);\n if (!binary) {\n reject(new Error(\"fallow CLI binary not found in PATH.\"));\n return;\n }\n\n const child = child_process.spawn(binary, [...args], {\n cwd,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n\n let stdout = \"\";\n let stderr = \"\";\n\n child.stdout?.setEncoding(\"utf8\");\n child.stdout?.on(\"data\", (chunk: string) => {\n stdout += chunk;\n });\n\n child.stderr?.setEncoding(\"utf8\");\n child.stderr?.on(\"data\", (chunk: string) => {\n stderr += chunk;\n });\n\n child.on(\"error\", (error) => {\n reject(error);\n });\n\n child.on(\"close\", (code, signal) => {\n if (signal) {\n reject(new Error(`fallow exited via signal ${signal}`));\n return;\n }\n\n if (code !== null && code !== 0 && code !== 1) {\n reject(\n new Error(\n stderr.trim() || `fallow exited with code ${code}`\n )\n );\n return;\n }\n\n resolve(stdout);\n });\n });\n\n/** Filter check results based on the user's issueTypes configuration. */\nconst filterCheckResult = (result: FallowCheckResult): FallowCheckResult => {\n const types = getIssueTypes();\n const filtered: FallowCheckResult = {\n ...result,\n unused_files: types[\"unused-files\"] ? result.unused_files : [],\n unused_exports: types[\"unused-exports\"] ? result.unused_exports : [],\n unused_types: types[\"unused-types\"] ? result.unused_types : [],\n private_type_leaks: types[\"private-type-leaks\"] ? result.private_type_leaks : [],\n unused_dependencies: types[\"unused-dependencies\"] ? result.unused_dependencies : [],\n unused_dev_dependencies: types[\"unused-dev-dependencies\"] ? result.unused_dev_dependencies : [],\n unused_optional_dependencies: types[\"unused-optional-dependencies\"] ? result.unused_optional_dependencies : [],\n unused_enum_members: types[\"unused-enum-members\"] ? result.unused_enum_members : [],\n unused_class_members: types[\"unused-class-members\"] ? result.unused_class_members : [],\n unresolved_imports: types[\"unresolved-imports\"] ? result.unresolved_imports : [],\n unlisted_dependencies: types[\"unlisted-dependencies\"] ? result.unlisted_dependencies : [],\n duplicate_exports: types[\"duplicate-exports\"] ? result.duplicate_exports : [],\n type_only_dependencies: types[\"type-only-dependencies\"] ? result.type_only_dependencies : [],\n test_only_dependencies: types[\"test-only-dependencies\"] ? result.test_only_dependencies : [],\n circular_dependencies: types[\"circular-dependencies\"] ? result.circular_dependencies : [],\n boundary_violations: types[\"boundary-violation\"] ? result.boundary_violations : [],\n stale_suppressions: types[\"stale-suppressions\"] ? result.stale_suppressions : [],\n unused_catalog_entries: types[\"unused-catalog-entries\"]\n ? result.unused_catalog_entries\n : [],\n unresolved_catalog_references: types[\"unresolved-catalog-references\"]\n ? result.unresolved_catalog_references\n : [],\n unused_dependency_overrides: types[\"unused-dependency-overrides\"]\n ? result.unused_dependency_overrides\n : [],\n misconfigured_dependency_overrides: types[\n \"misconfigured-dependency-overrides\"\n ]\n ? result.misconfigured_dependency_overrides\n : [],\n };\n const totalIssues = countCheckIssues(filtered);\n const summary = {\n total_issues: totalIssues,\n unused_files: filtered.unused_files.length,\n unused_exports: filtered.unused_exports.length,\n unused_types: filtered.unused_types.length,\n private_type_leaks: filtered.private_type_leaks?.length ?? 0,\n unused_dependencies:\n filtered.unused_dependencies.length +\n filtered.unused_dev_dependencies.length +\n (filtered.unused_optional_dependencies?.length ?? 0),\n unused_enum_members: filtered.unused_enum_members.length,\n unused_class_members: filtered.unused_class_members.length,\n unresolved_imports: filtered.unresolved_imports.length,\n unlisted_dependencies: filtered.unlisted_dependencies.length,\n duplicate_exports: filtered.duplicate_exports.length,\n type_only_dependencies: filtered.type_only_dependencies?.length ?? 0,\n test_only_dependencies: filtered.test_only_dependencies?.length ?? 0,\n circular_dependencies: filtered.circular_dependencies?.length ?? 0,\n boundary_violations: filtered.boundary_violations?.length ?? 0,\n stale_suppressions: filtered.stale_suppressions?.length ?? 0,\n unused_catalog_entries: filtered.unused_catalog_entries?.length ?? 0,\n unresolved_catalog_references:\n filtered.unresolved_catalog_references?.length ?? 0,\n };\n return {\n ...filtered,\n total_issues: totalIssues,\n summary,\n };\n};\n\nconst getWorkspaceRoot = (): string | null => {\n const folders = vscode.workspace.workspaceFolders;\n if (!folders || folders.length === 0) {\n return null;\n }\n return folders[0].uri.fsPath;\n};\n\ninterface FixQuickPickItem extends vscode.QuickPickItem {\n readonly action: \"navigate\" | \"apply-all\";\n readonly fix?: FixAction;\n}\n\nconst confirmApplyFixes = async (): Promise => {\n const confirm = await vscode.window.showWarningMessage(\n \"Fallow: This will unexport unused exports (keeps the code) and remove unused dependencies from package.json. Continue?\",\n \"Yes\",\n \"No\"\n );\n\n return confirm === \"Yes\";\n};\n\nconst openFixLocation = async (\n root: string,\n fix: FixAction | undefined\n): Promise => {\n if (!fix) {\n return;\n }\n\n const location = resolveFixLocation(root, fix);\n if (!location) {\n return;\n }\n\n await vscode.window.showTextDocument(vscode.Uri.file(location.absolutePath), {\n selection: new vscode.Range(location.line, 0, location.line, 0),\n });\n};\n\nconst showDryRunPreview = async (\n root: string,\n result: FallowFixResult\n): Promise => {\n if (result.fixes.length === 0) {\n void vscode.window.showInformationMessage(\"Fallow: no fixes available.\");\n return;\n }\n\n const quickPickItems: FixQuickPickItem[] = [];\n for (const item of createFixPreviewItems(result.fixes)) {\n if (item.action === \"apply-all\") {\n quickPickItems.push({\n label: \"\",\n kind: vscode.QuickPickItemKind.Separator,\n action: \"navigate\",\n });\n quickPickItems.push({\n label: \"$(play) Apply all fixes\",\n description: item.description,\n action: item.action,\n });\n continue;\n }\n\n quickPickItems.push({\n label: `$(wrench) ${item.label}`,\n description: item.description,\n detail: item.detail,\n action: item.action,\n fix: item.fix,\n });\n }\n\n const picked = await vscode.window.showQuickPick(quickPickItems, {\n title: `Fallow: ${result.fixes.length} fix${result.fixes.length === 1 ? \"\" : \"es\"} available`,\n placeHolder:\n \"Review fixes — select 'Apply all fixes' to apply, or click a fix to navigate\",\n });\n\n if (!picked) {\n return;\n }\n\n if (picked.action === \"apply-all\") {\n void vscode.commands.executeCommand(\"fallow.fix\");\n return;\n }\n\n await openFixLocation(root, picked.fix);\n};\n\nexport const runAnalysis = async (\n context: vscode.ExtensionContext\n): Promise<{\n check: FallowCheckResult | null;\n dupes: FallowDupesResult | null;\n}> => {\n const root = getWorkspaceRoot();\n if (!root) {\n void vscode.window.showWarningMessage(\"Fallow: no workspace folder open.\");\n return { check: null, dupes: null };\n }\n\n let check: FallowCheckResult | null = null;\n let dupes: FallowDupesResult | null = null;\n\n try {\n const analysisArgs = [\"--format\", \"json\", \"--quiet\", \"--skip\", \"health\"];\n if (getProduction()) {\n analysisArgs.push(\"--production\");\n }\n\n const changedSince = getChangedSince();\n if (changedSince) {\n analysisArgs.push(\"--changed-since\", changedSince);\n }\n\n const configPath = getResolvedConfigPath();\n if (configPath) {\n analysisArgs.push(\"--config\", configPath);\n }\n\n analysisArgs.push(\"--dupes-mode\", getDuplicationMode());\n analysisArgs.push(\"--dupes-threshold\", String(getDuplicationThreshold()));\n\n const output = await execFallow(context, analysisArgs, root);\n\n if (output.trim().length === 0) {\n // execFallow already rejects on non-zero exit codes (other than 0/1);\n // an empty stdout on a successful exit means there was nothing to\n // report. Leave check/dupes null and return without raising.\n return { check, dupes };\n }\n\n const result = JSON.parse(output) as FallowCombinedResult;\n check = result.check ? filterCheckResult(result.check) : null;\n dupes = result.dupes ?? null;\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n void vscode.window.showErrorMessage(`Fallow analysis failed: ${message}`);\n throw err;\n }\n\n return { check, dupes };\n};\n\nexport const runFix = async (\n context: vscode.ExtensionContext,\n dryRun: boolean\n): Promise => {\n const root = getWorkspaceRoot();\n if (!root) {\n void vscode.window.showWarningMessage(\"Fallow: no workspace folder open.\");\n return null;\n }\n\n if (!dryRun && !(await confirmApplyFixes())) {\n return null;\n }\n\n try {\n const fixArgs = buildFixArgs(dryRun, getProduction());\n const configPath = getResolvedConfigPath();\n if (configPath) {\n fixArgs.push(\"--config\", configPath);\n }\n\n const output = await execFallow(\n context,\n fixArgs,\n root\n );\n const result = JSON.parse(output) as FallowFixResult;\n\n if (dryRun) {\n await showDryRunPreview(root, result);\n } else {\n const fixCount = result.fixes.length;\n void vscode.window.showInformationMessage(\n `Fallow: applied ${fixCount} fix${fixCount === 1 ? \"\" : \"es\"}.`\n );\n }\n\n return result;\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n void vscode.window.showErrorMessage(`Fallow fix failed: ${message}`);\n return null;\n }\n};\n","// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport {\n DiagnosticFilter,\n diagnosticCode,\n getDiagnosticCategories,\n isFallowDiagnostic,\n} from \"./diagnosticFilter.js\";\n\nconst DUPLICATE_CODE = \"code-duplication\";\nconst STATUS_ITEM_ID = \"fallow.diagnosticMutes\";\nconst CODE_ACTION_KIND = vscode.CodeActionKind.QuickFix.append(\"fallow.mute\");\nconst FALLOW_LANGUAGES = [\n \"javascript\",\n \"javascriptreact\",\n \"typescript\",\n \"typescriptreact\",\n \"vue\",\n \"svelte\",\n \"astro\",\n \"mdx\",\n \"json\",\n];\n\nconst labelFor = (code: string): string =>\n getDiagnosticCategories().find((c) => c.code === code)?.label ?? code;\n\nconst categoryWord = (count: number): string =>\n count === 1 ? \"category\" : \"categories\";\n\nconst muteScopeTooltip = (filter: DiagnosticFilter): vscode.MarkdownString => {\n const muted = Array.from(filter.mutedCategoriesSnapshot())\n .map(labelFor)\n .sort();\n const mutedAll = filter.isMutedAll();\n const lines: string[] = [];\n if (mutedAll) {\n lines.push(\"**All Fallow findings hidden** in the editor.\");\n } else if (muted.length > 0) {\n lines.push(`**Hiding ${muted.length} ${categoryWord(muted.length)}** in the editor:`);\n lines.push(\"\");\n for (const m of muted) {\n lines.push(`- ${m}`);\n }\n } else {\n lines.push(\"All Fallow findings visible.\");\n }\n lines.push(\"\");\n lines.push(\n \"Local view filter only. CI and `fallow check` still report every finding.\"\n );\n lines.push(\"To disable a rule project-wide, edit your fallow config.\"\n );\n const md = new vscode.MarkdownString(lines.join(\"\\n\"));\n md.isTrusted = false;\n md.supportThemeIcons = true;\n return md;\n};\n\nconst summaryText = (filter: DiagnosticFilter): string => {\n if (filter.isMutedAll()) {\n return \"Fallow: hiding all\";\n }\n const n = filter.mutedCategoriesSnapshot().size;\n return `Fallow: hiding ${n} ${categoryWord(n)}`;\n};\n\n/** A LanguageStatusItem in the right gutter that surfaces mute state.\n * Severity is `Warning` whenever anything is muted, otherwise the item is\n * hidden. Click opens the manage-mutes QuickPick. A secondary command\n * clears all mutes in one click. */\nconst createLanguageStatus = (\n filter: DiagnosticFilter\n): vscode.LanguageStatusItem => {\n const selector = FALLOW_LANGUAGES.map((language) => ({\n scheme: \"file\",\n language,\n }));\n const item = vscode.languages.createLanguageStatusItem(STATUS_ITEM_ID, []);\n item.name = \"Fallow Mute\";\n item.accessibilityInformation = {\n label: \"Fallow diagnostic mute status\",\n role: \"button\",\n };\n\n const apply = (): void => {\n if (!filter.anythingMuted()) {\n item.selector = [];\n item.severity = vscode.LanguageStatusSeverity.Information;\n item.text = \"$(check) Fallow\";\n item.detail = \"all findings visible\";\n item.command = undefined;\n return;\n }\n item.selector = selector;\n item.severity = vscode.LanguageStatusSeverity.Warning;\n item.text = `$(eye-closed) ${summaryText(filter)}`;\n item.detail = \"click to manage\";\n item.command = {\n command: \"fallow.manageDiagnosticMutes\",\n title: \"Manage\",\n tooltip: \"Manage Fallow diagnostic mutes\",\n };\n };\n\n apply();\n filter.onDidChange(apply);\n return item;\n};\n\ninterface ManagePickItem extends vscode.QuickPickItem {\n readonly code: string | null;\n}\n\nconst TITLE_BUTTONS = {\n toggleAll: {\n iconPath: new vscode.ThemeIcon(\"eye-closed\"),\n tooltip: \"Toggle mute for ALL Fallow findings\",\n },\n clearAll: {\n iconPath: new vscode.ThemeIcon(\"clear-all\"),\n tooltip: \"Show all Fallow findings (clear all mutes)\",\n },\n} as const;\n\nconst showManageQuickPick = async (filter: DiagnosticFilter): Promise => {\n const pick = vscode.window.createQuickPick();\n pick.title = \"Fallow: manage diagnostic mutes (CI is unaffected)\";\n pick.placeholder =\n \"Check categories to hide them in the editor. Press Enter to apply.\";\n pick.canSelectMany = true;\n pick.matchOnDetail = true;\n pick.buttons = [TITLE_BUTTONS.toggleAll, TITLE_BUTTONS.clearAll];\n\n const globalItem: ManagePickItem = {\n label: \"$(eye-closed) All Fallow Findings\",\n description: filter.isMutedAll() ? \"currently hidden\" : \"currently visible\",\n detail: \"Global editor-only mute. Use the title buttons to toggle or clear it.\",\n code: null,\n picked: filter.isMutedAll(),\n alwaysShow: filter.isMutedAll(),\n };\n const items: ManagePickItem[] = [\n globalItem,\n ...getDiagnosticCategories().map(({ code, label }) => ({\n label,\n description: code,\n code,\n picked: filter.isMutedAll() || filter.isCategoryMuted(code),\n })),\n ];\n pick.items = items;\n pick.selectedItems = items.filter((i) => i.picked === true);\n\n await new Promise((resolve) => {\n pick.onDidTriggerButton((button) => {\n if (button === TITLE_BUTTONS.toggleAll) {\n filter.toggleMutedAll();\n } else if (button === TITLE_BUTTONS.clearAll) {\n filter.clearAllMutes();\n }\n pick.hide();\n });\n pick.onDidAccept(() => {\n const globalSelected = pick.selectedItems.some((i) => i.code === null);\n const selected = new Set(\n pick.selectedItems\n .map((i) => i.code)\n .filter((code): code is string => code !== null)\n );\n if (globalSelected) {\n filter.setMutedAll(true);\n } else {\n if (filter.isMutedAll()) {\n filter.setMutedAll(false);\n }\n filter.setMutedCategories(selected);\n }\n pick.hide();\n });\n pick.onDidHide(() => {\n pick.dispose();\n resolve();\n });\n pick.show();\n });\n};\n\nconst updateContextKey = (filter: DiagnosticFilter): void => {\n void vscode.commands.executeCommand(\n \"setContext\",\n \"fallow.duplicatesMuted\",\n filter.isCategoryMuted(DUPLICATE_CODE) || filter.isMutedAll()\n );\n void vscode.commands.executeCommand(\n \"setContext\",\n \"fallow.allDiagnosticsMuted\",\n filter.isMutedAll()\n );\n};\n\nclass FallowMuteCodeActions implements vscode.CodeActionProvider {\n public static readonly providedKinds: ReadonlyArray = [\n CODE_ACTION_KIND,\n ];\n\n public provideCodeActions(\n _document: vscode.TextDocument,\n _range: vscode.Range | vscode.Selection,\n context: vscode.CodeActionContext\n ): vscode.CodeAction[] {\n const seen = new Set();\n const actions: vscode.CodeAction[] = [];\n for (const diag of context.diagnostics) {\n if (!isFallowDiagnostic(diag)) {\n continue;\n }\n const code = diagnosticCode(diag);\n if (!code || seen.has(code)) {\n continue;\n }\n seen.add(code);\n const label = labelFor(code);\n const action = new vscode.CodeAction(\n `Mute Fallow ${label.toLowerCase()} findings in this workspace`,\n CODE_ACTION_KIND\n );\n action.command = {\n command: \"fallow.muteDiagnosticCategory\",\n title: \"Mute Fallow category\",\n arguments: [code],\n };\n action.diagnostics = [diag];\n actions.push(action);\n }\n return actions;\n }\n}\n\nexport const registerDiagnosticMuteUi = (\n context: vscode.ExtensionContext,\n filter: DiagnosticFilter\n): void => {\n const statusItem = createLanguageStatus(filter);\n context.subscriptions.push(statusItem);\n\n context.subscriptions.push(\n filter.onDidChange(() => updateContextKey(filter))\n );\n updateContextKey(filter);\n\n context.subscriptions.push(\n vscode.workspace.onDidCloseTextDocument((doc) => {\n filter.evictUri(doc.uri);\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.toggleMuteDuplicates\", () => {\n const nowMuted = filter.toggleCategory(DUPLICATE_CODE);\n void vscode.window.setStatusBarMessage(\n nowMuted\n ? \"Fallow: muted code-duplication findings (CI is unaffected)\"\n : \"Fallow: showing code-duplication findings\",\n 4000\n );\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.toggleAllDiagnostics\", () => {\n const nowMuted = filter.toggleMutedAll();\n void vscode.window.setStatusBarMessage(\n nowMuted\n ? \"Fallow: muted all findings (CI is unaffected)\"\n : \"Fallow: showing all findings\",\n 4000\n );\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\n \"fallow.manageDiagnosticMutes\",\n async () => {\n await showManageQuickPick(filter);\n }\n )\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.clearDiagnosticMutes\", () => {\n filter.clearAllMutes();\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\n \"fallow.muteDiagnosticCategory\",\n (code: unknown) => {\n if (typeof code === \"string\" && code.length > 0) {\n filter.setCategoryMuted(code, true);\n }\n }\n )\n );\n\n for (const language of FALLOW_LANGUAGES) {\n context.subscriptions.push(\n vscode.languages.registerCodeActionsProvider(\n { scheme: \"file\", language },\n new FallowMuteCodeActions(),\n { providedCodeActionKinds: FallowMuteCodeActions.providedKinds }\n )\n );\n }\n};\n\nexport const __testHelpers = {\n createLanguageStatus,\n labelFor,\n summaryText,\n showManageQuickPick,\n muteScopeTooltip,\n};\n","import { countCheckIssues } from \"./analysis-utils.js\";\nimport type { FallowCheckResult, FallowDupesResult } from \"./types.js\";\n\nexport interface AnalysisCompleteParams {\n totalIssues: number;\n unusedFiles: number;\n unusedExports: number;\n unusedTypes: number;\n privateTypeLeaks: number;\n unusedDependencies: number;\n unusedDevDependencies: number;\n unusedOptionalDependencies: number;\n unusedEnumMembers: number;\n unusedClassMembers: number;\n unresolvedImports: number;\n unlistedDependencies: number;\n duplicateExports: number;\n typeOnlyDependencies: number;\n testOnlyDependencies: number;\n circularDependencies: number;\n boundaryViolations: number;\n staleSuppressions: number;\n unusedCatalogEntries: number;\n unresolvedCatalogReferences: number;\n unusedDependencyOverrides: number;\n misconfiguredDependencyOverrides: number;\n duplicationPercentage: number;\n cloneGroups: number;\n}\n\n/**\n * Convert CLI analysis results into the same shape the LSP notification\n * delivers, so the status bar text and tooltip can be built from a single\n * source of truth regardless of whether LSP or CLI produced the data.\n */\nexport const buildParamsFromCli = (\n check: FallowCheckResult | null,\n dupes: FallowDupesResult | null\n): AnalysisCompleteParams => ({\n totalIssues: countCheckIssues(check),\n unusedFiles: check?.unused_files.length ?? 0,\n unusedExports: check?.unused_exports.length ?? 0,\n unusedTypes: check?.unused_types.length ?? 0,\n privateTypeLeaks: check?.private_type_leaks?.length ?? 0,\n unusedDependencies: check?.unused_dependencies.length ?? 0,\n unusedDevDependencies: check?.unused_dev_dependencies.length ?? 0,\n unusedOptionalDependencies: check?.unused_optional_dependencies?.length ?? 0,\n unusedEnumMembers: check?.unused_enum_members.length ?? 0,\n unusedClassMembers: check?.unused_class_members.length ?? 0,\n unresolvedImports: check?.unresolved_imports.length ?? 0,\n unlistedDependencies: check?.unlisted_dependencies.length ?? 0,\n duplicateExports: check?.duplicate_exports.length ?? 0,\n typeOnlyDependencies: check?.type_only_dependencies?.length ?? 0,\n testOnlyDependencies: check?.test_only_dependencies?.length ?? 0,\n circularDependencies: check?.circular_dependencies?.length ?? 0,\n boundaryViolations: check?.boundary_violations?.length ?? 0,\n staleSuppressions: check?.stale_suppressions?.length ?? 0,\n unusedCatalogEntries: check?.unused_catalog_entries?.length ?? 0,\n unresolvedCatalogReferences:\n check?.unresolved_catalog_references?.length ?? 0,\n unusedDependencyOverrides:\n check?.unused_dependency_overrides?.length ?? 0,\n misconfiguredDependencyOverrides:\n check?.misconfigured_dependency_overrides?.length ?? 0,\n duplicationPercentage: dupes?.stats.duplication_percentage ?? 0,\n cloneGroups: dupes?.stats.clone_groups ?? 0,\n});\n\ntype SeverityKey =\n | \"statusBarItem.errorBackground\"\n | \"statusBarItem.warningBackground\";\n\ninterface BreakdownLine {\n readonly count: keyof AnalysisCompleteParams;\n readonly icon: string;\n readonly label: string;\n}\n\nconst BREAKDOWN_LINES: ReadonlyArray = [\n {\n count: \"unresolvedImports\",\n icon: \"$(error)\",\n label: \"unresolved imports\",\n },\n { count: \"unusedFiles\", icon: \"$(warning)\", label: \"unused files\" },\n { count: \"unusedExports\", icon: \"$(warning)\", label: \"unused exports\" },\n { count: \"unusedTypes\", icon: \"$(info)\", label: \"unused types\" },\n {\n count: \"privateTypeLeaks\",\n icon: \"$(warning)\",\n label: \"private type leaks\",\n },\n {\n count: \"unusedDependencies\",\n icon: \"$(warning)\",\n label: \"unused dependencies\",\n },\n {\n count: \"unusedDevDependencies\",\n icon: \"$(warning)\",\n label: \"unused dev dependencies\",\n },\n {\n count: \"unusedOptionalDependencies\",\n icon: \"$(warning)\",\n label: \"unused optional dependencies\",\n },\n {\n count: \"unusedEnumMembers\",\n icon: \"$(info)\",\n label: \"unused enum members\",\n },\n {\n count: \"unusedClassMembers\",\n icon: \"$(info)\",\n label: \"unused class members\",\n },\n {\n count: \"unlistedDependencies\",\n icon: \"$(warning)\",\n label: \"unlisted dependencies\",\n },\n {\n count: \"duplicateExports\",\n icon: \"$(warning)\",\n label: \"duplicate exports\",\n },\n {\n count: \"typeOnlyDependencies\",\n icon: \"$(info)\",\n label: \"type-only dependencies\",\n },\n {\n count: \"testOnlyDependencies\",\n icon: \"$(info)\",\n label: \"test-only dependencies\",\n },\n {\n count: \"circularDependencies\",\n icon: \"$(warning)\",\n label: \"circular dependencies\",\n },\n {\n count: \"boundaryViolations\",\n icon: \"$(warning)\",\n label: \"boundary violations\",\n },\n {\n count: \"staleSuppressions\",\n icon: \"$(info)\",\n label: \"stale suppressions\",\n },\n {\n count: \"unusedCatalogEntries\",\n icon: \"$(warning)\",\n label: \"unused catalog entries\",\n },\n {\n count: \"unresolvedCatalogReferences\",\n icon: \"$(error)\",\n label: \"unresolved catalog references\",\n },\n {\n count: \"unusedDependencyOverrides\",\n icon: \"$(warning)\",\n label: \"unused dependency overrides\",\n },\n {\n count: \"misconfiguredDependencyOverrides\",\n icon: \"$(error)\",\n label: \"misconfigured dependency overrides\",\n },\n];\n\nexport const getDuplicationPercentage = (\n duplicationPercentage: number\n): number => (Number.isFinite(duplicationPercentage) ? duplicationPercentage : 0);\n\nexport const buildStatusBarPartsFromLsp = (\n params: AnalysisCompleteParams\n): string[] => [\n `${params.totalIssues} issues`,\n `${getDuplicationPercentage(params.duplicationPercentage).toFixed(1)}% duplication`,\n];\n\nexport const getStatusBarSeverityKey = (\n params: AnalysisCompleteParams\n): SeverityKey | null => {\n if (params.unresolvedImports > 0) {\n return \"statusBarItem.errorBackground\";\n }\n\n if (params.totalIssues > 0) {\n return \"statusBarItem.warningBackground\";\n }\n\n return null;\n};\n\nconst normalizeInlineText = (value: string): string =>\n value.replace(/\\s+/g, \" \").trim();\n\nexport const formatChangedSinceRefForStatusBar = (ref: string): string => {\n const normalized = normalizeInlineText(ref);\n return normalized.length > 48\n ? `${normalized.slice(0, 45).trimEnd()}...`\n : normalized;\n};\n\n/**\n * Resolve the visible status bar text for a given base label, appending\n * the persistent `changedSince` suffix when that filter is active.\n *\n * Single source of truth across the four status bar states (idle,\n * analyzing, error, post-analysis). Earlier the post-analysis path was\n * the only state that showed `(since )`, which made the filter feel\n * intermittent and forced users to hover the tooltip to verify it was\n * still active. The panel review for issue #190 flagged this as the\n * visible signal that should match the `changedSince` filter applied to\n * LSP diagnostics.\n *\n * Pure: takes the resolved ref so it can be unit-tested without a vscode\n * mock. Callers in `statusBar.ts` pass `getChangedSince()` or `null`.\n */\nexport const renderStatusBarText = (\n base: string,\n changedSince: string | null\n): string => {\n if (!changedSince) {\n return base;\n }\n return `${base} (since ${formatChangedSinceRefForStatusBar(changedSince)})`;\n};\n\nconst escapeMarkdownText = (value: string): string =>\n normalizeInlineText(value).replace(/([\\\\`*_{}[\\]()#+.!|>-])/g, \"\\\\$1\");\n\nexport const buildStatusBarTooltipMarkdown = (\n params: AnalysisCompleteParams,\n changedSinceRef: string | null = null\n): string => {\n const lines: string[] = [\"**Fallow** - Analysis Results\\n\"];\n const duplicationPercentage = getDuplicationPercentage(\n params.duplicationPercentage\n );\n\n if (changedSinceRef) {\n lines.push(\n `$(git-branch) Scoped to changes since ${escapeMarkdownText(changedSinceRef)}`\n );\n }\n\n for (const line of BREAKDOWN_LINES) {\n const count = params[line.count];\n if (typeof count === \"number\" && count > 0) {\n lines.push(`${line.icon} ${count} ${line.label}`);\n }\n }\n\n if (params.cloneGroups > 0) {\n lines.push(\n `$(copy) ${params.cloneGroups} clone groups (${duplicationPercentage.toFixed(1)}% duplication)`\n );\n }\n\n if (params.totalIssues === 0 && params.cloneGroups === 0) {\n lines.push(\"$(check) No issues found\");\n }\n\n lines.push(\"\\n---\\n\");\n lines.push(\n \"[$(play) Run Analysis](command:fallow.analyze) · [$(wrench) Auto-Fix](command:fallow.fix) · [$(output) Output](command:fallow.showOutput)\"\n );\n\n return lines.join(\"\\n\\n\");\n};\n","// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport { getChangedSince } from \"./config.js\";\nimport {\n buildParamsFromCli,\n buildStatusBarPartsFromLsp,\n buildStatusBarTooltipMarkdown,\n getStatusBarSeverityKey,\n renderStatusBarText,\n} from \"./statusBar-utils.js\";\nimport type { FallowCheckResult, FallowDupesResult } from \"./types.js\";\nexport type { AnalysisCompleteParams } from \"./statusBar-utils.js\";\nimport type { AnalysisCompleteParams } from \"./statusBar-utils.js\";\n\nlet statusBarItem: vscode.StatusBarItem | null = null;\n\nconst liveChangedSince = (): string | null => getChangedSince() || null;\n\nexport const createStatusBar = (): vscode.StatusBarItem => {\n statusBarItem = vscode.window.createStatusBarItem(\n vscode.StatusBarAlignment.Left,\n 50\n );\n statusBarItem.command = \"fallow.analyze\";\n statusBarItem.text = renderStatusBarText(\n \"$(search) Fallow\",\n liveChangedSince()\n );\n statusBarItem.show();\n return statusBarItem;\n};\n\n/** Update the status bar from CLI-driven analysis results. */\nexport const updateStatusBar = (\n checkResult: FallowCheckResult | null,\n dupesResult: FallowDupesResult | null\n): void => {\n if (!statusBarItem) {\n return;\n }\n\n const params = buildParamsFromCli(checkResult, dupesResult);\n applyTooltipAndSeverity(params);\n\n const parts: string[] = [];\n if (checkResult) {\n parts.push(`${params.totalIssues} issues`);\n }\n if (dupesResult) {\n parts.push(`${params.duplicationPercentage.toFixed(1)}% duplication`);\n }\n applyStatusBarText(parts);\n};\n\n/** Update the status bar from LSP notification data. */\nexport const updateStatusBarFromLsp = (params: AnalysisCompleteParams): void => {\n if (!statusBarItem) {\n return;\n }\n\n applyTooltipAndSeverity(params);\n applyStatusBarText(buildStatusBarPartsFromLsp(params));\n};\n\nconst applyTooltipAndSeverity = (params: AnalysisCompleteParams): void => {\n if (!statusBarItem) {\n return;\n }\n\n const severity = getStatusBarSeverityKey(params);\n statusBarItem.backgroundColor = severity\n ? new vscode.ThemeColor(severity)\n : undefined;\n\n const tooltip = new vscode.MarkdownString(\n buildStatusBarTooltipMarkdown(params, getChangedSince() || null)\n );\n tooltip.isTrusted = true;\n // Required so `$(name)` codicons in the markdown render as icons rather\n // than literal text. Without this the popup shows raw `$(error)`,\n // `$(warning)`, etc. (issue #179).\n tooltip.supportThemeIcons = true;\n statusBarItem.tooltip = tooltip;\n};\n\nconst applyStatusBarText = (parts: string[]): void => {\n if (!statusBarItem) {\n return;\n }\n const base =\n parts.length > 0\n ? `$(search) Fallow: ${parts.join(\" | \")}`\n : \"$(search) Fallow\";\n statusBarItem.text = renderStatusBarText(base, liveChangedSince());\n};\n\nexport const setStatusBarAnalyzing = (): void => {\n if (statusBarItem) {\n statusBarItem.text = renderStatusBarText(\n \"$(loading~spin) Fallow: Analyzing...\",\n liveChangedSince()\n );\n }\n};\n\nexport const setStatusBarError = (): void => {\n if (statusBarItem) {\n statusBarItem.text = renderStatusBarText(\n \"$(error) Fallow: Error\",\n liveChangedSince()\n );\n }\n};\n\nexport const disposeStatusBar = (): void => {\n if (statusBarItem) {\n statusBarItem.dispose();\n statusBarItem = null;\n }\n};\n","import * as path from \"node:path\";\n\nexport interface ResolvedPath {\n readonly absolute: string;\n readonly relative: string;\n}\n\nexport const resolveFilePath = (\n filePath: string | undefined,\n workspaceRoot: string | undefined\n): ResolvedPath => {\n if (!filePath) {\n return { absolute: \"\", relative: \"\" };\n }\n const absolute = workspaceRoot && !path.isAbsolute(filePath)\n ? path.resolve(workspaceRoot, filePath)\n : filePath;\n const relative = workspaceRoot ? path.relative(workspaceRoot, absolute) : filePath;\n return { absolute, relative };\n};\n","/**\n * Tree-view category labels. The kebab-case `IssueCategory` keys mirror\n * fallow's rule names and the VS Code setting `fallow.issueTypes.*` keys.\n * These are UI strings, not part of the JSON output contract.\n */\n\nexport type IssueCategory =\n | \"unused-files\"\n | \"unused-exports\"\n | \"unused-types\"\n | \"private-type-leaks\"\n | \"unused-dependencies\"\n | \"unused-dev-dependencies\"\n | \"unused-optional-dependencies\"\n | \"unused-enum-members\"\n | \"unused-class-members\"\n | \"unresolved-imports\"\n | \"unlisted-dependencies\"\n | \"duplicate-exports\"\n | \"type-only-dependencies\"\n | \"test-only-dependencies\"\n | \"circular-dependencies\"\n | \"boundary-violation\"\n | \"stale-suppressions\"\n | \"unused-catalog-entries\"\n | \"unresolved-catalog-references\"\n | \"unused-dependency-overrides\"\n | \"misconfigured-dependency-overrides\";\n\nexport const ISSUE_CATEGORY_LABELS: Record = {\n \"unused-files\": \"Unused Files\",\n \"unused-exports\": \"Unused Exports\",\n \"unused-types\": \"Unused Types\",\n \"private-type-leaks\": \"Private Type Leaks\",\n \"unused-dependencies\": \"Unused Dependencies\",\n \"unused-dev-dependencies\": \"Unused Dev Dependencies\",\n \"unused-optional-dependencies\": \"Unused Optional Dependencies\",\n \"unused-enum-members\": \"Unused Enum Members\",\n \"unused-class-members\": \"Unused Class Members\",\n \"unresolved-imports\": \"Unresolved Imports\",\n \"unlisted-dependencies\": \"Unlisted Dependencies\",\n \"duplicate-exports\": \"Duplicate Exports\",\n \"type-only-dependencies\": \"Type-Only Dependencies\",\n \"test-only-dependencies\": \"Test-Only Dependencies\",\n \"circular-dependencies\": \"Circular Dependencies\",\n \"boundary-violation\": \"Boundary Violations\",\n \"stale-suppressions\": \"Stale Suppressions\",\n \"unused-catalog-entries\": \"Unused Catalog Entries\",\n \"unresolved-catalog-references\": \"Unresolved Catalog References\",\n \"unused-dependency-overrides\": \"Unused Dependency Overrides\",\n \"misconfigured-dependency-overrides\": \"Misconfigured Dependency Overrides\",\n};\n","import * as path from \"node:path\";\n// VS Code calls TreeDataProvider members through the registered provider.\n// fallow-ignore-file unused-class-member\n// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport { countCheckIssues } from \"./analysis-utils.js\";\nimport { resolveFilePath as resolveFilePathPure } from \"./treeView-utils.js\";\nimport type {\n CloneGroup,\n FallowCheckResult,\n FallowDupesResult,\n IssueCategory,\n} from \"./types.js\";\nimport { ISSUE_CATEGORY_LABELS } from \"./types.js\";\n\nconst resolveFilePath = (filePath: string | undefined) =>\n resolveFilePathPure(filePath, vscode.workspace.workspaceFolders?.[0]?.uri.fsPath);\n\n/** Icons per issue category. */\nconst CATEGORY_ICONS: Record = {\n \"unused-files\": \"file-code\",\n \"unused-exports\": \"symbol-method\",\n \"unused-types\": \"symbol-interface\",\n \"private-type-leaks\": \"symbol-interface\",\n \"unused-dependencies\": \"package\",\n \"unused-dev-dependencies\": \"package\",\n \"unused-optional-dependencies\": \"package\",\n \"unused-enum-members\": \"symbol-enum-member\",\n \"unused-class-members\": \"symbol-field\",\n \"unresolved-imports\": \"error\",\n \"unlisted-dependencies\": \"package\",\n \"duplicate-exports\": \"files\",\n \"type-only-dependencies\": \"symbol-interface\",\n \"test-only-dependencies\": \"beaker\",\n \"circular-dependencies\": \"sync\",\n \"boundary-violation\": \"symbol-namespace\",\n \"stale-suppressions\": \"trash\",\n \"unused-catalog-entries\": \"package\",\n \"unresolved-catalog-references\": \"error\",\n \"unused-dependency-overrides\": \"package\",\n \"misconfigured-dependency-overrides\": \"error\",\n};\n\n/** Icons for individual issue items. */\nconst ISSUE_ICONS: Record = {\n \"unused-files\": \"file\",\n \"unused-exports\": \"symbol-method\",\n \"unused-types\": \"symbol-interface\",\n \"private-type-leaks\": \"symbol-interface\",\n \"unused-dependencies\": \"package\",\n \"unused-dev-dependencies\": \"package\",\n \"unused-optional-dependencies\": \"package\",\n \"unused-enum-members\": \"symbol-enum-member\",\n \"unused-class-members\": \"symbol-field\",\n \"unresolved-imports\": \"error\",\n \"unlisted-dependencies\": \"package\",\n \"duplicate-exports\": \"copy\",\n \"type-only-dependencies\": \"package\",\n \"test-only-dependencies\": \"beaker\",\n \"circular-dependencies\": \"sync\",\n \"boundary-violation\": \"symbol-namespace\",\n \"stale-suppressions\": \"trash\",\n \"unused-catalog-entries\": \"package\",\n \"unresolved-catalog-references\": \"error\",\n \"unused-dependency-overrides\": \"package\",\n \"misconfigured-dependency-overrides\": \"error\",\n};\n\nconst staleSuppressionLabel = (\n origin: NonNullable[number][\"origin\"]\n): string => {\n if (origin.type === \"jsdoc_tag\") {\n return `@expected-unused ${origin.export_name}`;\n }\n if (origin.issue_kind) {\n return origin.is_file_level\n ? `file ${origin.issue_kind}`\n : origin.issue_kind;\n }\n return origin.is_file_level ? \"file suppression\" : \"line suppression\";\n};\n\ntype DeadCodeItem = CategoryItem | IssueItem;\n\nclass CategoryItem extends vscode.TreeItem {\n readonly issues: ReadonlyArray;\n\n constructor(\n readonly category: IssueCategory,\n issues: ReadonlyArray\n ) {\n super(\n `${ISSUE_CATEGORY_LABELS[category]} (${issues.length})`,\n vscode.TreeItemCollapsibleState.Collapsed\n );\n this.issues = issues;\n this.contextValue = \"category\";\n this.iconPath = new vscode.ThemeIcon(CATEGORY_ICONS[category] ?? \"warning\");\n }\n}\n\nclass IssueItem extends vscode.TreeItem {\n constructor(\n label: string,\n readonly filePath: string,\n readonly line: number,\n readonly col: number,\n category: IssueCategory\n ) {\n super(label, vscode.TreeItemCollapsibleState.None);\n\n const { absolute, relative } = resolveFilePath(filePath);\n\n this.description = `${relative}:${line}`;\n this.tooltip = `${label}\\n${absolute}:${line}:${col}`;\n this.contextValue = \"issue\";\n\n this.command = {\n command: \"vscode.open\",\n title: \"Open File\",\n arguments: [\n vscode.Uri.file(absolute),\n {\n selection: new vscode.Range(\n Math.max(0, line - 1),\n col,\n Math.max(0, line - 1),\n col\n ),\n },\n ],\n };\n\n this.iconPath = new vscode.ThemeIcon(ISSUE_ICONS[category] ?? \"warning\");\n }\n}\n\nexport class DeadCodeTreeProvider\n implements vscode.TreeDataProvider\n{\n private result: FallowCheckResult | null = null;\n private view: vscode.TreeView | null = null;\n\n private readonly _onDidChangeTreeData = new vscode.EventEmitter<\n DeadCodeItem | undefined | null | void\n >();\n readonly onDidChangeTreeData = this._onDidChangeTreeData.event;\n\n setView(view: vscode.TreeView): void {\n this.view = view;\n }\n\n update(result: FallowCheckResult | null): void {\n this.result = result;\n this._onDidChangeTreeData.fire();\n this.updateBadge();\n }\n\n private updateBadge(): void {\n if (!this.view) {\n return;\n }\n if (!this.result) {\n this.view.badge = undefined;\n return;\n }\n const count = countCheckIssues(this.result);\n\n this.view.badge = count > 0\n ? { value: count, tooltip: `${count} issue${count === 1 ? \"\" : \"s\"}` }\n : undefined;\n }\n\n getTreeItem(element: DeadCodeItem): vscode.TreeItem {\n return element;\n }\n\n getChildren(element?: DeadCodeItem): DeadCodeItem[] {\n if (element instanceof CategoryItem) {\n return [...element.issues];\n }\n\n if (!this.result) {\n return [];\n }\n\n const categories: DeadCodeItem[] = [];\n\n const addCategory = (\n category: IssueCategory,\n items: ReadonlyArray\n ): void => {\n if (items.length > 0) {\n categories.push(new CategoryItem(category, items));\n }\n };\n\n addCategory(\n \"unused-files\",\n this.result.unused_files.map(\n (f) => new IssueItem(path.basename(f.path), f.path, 1, 0, \"unused-files\")\n )\n );\n\n addCategory(\n \"unused-exports\",\n this.result.unused_exports.map(\n (e) => new IssueItem(e.export_name, e.path, e.line, e.col, \"unused-exports\")\n )\n );\n\n addCategory(\n \"unused-types\",\n this.result.unused_types.map(\n (e) => new IssueItem(e.export_name, e.path, e.line, e.col, \"unused-types\")\n )\n );\n\n addCategory(\n \"private-type-leaks\",\n (this.result.private_type_leaks ?? []).map(\n (l) =>\n new IssueItem(\n `${l.export_name} -> ${l.type_name}`,\n l.path,\n l.line,\n l.col,\n \"private-type-leaks\"\n )\n )\n );\n\n addCategory(\n \"unused-dependencies\",\n this.result.unused_dependencies.map(\n (d) => new IssueItem(d.package_name, d.path, d.line, 0, \"unused-dependencies\")\n )\n );\n\n addCategory(\n \"unused-dev-dependencies\",\n this.result.unused_dev_dependencies.map(\n (d) => new IssueItem(d.package_name, d.path, d.line, 0, \"unused-dev-dependencies\")\n )\n );\n\n if (this.result.unused_optional_dependencies) {\n addCategory(\n \"unused-optional-dependencies\",\n this.result.unused_optional_dependencies.map(\n (d) => new IssueItem(d.package_name, d.path, d.line, 0, \"unused-optional-dependencies\")\n )\n );\n }\n\n addCategory(\n \"unused-enum-members\",\n this.result.unused_enum_members.map(\n (m) =>\n new IssueItem(`${m.parent_name}.${m.member_name}`, m.path, m.line, m.col, \"unused-enum-members\")\n )\n );\n\n addCategory(\n \"unused-class-members\",\n this.result.unused_class_members.map(\n (m) =>\n new IssueItem(`${m.parent_name}.${m.member_name}`, m.path, m.line, m.col, \"unused-class-members\")\n )\n );\n\n addCategory(\n \"unresolved-imports\",\n this.result.unresolved_imports.map(\n (i) => new IssueItem(i.specifier, i.path, i.line, i.col, \"unresolved-imports\")\n )\n );\n\n addCategory(\n \"unlisted-dependencies\",\n this.result.unlisted_dependencies.flatMap((d) =>\n d.imported_from.map(\n (site) => new IssueItem(d.package_name, site.path, site.line, site.col, \"unlisted-dependencies\")\n )\n )\n );\n\n addCategory(\n \"duplicate-exports\",\n this.result.duplicate_exports.flatMap((d) =>\n d.locations.map(\n (loc) => new IssueItem(d.export_name, loc.path, loc.line, loc.col, \"duplicate-exports\")\n )\n )\n );\n\n if (this.result.type_only_dependencies) {\n addCategory(\n \"type-only-dependencies\",\n this.result.type_only_dependencies.map(\n (d) => new IssueItem(d.package_name, d.path, d.line, 0, \"type-only-dependencies\")\n )\n );\n }\n\n if (this.result.test_only_dependencies) {\n addCategory(\n \"test-only-dependencies\",\n this.result.test_only_dependencies.map(\n (d) => new IssueItem(d.package_name, d.path, d.line, 0, \"test-only-dependencies\")\n )\n );\n }\n\n if (this.result.circular_dependencies) {\n addCategory(\n \"circular-dependencies\",\n this.result.circular_dependencies.map(\n (c) => new IssueItem(\n `${c.length} files`,\n c.files[0] ?? \"\",\n c.line,\n c.col,\n \"circular-dependencies\"\n )\n )\n );\n }\n\n if (this.result.boundary_violations) {\n addCategory(\n \"boundary-violation\",\n this.result.boundary_violations.map(\n (v) =>\n new IssueItem(\n `${v.from_zone} -> ${v.to_zone}`,\n v.from_path,\n v.line,\n v.col,\n \"boundary-violation\"\n )\n )\n );\n }\n\n if (this.result.stale_suppressions) {\n addCategory(\n \"stale-suppressions\",\n this.result.stale_suppressions.map(\n (s) =>\n new IssueItem(\n staleSuppressionLabel(s.origin),\n s.path,\n s.line,\n s.col,\n \"stale-suppressions\"\n )\n )\n );\n }\n\n if (this.result.unused_catalog_entries) {\n addCategory(\n \"unused-catalog-entries\",\n this.result.unused_catalog_entries.map(\n (entry) =>\n new IssueItem(\n entry.catalog_name === \"default\"\n ? entry.entry_name\n : `${entry.entry_name} (${entry.catalog_name})`,\n entry.path,\n entry.line,\n 0,\n \"unused-catalog-entries\"\n )\n )\n );\n }\n\n if (this.result.unresolved_catalog_references) {\n addCategory(\n \"unresolved-catalog-references\",\n this.result.unresolved_catalog_references.map(\n (finding) =>\n new IssueItem(\n finding.catalog_name === \"default\"\n ? finding.entry_name\n : `${finding.entry_name} (${finding.catalog_name})`,\n finding.path,\n finding.line,\n 0,\n \"unresolved-catalog-references\"\n )\n )\n );\n }\n\n if (this.result.unused_dependency_overrides) {\n addCategory(\n \"unused-dependency-overrides\",\n this.result.unused_dependency_overrides.map(\n (finding) =>\n new IssueItem(\n `${finding.raw_key} (${finding.source})`,\n finding.path,\n finding.line,\n 0,\n \"unused-dependency-overrides\"\n )\n )\n );\n }\n\n if (this.result.misconfigured_dependency_overrides) {\n addCategory(\n \"misconfigured-dependency-overrides\",\n this.result.misconfigured_dependency_overrides.map(\n (finding) =>\n new IssueItem(\n `${finding.raw_key} (${finding.source})`,\n finding.path,\n finding.line,\n 0,\n \"misconfigured-dependency-overrides\"\n )\n )\n );\n }\n\n return categories;\n }\n\n dispose(): void {\n this._onDidChangeTreeData.dispose();\n }\n}\n\ntype DuplicateItem = CloneFamilyItem | CloneInstanceItem;\n\nclass CloneFamilyItem extends vscode.TreeItem {\n readonly instances: ReadonlyArray;\n\n constructor(group: CloneGroup, index: number) {\n const instanceItems = group.instances.map(\n (inst) => new CloneInstanceItem(inst.file, inst.start_line, inst.end_line)\n );\n super(\n `Clone #${index + 1} (${group.line_count} lines, ${group.instances.length} instances)`,\n vscode.TreeItemCollapsibleState.Collapsed\n );\n this.instances = instanceItems;\n this.contextValue = \"cloneFamily\";\n this.iconPath = new vscode.ThemeIcon(\"files\");\n }\n}\n\nclass CloneInstanceItem extends vscode.TreeItem {\n constructor(\n readonly filePath: string,\n readonly startLine: number,\n readonly endLine: number\n ) {\n const basename = path.basename(filePath);\n super(\n `${basename}:${startLine}-${endLine}`,\n vscode.TreeItemCollapsibleState.None\n );\n\n const { absolute, relative } = resolveFilePath(filePath);\n\n this.description = relative;\n this.tooltip = `${absolute}:${startLine}-${endLine}`;\n this.contextValue = \"cloneInstance\";\n\n this.command = {\n command: \"vscode.open\",\n title: \"Open File\",\n arguments: [\n vscode.Uri.file(absolute),\n {\n selection: new vscode.Range(\n Math.max(0, startLine - 1),\n 0,\n Math.max(0, endLine - 1),\n 0\n ),\n },\n ],\n };\n\n this.iconPath = new vscode.ThemeIcon(\"copy\");\n }\n}\n\nexport class DuplicatesTreeProvider\n implements vscode.TreeDataProvider\n{\n private result: FallowDupesResult | null = null;\n\n private readonly _onDidChangeTreeData = new vscode.EventEmitter<\n DuplicateItem | undefined | null | void\n >();\n readonly onDidChangeTreeData = this._onDidChangeTreeData.event;\n\n update(result: FallowDupesResult | null): void {\n this.result = result;\n this._onDidChangeTreeData.fire();\n }\n\n getTreeItem(element: DuplicateItem): vscode.TreeItem {\n return element;\n }\n\n getChildren(element?: DuplicateItem): DuplicateItem[] {\n if (element instanceof CloneFamilyItem) {\n return [...element.instances];\n }\n\n if (!this.result) {\n return [];\n }\n\n return this.result.clone_groups.map(\n (group, i) => new CloneFamilyItem(group, i)\n );\n }\n\n dispose(): void {\n this._onDidChangeTreeData.dispose();\n }\n}\n","// VS Code injects this module into the extension host at runtime.\n// fallow-ignore-next-line unlisted-dependency\nimport * as vscode from \"vscode\";\nimport { countCheckIssues } from \"./analysis-utils.js\";\nimport { startClient, stopClient, restartClient } from \"./client.js\";\nimport { onConfigChange } from \"./config.js\";\nimport { runAnalysis, runFix } from \"./commands.js\";\nimport { DiagnosticFilter } from \"./diagnosticFilter.js\";\nimport { registerDiagnosticMuteUi } from \"./diagnosticMute.js\";\nimport {\n createStatusBar,\n updateStatusBar,\n updateStatusBarFromLsp,\n setStatusBarAnalyzing,\n setStatusBarError,\n disposeStatusBar,\n} from \"./statusBar.js\";\nimport type { AnalysisCompleteParams } from \"./statusBar.js\";\nimport { DeadCodeTreeProvider, DuplicatesTreeProvider } from \"./treeView.js\";\nimport type { FallowCheckResult, FallowDupesResult } from \"./types.js\";\n\nlet outputChannel: vscode.OutputChannel;\nlet lastCheckResult: FallowCheckResult | null = null;\nlet lastDupesResult: FallowDupesResult | null = null;\n\nexport interface ExtensionApi {\n readonly runAnalysis: typeof runAnalysis;\n readonly runFix: typeof runFix;\n}\n\nexport const activate = async (\n context: vscode.ExtensionContext\n): Promise => {\n outputChannel = vscode.window.createOutputChannel(\"Fallow\");\n context.subscriptions.push(outputChannel);\n\n const statusBar = createStatusBar();\n context.subscriptions.push(statusBar);\n\n const diagnosticFilter = new DiagnosticFilter(context.workspaceState);\n context.subscriptions.push({ dispose: () => diagnosticFilter.dispose() });\n registerDiagnosticMuteUi(context, diagnosticFilter);\n\n const deadCodeProvider = new DeadCodeTreeProvider();\n const duplicatesProvider = new DuplicatesTreeProvider();\n\n // Use createTreeView to get visibility events — defer CLI analysis until the\n // tree view is first shown, avoiding a double analysis on activation (the LSP\n // runs its own analysis for diagnostics).\n let cliAnalysisRan = false;\n\n const triggerCliAnalysis = async (): Promise => {\n setStatusBarAnalyzing();\n await vscode.window.withProgress(\n {\n location: vscode.ProgressLocation.Notification,\n title: \"Fallow: Analyzing...\",\n cancellable: false,\n },\n async () => {\n try {\n const { check, dupes } = await runAnalysis(context);\n lastCheckResult = check;\n lastDupesResult = dupes;\n updateViews();\n void vscode.commands.executeCommand(\n \"setContext\",\n \"fallow.hasAnalyzed\",\n true\n );\n\n const issueCount = countCheckIssues(check);\n\n if (issueCount > 0) {\n void vscode.window.showInformationMessage(\n `Fallow: found ${issueCount} issue${issueCount === 1 ? \"\" : \"s\"}. Open the Fallow sidebar to explore.`,\n \"Open Sidebar\"\n ).then((choice) => {\n if (choice === \"Open Sidebar\") {\n void vscode.commands.executeCommand(\"fallow.deadCode.focus\");\n }\n });\n } else {\n void vscode.window.showInformationMessage(\n \"Fallow: no issues found.\"\n );\n }\n } catch {\n setStatusBarError();\n }\n }\n );\n };\n\n const deadCodeView = vscode.window.createTreeView(\"fallow.deadCode\", {\n treeDataProvider: deadCodeProvider,\n });\n deadCodeProvider.setView(deadCodeView);\n const duplicatesView = vscode.window.createTreeView(\"fallow.duplicates\", {\n treeDataProvider: duplicatesProvider,\n });\n context.subscriptions.push(deadCodeView, duplicatesView);\n\n const onViewVisible = (): void => {\n if (cliAnalysisRan) {\n return;\n }\n cliAnalysisRan = true;\n void triggerCliAnalysis();\n };\n\n context.subscriptions.push(\n deadCodeView.onDidChangeVisibility((e) => {\n if (e.visible) {\n onViewVisible();\n }\n })\n );\n context.subscriptions.push(\n duplicatesView.onDidChangeVisibility((e) => {\n if (e.visible) {\n onViewVisible();\n }\n })\n );\n\n const updateViews = (): void => {\n deadCodeProvider.update(lastCheckResult);\n duplicatesProvider.update(lastDupesResult);\n updateStatusBar(lastCheckResult, lastDupesResult);\n };\n\n // Register commands\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.analyze\", async () => {\n cliAnalysisRan = true;\n await triggerCliAnalysis();\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.fix\", async () => {\n // Save dirty editors first so the fix works on up-to-date content\n await vscode.workspace.saveAll(false);\n await runFix(context, false);\n // Restart LSP to force fresh analysis — the fix modified files on disk\n // bypassing VS Code's editor, so did_save never fires for those files\n await restartClient(context, outputChannel, diagnosticFilter);\n // Re-run CLI analysis for tree views\n cliAnalysisRan = true;\n await triggerCliAnalysis();\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.fixDryRun\", async () => {\n await runFix(context, true);\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.restart\", async () => {\n outputChannel.appendLine(\"Restarting language server...\");\n await restartClient(context, outputChannel, diagnosticFilter);\n })\n );\n\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.showOutput\", () => {\n outputChannel.show();\n })\n );\n\n // Open the Fallow sidebar (used by walkthrough completion event)\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.openSidebar\", () => {\n void vscode.commands.executeCommand(\"fallow.deadCode.focus\");\n })\n );\n\n // Open Fallow settings (used by walkthrough completion event)\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.openSettings\", () => {\n void vscode.commands.executeCommand(\n \"workbench.action.openSettings\",\n \"fallow\"\n );\n })\n );\n\n // Fallback command for Code Lens items with 0 references (display-only)\n context.subscriptions.push(\n vscode.commands.registerCommand(\"fallow.noop\", () => {})\n );\n\n // Watch for config changes\n context.subscriptions.push(\n onConfigChange(async (e) => {\n const needsRestart =\n e.affectsConfiguration(\"fallow.lspPath\") ||\n e.affectsConfiguration(\"fallow.configPath\") ||\n e.affectsConfiguration(\"fallow.trace.server\") ||\n e.affectsConfiguration(\"fallow.issueTypes\") ||\n e.affectsConfiguration(\"fallow.changedSince\");\n\n const needsReanalysis =\n e.affectsConfiguration(\"fallow.configPath\") ||\n e.affectsConfiguration(\"fallow.production\") ||\n e.affectsConfiguration(\"fallow.duplication\") ||\n e.affectsConfiguration(\"fallow.issueTypes\") ||\n e.affectsConfiguration(\"fallow.changedSince\");\n\n if (needsRestart) {\n outputChannel.appendLine(\"Configuration changed, restarting server...\");\n await restartClient(context, outputChannel, diagnosticFilter);\n }\n\n if (needsReanalysis) {\n // Re-run CLI analysis for tree views and status bar\n // (sequenced after LSP restart if both apply)\n void triggerCliAnalysis();\n }\n })\n );\n\n // Start LSP client\n const client = await startClient(context, outputChannel, diagnosticFilter);\n if (client) {\n context.subscriptions.push({ dispose: () => void stopClient() });\n\n // Handle custom LSP notification: update status bar from LSP data\n // so the extension shows results immediately without waiting for CLI\n const notificationDisposable = client.onNotification(\n \"fallow/analysisComplete\",\n (params: AnalysisCompleteParams) => {\n updateStatusBarFromLsp(params);\n void vscode.commands.executeCommand(\n \"setContext\",\n \"fallow.hasAnalyzed\",\n true\n );\n }\n );\n context.subscriptions.push(notificationDisposable);\n }\n\n // Show walkthrough on first install\n const walkthroughShown = context.globalState.get(\n \"fallow.walkthroughShown\"\n );\n if (!walkthroughShown) {\n void context.globalState.update(\"fallow.walkthroughShown\", true);\n void vscode.commands.executeCommand(\n \"workbench.action.openWalkthrough\",\n \"fallow-rs.fallow-vscode#fallow.gettingStarted\",\n false\n );\n }\n\n return {\n runAnalysis,\n runFix,\n };\n};\n\nexport const deactivate = async (): Promise => {\n disposeStatusBar();\n await stopClient();\n};\n"],"x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125],"mappings":"40BAEA,MAAa,EAAoB,GAC1B,EAKH,EAAO,aAAa,OACpB,EAAO,eAAe,OACtB,EAAO,aAAa,QACnB,EAAO,oBAAoB,QAAU,GACtC,EAAO,oBAAoB,OAC3B,EAAO,wBAAwB,QAC9B,EAAO,8BAA8B,QAAU,GAChD,EAAO,oBAAoB,OAC3B,EAAO,qBAAqB,OAC5B,EAAO,mBAAmB,OAC1B,EAAO,sBAAsB,OAC7B,EAAO,kBAAkB,QACxB,EAAO,wBAAwB,QAAU,IACzC,EAAO,wBAAwB,QAAU,IACzC,EAAO,uBAAuB,QAAU,IACxC,EAAO,qBAAqB,QAAU,IACtC,EAAO,oBAAoB,QAAU,IACrC,EAAO,wBAAwB,QAAU,IACzC,EAAO,+BAA+B,QAAU,IAChD,EAAO,6BAA6B,QAAU,IAC9C,EAAO,oCAAoC,QAAU,GAxB/C,eCCX,OAAO,eAAe,EAAS,aAAc,CAAE,MAAO,GAAM,CAAC,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M,IAAY"} \ No newline at end of file diff --git a/editors/vscode/package.json b/editors/vscode/package.json index 47d6478b9..1a29c5838 100644 --- a/editors/vscode/package.json +++ b/editors/vscode/package.json @@ -164,7 +164,9 @@ "boundary-violation": true, "stale-suppressions": true, "unused-catalog-entries": true, - "unresolved-catalog-references": true + "unresolved-catalog-references": true, + "unused-dependency-overrides": true, + "misconfigured-dependency-overrides": true }, "description": "Toggle individual issue types on or off. Uses kebab-case names matching fallow's rules config.", "properties": { @@ -224,6 +226,12 @@ }, "unresolved-catalog-references": { "type": "boolean" + }, + "unused-dependency-overrides": { + "type": "boolean" + }, + "misconfigured-dependency-overrides": { + "type": "boolean" } } }, diff --git a/editors/vscode/src/analysis-utils.ts b/editors/vscode/src/analysis-utils.ts index d75b21d6d..54e652953 100644 --- a/editors/vscode/src/analysis-utils.ts +++ b/editors/vscode/src/analysis-utils.ts @@ -24,6 +24,8 @@ export const countCheckIssues = (result: FallowCheckResult | null): number => { (result.boundary_violations?.length ?? 0) + (result.stale_suppressions?.length ?? 0) + (result.unused_catalog_entries?.length ?? 0) + - (result.unresolved_catalog_references?.length ?? 0) + (result.unresolved_catalog_references?.length ?? 0) + + (result.unused_dependency_overrides?.length ?? 0) + + (result.misconfigured_dependency_overrides?.length ?? 0) ); }; diff --git a/editors/vscode/src/commands.ts b/editors/vscode/src/commands.ts index f77523fd0..4218cf4b6 100644 --- a/editors/vscode/src/commands.ts +++ b/editors/vscode/src/commands.ts @@ -138,6 +138,14 @@ const filterCheckResult = (result: FallowCheckResult): FallowCheckResult => { unresolved_catalog_references: types["unresolved-catalog-references"] ? result.unresolved_catalog_references : [], + unused_dependency_overrides: types["unused-dependency-overrides"] + ? result.unused_dependency_overrides + : [], + misconfigured_dependency_overrides: types[ + "misconfigured-dependency-overrides" + ] + ? result.misconfigured_dependency_overrides + : [], }; const totalIssues = countCheckIssues(filtered); const summary = { diff --git a/editors/vscode/src/config.ts b/editors/vscode/src/config.ts index 60dbf510d..cf2f971de 100644 --- a/editors/vscode/src/config.ts +++ b/editors/vscode/src/config.ts @@ -48,6 +48,8 @@ export const getIssueTypes = (): IssueTypeConfig => "stale-suppressions": true, "unused-catalog-entries": true, "unresolved-catalog-references": true, + "unused-dependency-overrides": true, + "misconfigured-dependency-overrides": true, }); export const getDuplicationThreshold = (): number => diff --git a/editors/vscode/src/diagnosticFilter.ts b/editors/vscode/src/diagnosticFilter.ts index b4e817384..1e5c43134 100644 --- a/editors/vscode/src/diagnosticFilter.ts +++ b/editors/vscode/src/diagnosticFilter.ts @@ -55,6 +55,14 @@ export const DIAGNOSTIC_CATEGORIES: ReadonlyArray = [ code: "unresolved-catalog-reference", label: "Unresolved Catalog References", }, + { + code: "unused-dependency-override", + label: "Unused Dependency Overrides", + }, + { + code: "misconfigured-dependency-override", + label: "Misconfigured Dependency Overrides", + }, ]; let activeDiagnosticCategories: ReadonlyArray = diff --git a/editors/vscode/src/generated/output-contract.d.ts b/editors/vscode/src/generated/output-contract.d.ts index 1b340af17..65d73a0ed 100644 --- a/editors/vscode/src/generated/output-contract.d.ts +++ b/editors/vscode/src/generated/output-contract.d.ts @@ -121,6 +121,14 @@ unused_catalog_entries?: UnusedCatalogEntry[] * Workspace package.json references to catalogs (catalog: or catalog:) that do not declare the consumed package. pnpm install will error until the named catalog grows to include the package or the reference is switched / removed. */ unresolved_catalog_references?: UnresolvedCatalogReference[] +/** + * Entries in pnpm-workspace.yaml's overrides: section, or package.json's pnpm.overrides block, whose target package no workspace package depends on. Default severity is warn because some entries are intentional pins for transitive CVEs; the hint field flags the cases the conservative algorithm cannot disambiguate. + */ +unused_dependency_overrides?: UnusedDependencyOverride[] +/** + * pnpm.overrides entries whose key or value does not parse as a valid override spec (empty key, empty value, malformed selector, unbalanced parent matcher). pnpm install will reject these. Default severity is error. + */ +misconfigured_dependency_overrides?: MisconfiguredDependencyOverride[] entry_points?: EntryPoints summary?: CheckSummary baseline_deltas?: BaselineDeltas @@ -143,7 +151,7 @@ export interface FixAction { /** * Kebab-case identifier for the fix action. */ -type: ("remove-export" | "delete-file" | "remove-dependency" | "move-dependency" | "remove-enum-member" | "remove-class-member" | "resolve-import" | "install-dependency" | "remove-duplicate" | "move-to-dev" | "refactor-cycle" | "refactor-boundary" | "export-type" | "remove-catalog-entry" | "update-catalog-reference" | "add-catalog-entry" | "remove-catalog-reference") +type: ("remove-export" | "delete-file" | "remove-dependency" | "move-dependency" | "remove-enum-member" | "remove-class-member" | "resolve-import" | "install-dependency" | "remove-duplicate" | "move-to-dev" | "refactor-cycle" | "refactor-boundary" | "export-type" | "remove-catalog-entry" | "update-catalog-reference" | "add-catalog-entry" | "remove-catalog-reference" | "remove-dependency-override" | "fix-dependency-override") /** * Whether `fallow fix` can apply this fix automatically. */ @@ -219,12 +227,14 @@ description: string */ config_key: string /** - * Value to add to the config key. Shape depends on `config_key`. For scalar config keys (`ignoreDependencies`, others) this is a string such as `"lodash"`. For `ignoreExports` this is an array of `{ file, exports }` rule objects so the snippet can be merged into the user's config verbatim. + * Value to add to the config key. Shape depends on `config_key`. For scalar config keys (`ignoreDependencies`, others) this is a string such as `"lodash"`. For `ignoreExports` this is an array of `{ file, exports }` rule objects so the snippet can be merged into the user's config verbatim. For `ignoreCatalogReferences` and `ignoreDependencyOverrides` this is an object whose shape matches the rule entry users add to their fallow config. */ value: (string | { file: string exports: string[] -}[]) +}[] | { + +}) /** * Optional URL pointing at a stable JSON Schema fragment that describes the shape of `value`. Agents that intend to validate `value` before writing it into a user's config can fetch the linked schema and run it against `value`. The URL is a JSON Pointer fragment into fallow's main config schema (e.g. `schema.json#/properties/ignoreExports` for the ignoreExports action, or `schema.json#/properties/ignoreDependencies/items` for the per-package ignoreDependencies action). Strictly additive: consumers that ignore the field keep working unchanged. */ @@ -621,6 +631,80 @@ available_in_catalogs?: string[] actions?: IssueAction[] introduced?: AuditIntroduced } +/** + * A pnpm.overrides entry whose target package is not declared in any workspace package.json (directly or as a declared parent in a parent>child override). May still be intentional for a transitive CVE pin; see `hint`. + */ +export interface UnusedDependencyOverride { +/** + * Full original override key as written (e.g. 'react>react-dom', '@types/react@<18'). + */ +raw_key: string +/** + * Target package the override rewrites (rightmost segment for parent>child keys). + */ +target_package: string +/** + * Optional parent package (left side of `>`). Omitted for bare-target keys. + */ +parent_package?: string +/** + * Optional version selector on the target (e.g. '<18' for '@types/react@<18'). Omitted when absent. + */ +version_constraint?: string +/** + * Right-hand side of the entry: the version pnpm should force. + */ +version_range: string +/** + * File the override was declared in. Matches the value users write in `ignoreDependencyOverrides[].source`. + */ +source: ("pnpm-workspace.yaml" | "package.json") +/** + * Relative path to the source file. + */ +path: string +/** + * 1-based line number of the entry. + */ +line: number +/** + * Soft hint for cases the conservative algorithm cannot disambiguate (e.g. a transitive CVE pin not visible to static analysis). Omitted when absent. + */ +hint?: string +actions?: IssueAction[] +introduced?: AuditIntroduced +} +/** + * A pnpm.overrides entry whose key or value does not parse as a valid pnpm override spec. `pnpm install` will reject these. + */ +export interface MisconfiguredDependencyOverride { +/** + * Full original override key as written. + */ +raw_key: string +/** + * Right-hand side of the entry, exactly as written. Empty when the value was missing. + */ +raw_value: string +/** + * Classifier for the misconfiguration. 'unparsable-key' = the key is not a valid pnpm shape; 'empty-value' = the value is missing, empty, or contains line breaks. + */ +reason: ("unparsable-key" | "empty-value") +/** + * File the override was declared in. + */ +source: ("pnpm-workspace.yaml" | "package.json") +/** + * Relative path to the source file. + */ +path: string +/** + * 1-based line number of the entry. + */ +line: number +actions?: IssueAction[] +introduced?: AuditIntroduced +} /** * Entry point detection summary showing total detected entry points and their sources. */ @@ -656,6 +740,8 @@ boundary_violations?: number stale_suppressions?: number unused_catalog_entries?: number unresolved_catalog_references?: number +unused_dependency_overrides?: number +misconfigured_dependency_overrides?: number } /** * Per-category delta comparison against a saved baseline. Shows current count, baseline count, and delta for each category. diff --git a/editors/vscode/src/labels.ts b/editors/vscode/src/labels.ts index ef76b80f4..8837c047a 100644 --- a/editors/vscode/src/labels.ts +++ b/editors/vscode/src/labels.ts @@ -23,7 +23,9 @@ export type IssueCategory = | "boundary-violation" | "stale-suppressions" | "unused-catalog-entries" - | "unresolved-catalog-references"; + | "unresolved-catalog-references" + | "unused-dependency-overrides" + | "misconfigured-dependency-overrides"; export const ISSUE_CATEGORY_LABELS: Record = { "unused-files": "Unused Files", @@ -45,4 +47,6 @@ export const ISSUE_CATEGORY_LABELS: Record = { "stale-suppressions": "Stale Suppressions", "unused-catalog-entries": "Unused Catalog Entries", "unresolved-catalog-references": "Unresolved Catalog References", + "unused-dependency-overrides": "Unused Dependency Overrides", + "misconfigured-dependency-overrides": "Misconfigured Dependency Overrides", }; diff --git a/editors/vscode/src/settings.ts b/editors/vscode/src/settings.ts index e7576a268..97224b84a 100644 --- a/editors/vscode/src/settings.ts +++ b/editors/vscode/src/settings.ts @@ -25,6 +25,8 @@ export interface IssueTypeConfig { readonly "stale-suppressions": boolean; readonly "unused-catalog-entries": boolean; readonly "unresolved-catalog-references": boolean; + readonly "unused-dependency-overrides": boolean; + readonly "misconfigured-dependency-overrides": boolean; } export type DuplicationMode = "strict" | "mild" | "weak" | "semantic"; diff --git a/editors/vscode/src/statusBar-utils.ts b/editors/vscode/src/statusBar-utils.ts index 07737b438..6fc245d28 100644 --- a/editors/vscode/src/statusBar-utils.ts +++ b/editors/vscode/src/statusBar-utils.ts @@ -22,6 +22,8 @@ export interface AnalysisCompleteParams { staleSuppressions: number; unusedCatalogEntries: number; unresolvedCatalogReferences: number; + unusedDependencyOverrides: number; + misconfiguredDependencyOverrides: number; duplicationPercentage: number; cloneGroups: number; } @@ -56,6 +58,10 @@ export const buildParamsFromCli = ( unusedCatalogEntries: check?.unused_catalog_entries?.length ?? 0, unresolvedCatalogReferences: check?.unresolved_catalog_references?.length ?? 0, + unusedDependencyOverrides: + check?.unused_dependency_overrides?.length ?? 0, + misconfiguredDependencyOverrides: + check?.misconfigured_dependency_overrides?.length ?? 0, duplicationPercentage: dupes?.stats.duplication_percentage ?? 0, cloneGroups: dupes?.stats.clone_groups ?? 0, }); @@ -154,6 +160,16 @@ const BREAKDOWN_LINES: ReadonlyArray = [ icon: "$(error)", label: "unresolved catalog references", }, + { + count: "unusedDependencyOverrides", + icon: "$(warning)", + label: "unused dependency overrides", + }, + { + count: "misconfiguredDependencyOverrides", + icon: "$(error)", + label: "misconfigured dependency overrides", + }, ]; export const getDuplicationPercentage = ( diff --git a/editors/vscode/src/treeView.ts b/editors/vscode/src/treeView.ts index 92c47b4ae..edf0798fc 100644 --- a/editors/vscode/src/treeView.ts +++ b/editors/vscode/src/treeView.ts @@ -38,6 +38,8 @@ const CATEGORY_ICONS: Record = { "stale-suppressions": "trash", "unused-catalog-entries": "package", "unresolved-catalog-references": "error", + "unused-dependency-overrides": "package", + "misconfigured-dependency-overrides": "error", }; /** Icons for individual issue items. */ @@ -61,6 +63,8 @@ const ISSUE_ICONS: Record = { "stale-suppressions": "trash", "unused-catalog-entries": "package", "unresolved-catalog-references": "error", + "unused-dependency-overrides": "package", + "misconfigured-dependency-overrides": "error", }; const staleSuppressionLabel = ( @@ -392,6 +396,38 @@ export class DeadCodeTreeProvider ); } + if (this.result.unused_dependency_overrides) { + addCategory( + "unused-dependency-overrides", + this.result.unused_dependency_overrides.map( + (finding) => + new IssueItem( + `${finding.raw_key} (${finding.source})`, + finding.path, + finding.line, + 0, + "unused-dependency-overrides" + ) + ) + ); + } + + if (this.result.misconfigured_dependency_overrides) { + addCategory( + "misconfigured-dependency-overrides", + this.result.misconfigured_dependency_overrides.map( + (finding) => + new IssueItem( + `${finding.raw_key} (${finding.source})`, + finding.path, + finding.line, + 0, + "misconfigured-dependency-overrides" + ) + ) + ); + } + return categories; } diff --git a/editors/vscode/src/types.ts b/editors/vscode/src/types.ts index 251957383..1e5c0697b 100644 --- a/editors/vscode/src/types.ts +++ b/editors/vscode/src/types.ts @@ -46,6 +46,8 @@ export type { UnresolvedImport, UnusedCatalogEntry, UnusedDependency, + UnusedDependencyOverride, + MisconfiguredDependencyOverride, UnusedExport, UnusedFile, UnusedMember, diff --git a/editors/vscode/test/statusBar-utils.test.ts b/editors/vscode/test/statusBar-utils.test.ts index 83650fe88..0e285bb5c 100644 --- a/editors/vscode/test/statusBar-utils.test.ts +++ b/editors/vscode/test/statusBar-utils.test.ts @@ -34,6 +34,8 @@ const baseParams = ( staleSuppressions: 0, unusedCatalogEntries: 0, unresolvedCatalogReferences: 0, + unusedDependencyOverrides: 0, + misconfiguredDependencyOverrides: 0, duplicationPercentage: 0, cloneGroups: 0, }, overrides); diff --git a/npm/fallow/types/output-contract.d.ts b/npm/fallow/types/output-contract.d.ts index 1b340af17..65d73a0ed 100644 --- a/npm/fallow/types/output-contract.d.ts +++ b/npm/fallow/types/output-contract.d.ts @@ -121,6 +121,14 @@ unused_catalog_entries?: UnusedCatalogEntry[] * Workspace package.json references to catalogs (catalog: or catalog:) that do not declare the consumed package. pnpm install will error until the named catalog grows to include the package or the reference is switched / removed. */ unresolved_catalog_references?: UnresolvedCatalogReference[] +/** + * Entries in pnpm-workspace.yaml's overrides: section, or package.json's pnpm.overrides block, whose target package no workspace package depends on. Default severity is warn because some entries are intentional pins for transitive CVEs; the hint field flags the cases the conservative algorithm cannot disambiguate. + */ +unused_dependency_overrides?: UnusedDependencyOverride[] +/** + * pnpm.overrides entries whose key or value does not parse as a valid override spec (empty key, empty value, malformed selector, unbalanced parent matcher). pnpm install will reject these. Default severity is error. + */ +misconfigured_dependency_overrides?: MisconfiguredDependencyOverride[] entry_points?: EntryPoints summary?: CheckSummary baseline_deltas?: BaselineDeltas @@ -143,7 +151,7 @@ export interface FixAction { /** * Kebab-case identifier for the fix action. */ -type: ("remove-export" | "delete-file" | "remove-dependency" | "move-dependency" | "remove-enum-member" | "remove-class-member" | "resolve-import" | "install-dependency" | "remove-duplicate" | "move-to-dev" | "refactor-cycle" | "refactor-boundary" | "export-type" | "remove-catalog-entry" | "update-catalog-reference" | "add-catalog-entry" | "remove-catalog-reference") +type: ("remove-export" | "delete-file" | "remove-dependency" | "move-dependency" | "remove-enum-member" | "remove-class-member" | "resolve-import" | "install-dependency" | "remove-duplicate" | "move-to-dev" | "refactor-cycle" | "refactor-boundary" | "export-type" | "remove-catalog-entry" | "update-catalog-reference" | "add-catalog-entry" | "remove-catalog-reference" | "remove-dependency-override" | "fix-dependency-override") /** * Whether `fallow fix` can apply this fix automatically. */ @@ -219,12 +227,14 @@ description: string */ config_key: string /** - * Value to add to the config key. Shape depends on `config_key`. For scalar config keys (`ignoreDependencies`, others) this is a string such as `"lodash"`. For `ignoreExports` this is an array of `{ file, exports }` rule objects so the snippet can be merged into the user's config verbatim. + * Value to add to the config key. Shape depends on `config_key`. For scalar config keys (`ignoreDependencies`, others) this is a string such as `"lodash"`. For `ignoreExports` this is an array of `{ file, exports }` rule objects so the snippet can be merged into the user's config verbatim. For `ignoreCatalogReferences` and `ignoreDependencyOverrides` this is an object whose shape matches the rule entry users add to their fallow config. */ value: (string | { file: string exports: string[] -}[]) +}[] | { + +}) /** * Optional URL pointing at a stable JSON Schema fragment that describes the shape of `value`. Agents that intend to validate `value` before writing it into a user's config can fetch the linked schema and run it against `value`. The URL is a JSON Pointer fragment into fallow's main config schema (e.g. `schema.json#/properties/ignoreExports` for the ignoreExports action, or `schema.json#/properties/ignoreDependencies/items` for the per-package ignoreDependencies action). Strictly additive: consumers that ignore the field keep working unchanged. */ @@ -621,6 +631,80 @@ available_in_catalogs?: string[] actions?: IssueAction[] introduced?: AuditIntroduced } +/** + * A pnpm.overrides entry whose target package is not declared in any workspace package.json (directly or as a declared parent in a parent>child override). May still be intentional for a transitive CVE pin; see `hint`. + */ +export interface UnusedDependencyOverride { +/** + * Full original override key as written (e.g. 'react>react-dom', '@types/react@<18'). + */ +raw_key: string +/** + * Target package the override rewrites (rightmost segment for parent>child keys). + */ +target_package: string +/** + * Optional parent package (left side of `>`). Omitted for bare-target keys. + */ +parent_package?: string +/** + * Optional version selector on the target (e.g. '<18' for '@types/react@<18'). Omitted when absent. + */ +version_constraint?: string +/** + * Right-hand side of the entry: the version pnpm should force. + */ +version_range: string +/** + * File the override was declared in. Matches the value users write in `ignoreDependencyOverrides[].source`. + */ +source: ("pnpm-workspace.yaml" | "package.json") +/** + * Relative path to the source file. + */ +path: string +/** + * 1-based line number of the entry. + */ +line: number +/** + * Soft hint for cases the conservative algorithm cannot disambiguate (e.g. a transitive CVE pin not visible to static analysis). Omitted when absent. + */ +hint?: string +actions?: IssueAction[] +introduced?: AuditIntroduced +} +/** + * A pnpm.overrides entry whose key or value does not parse as a valid pnpm override spec. `pnpm install` will reject these. + */ +export interface MisconfiguredDependencyOverride { +/** + * Full original override key as written. + */ +raw_key: string +/** + * Right-hand side of the entry, exactly as written. Empty when the value was missing. + */ +raw_value: string +/** + * Classifier for the misconfiguration. 'unparsable-key' = the key is not a valid pnpm shape; 'empty-value' = the value is missing, empty, or contains line breaks. + */ +reason: ("unparsable-key" | "empty-value") +/** + * File the override was declared in. + */ +source: ("pnpm-workspace.yaml" | "package.json") +/** + * Relative path to the source file. + */ +path: string +/** + * 1-based line number of the entry. + */ +line: number +actions?: IssueAction[] +introduced?: AuditIntroduced +} /** * Entry point detection summary showing total detected entry points and their sources. */ @@ -656,6 +740,8 @@ boundary_violations?: number stale_suppressions?: number unused_catalog_entries?: number unresolved_catalog_references?: number +unused_dependency_overrides?: number +misconfigured_dependency_overrides?: number } /** * Per-category delta comparison against a saved baseline. Shows current count, baseline count, and delta for each category. diff --git a/schema.json b/schema.json index 41804b62b..312fcc679 100644 --- a/schema.json +++ b/schema.json @@ -79,6 +79,13 @@ "$ref": "#/$defs/IgnoreCatalogReferenceRule" } }, + "ignoreDependencyOverrides": { + "description": "Rules for suppressing `unused-dependency-override` and\n`misconfigured-dependency-override` findings.\n\nEach rule matches by override target package, optionally scoped to the\ndeclaring source file (`pnpm-workspace.yaml` or `package.json`). Useful\nfor overrides targeting purely-transitive packages (CVE-fix pattern)\nwhere the conservative static algorithm would otherwise cry wolf.", + "type": "array", + "items": { + "$ref": "#/$defs/IgnoreDependencyOverrideRule" + } + }, "ignoreExportsUsedInFile": { "description": "Suppress unused-export findings when the exported symbol is referenced\ninside the file that declares it. This mirrors Knip's\n`ignoreExportsUsedInFile` option while still reporting exports that have\nno references at all.", "$ref": "#/$defs/IgnoreExportsUsedInFileConfig", @@ -158,7 +165,9 @@ "feature-flags": "off", "stale-suppressions": "warn", "unused-catalog-entries": "warn", - "unresolved-catalog-references": "error" + "unresolved-catalog-references": "error", + "unused-dependency-overrides": "warn", + "misconfigured-dependency-overrides": "error" } }, "boundaries": { @@ -566,6 +575,27 @@ "package" ] }, + "IgnoreDependencyOverrideRule": { + "description": "Rule for suppressing an `unused-dependency-override` or\n`misconfigured-dependency-override` finding.\n\nA finding is suppressed when ALL provided fields match the finding:\n- `package` matches the override's target package name exactly\n (case-sensitive). For parent-chain overrides (`react>react-dom`), the\n target is the rightmost segment (`react-dom`).\n- `source`, if set, scopes the suppression to overrides declared in that\n source file. Accepts `\"pnpm-workspace.yaml\"` or `\"package.json\"`.\n When omitted, both sources match.\n\nTypical use cases:\n- Library-internal CI tooling overrides we cannot drop yet\n- Overrides targeting purely-transitive packages (CVE-fix pattern)", + "type": "object", + "properties": { + "package": { + "description": "Override target package name (exact match; case-sensitive).", + "type": "string" + }, + "source": { + "description": "Source file scope: `\"pnpm-workspace.yaml\"` or `\"package.json\"`.\n`None` matches both sources.", + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false, + "required": [ + "package" + ] + }, "IgnoreExportsUsedInFileConfig": { "description": "Controls whether exports referenced only inside their defining file are\nreported as unused exports.", "anyOf": [ @@ -926,6 +956,14 @@ "unresolved-catalog-references": { "$ref": "#/$defs/Severity", "default": "error" + }, + "unused-dependency-overrides": { + "$ref": "#/$defs/Severity", + "default": "warn" + }, + "misconfigured-dependency-overrides": { + "$ref": "#/$defs/Severity", + "default": "error" } } }, @@ -1390,6 +1428,26 @@ "type": "null" } ] + }, + "unused-dependency-overrides": { + "anyOf": [ + { + "$ref": "#/$defs/Severity" + }, + { + "type": "null" + } + ] + }, + "misconfigured-dependency-overrides": { + "anyOf": [ + { + "$ref": "#/$defs/Severity" + }, + { + "type": "null" + } + ] } } }, From e9e30e3450b53079c1f65e5de609290d324f5e27 Mon Sep 17 00:00:00 2001 From: Bart Waardenburg Date: Tue, 12 May 2026 23:14:22 +0200 Subject: [PATCH 5/6] fix(overrides): address Phase B review concerns (json-output + github-action) Two non-blocking concerns from the parallel team review, addressed in one follow-up. json-output-reviewer (CONCERN): 1. `ignoreDependencyOverrides` add-to-config action lacked `value_schema` while the sibling `ignoreCatalogReferences` action has it. Added IGNORE_DEPENDENCY_OVERRIDES_VALUE_SCHEMA constant and threaded it through so CI agents and IDE integrations can validate the suppression snippet shape before writing to fallow config. 2. Misconfigured findings with `unparsable-key` reason carry an empty `raw_key` and no `target_package`. The previous fallback emitted `{"package":"","source":"package.json"}`, which the config parser would silently ignore. The suppress action is now skipped entirely when neither `target_package` nor `raw_key` yields a non-empty name; the primary `fix-dependency-override` action still fires. github-action-reviewer (CONCERN): 3. action/jq/annotations-check.jq and action/jq/summary-check.jq (plus the ci/ mirror) called `.reason | san` and `.raw_key` / `.raw_value` directly on the misconfigured payload. If a future schema refactor were to drop one of those required fields, jq would crash with exit 5 or render literal `null`. Added `// ""` null-safe fallbacks throughout so the action layer degrades gracefully. Internal docs (README "What it finds", CHANGELOG `[Unreleased]`, and .claude/rules/detection.md) updated to surface both new rules in the dependencies family. Snapshot tests regenerated to absorb the new value_schema field. Action (196) and ci (203) test suites green. Refs #336 --- .claude/rules/detection.md | 2 + CHANGELOG.md | 2 +- README.md | 2 +- action/jq/annotations-check.jq | 4 +- action/jq/summary-check.jq | 2 +- ci/jq/summary-check.jq | 2 +- crates/cli/src/report/json.rs | 53 +++++++++++++------ .../snapshot_tests__json_mixed_severity.snap | 6 ++- .../snapshot_tests__json_output.snap | 6 ++- 9 files changed, 52 insertions(+), 27 deletions(-) diff --git a/.claude/rules/detection.md b/.claude/rules/detection.md index 1ac497e42..12973138c 100644 --- a/.claude/rules/detection.md +++ b/.claude/rules/detection.md @@ -95,3 +95,5 @@ Non-obvious implementation details for each detection feature. These are NOT dis - **Feature flag detection**: AST-based detection of feature flag patterns. Three categories: (1) environment variables (`process.env.FEATURE_*` with 12 built-in prefixes), (2) SDK calls (25+ built-in patterns for LaunchDarkly, Statsig, Unleash, GrowthBook, Split, ConfigCat, Flagsmith), (3) config objects (opt-in heuristic for objects named "feature", "flag", "toggle"). Reports flag locations, detection confidence (high/low), guard spans. Cross-references with dead code: flags guarding unused exports are highlighted. Configured via `flags` section in config. Default severity: `off`. CLI: `fallow flags`. Inline suppression: `// fallow-ignore-next-line feature-flag` (line-level) and `// fallow-ignore-file feature-flag` (file-level). The suppression check runs in `crates/cli/src/flags.rs` during both built-in and custom flag collection loops, using `is_suppressed()` / `is_file_suppressed()` with `IssueKind::FeatureFlag`. The file-level check is hoisted outside the per-flag loop for efficiency. - **Unused pnpm catalog entries**: `pnpm-workspace.yaml`'s `catalog:` map (default catalog) and `catalogs.:` maps (named catalogs) are parsed via `serde_yml` plus a section-aware line scanner (`crates/config/src/workspace/pnpm_catalog.rs`) that records the 1-based source line for every entry. Workspace `package.json` files are walked for dependency values matching the `catalog:` protocol: a bare `"react": "catalog:"` and an explicit `"react": "catalog:default"` both resolve to the default catalog per pnpm's spec; named references use the catalog name verbatim. The detector (`crates/core/src/analyze/unused_catalog.rs::find_unused_catalog_entries`) emits one `UnusedCatalogEntry` per catalog entry no workspace `package.json` references via `catalog:` for the matching catalog group. Each finding also carries `hardcoded_consumers: Vec`, the workspace `package.json` paths that declare the same package with a non-`catalog:` version range, so consumers can decide whether to delete the catalog entry or switch the consumer to `catalog:` first (the differentiator vs knip's catalog detection). Output sort is `(path, catalog_name, entry_name)` with the default catalog sorting first via `catalog_sort_key`. Default severity `warn` (not `error`) because catalog entries ship zero bytes; matches the rest of the `unused_dev_dependencies` / `unused_optional_dependencies` family. JSON `actions[]` emits a YAML-style `# fallow-ignore-next-line unused-catalog-entry` suppression action via the new `SuppressKind::YamlComment`. Filter-to-workspaces clears catalog findings (whole-project concern, not per-workspace). **Auto-fix** (`crates/cli/src/fix/catalog.rs`, issue #335): `fallow fix` removes the entry by line-aware deletion (no YAML round-trip writer in the workspace; a full reprint via `serde_yaml_ng` would obliterate comments). Object-form entries (`react:\n specifier: ^18.2.0`) are detected by consuming subsequent lines whose indent is strictly greater than the entry's own; blank lines stop the consumption to preserve inter-entry whitespace. Entries with non-empty `hardcoded_consumers` are skipped (a record with `applied: false`, `skipped: true`, `skip_reason: "hardcoded_consumers"` is emitted so the user knows to migrate the consumer first). Multi-document YAML files (`---` separator) are rejected up front with `skip_reason: "multi_document_yaml"`. When removing the last entry of a catalog group (default `catalog:` or a named `catalogs.:`) leaves the header with no children, the fix rewrites the header to `catalog: {}` / `: {}` instead of leaving bare `key:`, because bare-key parses as null in YAML and pnpm rejects null-valued catalogs with `Cannot convert undefined or null to object` at install time (verified against pnpm 10.33.4). The post-edit content is reparsed with `serde_yaml_ng` as a syntactic sanity gate before persisting. The per-instance `auto_fixable` bool in the JSON `actions[]` flips to `false` for entries with hardcoded consumers (computed in `build_actions` in `crates/cli/src/report/json.rs`, mirroring the existing per-instance pattern used by `unresolved_catalog_references`); agents that filter on the bool no longer apply destructive ops to entries needing consumer-side migration first. After a successful fix that touched `pnpm-workspace.yaml`, the human stderr emits a one-line `Run \`pnpm install\` to refresh pnpm-lock.yaml` reminder. The LSP code action (`crates/lsp/src/code_actions/quick_fix.rs::build_remove_catalog_entry_actions`) mirrors the same guard and uses anchored key-prefix matching to reject substring collisions between sibling catalog entries with shared prefixes (`react` vs `react-native`). See issues #329 (detection) and #335 (auto-fix). See also: the `unresolved-catalog-reference` inverse rule (consumer references a catalog that does not declare the package). - **Unresolved pnpm catalog references**: the inverse of `unused-catalog-entries`. The same YAML parse + consumer walk (`find_unresolved_catalog_references` in `crates/core/src/analyze/unused_catalog.rs`) iterates over every `catalog:` / `catalog:` reference collected in `CatalogConsumers.referenced_with_locations` and emits an `UnresolvedCatalogReference` for any `(catalog_name, package_name)` pair the YAML does not declare. The consumer-side line number is captured by a section-aware `scan_dep_lines` pass over the raw `package.json` source that tracks brace depth so nested-object keys (`peerDependenciesMeta..optional`) cannot be misread as direct dep entries. Each finding carries `available_in_catalogs: Vec`: other catalogs in the same workspace that DO declare the package, sorted lexicographically; agents flip the reference to one of those when non-empty, otherwise add the missing entry to the named catalog. Default severity `error` (matches `unresolved-imports`): `pnpm install` errors with `ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_CATALOG_PROTOCOL` so the static finding catches the same failure pre-install. Default-catalog rendering uses a special-case "default catalog" phrasing in human / SARIF / LSP / CodeClimate output instead of `catalog 'default'` because users who write bare `catalog:` think of it as "the catalog", not as a named one. Suppression is config-only via the new `IgnoreCatalogReferenceRule { package, catalog?, consumer? }` array on `FallowConfig` (consumer is a glob, all three fields AND together when set); `package.json` does not support comments so inline suppression is structurally impossible. JSON `actions[]` is discriminated by the `available_in_catalogs` shape: `update-catalog-reference` (primary when alternatives exist), `add-catalog-entry` (primary when none do), `remove-catalog-reference` (fallback from the generic spec), plus an `add-to-config` for `ignoreCatalogReferences` with a paste-ready value scoped to the consumer. Filter-to-workspaces retains findings under the active set because each finding is anchored at a consumer `package.json` (unlike unused-catalog-entries which lives in the root YAML). The LSP diagnostic mirrors the catalog-entries pattern with `root.join(&finding.path)` so the URI built from the project-relative path is absolute. See issue #334. +- **Unused pnpm dependency overrides**: pnpm's `overrides:` section (top-level in `pnpm-workspace.yaml` for pnpm 9+, or legacy `pnpm.overrides` in the root `package.json`) lets a workspace force a specific transitive dependency version (typically for a CVE patch). The detector (`crates/core/src/analyze/unused_overrides.rs::find_unused_dependency_overrides`) parses both source forms via `crates/config/src/workspace/pnpm_overrides.rs`, walks every workspace `package.json` to compute the union of declared package names across `dependencies`, `devDependencies`, `peerDependencies`, and `optionalDependencies`, then emits an `UnusedDependencyOverride` for every override whose target package is not in that set. Parent-chain shapes (`react>react-dom: ^17`) are evaluated against the parent-chain rule: USED when EITHER the parent OR the target is declared, covering the CVE-fix pattern where the parent is declared in the workspace and the override forces a transitive version under it. Bare-name targets carry an optional `hint` flagging the case the static algorithm cannot disambiguate (the override may target a purely-transitive package). Default severity `warn`: most unused overrides are removable cruft, but the transitive-CVE pattern means some are intentional pins that a static algorithm cannot prove are obsolete. Each finding decomposes the raw key into `target_package`, `parent_package` (Option), `version_constraint` (Option, e.g. `Some("<18")` for `@types/react@<18`), and `version_range` (the forced version). Suppression is config-only via `ignoreDependencyOverrides: [{ package, source? }]` on `FallowConfig`: `package` matches the override's `target_package` exactly, optional `source` scopes to `"pnpm-workspace.yaml"` or `"package.json"`. JSON `actions[]` emits `remove-dependency-override` as primary plus an `add-to-config` for `ignoreDependencyOverrides`. Filter-to-workspaces clears findings (whole-project concern). See also: `misconfigured-dependency-overrides` (the entry-shape variant). See issue #336. +- **Misconfigured pnpm dependency overrides**: same parser as `unused-dependency-overrides`, different gate. `find_misconfigured_dependency_overrides` emits `MisconfiguredDependencyOverride` for entries whose key cannot be parsed (`DependencyOverrideMisconfigReason::UnparsableKey`: empty key, dangling separators like `react>`, malformed selectors like `@types/react@<<18`) or whose value is missing/empty (`EmptyValue`). pnpm itself refuses to honor these at install time. The pnpm idiom values `-` (delete), `$ref` (self-reference), and `npm:alias@^1` (npm alias) are explicitly allowlisted and never flagged. Default severity `error`: a malformed override breaks `pnpm install` for every contributor. Findings carry the raw key, raw value, the reason discriminant (serialized as kebab-case `unparsable-key` / `empty-value`), source, path, and line. Suppression: same `ignoreDependencyOverrides` config-only rule as `unused-dependency-overrides`. JSON `actions[]` emits `fix-dependency-override` as primary plus the same `add-to-config` suppress. Filter-to-workspaces clears findings. See also: `unused-dependency-overrides` (the consumer-not-declared variant). See issue #336. diff --git a/CHANGELOG.md b/CHANGELOG.md index 272d1036a..7f8c15169 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **`fallow fix` now auto-removes unused pnpm catalog entries from `pnpm-workspace.yaml`.** The `unused-catalog-entries` detector shipped in v2.70.0, but until now the only available action was `# fallow-ignore-next-line unused-catalog-entry`; users had to hand-edit the YAML to drop the entry. The fix is line-aware (preserves comments and stylistic choices in the file) and detects object-form entries such as `react:\n specifier: ^18.2.0\n publishConfig: {}` by consuming subsequent lines whose indent is strictly greater than the entry's own. When removing the last entry of a catalog group (default `catalog:` or a named `catalogs.:`) leaves the header with no children, the fix rewrites the header to `catalog: {}` / `: {}` so the file stays installable; bare `key:` in YAML parses as null which pnpm rejects with `Cannot convert undefined or null to object` at install time. Entries whose `hardcoded_consumers` is non-empty are skipped: removing the catalog entry while a workspace package still pins a hardcoded version of the same package would break the user's next `pnpm install`. The skip is surfaced in the human stderr summary and in the JSON output (`{"type": "remove_catalog_entry", "applied": false, "skipped": true, "skip_reason": "hardcoded_consumers", "consumers": [...], "description": "..."}`), and the per-instance `auto_fixable` bool on the check-command action correctly flips to `false` for findings with hardcoded consumers so agents that filter on the bool skip those automatically. After a successful run the CLI emits a one-line `Run \`pnpm install\` to refresh pnpm-lock.yaml` reminder so the workspace stays internally consistent. The fix output's top-level envelope adds a `"skipped"` count alongside the existing `"total_fixed"` so consumers can gate on partial-fix runs. The LSP `unused-catalog-entry` diagnostic now exposes a matching `Remove unused catalog entry` quick-fix code action with the same hardcoded-consumer guard, the same empty-parent rewrite, and an anchored key-prefix sanity check so sibling entries with shared prefixes (`react` vs `react-native`, `lodash` vs `lodash-es`) cannot be deleted by mistake. (Closes [#335](https://github.com/fallow-rs/fallow/issues/335).) -- **Detects unused and misconfigured pnpm `overrides` entries (Phase A).** **Upgrade note:** the new `misconfigured-dependency-overrides` rule defaults to `error`, so a workspace with a malformed override key or empty value will flip from a green `fallow check` on v2.72 to a red one on the next minor. To absorb the change without action, set `rules.misconfigured-dependency-overrides: "warn"` in your fallow config before upgrading. Two new rules read both `pnpm-workspace.yaml`'s `overrides:` top-level (canonical, pnpm 9+) and the root `package.json`'s `pnpm.overrides` (legacy form). `unused-dependency-overrides` (default `warn`) flags entries whose target package is not declared in any workspace `package.json`; conservative static algorithm uses the parent-chain rule (`react>react-dom` is considered USED when EITHER `react` OR `react-dom` is declared, covering the CVE-fix pattern where the parent is declared and the override forces a transitive version). Findings carry the raw key, structured `target_package` / `parent_package` / `version_constraint` / `version_range` decomposition, the source file (`pnpm-workspace.yaml` or `package.json`), 1-based line number, and an optional `hint` flagging parent-chain shapes that may target a purely transitive dependency. `misconfigured-dependency-overrides` (default `error`) catches entries whose key cannot be parsed (empty key, dangling separators) or whose value is missing; `pnpm install` refuses to honor these. Special pnpm values (`-` removal, `$ref` self-reference, `npm:alias@^1`) are explicitly allowlisted and never flagged as misconfigured. Suppression is config-only via `ignoreDependencyOverrides: [{ package, source? }]` (inline YAML / JSON comments are not feasible since `pnpm-workspace.yaml` uses YAML and `package.json` has no comment syntax); the optional `source` field scopes a suppression to `"pnpm-workspace.yaml"` or `"package.json"`. New `IssueKind::UnusedDependencyOverride` (discriminant 23) and `IssueKind::MisconfiguredDependencyOverride` (discriminant 24); new `UnusedDependencyOverride` + `MisconfiguredDependencyOverride` structs on `AnalysisResults`. Phase A wires the detector, types, config, integration tests, and JSON output; subsequent phases will extend the CLI report formats (human / SARIF / compact / markdown / CodeClimate), LSP / MCP / VS Code surfaces, and CI wrappers. (Refs [#336](https://github.com/fallow-rs/fallow/issues/336)) +- **Detects unused and misconfigured pnpm `overrides` entries.** **Upgrade note:** the new `misconfigured-dependency-overrides` rule defaults to `error`, so a workspace with a malformed override key or empty value will flip from a green `fallow check` on v2.72 to a red one on the next minor. To absorb the change without action, set `rules.misconfigured-dependency-overrides: "warn"` in your fallow config before upgrading. Two new rules read both `pnpm-workspace.yaml`'s `overrides:` top-level (canonical, pnpm 9+) and the root `package.json`'s `pnpm.overrides` (legacy form). `unused-dependency-overrides` (default `warn`) flags entries whose target package is not declared in any workspace `package.json`; conservative static algorithm uses the parent-chain rule (`react>react-dom` is considered USED when EITHER `react` OR `react-dom` is declared, covering the CVE-fix pattern where the parent is declared and the override forces a transitive version). Findings carry the raw key, structured `target_package` / `parent_package` / `version_constraint` / `version_range` decomposition, the source file (`pnpm-workspace.yaml` or `package.json`), 1-based line number, and an optional `hint` flagging entries that may target a purely transitive dependency (CVE-fix or canary-alias pattern). `misconfigured-dependency-overrides` (default `error`) catches entries whose key cannot be parsed (empty key, dangling separators) or whose value is missing; `pnpm install` refuses to honor these. Special pnpm values (`-` removal, `$ref` self-reference, `npm:alias@^1`) are explicitly allowlisted and never flagged as misconfigured. Suppression is config-only via `ignoreDependencyOverrides: [{ package, source? }]` (inline YAML / JSON comments are not feasible since `pnpm-workspace.yaml` uses YAML and `package.json` has no comment syntax); the optional `source` field scopes a suppression to `"pnpm-workspace.yaml"` or `"package.json"`. New `IssueKind::UnusedDependencyOverride` (discriminant 23) and `IssueKind::MisconfiguredDependencyOverride` (discriminant 24); new `UnusedDependencyOverride` + `MisconfiguredDependencyOverride` structs on `AnalysisResults`. All six report formats render the findings (human two-tier, JSON with discriminated `remove-dependency-override` / `fix-dependency-override` primary actions + `ignoreDependencyOverrides` add-to-config suppress, SARIF rules `fallow/unused-dependency-override` and `fallow/misconfigured-dependency-override`, compact, markdown, CodeClimate). The GitHub Action and GitLab CI jq scripts surface both in summary tables and emit `::warning` for unused and `::error` for misconfigured annotations. The LSP emits matching diagnostics anchored on the source file line. The MCP `analyze` tool accepts `issue_types: ["unused-dependency-overrides", "misconfigured-dependency-overrides"]`, and the VS Code "Unused Code" tree shows two new categories. `fallow explain unused-dependency-override` and `fallow explain misconfigured-dependency-override` open with the CVE-pin caveat and pnpm-grammar examples respectively. (Closes [#336](https://github.com/fallow-rs/fallow/issues/336)) ## [2.72.0] - 2026-05-12 diff --git a/README.md b/README.md index 37e76977e..fc0170522 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ fallow fix --dry-run # Preview automatic cleanup ## What it finds -- **Dead code**: unused files, exports, dependencies, types, cycles, boundaries, stale suppressions, unused pnpm `catalog:` entries, unresolved pnpm `catalog:` references (a `package.json` references a catalog that does not declare the package, so `pnpm install` would fail), GraphQL documents linked by `#import`, plus opt-in API hygiene checks such as private type leaks +- **Dead code**: unused files, exports, dependencies, types, cycles, boundaries, stale suppressions, unused pnpm `catalog:` entries, unresolved pnpm `catalog:` references (a `package.json` references a catalog that does not declare the package, so `pnpm install` would fail), unused or misconfigured pnpm `overrides:` entries (an override forces a version no workspace package depends on, or an override key/value is malformed), GraphQL documents linked by `#import`, plus opt-in API hygiene checks such as private type leaks - **Duplication**: repeated blocks from exact to semantic clones - **Complexity**: high-risk functions, file scores, hotspots, and refactor targets - **Architecture drift**: boundary violations across layers and modules diff --git a/action/jq/annotations-check.jq b/action/jq/annotations-check.jq index 521767113..e8d3b6db8 100644 --- a/action/jq/annotations-check.jq +++ b/action/jq/annotations-check.jq @@ -57,7 +57,7 @@ def dependency_action(pkg): (.unresolved_catalog_references[]? | "::error file=\(.path | san),line=\(.line),title=Unresolved catalog reference::Package '\(.entry_name | san)' is referenced via `catalog:\(if .catalog_name == "default" then "" else (.catalog_name | san) end)` but \(if .catalog_name == "default" then "the default catalog" else "catalog '" + (.catalog_name | san) + "'" end) does not declare it. `pnpm install` will fail.\(nl)\(nl)\(if ((.available_in_catalogs // []) | length) > 0 then "Available in: " + (.available_in_catalogs | map(san) | join(", ")) + ".\(nl)Switch the reference to a catalog that declares this package, or add it to the named catalog." else "Add this package to the named catalog in pnpm-workspace.yaml, or remove the reference and pin a hardcoded version." end)"), (.unused_dependency_overrides[]? | - "::warning file=\(.path | san),line=\(.line),title=Unused dependency override::Override `\(.raw_key | san)` forces `\(.target_package | san)` to `\(.version_range | san)` but no workspace package depends on `\(.target_package | san)`.\(nl)\(nl)\(if .hint then (.hint | san) + ".\(nl)" else "" end)Delete the entry, or scope it under a real parent (`pkg>\(.target_package | san)`) if it pins a transitive."), + "::warning file=\((.path // "") | san),line=\(.line // 0),title=Unused dependency override::Override `\((.raw_key // "") | san)` forces `\((.target_package // "") | san)` to `\((.version_range // "") | san)` but no workspace package depends on `\((.target_package // "") | san)`.\(nl)\(nl)\(if .hint then (.hint | san) + ".\(nl)" else "" end)Delete the entry, or scope it under a real parent (`pkg>\((.target_package // "") | san)`) if it pins a transitive."), (.misconfigured_dependency_overrides[]? | - "::error file=\(.path | san),line=\(.line),title=Misconfigured dependency override::Override `\(.raw_key | san)` -> `\(.raw_value | san)` is malformed (\(.reason | san)). `pnpm install` will reject this entry.\(nl)\(nl)Fix the key/value to match pnpm's override grammar, or remove the entry.") + "::error file=\((.path // "") | san),line=\(.line // 0),title=Misconfigured dependency override::Override `\((.raw_key // "") | san)` -> `\((.raw_value // "") | san)` is malformed (\((.reason // "unparsable") | san)). `pnpm install` will reject this entry.\(nl)\(nl)Fix the key/value to match pnpm's override grammar, or remove the entry.") ] | .[] diff --git a/action/jq/summary-check.jq b/action/jq/summary-check.jq index ff0b7e408..11c8f0406 100644 --- a/action/jq/summary-check.jq +++ b/action/jq/summary-check.jq @@ -114,7 +114,7 @@ else "| `\(.raw_key)` | `\(.target_package)` -> `\(.version_range)` | `\(.source)` | `\(.path):\(.line)` | \(.hint // "") |") + section("Misconfigured dependency overrides"; "misconfigured_dependency_overrides"; "`pnpm.overrides` entries with an unparsable key or empty value. `pnpm install` will reject these.\n\n| Override | Value | Source | Location | Reason |\n|----------|-------|--------|----------|--------|\n"; - "| `\(.raw_key)` | `\(.raw_value)` | `\(.source)` | `\(.path):\(.line)` | \(.reason) |") + + "| `\(.raw_key // "")` | `\(.raw_value // "")` | `\(.source)` | `\(.path):\(.line)` | \(.reason // "unparsable") |") + "\n\n> [!TIP]\n" + (if ((.unused_exports // []) + (.unused_dependencies // []) + (.unused_enum_members // [])) | length > 0 then "> Run `fallow fix --dry-run` to preview safe auto-fixes.\n" diff --git a/ci/jq/summary-check.jq b/ci/jq/summary-check.jq index de3f4b62a..d96b71a7f 100644 --- a/ci/jq/summary-check.jq +++ b/ci/jq/summary-check.jq @@ -117,7 +117,7 @@ else "| `\(.raw_key)` | `\(.target_package)` -> `\(.version_range)` | `\(.source)` | `\(.path):\(.line)` | \(.hint // "") |") + section("Misconfigured dependency overrides"; "misconfigured_dependency_overrides"; "`pnpm.overrides` entries with an unparsable key or empty value. `pnpm install` will reject these.\n\n| Override | Value | Source | Location | Reason |\n|----------|-------|--------|----------|--------|\n"; - "| `\(.raw_key)` | `\(.raw_value)` | `\(.source)` | `\(.path):\(.line)` | \(.reason) |") + + "| `\(.raw_key // "")` | `\(.raw_value // "")` | `\(.source)` | `\(.path):\(.line)` | \(.reason // "unparsable") |") + "\n\n" + (if ((.unused_exports // []) + (.unused_dependencies // []) + (.unused_enum_members // [])) | length > 0 then "> :bulb: Run `fallow fix --dry-run` to preview safe auto-fixes.\n" diff --git a/crates/cli/src/report/json.rs b/crates/cli/src/report/json.rs index a42f0021b..06b1083db 100644 --- a/crates/cli/src/report/json.rs +++ b/crates/cli/src/report/json.rs @@ -27,6 +27,11 @@ const IGNORE_DEPENDENCIES_VALUE_SCHEMA: &str = "https://raw.githubusercontent.co /// consumer? }` entry to append. const IGNORE_CATALOG_REFERENCES_VALUE_SCHEMA: &str = "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json#/properties/ignoreCatalogReferences/items"; +/// JSON Pointer fragment URL describing the shape of the `value` field on an +/// `ignoreDependencyOverrides` `add-to-config` action: one `{ package, source? }` +/// entry to append. +const IGNORE_DEPENDENCY_OVERRIDES_VALUE_SCHEMA: &str = "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json#/properties/ignoreDependencyOverrides/items"; + pub(super) fn print_json( results: &AnalysisResults, root: &Path, @@ -766,26 +771,40 @@ fn build_actions( })); } SuppressKind::AddToConfigIgnoreDependencyOverrides => { + // `target_package` is set on unused overrides (the key parsed + // successfully) but absent on misconfigured ones whose `raw_key` + // could not be parsed. Falling back to `raw_key` is unsafe in the + // misconfigured case: it may be empty or malformed. Skip the + // suppress action entirely when neither field yields a non-empty + // name; an `ignoreDependencyOverrides` entry with `package: ""` + // would be silently ignored by the config parser. let package_name = item .get("target_package") .and_then(serde_json::Value::as_str) - .or_else(|| item.get("raw_key").and_then(serde_json::Value::as_str)) - .unwrap_or("package"); - let source = item - .get("source") - .and_then(serde_json::Value::as_str) - .unwrap_or("pnpm-workspace.yaml"); - let value = serde_json::json!({ - "package": package_name, - "source": source, - }); - actions.push(serde_json::json!({ - "type": "add-to-config", - "auto_fixable": false, - "description": "Suppress this override finding via ignoreDependencyOverrides in fallow config (use for CVE-fix overrides that target a purely-transitive package).", - "config_key": "ignoreDependencyOverrides", - "value": value, - })); + .filter(|s| !s.is_empty()) + .or_else(|| { + item.get("raw_key") + .and_then(serde_json::Value::as_str) + .filter(|s| !s.is_empty()) + }); + if let Some(package_name) = package_name { + let source = item + .get("source") + .and_then(serde_json::Value::as_str) + .unwrap_or("pnpm-workspace.yaml"); + let value = serde_json::json!({ + "package": package_name, + "source": source, + }); + actions.push(serde_json::json!({ + "type": "add-to-config", + "auto_fixable": false, + "description": "Suppress this override finding via ignoreDependencyOverrides in fallow config (use for CVE-fix overrides that target a purely-transitive package).", + "config_key": "ignoreDependencyOverrides", + "value": value, + "value_schema": IGNORE_DEPENDENCY_OVERRIDES_VALUE_SCHEMA, + })); + } } } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap b/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap index a1fdbcc31..954fbc3fd 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_mixed_severity.snap @@ -499,7 +499,8 @@ expression: redact_version(&json_str) "value": { "package": "axios", "source": "pnpm-workspace.yaml" - } + }, + "value_schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json#/properties/ignoreDependencyOverrides/items" } ] } @@ -527,7 +528,8 @@ expression: redact_version(&json_str) "value": { "package": "@types/react@<<18", "source": "package.json" - } + }, + "value_schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json#/properties/ignoreDependencyOverrides/items" } ] } diff --git a/crates/cli/tests/snapshots/snapshot_tests__json_output.snap b/crates/cli/tests/snapshots/snapshot_tests__json_output.snap index 9cd460076..d12644369 100644 --- a/crates/cli/tests/snapshots/snapshot_tests__json_output.snap +++ b/crates/cli/tests/snapshots/snapshot_tests__json_output.snap @@ -499,7 +499,8 @@ expression: "json_str.replace(&format!(\"\\\"version\\\": \\\"{}\\\"\", env!(\"C "value": { "package": "axios", "source": "pnpm-workspace.yaml" - } + }, + "value_schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json#/properties/ignoreDependencyOverrides/items" } ] } @@ -527,7 +528,8 @@ expression: "json_str.replace(&format!(\"\\\"version\\\": \\\"{}\\\"\", env!(\"C "value": { "package": "@types/react@<<18", "source": "package.json" - } + }, + "value_schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json#/properties/ignoreDependencyOverrides/items" } ] } From d7100f840765b3856d461c865d7a6636879d6ddc Mon Sep 17 00:00:00 2001 From: Bart Waardenburg Date: Tue, 12 May 2026 23:34:22 +0200 Subject: [PATCH 6/6] fix(overrides): address codex review BLOCKs (changed-since + per-file rules + suppress value) Three load-bearing wiring gaps caught by codex's parallel /fallow-review of Phase B (PR #362), missed by claude's local team review. BLOCK 1: --changed-since filtered out the new override findings. UnusedDependencyOverride.path / MisconfiguredDependencyOverride.path stored project-root-relative strings ("pnpm-workspace.yaml", "package.json"), but try_get_changed_files returns absolute paths, so the changed_files.contains check in filter_results_by_changed_files never matched. Storage flipped to absolute internally (config.root.join(...) at detection time), matching the UnresolvedCatalogReference convention shipped in #334. serde_path::serialize keeps the JSON output relative. BLOCK 2: per-file overrides.rules did not apply because crates/cli/src/check/ rules.rs::apply_rules' has_overrides branch handled file-scoped issue types but not the new override findings; setting both rules off for pnpm-workspace.yaml / package.json via config overrides still surfaced findings. Added per-file resolve in both apply_rules and has_error_severity_issues for unused_dependency_overrides and misconfigured_dependency_overrides, matching the unresolved-catalog-references fix from 176698ff. BLOCK 3: JSON add-to-config suppress action could emit an unsuppressable value for misconfigured findings with the EmptyValue reason. raw_key "react@<18" was used as fallback when target_package was absent, but the suppression matcher keys on the parsed package name "react"; the suggested { package: "react@<18" } did not actually suppress the finding. Added target_package: Option to MisconfiguredDependencyOverride, populated from the parsed key when it parses (EmptyValue path; remains None for UnparsableKey). JSON now reads the parsed name first and skips the suppress action entirely when no parseable package name exists, mirroring the empty- raw_key handling shipped earlier. LSP follow-up: dropped root.join in push_dependency_override_diagnostics now that finding.path is absolute; regression tests updated to construct absolute paths and assert under them. Snapshot sample data also flipped to absolute. Codex repros against the rebuilt binary now produce: - BLOCK 1: editing pnpm-workspace.yaml under --changed-since HEAD~1 retains the override findings (was 0 before, now 3) - BLOCK 2: per-file overrides.rules.{unused,misconfigured}-dependency- overrides: "off" clears the findings (was 2+2, now 0) - BLOCK 3: misconfigured react@<18 EmptyValue suggests {package: "react"} (was "react@<18"), unparsable-key emits no add-to-config action Refs #336 --- crates/cli/src/check/rules.rs | 12 +++++++++ crates/cli/src/report/json.rs | 4 +++ crates/cli/tests/snapshot_tests.rs | 5 ++-- crates/core/src/analyze/unused_overrides.rs | 20 ++++++++++----- crates/lsp/src/diagnostics/unused.rs | 27 ++++++++++++--------- crates/types/src/results.rs | 19 +++++++++++++-- 6 files changed, 65 insertions(+), 22 deletions(-) diff --git a/crates/cli/src/check/rules.rs b/crates/cli/src/check/rules.rs index 723380b87..d362aa761 100644 --- a/crates/cli/src/check/rules.rs +++ b/crates/cli/src/check/rules.rs @@ -44,6 +44,18 @@ pub fn apply_rules(results: &mut fallow_core::results::AnalysisResults, config: .unresolved_catalog_references != Severity::Off }); + results.unused_dependency_overrides.retain(|o| { + config + .resolve_rules_for_path(&o.path) + .unused_dependency_overrides + != Severity::Off + }); + results.misconfigured_dependency_overrides.retain(|o| { + config + .resolve_rules_for_path(&o.path) + .misconfigured_dependency_overrides + != Severity::Off + }); results.circular_dependencies.retain(|c| { c.files.iter().any(|path| { config.resolve_rules_for_path(path).circular_dependencies != Severity::Off diff --git a/crates/cli/src/report/json.rs b/crates/cli/src/report/json.rs index 06b1083db..1bbf1b2c9 100644 --- a/crates/cli/src/report/json.rs +++ b/crates/cli/src/report/json.rs @@ -617,6 +617,10 @@ fn build_unresolved_catalog_reference_primary_action( } /// Build the `actions` array for a single issue item. +#[expect( + clippy::too_many_lines, + reason = "One match arm per SuppressKind; the line count grows with new issue types and the structure is clearer than extracting per-arm helpers." +)] fn build_actions( item: &serde_json::Value, issue_key: &str, diff --git a/crates/cli/tests/snapshot_tests.rs b/crates/cli/tests/snapshot_tests.rs index e12fa4c4a..5ba2dcee2 100644 --- a/crates/cli/tests/snapshot_tests.rs +++ b/crates/cli/tests/snapshot_tests.rs @@ -162,7 +162,7 @@ fn sample_results(root: &Path) -> AnalysisResults { version_constraint: None, version_range: "^1.6.0".to_string(), source: fallow_core::results::DependencyOverrideSource::PnpmWorkspaceYaml, - path: PathBuf::from("pnpm-workspace.yaml"), + path: root.join("pnpm-workspace.yaml"), line: 9, hint: Some( "May be an intentional pin for a transitive CVE that no workspace package depends on directly" @@ -173,10 +173,11 @@ fn sample_results(root: &Path) -> AnalysisResults { r.misconfigured_dependency_overrides.push( fallow_core::results::MisconfiguredDependencyOverride { raw_key: "@types/react@<<18".to_string(), + target_package: None, raw_value: "18.0.0".to_string(), reason: fallow_core::results::DependencyOverrideMisconfigReason::UnparsableKey, source: fallow_core::results::DependencyOverrideSource::PnpmPackageJson, - path: PathBuf::from("package.json"), + path: root.join("package.json"), line: 3, }, ); diff --git a/crates/core/src/analyze/unused_overrides.rs b/crates/core/src/analyze/unused_overrides.rs index ab99017c8..5552982aa 100644 --- a/crates/core/src/analyze/unused_overrides.rs +++ b/crates/core/src/analyze/unused_overrides.rs @@ -30,8 +30,6 @@ //! This matches the common CVE-fix pattern where the parent is declared and //! the override forces a transitive version inside that parent's subtree. -use std::path::PathBuf; - use fallow_config::{ CompiledIgnoreDependencyOverrideRule, PackageJson, PnpmOverrideData, ResolvedConfig, WorkspaceInfo, override_misconfig_reason as parser_misconfig_reason, @@ -147,8 +145,8 @@ pub fn find_unused_dependency_overrides( config: &ResolvedConfig, ) -> Vec { let mut findings = Vec::new(); - let yaml_path = PathBuf::from(PNPM_WORKSPACE_FILE); - let json_path = PathBuf::from(ROOT_PACKAGE_JSON); + let yaml_path = config.root.join(PNPM_WORKSPACE_FILE); + let json_path = config.root.join(ROOT_PACKAGE_JSON); collect_unused_from_source( &state.workspace_yaml_data, DependencyOverrideSource::PnpmWorkspaceYaml, @@ -237,8 +235,8 @@ pub fn find_misconfigured_dependency_overrides( config: &ResolvedConfig, ) -> Vec { let mut findings = Vec::new(); - let yaml_path = PathBuf::from(PNPM_WORKSPACE_FILE); - let json_path = PathBuf::from(ROOT_PACKAGE_JSON); + let yaml_path = config.root.join(PNPM_WORKSPACE_FILE); + let json_path = config.root.join(ROOT_PACKAGE_JSON); collect_misconfigured_from_source( &state.workspace_yaml_data, DependencyOverrideSource::PnpmWorkspaceYaml, @@ -281,8 +279,18 @@ fn collect_misconfigured_from_source( continue; } + // `target_package` is the parsed package name when the key parses + // (always for `EmptyValue` findings, never for `UnparsableKey`). + // Surfacing it lets JSON `add-to-config` actions emit a paste-ready + // suppression value that matches the actual suppression matcher (which + // also keys on `target_package`); without it, a raw_key like + // `"react@<18"` would suggest `{ package: "react@<18" }` that does not + // suppress the finding (suppressor uses just `"react"`). + let target_package = entry.parsed_key.as_ref().map(|p| p.target_package.clone()); + findings.push(MisconfiguredDependencyOverride { raw_key: entry.raw_key.clone(), + target_package, raw_value: entry.raw_value.clone().unwrap_or_default(), reason: map_misconfig_reason(reason), source, diff --git a/crates/lsp/src/diagnostics/unused.rs b/crates/lsp/src/diagnostics/unused.rs index a9ce1b68c..05c982d1f 100644 --- a/crates/lsp/src/diagnostics/unused.rs +++ b/crates/lsp/src/diagnostics/unused.rs @@ -288,7 +288,7 @@ pub fn push_dep_diagnostics( } push_unresolved_catalog_reference_diagnostics(map, results); - push_dependency_override_diagnostics(map, results, root); + push_dependency_override_diagnostics(map, results); } /// Emit one `ERROR`-severity diagnostic per unresolved-catalog-reference @@ -342,18 +342,18 @@ fn push_unresolved_catalog_reference_diagnostics( } /// Emit diagnostics for unused and misconfigured pnpm dependency-override -/// findings. Both finding types carry a project-root-relative `path` (same -/// convention as `UnusedCatalogEntry`), so the URI must be built from -/// `root.join(&finding.path)`. Severity matches the default rule severity: -/// unused = `WARNING`, misconfigured = `ERROR` (pnpm refuses to install). +/// findings. Both finding types carry an absolute `path` (matching the +/// `UnresolvedCatalogReference` convention so `--changed-since` and per-file +/// overrides.rules can compare directly). `Url::from_file_path` accepts the +/// path as-is. Severity matches the default rule severity: unused = +/// `WARNING`, misconfigured = `ERROR` (pnpm refuses to install). fn push_dependency_override_diagnostics( map: &mut FxHashMap>, results: &AnalysisResults, - root: &std::path::Path, ) { use std::fmt::Write as _; for finding in &results.unused_dependency_overrides { - let Ok(uri) = Url::from_file_path(root.join(&finding.path)) else { + let Ok(uri) = Url::from_file_path(&finding.path) else { continue; }; let line = finding.line.saturating_sub(1); @@ -383,7 +383,7 @@ fn push_dependency_override_diagnostics( }); } for finding in &results.misconfigured_dependency_overrides { - let Ok(uri) = Url::from_file_path(root.join(&finding.path)) else { + let Ok(uri) = Url::from_file_path(&finding.path) else { continue; }; let line = finding.line.saturating_sub(1); @@ -1044,6 +1044,7 @@ mod tests { let root = test_root(); let mut results = AnalysisResults::default(); + let yaml_path = root.join("pnpm-workspace.yaml"); results .unused_dependency_overrides .push(UnusedDependencyOverride { @@ -1053,7 +1054,7 @@ mod tests { version_constraint: None, version_range: "^1.6.0".to_string(), source: DependencyOverrideSource::PnpmWorkspaceYaml, - path: PathBuf::from("pnpm-workspace.yaml"), + path: yaml_path.clone(), line: 9, hint: Some("may be intentional transitive pin".to_string()), }); @@ -1061,7 +1062,7 @@ mod tests { let duplication = empty_duplication(); let diags = build_diagnostics(&results, &duplication, &root); - let uri = Url::from_file_path(root.join("pnpm-workspace.yaml")).unwrap(); + let uri = Url::from_file_path(&yaml_path).unwrap(); let file_diags = diags .get(&uri) .expect("unused-dependency-override diagnostic must key by absolute URI"); @@ -1092,22 +1093,24 @@ mod tests { }; let root = test_root(); + let json_path = root.join("package.json"); let mut results = AnalysisResults::default(); results .misconfigured_dependency_overrides .push(MisconfiguredDependencyOverride { raw_key: "@types/react@<<18".to_string(), + target_package: None, raw_value: "18.0.0".to_string(), reason: DependencyOverrideMisconfigReason::UnparsableKey, source: DependencyOverrideSource::PnpmPackageJson, - path: PathBuf::from("package.json"), + path: json_path.clone(), line: 3, }); let duplication = empty_duplication(); let diags = build_diagnostics(&results, &duplication, &root); - let uri = Url::from_file_path(root.join("package.json")).unwrap(); + let uri = Url::from_file_path(&json_path).unwrap(); let d = &diags[&uri][0]; assert_eq!(d.severity, Some(DiagnosticSeverity::ERROR)); assert_eq!( diff --git a/crates/types/src/results.rs b/crates/types/src/results.rs index ecb915600..dd1003aba 100644 --- a/crates/types/src/results.rs +++ b/crates/types/src/results.rs @@ -675,7 +675,11 @@ pub struct UnusedDependencyOverride { /// Where the override entry was declared. pub source: DependencyOverrideSource, /// Path to the source file. `pnpm-workspace.yaml` or a `package.json`, - /// stored as project-root-relative for consistency with `UnusedCatalogEntry`. + /// stored as an absolute filesystem path so `--changed-since` and + /// per-file `overrides.rules` can compare directly against the analyzer's + /// changed-set / per-path rule lookups. JSON serialization strips the + /// project root via `serde_path::serialize`, matching the + /// `UnresolvedCatalogReference` convention. #[serde(serialize_with = "serde_path::serialize")] pub path: PathBuf, /// 1-based line number of the entry within the source file. @@ -720,6 +724,15 @@ impl DependencyOverrideMisconfigReason { pub struct MisconfiguredDependencyOverride { /// The full original override key as written in the source. pub raw_key: String, + /// Parsed target package name when the key was syntactically valid (the + /// `EmptyValue` reason path). `None` for `UnparsableKey` findings whose + /// key could not be parsed at all. Used by JSON `add-to-config` actions to + /// emit a paste-ready `ignoreDependencyOverrides` value that matches the + /// suppression matcher (which also keys on `target_package`); avoids the + /// pitfall where `raw_key` like `"react@<18"` would not match the rule + /// that targets package `"react"`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target_package: Option, /// The right-hand side of the entry, exactly as written. Empty when the /// value was missing. pub raw_value: String, @@ -727,7 +740,9 @@ pub struct MisconfiguredDependencyOverride { pub reason: DependencyOverrideMisconfigReason, /// Where the override entry was declared. pub source: DependencyOverrideSource, - /// Path to the source file (project-root-relative). + /// Path to the source file. Stored as an absolute filesystem path so + /// `--changed-since` and per-file `overrides.rules` can compare directly. + /// JSON serialization strips the project root via `serde_path::serialize`. #[serde(serialize_with = "serde_path::serialize")] pub path: PathBuf, /// 1-based line number of the entry within the source file.