@duckmind/dm-linux-x64 0.65.8 → 0.66.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dm +2 -2
- package/extensions/.dm-extensions.json +14 -548
- package/extensions/dm-lens/clients/dispatch/runners/utils/runner-helpers.js +1 -1
- package/extensions/dm-mcp-adapter/mcp-keyring-helper.cjs +1 -1
- package/extensions/dm-ponytail/hooks/ponytail-activate.js +1 -1
- package/extensions/dm-ponytail/hooks/ponytail-instructions.js +1 -1
- package/extensions/dm-subagents/src/extension/tool-activation.js +7 -2
- package/extensions/dm-subagents/src/runs/background/runner-aliases.js +2 -2
- package/extensions/dm-subagents/src/runs/foreground/prompt-audit.js +4 -1
- package/extensions/dm-subagents/src/runs/shared/child-session.js +8 -6
- package/extensions/dm-subagents/src/runs/shared/dm-spawn.js +5 -1
- package/extensions/dm-subagents/src/watchdog/permission-arbiter.js +9 -1
- package/extensions/dm-subagents/src/watchdog/review.js +4 -1
- package/extensions/dm-web-access/tool-activation.js +0 -1
- package/package.json +1 -1
- package/extensions/dm-lens/dist/clients/actionable-warnings-logger.js +0 -24
- package/extensions/dm-lens/dist/clients/actionable-warnings.js +0 -1014
- package/extensions/dm-lens/dist/clients/advisory-provenance.js +0 -385
- package/extensions/dm-lens/dist/clients/agent-behavior-client.js +0 -94
- package/extensions/dm-lens/dist/clients/agent-nudge.js +0 -151
- package/extensions/dm-lens/dist/clients/analysed-root.js +0 -1
- package/extensions/dm-lens/dist/clients/ast-grep-client.js +0 -576
- package/extensions/dm-lens/dist/clients/ast-grep-rule-manager.js +0 -114
- package/extensions/dm-lens/dist/clients/ast-grep-tool-logger.js +0 -85
- package/extensions/dm-lens/dist/clients/ast-grep-types.js +0 -1
- package/extensions/dm-lens/dist/clients/ast-grep-yaml-synth.js +0 -109
- package/extensions/dm-lens/dist/clients/atomic-write-staging.js +0 -66
- package/extensions/dm-lens/dist/clients/atomic-write.js +0 -37
- package/extensions/dm-lens/dist/clients/availability-probe-flight.js +0 -11
- package/extensions/dm-lens/dist/clients/bash-file-access.js +0 -830
- package/extensions/dm-lens/dist/clients/biome-client.js +0 -221
- package/extensions/dm-lens/dist/clients/blocker-freshness.js +0 -385
- package/extensions/dm-lens/dist/clients/blocker-past-eof.js +0 -49
- package/extensions/dm-lens/dist/clients/bootstrap.js +0 -246
- package/extensions/dm-lens/dist/clients/bounded-cache.js +0 -105
- package/extensions/dm-lens/dist/clients/bounded-pid-file-lock.js +0 -173
- package/extensions/dm-lens/dist/clients/bounded-telemetry.js +0 -104
- package/extensions/dm-lens/dist/clients/build-identity.js +0 -45
- package/extensions/dm-lens/dist/clients/bundled-resource-health.js +0 -41
- package/extensions/dm-lens/dist/clients/bus-events-logger.js +0 -48
- package/extensions/dm-lens/dist/clients/bus-publish.js +0 -117
- package/extensions/dm-lens/dist/clients/cache/rule-cache.js +0 -103
- package/extensions/dm-lens/dist/clients/cache-manager.js +0 -340
- package/extensions/dm-lens/dist/clients/cache-observability.js +0 -847
- package/extensions/dm-lens/dist/clients/call-graph.js +0 -628
- package/extensions/dm-lens/dist/clients/cargo-manifest.js +0 -151
- package/extensions/dm-lens/dist/clients/cascade-budget.js +0 -52
- package/extensions/dm-lens/dist/clients/cascade-format.js +0 -160
- package/extensions/dm-lens/dist/clients/cascade-logger.js +0 -22
- package/extensions/dm-lens/dist/clients/cascade-types.js +0 -1
- package/extensions/dm-lens/dist/clients/child-unref.js +0 -59
- package/extensions/dm-lens/dist/clients/code-quality-warnings.js +0 -192
- package/extensions/dm-lens/dist/clients/codebase-model.js +0 -110
- package/extensions/dm-lens/dist/clients/collateral-test-role.js +0 -8
- package/extensions/dm-lens/dist/clients/complexity-client.js +0 -398
- package/extensions/dm-lens/dist/clients/config-core/deny.js +0 -117
- package/extensions/dm-lens/dist/clients/config-core/index.js +0 -2
- package/extensions/dm-lens/dist/clients/config-core/merge.js +0 -228
- package/extensions/dm-lens/dist/clients/config-core/normalize.js +0 -217
- package/extensions/dm-lens/dist/clients/config-core/process-spec.js +0 -147
- package/extensions/dm-lens/dist/clients/config-core/provenance.js +0 -54
- package/extensions/dm-lens/dist/clients/config-core/records.js +0 -79
- package/extensions/dm-lens/dist/clients/config-core/resolve.js +0 -48
- package/extensions/dm-lens/dist/clients/config-core/safe-object.js +0 -22
- package/extensions/dm-lens/dist/clients/config-core/schema.js +0 -90
- package/extensions/dm-lens/dist/clients/config-diagnostic-codes.js +0 -90
- package/extensions/dm-lens/dist/clients/config-locations.js +0 -175
- package/extensions/dm-lens/dist/clients/config-resolve.js +0 -359
- package/extensions/dm-lens/dist/clients/config-schema.js +0 -128
- package/extensions/dm-lens/dist/clients/config-warn.js +0 -146
- package/extensions/dm-lens/dist/clients/console-guard-install.js +0 -4
- package/extensions/dm-lens/dist/clients/cooperative-budget.js +0 -36
- package/extensions/dm-lens/dist/clients/dead-code-client.js +0 -342
- package/extensions/dm-lens/dist/clients/dead-code-logger.js +0 -18
- package/extensions/dm-lens/dist/clients/deadline-utils.js +0 -117
- package/extensions/dm-lens/dist/clients/debug-handles.js +0 -121
- package/extensions/dm-lens/dist/clients/debug-heap.js +0 -80
- package/extensions/dm-lens/dist/clients/deferred-lsp-work.js +0 -33
- package/extensions/dm-lens/dist/clients/degradation-ledger.js +0 -272
- package/extensions/dm-lens/dist/clients/demoted-finding-render.js +0 -61
- package/extensions/dm-lens/dist/clients/dependency-checker.js +0 -525
- package/extensions/dm-lens/dist/clients/deps/ast-grep-napi.js +0 -17
- package/extensions/dm-lens/dist/clients/deps/dm-host-deps.js +0 -10
- package/extensions/dm-lens/dist/clients/deps/dm-tui-compat.js +0 -58
- package/extensions/dm-lens/dist/clients/deps/js-yaml.js +0 -7
- package/extensions/dm-lens/dist/clients/deps/minimatch.js +0 -6
- package/extensions/dm-lens/dist/clients/deps/pidusage.js +0 -5
- package/extensions/dm-lens/dist/clients/deps/typebox.js +0 -5
- package/extensions/dm-lens/dist/clients/deps/vscode-jsonrpc.js +0 -8
- package/extensions/dm-lens/dist/clients/deps/web-tree-sitter.js +0 -11
- package/extensions/dm-lens/dist/clients/diagnostic-dispositions.js +0 -318
- package/extensions/dm-lens/dist/clients/diagnostic-line-freshness.js +0 -144
- package/extensions/dm-lens/dist/clients/diagnostic-logger.js +0 -60
- package/extensions/dm-lens/dist/clients/diagnostic-tracker.js +0 -89
- package/extensions/dm-lens/dist/clients/diagnostics-publish.js +0 -134
- package/extensions/dm-lens/dist/clients/dispatch/ast-grep-catalog.js +0 -16
- package/extensions/dm-lens/dist/clients/dispatch/auxiliary-lsp.js +0 -158
- package/extensions/dm-lens/dist/clients/dispatch/collect-later-tier.js +0 -25
- package/extensions/dm-lens/dist/clients/dispatch/diagnostic-taxonomy.js +0 -58
- package/extensions/dm-lens/dist/clients/dispatch/dispatcher.js +0 -953
- package/extensions/dm-lens/dist/clients/dispatch/fact-provider-types.js +0 -1
- package/extensions/dm-lens/dist/clients/dispatch/fact-rule-runner.js +0 -17
- package/extensions/dm-lens/dist/clients/dispatch/fact-runner.js +0 -18
- package/extensions/dm-lens/dist/clients/dispatch/fact-scheduler.js +0 -52
- package/extensions/dm-lens/dist/clients/dispatch/fact-store.js +0 -199
- package/extensions/dm-lens/dist/clients/dispatch/facts/comment-facts.js +0 -20
- package/extensions/dm-lens/dist/clients/dispatch/facts/file-content.js +0 -18
- package/extensions/dm-lens/dist/clients/dispatch/facts/function-facts.js +0 -281
- package/extensions/dm-lens/dist/clients/dispatch/facts/import-facts.js +0 -169
- package/extensions/dm-lens/dist/clients/dispatch/facts/tree-sitter-facts.js +0 -19
- package/extensions/dm-lens/dist/clients/dispatch/facts/try-catch-facts.js +0 -95
- package/extensions/dm-lens/dist/clients/dispatch/finding-policy.js +0 -159
- package/extensions/dm-lens/dist/clients/dispatch/indent-detect.js +0 -227
- package/extensions/dm-lens/dist/clients/dispatch/inline-suppressions.js +0 -52
- package/extensions/dm-lens/dist/clients/dispatch/integration.js +0 -1463
- package/extensions/dm-lens/dist/clients/dispatch/lazy.js +0 -8
- package/extensions/dm-lens/dist/clients/dispatch/pending-runner-findings.js +0 -75
- package/extensions/dm-lens/dist/clients/dispatch/plan.js +0 -278
- package/extensions/dm-lens/dist/clients/dispatch/priorities.js +0 -14
- package/extensions/dm-lens/dist/clients/dispatch/rule-id-normalize.js +0 -42
- package/extensions/dm-lens/dist/clients/dispatch/rule-ignores.js +0 -21
- package/extensions/dm-lens/dist/clients/dispatch/rule-policy.js +0 -73
- package/extensions/dm-lens/dist/clients/dispatch/rules/async-noise.js +0 -31
- package/extensions/dm-lens/dist/clients/dispatch/rules/async-unnecessary-wrapper.js +0 -27
- package/extensions/dm-lens/dist/clients/dispatch/rules/cors-wildcard.js +0 -35
- package/extensions/dm-lens/dist/clients/dispatch/rules/error-obscuring.js +0 -29
- package/extensions/dm-lens/dist/clients/dispatch/rules/error-swallowing.js +0 -29
- package/extensions/dm-lens/dist/clients/dispatch/rules/framework-call-noise.js +0 -31
- package/extensions/dm-lens/dist/clients/dispatch/rules/high-complexity.js +0 -56
- package/extensions/dm-lens/dist/clients/dispatch/rules/high-fan-out.js +0 -45
- package/extensions/dm-lens/dist/clients/dispatch/rules/high-import-coupling.js +0 -31
- package/extensions/dm-lens/dist/clients/dispatch/rules/missing-error-propagation.js +0 -45
- package/extensions/dm-lens/dist/clients/dispatch/rules/no-commented-credentials.js +0 -46
- package/extensions/dm-lens/dist/clients/dispatch/rules/pass-through-wrappers.js +0 -38
- package/extensions/dm-lens/dist/clients/dispatch/rules/placeholder-comments.js +0 -40
- package/extensions/dm-lens/dist/clients/dispatch/rules/unsafe-boundary.js +0 -101
- package/extensions/dm-lens/dist/clients/dispatch/runner-context.js +0 -46
- package/extensions/dm-lens/dist/clients/dispatch/runners/actionlint.js +0 -98
- package/extensions/dm-lens/dist/clients/dispatch/runners/ast-grep-napi.js +0 -690
- package/extensions/dm-lens/dist/clients/dispatch/runners/biome-check.js +0 -202
- package/extensions/dm-lens/dist/clients/dispatch/runners/cpp-check.js +0 -190
- package/extensions/dm-lens/dist/clients/dispatch/runners/credo.js +0 -66
- package/extensions/dm-lens/dist/clients/dispatch/runners/cue-vet.js +0 -167
- package/extensions/dm-lens/dist/clients/dispatch/runners/dart-analyze.js +0 -151
- package/extensions/dm-lens/dist/clients/dispatch/runners/detekt.js +0 -157
- package/extensions/dm-lens/dist/clients/dispatch/runners/dotnet-build.js +0 -157
- package/extensions/dm-lens/dist/clients/dispatch/runners/elixir-check.js +0 -153
- package/extensions/dm-lens/dist/clients/dispatch/runners/eslint.js +0 -99
- package/extensions/dm-lens/dist/clients/dispatch/runners/fact-rules.js +0 -20
- package/extensions/dm-lens/dist/clients/dispatch/runners/fish-indent.js +0 -65
- package/extensions/dm-lens/dist/clients/dispatch/runners/gleam-check.js +0 -107
- package/extensions/dm-lens/dist/clients/dispatch/runners/go-vet.js +0 -51
- package/extensions/dm-lens/dist/clients/dispatch/runners/golangci-lint.js +0 -89
- package/extensions/dm-lens/dist/clients/dispatch/runners/hadolint.js +0 -83
- package/extensions/dm-lens/dist/clients/dispatch/runners/helm-lint.js +0 -144
- package/extensions/dm-lens/dist/clients/dispatch/runners/helm-render.js +0 -593
- package/extensions/dm-lens/dist/clients/dispatch/runners/htmlhint.js +0 -103
- package/extensions/dm-lens/dist/clients/dispatch/runners/index.js +0 -100
- package/extensions/dm-lens/dist/clients/dispatch/runners/javac.js +0 -82
- package/extensions/dm-lens/dist/clients/dispatch/runners/ktlint.js +0 -93
- package/extensions/dm-lens/dist/clients/dispatch/runners/lsp.js +0 -206
- package/extensions/dm-lens/dist/clients/dispatch/runners/markdownlint.js +0 -129
- package/extensions/dm-lens/dist/clients/dispatch/runners/mypy.js +0 -70
- package/extensions/dm-lens/dist/clients/dispatch/runners/oxlint.js +0 -305
- package/extensions/dm-lens/dist/clients/dispatch/runners/php-lint.js +0 -70
- package/extensions/dm-lens/dist/clients/dispatch/runners/phpstan.js +0 -90
- package/extensions/dm-lens/dist/clients/dispatch/runners/prisma-validate.js +0 -56
- package/extensions/dm-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +0 -307
- package/extensions/dm-lens/dist/clients/dispatch/runners/pyright.js +0 -118
- package/extensions/dm-lens/dist/clients/dispatch/runners/rubocop.js +0 -79
- package/extensions/dm-lens/dist/clients/dispatch/runners/ruff.js +0 -69
- package/extensions/dm-lens/dist/clients/dispatch/runners/rust-clippy.js +0 -147
- package/extensions/dm-lens/dist/clients/dispatch/runners/shellcheck.js +0 -111
- package/extensions/dm-lens/dist/clients/dispatch/runners/shfmt.js +0 -81
- package/extensions/dm-lens/dist/clients/dispatch/runners/spellcheck.js +0 -74
- package/extensions/dm-lens/dist/clients/dispatch/runners/spotbugs.js +0 -208
- package/extensions/dm-lens/dist/clients/dispatch/runners/sqlfluff.js +0 -136
- package/extensions/dm-lens/dist/clients/dispatch/runners/stylelint.js +0 -118
- package/extensions/dm-lens/dist/clients/dispatch/runners/swiftlint.js +0 -143
- package/extensions/dm-lens/dist/clients/dispatch/runners/taplo.js +0 -97
- package/extensions/dm-lens/dist/clients/dispatch/runners/terragrunt.js +0 -110
- package/extensions/dm-lens/dist/clients/dispatch/runners/tflint.js +0 -104
- package/extensions/dm-lens/dist/clients/dispatch/runners/tree-sitter.js +0 -516
- package/extensions/dm-lens/dist/clients/dispatch/runners/trivy-config.js +0 -155
- package/extensions/dm-lens/dist/clients/dispatch/runners/utils/availability-policy.js +0 -285
- package/extensions/dm-lens/dist/clients/dispatch/runners/utils/candidate-probe.js +0 -61
- package/extensions/dm-lens/dist/clients/dispatch/runners/utils/diagnostic-parsers.js +0 -61
- package/extensions/dm-lens/dist/clients/dispatch/runners/utils/lazy-installer.js +0 -130
- package/extensions/dm-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +0 -1067
- package/extensions/dm-lens/dist/clients/dispatch/runners/utils/spawn-outcome.js +0 -40
- package/extensions/dm-lens/dist/clients/dispatch/runners/utils/tool-failure.js +0 -117
- package/extensions/dm-lens/dist/clients/dispatch/runners/utils/toolchain-availability.js +0 -88
- package/extensions/dm-lens/dist/clients/dispatch/runners/utils.js +0 -8
- package/extensions/dm-lens/dist/clients/dispatch/runners/vale.js +0 -106
- package/extensions/dm-lens/dist/clients/dispatch/runners/yaml-rule-parser.js +0 -163
- package/extensions/dm-lens/dist/clients/dispatch/runners/yamllint.js +0 -83
- package/extensions/dm-lens/dist/clients/dispatch/runners/zig-check.js +0 -72
- package/extensions/dm-lens/dist/clients/dispatch/suppress-writer.js +0 -57
- package/extensions/dm-lens/dist/clients/dispatch/tool-profile.js +0 -30
- package/extensions/dm-lens/dist/clients/dispatch/types.js +0 -7
- package/extensions/dm-lens/dist/clients/dispatch/utils/format-utils.js +0 -45
- package/extensions/dm-lens/dist/clients/dispatch/utils/lsp-diagnostics.js +0 -31
- package/extensions/dm-lens/dist/clients/disposition-logger.js +0 -19
- package/extensions/dm-lens/dist/clients/disposition-publish.js +0 -88
- package/extensions/dm-lens/dist/clients/durable-store.js +0 -77
- package/extensions/dm-lens/dist/clients/effective-config.js +0 -160
- package/extensions/dm-lens/dist/clients/env-utils.js +0 -26
- package/extensions/dm-lens/dist/clients/error-class.js +0 -3
- package/extensions/dm-lens/dist/clients/eval-timestamp.js +0 -2
- package/extensions/dm-lens/dist/clients/event-loop-hold.js +0 -119
- package/extensions/dm-lens/dist/clients/event-loop-monitor.js +0 -84
- package/extensions/dm-lens/dist/clients/extension-log.js +0 -230
- package/extensions/dm-lens/dist/clients/extension-mode.js +0 -20
- package/extensions/dm-lens/dist/clients/feature-hints.js +0 -88
- package/extensions/dm-lens/dist/clients/file-kinds.js +0 -304
- package/extensions/dm-lens/dist/clients/file-role.js +0 -50
- package/extensions/dm-lens/dist/clients/file-time.js +0 -112
- package/extensions/dm-lens/dist/clients/file-utils.js +0 -630
- package/extensions/dm-lens/dist/clients/finding-delivery-gate.js +0 -129
- package/extensions/dm-lens/dist/clients/finding-identity.js +0 -23
- package/extensions/dm-lens/dist/clients/fix-worklog.js +0 -75
- package/extensions/dm-lens/dist/clients/format-events-publish.js +0 -230
- package/extensions/dm-lens/dist/clients/format-service.js +0 -154
- package/extensions/dm-lens/dist/clients/formatters-lazy.js +0 -8
- package/extensions/dm-lens/dist/clients/formatters.js +0 -1351
- package/extensions/dm-lens/dist/clients/freshness-cadence.js +0 -1
- package/extensions/dm-lens/dist/clients/freshness.js +0 -8
- package/extensions/dm-lens/dist/clients/generated-artifacts.js +0 -209
- package/extensions/dm-lens/dist/clients/generation-guard.js +0 -105
- package/extensions/dm-lens/dist/clients/git-guard.js +0 -770
- package/extensions/dm-lens/dist/clients/git-tracked-ignore.js +0 -120
- package/extensions/dm-lens/dist/clients/gitleaks-client.js +0 -282
- package/extensions/dm-lens/dist/clients/go-client.js +0 -47
- package/extensions/dm-lens/dist/clients/govulncheck-client.js +0 -411
- package/extensions/dm-lens/dist/clients/gradle-ktfmt-style.js +0 -177
- package/extensions/dm-lens/dist/clients/grammar-source.js +0 -224
- package/extensions/dm-lens/dist/clients/gzip-stage-write.js +0 -85
- package/extensions/dm-lens/dist/clients/hashline-anchor.js +0 -222
- package/extensions/dm-lens/dist/clients/hook-budgets.js +0 -16
- package/extensions/dm-lens/dist/clients/host-edit-normalize.js +0 -87
- package/extensions/dm-lens/dist/clients/host-ports.js +0 -35
- package/extensions/dm-lens/dist/clients/indent-retarget.js +0 -102
- package/extensions/dm-lens/dist/clients/inline-blocker-dispositions.js +0 -103
- package/extensions/dm-lens/dist/clients/install-diagnostics.js +0 -123
- package/extensions/dm-lens/dist/clients/installer/index.js +0 -3770
- package/extensions/dm-lens/dist/clients/installer/managed-tool-refresh-session.js +0 -17
- package/extensions/dm-lens/dist/clients/installer/managed-tool-refresh.js +0 -522
- package/extensions/dm-lens/dist/clients/instance-reaper-state.js +0 -3
- package/extensions/dm-lens/dist/clients/instance-reaper.js +0 -577
- package/extensions/dm-lens/dist/clients/instance-registry-lock.js +0 -131
- package/extensions/dm-lens/dist/clients/instance-registry.js +0 -452
- package/extensions/dm-lens/dist/clients/jscpd-client.js +0 -252
- package/extensions/dm-lens/dist/clients/json-cache-read.js +0 -25
- package/extensions/dm-lens/dist/clients/knip-client.js +0 -472
- package/extensions/dm-lens/dist/clients/language-policy.js +0 -242
- package/extensions/dm-lens/dist/clients/language-profile.js +0 -261
- package/extensions/dm-lens/dist/clients/language-registry.js +0 -424
- package/extensions/dm-lens/dist/clients/latency-logger.js +0 -192
- package/extensions/dm-lens/dist/clients/lazy-import.js +0 -14
- package/extensions/dm-lens/dist/clients/ledger-bounds.js +0 -21
- package/extensions/dm-lens/dist/clients/lens-config.js +0 -237
- package/extensions/dm-lens/dist/clients/lens-engine.js +0 -181
- package/extensions/dm-lens/dist/clients/lens-events.js +0 -105
- package/extensions/dm-lens/dist/clients/lens-flag-registry.js +0 -302
- package/extensions/dm-lens/dist/clients/lens-map.js +0 -980
- package/extensions/dm-lens/dist/clients/live-bus-emitter.js +0 -53
- package/extensions/dm-lens/dist/clients/log-cleanup.js +0 -138
- package/extensions/dm-lens/dist/clients/lsp/aggregation.js +0 -88
- package/extensions/dm-lens/dist/clients/lsp/cascade-tier.js +0 -203
- package/extensions/dm-lens/dist/clients/lsp/client.js +0 -2709
- package/extensions/dm-lens/dist/clients/lsp/config.js +0 -252
- package/extensions/dm-lens/dist/clients/lsp/content-limits.js +0 -21
- package/extensions/dm-lens/dist/clients/lsp/diagnostic-binding.js +0 -79
- package/extensions/dm-lens/dist/clients/lsp/document-drift.js +0 -312
- package/extensions/dm-lens/dist/clients/lsp/edits.js +0 -930
- package/extensions/dm-lens/dist/clients/lsp/index.js +0 -4448
- package/extensions/dm-lens/dist/clients/lsp/inferred-project.js +0 -121
- package/extensions/dm-lens/dist/clients/lsp/jvm-runtime.js +0 -194
- package/extensions/dm-lens/dist/clients/lsp/language.js +0 -23
- package/extensions/dm-lens/dist/clients/lsp/launch.js +0 -468
- package/extensions/dm-lens/dist/clients/lsp/lombok.js +0 -146
- package/extensions/dm-lens/dist/clients/lsp/path-utils.js +0 -1
- package/extensions/dm-lens/dist/clients/lsp/pending-aux-coverage.js +0 -90
- package/extensions/dm-lens/dist/clients/lsp/position-encoding.js +0 -28
- package/extensions/dm-lens/dist/clients/lsp/ruby-drive-dirs.js +0 -42
- package/extensions/dm-lens/dist/clients/lsp/server.js +0 -2422
- package/extensions/dm-lens/dist/clients/lsp/session-roots.js +0 -52
- package/extensions/dm-lens/dist/clients/lsp/spawn-history.js +0 -15
- package/extensions/dm-lens/dist/clients/lsp/sync-kind.js +0 -30
- package/extensions/dm-lens/dist/clients/lsp/tsserver-sync.js +0 -156
- package/extensions/dm-lens/dist/clients/lsp/wait-policy/capability-snapshot.js +0 -1
- package/extensions/dm-lens/dist/clients/lsp/wait-policy/classification.js +0 -36
- package/extensions/dm-lens/dist/clients/lsp/wait-policy/index.js +0 -3
- package/extensions/dm-lens/dist/clients/lsp/wait-policy/strategies.js +0 -175
- package/extensions/dm-lens/dist/clients/lsp/watch-queue.js +0 -40
- package/extensions/dm-lens/dist/clients/lsp/workspace-diagnostics-cache.js +0 -267
- package/extensions/dm-lens/dist/clients/lsp/workspace-diagnostics-session.js +0 -7
- package/extensions/dm-lens/dist/clients/lsp/workspace-sweep-hold.js +0 -93
- package/extensions/dm-lens/dist/clients/lsp-budget.js +0 -83
- package/extensions/dm-lens/dist/clients/lsp-document-symbols.js +0 -93
- package/extensions/dm-lens/dist/clients/lsp-lazy.js +0 -8
- package/extensions/dm-lens/dist/clients/lsp-mutation.js +0 -273
- package/extensions/dm-lens/dist/clients/lsp-status.js +0 -37
- package/extensions/dm-lens/dist/clients/map-with-concurrency.js +0 -20
- package/extensions/dm-lens/dist/clients/mcp/analyze.js +0 -251
- package/extensions/dm-lens/dist/clients/mcp/host-shim.js +0 -14
- package/extensions/dm-lens/dist/clients/mcp/ipc.js +0 -302
- package/extensions/dm-lens/dist/clients/mcp/review.js +0 -137
- package/extensions/dm-lens/dist/clients/mcp/session.js +0 -305
- package/extensions/dm-lens/dist/clients/memory-sampler.js +0 -107
- package/extensions/dm-lens/dist/clients/message-end-attribution.js +0 -18
- package/extensions/dm-lens/dist/clients/metrics-client.js +0 -80
- package/extensions/dm-lens/dist/clients/metrics-history.js +0 -255
- package/extensions/dm-lens/dist/clients/middle-man-analysis.js +0 -161
- package/extensions/dm-lens/dist/clients/model-provider.js +0 -31
- package/extensions/dm-lens/dist/clients/module-report-lsp.js +0 -140
- package/extensions/dm-lens/dist/clients/module-report.js +0 -1642
- package/extensions/dm-lens/dist/clients/mutating-tool.js +0 -377
- package/extensions/dm-lens/dist/clients/mutation-attribution.js +0 -168
- package/extensions/dm-lens/dist/clients/mutation-bridge.js +0 -102
- package/extensions/dm-lens/dist/clients/ndjson-logger.js +0 -471
- package/extensions/dm-lens/dist/clients/observed-mutation-sources.js +0 -43
- package/extensions/dm-lens/dist/clients/observed-mutation.js +0 -709
- package/extensions/dm-lens/dist/clients/oldtext-autopatch.js +0 -100
- package/extensions/dm-lens/dist/clients/opaque-mutation-scan.js +0 -313
- package/extensions/dm-lens/dist/clients/opengrep-client.js +0 -216
- package/extensions/dm-lens/dist/clients/opengrep-config.js +0 -52
- package/extensions/dm-lens/dist/clients/package-manager.js +0 -303
- package/extensions/dm-lens/dist/clients/package-root.js +0 -25
- package/extensions/dm-lens/dist/clients/partial-edit-apply.js +0 -337
- package/extensions/dm-lens/dist/clients/path-attribution-telemetry.js +0 -31
- package/extensions/dm-lens/dist/clients/path-keyed-map.js +0 -57
- package/extensions/dm-lens/dist/clients/path-utils.js +0 -476
- package/extensions/dm-lens/dist/clients/performance-report.js +0 -291
- package/extensions/dm-lens/dist/clients/persist-debounce.js +0 -37
- package/extensions/dm-lens/dist/clients/persistent-reverify.js +0 -165
- package/extensions/dm-lens/dist/clients/php-cs-fixer-config.js +0 -15
- package/extensions/dm-lens/dist/clients/pipeline.js +0 -1091
- package/extensions/dm-lens/dist/clients/post-autofix-notice.js +0 -19
- package/extensions/dm-lens/dist/clients/print-mode.js +0 -3
- package/extensions/dm-lens/dist/clients/probe-home-state.js +0 -62
- package/extensions/dm-lens/dist/clients/process-bridge.js +0 -20
- package/extensions/dm-lens/dist/clients/process-singletons.js +0 -69
- package/extensions/dm-lens/dist/clients/process-snapshot.js +0 -22
- package/extensions/dm-lens/dist/clients/project-changes.js +0 -112
- package/extensions/dm-lens/dist/clients/project-conventions.js +0 -152
- package/extensions/dm-lens/dist/clients/project-diagnostics/cache.js +0 -91
- package/extensions/dm-lens/dist/clients/project-diagnostics/extractors.js +0 -53
- package/extensions/dm-lens/dist/clients/project-diagnostics/fresh-fetch.js +0 -408
- package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/call-graph-impact.js +0 -64
- package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/dead-code.js +0 -38
- package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/gitleaks.js +0 -21
- package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/govulncheck.js +0 -23
- package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/jscpd.js +0 -28
- package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/knip.js +0 -45
- package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/madge.js +0 -34
- package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/opengrep.js +0 -32
- package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/runner-findings.js +0 -79
- package/extensions/dm-lens/dist/clients/project-diagnostics/runner-adapters/trivy.js +0 -41
- package/extensions/dm-lens/dist/clients/project-diagnostics/scanner.js +0 -349
- package/extensions/dm-lens/dist/clients/project-diagnostics/types.js +0 -1
- package/extensions/dm-lens/dist/clients/project-lens-config.js +0 -437
- package/extensions/dm-lens/dist/clients/project-report.js +0 -527
- package/extensions/dm-lens/dist/clients/project-scale.js +0 -60
- package/extensions/dm-lens/dist/clients/project-scan-policy.js +0 -4
- package/extensions/dm-lens/dist/clients/project-snapshot-fingerprint.js +0 -39
- package/extensions/dm-lens/dist/clients/project-snapshot-persist-worker.js +0 -14
- package/extensions/dm-lens/dist/clients/project-snapshot.js +0 -1178
- package/extensions/dm-lens/dist/clients/project-trust.js +0 -104
- package/extensions/dm-lens/dist/clients/python-environment.js +0 -120
- package/extensions/dm-lens/dist/clients/python-provenance.js +0 -551
- package/extensions/dm-lens/dist/clients/quiet-window-config.js +0 -16
- package/extensions/dm-lens/dist/clients/quiet-window.js +0 -126
- package/extensions/dm-lens/dist/clients/read-bridge.js +0 -46
- package/extensions/dm-lens/dist/clients/read-expansion.js +0 -218
- package/extensions/dm-lens/dist/clients/read-guard-logger.js +0 -178
- package/extensions/dm-lens/dist/clients/read-guard-tool-lines.js +0 -1042
- package/extensions/dm-lens/dist/clients/read-guard.js +0 -1096
- package/extensions/dm-lens/dist/clients/recent-touches.js +0 -126
- package/extensions/dm-lens/dist/clients/redact/secrets.js +0 -386
- package/extensions/dm-lens/dist/clients/resource-sampler.js +0 -344
- package/extensions/dm-lens/dist/clients/reverse-deps.js +0 -227
- package/extensions/dm-lens/dist/clients/review-graph/builder.js +0 -3635
- package/extensions/dm-lens/dist/clients/review-graph/format.js +0 -30
- package/extensions/dm-lens/dist/clients/review-graph/git-identity.js +0 -115
- package/extensions/dm-lens/dist/clients/review-graph/import-resolvers.js +0 -325
- package/extensions/dm-lens/dist/clients/review-graph/persist-worker.js +0 -8
- package/extensions/dm-lens/dist/clients/review-graph/query.js +0 -195
- package/extensions/dm-lens/dist/clients/review-graph/revision-drift.js +0 -3
- package/extensions/dm-lens/dist/clients/review-graph/service.js +0 -60
- package/extensions/dm-lens/dist/clients/review-graph/shared-extraction-ir.js +0 -54
- package/extensions/dm-lens/dist/clients/review-graph/symbol-id.js +0 -29
- package/extensions/dm-lens/dist/clients/review-graph/tsconfig-paths.js +0 -253
- package/extensions/dm-lens/dist/clients/review-graph/types.js +0 -1
- package/extensions/dm-lens/dist/clients/review-graph/workspace-modules.js +0 -374
- package/extensions/dm-lens/dist/clients/review-graph-logger.js +0 -51
- package/extensions/dm-lens/dist/clients/ruff-client.js +0 -109
- package/extensions/dm-lens/dist/clients/rules-scanner.js +0 -113
- package/extensions/dm-lens/dist/clients/run-duration.js +0 -9
- package/extensions/dm-lens/dist/clients/runtime-agent-end.js +0 -608
- package/extensions/dm-lens/dist/clients/runtime-config.js +0 -39
- package/extensions/dm-lens/dist/clients/runtime-context.js +0 -155
- package/extensions/dm-lens/dist/clients/runtime-coordinator.js +0 -817
- package/extensions/dm-lens/dist/clients/runtime-session.js +0 -1625
- package/extensions/dm-lens/dist/clients/runtime-tool-call.js +0 -868
- package/extensions/dm-lens/dist/clients/runtime-tool-result.js +0 -1317
- package/extensions/dm-lens/dist/clients/runtime-turn.js +0 -2333
- package/extensions/dm-lens/dist/clients/rust-client.js +0 -48
- package/extensions/dm-lens/dist/clients/safe-spawn.js +0 -1267
- package/extensions/dm-lens/dist/clients/sanitize.js +0 -174
- package/extensions/dm-lens/dist/clients/scan-utils.js +0 -7
- package/extensions/dm-lens/dist/clients/scratch-tree-policy.js +0 -57
- package/extensions/dm-lens/dist/clients/search-read-registration.js +0 -59
- package/extensions/dm-lens/dist/clients/secret-findings.js +0 -69
- package/extensions/dm-lens/dist/clients/security-scan-client.js +0 -208
- package/extensions/dm-lens/dist/clients/session-event-guard.js +0 -111
- package/extensions/dm-lens/dist/clients/session-lifecycle.js +0 -173
- package/extensions/dm-lens/dist/clients/session-start-observability.js +0 -47
- package/extensions/dm-lens/dist/clients/session-state-store.js +0 -63
- package/extensions/dm-lens/dist/clients/session-summary.js +0 -8
- package/extensions/dm-lens/dist/clients/sessionstart-logger.js +0 -22
- package/extensions/dm-lens/dist/clients/sg-runner.js +0 -627
- package/extensions/dm-lens/dist/clients/sgconfig.js +0 -280
- package/extensions/dm-lens/dist/clients/shared-checkout-guard.js +0 -177
- package/extensions/dm-lens/dist/clients/single-flight.js +0 -52
- package/extensions/dm-lens/dist/clients/situational-tool-telemetry.js +0 -85
- package/extensions/dm-lens/dist/clients/skills-resolver.js +0 -38
- package/extensions/dm-lens/dist/clients/slow-fs.js +0 -77
- package/extensions/dm-lens/dist/clients/smells-rollup.js +0 -118
- package/extensions/dm-lens/dist/clients/source-filter.js +0 -320
- package/extensions/dm-lens/dist/clients/source-walker.js +0 -96
- package/extensions/dm-lens/dist/clients/spawn-output-cap.js +0 -35
- package/extensions/dm-lens/dist/clients/spawn-timeout-cooldown.js +0 -51
- package/extensions/dm-lens/dist/clients/stale-marker.js +0 -1
- package/extensions/dm-lens/dist/clients/startup-scan.js +0 -222
- package/extensions/dm-lens/dist/clients/startup-timing.js +0 -67
- package/extensions/dm-lens/dist/clients/string-utils.js +0 -6
- package/extensions/dm-lens/dist/clients/subagent-mode.js +0 -40
- package/extensions/dm-lens/dist/clients/symbol-containment.js +0 -16
- package/extensions/dm-lens/dist/clients/symbol-types.js +0 -1
- package/extensions/dm-lens/dist/clients/test-runner-client.js +0 -1504
- package/extensions/dm-lens/dist/clients/test-runner-delivery.js +0 -260
- package/extensions/dm-lens/dist/clients/todo-scanner.js +0 -164
- package/extensions/dm-lens/dist/clients/tool-agreement.js +0 -377
- package/extensions/dm-lens/dist/clients/tool-config.js +0 -218
- package/extensions/dm-lens/dist/clients/tool-cwd.js +0 -235
- package/extensions/dm-lens/dist/clients/tool-definition.js +0 -22
- package/extensions/dm-lens/dist/clients/tool-event.js +0 -18
- package/extensions/dm-lens/dist/clients/tool-policy.js +0 -2393
- package/extensions/dm-lens/dist/clients/tool-probe.js +0 -5
- package/extensions/dm-lens/dist/clients/tool-render.js +0 -79
- package/extensions/dm-lens/dist/clients/tool-set-policy.js +0 -70
- package/extensions/dm-lens/dist/clients/tree-sitter-cache.js +0 -206
- package/extensions/dm-lens/dist/clients/tree-sitter-client.js +0 -2787
- package/extensions/dm-lens/dist/clients/tree-sitter-logger.js +0 -77
- package/extensions/dm-lens/dist/clients/tree-sitter-navigator.js +0 -198
- package/extensions/dm-lens/dist/clients/tree-sitter-query-loader.js +0 -318
- package/extensions/dm-lens/dist/clients/tree-sitter-shared.js +0 -87
- package/extensions/dm-lens/dist/clients/tree-sitter-symbol-extractor.js +0 -957
- package/extensions/dm-lens/dist/clients/trivy-client.js +0 -305
- package/extensions/dm-lens/dist/clients/tui-fit.js +0 -26
- package/extensions/dm-lens/dist/clients/turn-context.js +0 -48
- package/extensions/dm-lens/dist/clients/turn-end/lane.js +0 -1
- package/extensions/dm-lens/dist/clients/turn-end/lanes/govulncheck.js +0 -54
- package/extensions/dm-lens/dist/clients/turn-end/lanes/secrets.js +0 -131
- package/extensions/dm-lens/dist/clients/turn-summary-render.js +0 -56
- package/extensions/dm-lens/dist/clients/turn-summary.js +0 -84
- package/extensions/dm-lens/dist/clients/typos-config.js +0 -9
- package/extensions/dm-lens/dist/clients/user-notify.js +0 -15
- package/extensions/dm-lens/dist/clients/vanished-instance-marker.js +0 -18
- package/extensions/dm-lens/dist/clients/warm-attach.js +0 -210
- package/extensions/dm-lens/dist/clients/widget-state.js +0 -963
- package/extensions/dm-lens/dist/clients/word-index-logger.js +0 -21
- package/extensions/dm-lens/dist/clients/word-index-store.js +0 -222
- package/extensions/dm-lens/dist/clients/word-index.js +0 -1426
- package/extensions/dm-lens/dist/clients/workspace-topology.js +0 -261
- package/extensions/dm-lens/dist/clients/write-ordering-guard.js +0 -24
- package/extensions/dm-lens/dist/clients/zizmor-config.js +0 -160
- package/extensions/dm-lens/dist/i18n.js +0 -67
- package/extensions/dm-lens/dist/index.js +0 -1782
- package/extensions/dm-lens/dist/mcp/analyze-cli.js +0 -178
- package/extensions/dm-lens/dist/mcp/build-staleness.js +0 -55
- package/extensions/dm-lens/dist/mcp/cli.js +0 -78
- package/extensions/dm-lens/dist/mcp/server.js +0 -1208
- package/extensions/dm-lens/dist/mcp/worker.js +0 -33
- package/extensions/dm-lens/dist/scripts/lib/process-scan.mjs +0 -256
- package/extensions/dm-lens/dist/scripts/lib/skills-predicate.mjs +0 -53
- package/extensions/dm-lens/dist/scripts/lib/web-tree-sitter-dir.mjs +0 -45
- package/extensions/dm-lens/dist/tools/activate-tools.js +0 -61
- package/extensions/dm-lens/dist/tools/ast-grep-outline.js +0 -127
- package/extensions/dm-lens/dist/tools/ast-grep-replace.js +0 -226
- package/extensions/dm-lens/dist/tools/ast-grep-search.js +0 -687
- package/extensions/dm-lens/dist/tools/effective-config.js +0 -59
- package/extensions/dm-lens/dist/tools/lens-diagnostic-mark.js +0 -240
- package/extensions/dm-lens/dist/tools/lens-diagnostics.js +0 -1484
- package/extensions/dm-lens/dist/tools/lsp-diagnostics.js +0 -1088
- package/extensions/dm-lens/dist/tools/lsp-navigation.js +0 -1194
- package/extensions/dm-lens/dist/tools/lsp-structured-output.js +0 -277
- package/extensions/dm-lens/dist/tools/module-report.js +0 -332
- package/extensions/dm-lens/dist/tools/project-report.js +0 -72
- package/extensions/dm-lens/dist/tools/render-compact.js +0 -272
- package/extensions/dm-lens/dist/tools/scan-progress.js +0 -31
- package/extensions/dm-lens/dist/tools/shared.js +0 -26
- package/extensions/dm-lens/dist/tools/symbol-search.js +0 -133
- package/extensions/dm-mcp-adapter/dist/abort.js +0 -35
- package/extensions/dm-mcp-adapter/dist/agent-dir.js +0 -45
- package/extensions/dm-mcp-adapter/dist/agent-plugin-loader.js +0 -392
- package/extensions/dm-mcp-adapter/dist/agent-plugin-provenance.js +0 -26
- package/extensions/dm-mcp-adapter/dist/bearer-command-resolver.js +0 -182
- package/extensions/dm-mcp-adapter/dist/claude-plugin-loader.js +0 -350
- package/extensions/dm-mcp-adapter/dist/config.js +0 -1310
- package/extensions/dm-mcp-adapter/dist/consent-manager.js +0 -84
- package/extensions/dm-mcp-adapter/dist/elicitation-handler.js +0 -308
- package/extensions/dm-mcp-adapter/dist/errors.js +0 -225
- package/extensions/dm-mcp-adapter/dist/http-ca.js +0 -71
- package/extensions/dm-mcp-adapter/dist/jev-client.js +0 -359
- package/extensions/dm-mcp-adapter/dist/jev-contracts.js +0 -1
- package/extensions/dm-mcp-adapter/dist/jev-key-store.js +0 -176
- package/extensions/dm-mcp-adapter/dist/json-schema-validator.js +0 -70
- package/extensions/dm-mcp-adapter/dist/lifecycle.js +0 -387
- package/extensions/dm-mcp-adapter/dist/logger.js +0 -115
- package/extensions/dm-mcp-adapter/dist/mcp-auth-fetch.js +0 -86
- package/extensions/dm-mcp-adapter/dist/mcp-auth-flow.js +0 -949
- package/extensions/dm-mcp-adapter/dist/mcp-auth.js +0 -997
- package/extensions/dm-mcp-adapter/dist/mcp-bearer-store.js +0 -182
- package/extensions/dm-mcp-adapter/dist/mcp-callback-server.js +0 -381
- package/extensions/dm-mcp-adapter/dist/mcp-oauth-provider.js +0 -524
- package/extensions/dm-mcp-adapter/dist/mcp-probe.js +0 -151
- package/extensions/dm-mcp-adapter/dist/mcp-tasks.js +0 -300
- package/extensions/dm-mcp-adapter/dist/mcp-trace.js +0 -215
- package/extensions/dm-mcp-adapter/dist/metadata-cache.js +0 -267
- package/extensions/dm-mcp-adapter/dist/npx-resolver.js +0 -465
- package/extensions/dm-mcp-adapter/dist/package-mcp-loader.js +0 -135
- package/extensions/dm-mcp-adapter/dist/request-headers-command.js +0 -294
- package/extensions/dm-mcp-adapter/dist/resource-tools.js +0 -7
- package/extensions/dm-mcp-adapter/dist/runtime-owner.js +0 -94
- package/extensions/dm-mcp-adapter/dist/sampling-handler.js +0 -213
- package/extensions/dm-mcp-adapter/dist/secure-keyring.js +0 -191
- package/extensions/dm-mcp-adapter/dist/server-manager.js +0 -1514
- package/extensions/dm-mcp-adapter/dist/session-approvals.js +0 -127
- package/extensions/dm-mcp-adapter/dist/session-recovery.js +0 -82
- package/extensions/dm-mcp-adapter/dist/state.js +0 -1
- package/extensions/dm-mcp-adapter/dist/types.js +0 -286
- package/extensions/dm-mcp-adapter/dist/ui-app-bridge-helpers.js +0 -36
- package/extensions/dm-mcp-adapter/dist/ui-resource-handler.js +0 -204
- package/extensions/dm-mcp-adapter/dist/ui-stream-types.js +0 -58
- package/extensions/dm-mcp-adapter/dist/ui-tool-visibility.js +0 -26
- package/extensions/dm-mcp-adapter/dist/unix-socket-transport.js +0 -83
- package/extensions/dm-mcp-adapter/dist/utils.js +0 -382
|
@@ -1,957 +0,0 @@
|
|
|
1
|
-
import { logTreeSitterDiagnostic } from "./tree-sitter-logger.js";
|
|
2
|
-
import { EXTENSION_TO_GRAMMAR, KIND_TO_GRAMMAR } from "./language-registry.js";
|
|
3
|
-
import * as path from "node:path";
|
|
4
|
-
import { loadWebTreeSitter } from "./deps/web-tree-sitter.js";
|
|
5
|
-
const SYMBOL_QUERIES = {
|
|
6
|
-
typescript: {
|
|
7
|
-
defs: `
|
|
8
|
-
;; Function declarations: function foo(params) { }
|
|
9
|
-
(function_declaration
|
|
10
|
-
name: (identifier) @funcName
|
|
11
|
-
parameters: (formal_parameters) @funcParams
|
|
12
|
-
body: (statement_block) @funcBody) @funcDef
|
|
13
|
-
|
|
14
|
-
;; Arrow functions: const foo = (params) => { }
|
|
15
|
-
(variable_declarator
|
|
16
|
-
name: (identifier) @arrowName
|
|
17
|
-
value: (arrow_function
|
|
18
|
-
parameters: (formal_parameters) @arrowParams
|
|
19
|
-
body: (_) @arrowBody)) @arrowDef
|
|
20
|
-
|
|
21
|
-
;; Class declarations: class Foo { }
|
|
22
|
-
(class_declaration
|
|
23
|
-
name: (type_identifier) @className) @classDef
|
|
24
|
-
|
|
25
|
-
;; Method definitions: class Foo { bar() { } }
|
|
26
|
-
(method_definition
|
|
27
|
-
name: (property_identifier) @methodName
|
|
28
|
-
parameters: (formal_parameters) @methodParams) @methodDef
|
|
29
|
-
|
|
30
|
-
;; Interface declarations: interface Foo { }
|
|
31
|
-
(interface_declaration
|
|
32
|
-
name: (type_identifier) @interfaceName) @interfaceDef
|
|
33
|
-
|
|
34
|
-
;; Type alias: type Foo = ...
|
|
35
|
-
(type_alias_declaration
|
|
36
|
-
name: (type_identifier) @typeName) @typeDef
|
|
37
|
-
`,
|
|
38
|
-
refs: `
|
|
39
|
-
;; Function/method calls: foo() or obj.bar()
|
|
40
|
-
(call_expression
|
|
41
|
-
function: (identifier) @callIdent) @callRef
|
|
42
|
-
|
|
43
|
-
(call_expression
|
|
44
|
-
function: (member_expression
|
|
45
|
-
object: (_)
|
|
46
|
-
property: (property_identifier) @callMethod)) @callMethodRef
|
|
47
|
-
|
|
48
|
-
;; New expressions: new Foo()
|
|
49
|
-
(new_expression
|
|
50
|
-
constructor: (identifier) @newIdent) @newRef
|
|
51
|
-
|
|
52
|
-
;; Type references: type T = Foo
|
|
53
|
-
(type_identifier) @typeIdent
|
|
54
|
-
`
|
|
55
|
-
},
|
|
56
|
-
python: {
|
|
57
|
-
defs: `
|
|
58
|
-
;; Function definitions: def foo(params):
|
|
59
|
-
(function_definition
|
|
60
|
-
name: (identifier) @funcName
|
|
61
|
-
parameters: (parameters) @funcParams) @funcDef
|
|
62
|
-
|
|
63
|
-
;; Class definitions: class Foo:
|
|
64
|
-
(class_definition
|
|
65
|
-
name: (identifier) @className) @classDef
|
|
66
|
-
|
|
67
|
-
;; Method definitions (within class)
|
|
68
|
-
(class_definition
|
|
69
|
-
body: (block
|
|
70
|
-
(function_definition
|
|
71
|
-
name: (identifier) @methodName
|
|
72
|
-
parameters: (parameters) @methodParams) @methodDef))
|
|
73
|
-
`,
|
|
74
|
-
refs: `
|
|
75
|
-
;; Function calls: foo() or obj.bar()
|
|
76
|
-
(call
|
|
77
|
-
function: (identifier) @callIdent) @callRef
|
|
78
|
-
|
|
79
|
-
(call
|
|
80
|
-
function: (attribute
|
|
81
|
-
object: (_)
|
|
82
|
-
attribute: (identifier) @callMethod)) @callMethodRef
|
|
83
|
-
`
|
|
84
|
-
},
|
|
85
|
-
rust: {
|
|
86
|
-
defs: `
|
|
87
|
-
;; Function definitions: fn foo(params) { }
|
|
88
|
-
(function_item
|
|
89
|
-
name: (identifier) @funcName
|
|
90
|
-
parameters: (parameters) @funcParams) @funcDef
|
|
91
|
-
|
|
92
|
-
;; Struct definitions: struct Foo { }
|
|
93
|
-
(struct_item
|
|
94
|
-
name: (type_identifier) @structName) @structDef
|
|
95
|
-
|
|
96
|
-
;; Impl blocks: impl Foo { fn bar() { } }
|
|
97
|
-
(impl_item
|
|
98
|
-
type: (type_identifier) @implType
|
|
99
|
-
body: (declaration_list
|
|
100
|
-
(function_item
|
|
101
|
-
name: (identifier) @implMethodName) @implMethodDef))
|
|
102
|
-
`,
|
|
103
|
-
refs: `
|
|
104
|
-
;; Function calls: foo() or obj.bar()
|
|
105
|
-
(call_expression
|
|
106
|
-
function: (identifier) @callIdent) @callRef
|
|
107
|
-
|
|
108
|
-
(call_expression
|
|
109
|
-
function: (field_expression
|
|
110
|
-
value: (_)
|
|
111
|
-
field: (field_identifier) @callField)) @callFieldRef
|
|
112
|
-
`
|
|
113
|
-
},
|
|
114
|
-
go: {
|
|
115
|
-
defs: `
|
|
116
|
-
(function_declaration
|
|
117
|
-
name: (identifier) @funcName
|
|
118
|
-
parameters: (parameter_list) @funcParams) @funcDef
|
|
119
|
-
|
|
120
|
-
(method_declaration
|
|
121
|
-
name: (field_identifier) @methodName
|
|
122
|
-
parameters: (parameter_list) @methodParams) @methodDef
|
|
123
|
-
|
|
124
|
-
(type_spec
|
|
125
|
-
name: (type_identifier) @typeName) @typeDef
|
|
126
|
-
`,
|
|
127
|
-
refs: `
|
|
128
|
-
(call_expression
|
|
129
|
-
function: (identifier) @callIdent) @callRef
|
|
130
|
-
|
|
131
|
-
(call_expression
|
|
132
|
-
function: (selector_expression
|
|
133
|
-
field: (field_identifier) @callMethod)) @callMethodRef
|
|
134
|
-
`
|
|
135
|
-
},
|
|
136
|
-
ruby: {
|
|
137
|
-
defs: `
|
|
138
|
-
(method
|
|
139
|
-
name: (identifier) @methodName) @methodDef
|
|
140
|
-
|
|
141
|
-
(singleton_method
|
|
142
|
-
name: (identifier) @methodName) @methodDef
|
|
143
|
-
|
|
144
|
-
(class
|
|
145
|
-
name: (constant) @className) @classDef
|
|
146
|
-
|
|
147
|
-
(module
|
|
148
|
-
name: (constant) @moduleName) @moduleDef
|
|
149
|
-
`,
|
|
150
|
-
refs: `
|
|
151
|
-
(call
|
|
152
|
-
method: (identifier) @callIdent) @callRef
|
|
153
|
-
|
|
154
|
-
(call
|
|
155
|
-
method: (constant) @typeIdent) @typeRef
|
|
156
|
-
`
|
|
157
|
-
},
|
|
158
|
-
c: {
|
|
159
|
-
defs: `
|
|
160
|
-
(function_definition
|
|
161
|
-
declarator: (function_declarator
|
|
162
|
-
declarator: (identifier) @funcName
|
|
163
|
-
parameters: (parameter_list) @funcParams)) @funcDef
|
|
164
|
-
|
|
165
|
-
(type_definition
|
|
166
|
-
declarator: (type_identifier) @typeName) @typeDef
|
|
167
|
-
|
|
168
|
-
(struct_specifier
|
|
169
|
-
name: (type_identifier) @typeName) @typeDef
|
|
170
|
-
|
|
171
|
-
(enum_specifier
|
|
172
|
-
name: (type_identifier) @typeName) @typeDef
|
|
173
|
-
`,
|
|
174
|
-
refs: `
|
|
175
|
-
(call_expression
|
|
176
|
-
function: (identifier) @callIdent) @callRef
|
|
177
|
-
|
|
178
|
-
(call_expression
|
|
179
|
-
function: (field_expression
|
|
180
|
-
field: (field_identifier) @callField)) @callFieldRef
|
|
181
|
-
|
|
182
|
-
(type_identifier) @typeIdent
|
|
183
|
-
`
|
|
184
|
-
},
|
|
185
|
-
cpp: {
|
|
186
|
-
defs: `
|
|
187
|
-
(function_definition
|
|
188
|
-
declarator: (function_declarator
|
|
189
|
-
declarator: (identifier) @funcName
|
|
190
|
-
parameters: (parameter_list) @funcParams)) @funcDef
|
|
191
|
-
|
|
192
|
-
(class_specifier
|
|
193
|
-
name: (type_identifier) @className) @classDef
|
|
194
|
-
|
|
195
|
-
(struct_specifier
|
|
196
|
-
name: (type_identifier) @className) @classDef
|
|
197
|
-
|
|
198
|
-
(type_definition
|
|
199
|
-
declarator: (type_identifier) @typeName) @typeDef
|
|
200
|
-
`,
|
|
201
|
-
refs: `
|
|
202
|
-
(call_expression
|
|
203
|
-
function: (identifier) @callIdent) @callRef
|
|
204
|
-
|
|
205
|
-
(call_expression
|
|
206
|
-
function: (field_expression
|
|
207
|
-
field: (field_identifier) @callField)) @callFieldRef
|
|
208
|
-
|
|
209
|
-
(type_identifier) @typeIdent
|
|
210
|
-
`
|
|
211
|
-
},
|
|
212
|
-
java: {
|
|
213
|
-
defs: `
|
|
214
|
-
(method_declaration
|
|
215
|
-
name: (identifier) @methodName
|
|
216
|
-
parameters: (formal_parameters) @methodParams) @methodDef
|
|
217
|
-
|
|
218
|
-
(class_declaration
|
|
219
|
-
name: (identifier) @className) @classDef
|
|
220
|
-
|
|
221
|
-
(interface_declaration
|
|
222
|
-
name: (identifier) @interfaceName) @interfaceDef
|
|
223
|
-
|
|
224
|
-
(constructor_declaration
|
|
225
|
-
name: (identifier) @funcName
|
|
226
|
-
parameters: (formal_parameters) @funcParams) @funcDef
|
|
227
|
-
|
|
228
|
-
(enum_declaration
|
|
229
|
-
name: (identifier) @className) @classDef
|
|
230
|
-
`,
|
|
231
|
-
refs: `
|
|
232
|
-
(method_invocation
|
|
233
|
-
name: (identifier) @callMethod) @callRef
|
|
234
|
-
|
|
235
|
-
(object_creation_expression
|
|
236
|
-
type: (type_identifier) @newIdent) @newRef
|
|
237
|
-
|
|
238
|
-
(type_identifier) @typeIdent
|
|
239
|
-
`
|
|
240
|
-
},
|
|
241
|
-
kotlin: {
|
|
242
|
-
defs: `
|
|
243
|
-
(function_declaration
|
|
244
|
-
(simple_identifier) @funcName) @funcDef
|
|
245
|
-
|
|
246
|
-
(class_declaration
|
|
247
|
-
(type_identifier) @className) @classDef
|
|
248
|
-
|
|
249
|
-
(object_declaration
|
|
250
|
-
(type_identifier) @className) @classDef
|
|
251
|
-
`,
|
|
252
|
-
refs: `
|
|
253
|
-
(call_expression
|
|
254
|
-
(simple_identifier) @callIdent) @callRef
|
|
255
|
-
|
|
256
|
-
(user_type (type_identifier) @typeIdent)
|
|
257
|
-
`
|
|
258
|
-
},
|
|
259
|
-
dart: {
|
|
260
|
-
defs: `
|
|
261
|
-
(function_signature
|
|
262
|
-
(identifier) @funcName
|
|
263
|
-
(formal_parameter_list) @funcParams) @funcDef
|
|
264
|
-
|
|
265
|
-
(class_definition
|
|
266
|
-
(identifier) @className) @classDef
|
|
267
|
-
`,
|
|
268
|
-
refs: `
|
|
269
|
-
(type_identifier) @typeIdent
|
|
270
|
-
`
|
|
271
|
-
},
|
|
272
|
-
elixir: {
|
|
273
|
-
defs: `
|
|
274
|
-
(call
|
|
275
|
-
target: (identifier) @_kw
|
|
276
|
-
(arguments
|
|
277
|
-
(call
|
|
278
|
-
target: (identifier) @funcName
|
|
279
|
-
(arguments) @funcParams) @funcDef)
|
|
280
|
-
(#match? @_kw "^def[pm]?$"))
|
|
281
|
-
|
|
282
|
-
(call
|
|
283
|
-
target: (identifier) @_kw
|
|
284
|
-
(arguments (alias) @moduleName) @moduleDef
|
|
285
|
-
(#match? @_kw "^defmodule$"))
|
|
286
|
-
`,
|
|
287
|
-
refs: `
|
|
288
|
-
(call
|
|
289
|
-
target: (identifier) @callIdent) @callRef
|
|
290
|
-
|
|
291
|
-
(alias) @typeIdent
|
|
292
|
-
`
|
|
293
|
-
},
|
|
294
|
-
csharp: {
|
|
295
|
-
defs: `
|
|
296
|
-
(method_declaration
|
|
297
|
-
name: (identifier) @methodName
|
|
298
|
-
parameters: (parameter_list) @methodParams) @methodDef
|
|
299
|
-
|
|
300
|
-
(class_declaration
|
|
301
|
-
name: (identifier) @className) @classDef
|
|
302
|
-
|
|
303
|
-
(struct_declaration
|
|
304
|
-
name: (identifier) @className) @classDef
|
|
305
|
-
|
|
306
|
-
(interface_declaration
|
|
307
|
-
name: (identifier) @interfaceName) @interfaceDef
|
|
308
|
-
|
|
309
|
-
(constructor_declaration
|
|
310
|
-
name: (identifier) @funcName
|
|
311
|
-
parameters: (parameter_list) @funcParams) @funcDef
|
|
312
|
-
|
|
313
|
-
(enum_declaration
|
|
314
|
-
name: (identifier) @className) @classDef
|
|
315
|
-
`,
|
|
316
|
-
refs: `
|
|
317
|
-
(invocation_expression
|
|
318
|
-
function: (identifier) @callIdent) @callRef
|
|
319
|
-
|
|
320
|
-
(invocation_expression
|
|
321
|
-
function: (member_access_expression
|
|
322
|
-
name: (identifier) @callMethod)) @callMethodRef
|
|
323
|
-
|
|
324
|
-
(object_creation_expression
|
|
325
|
-
type: (identifier) @newIdent) @newRef
|
|
326
|
-
`
|
|
327
|
-
},
|
|
328
|
-
php: {
|
|
329
|
-
defs: `
|
|
330
|
-
(function_definition
|
|
331
|
-
name: (name) @funcName
|
|
332
|
-
parameters: (formal_parameters) @funcParams) @funcDef
|
|
333
|
-
|
|
334
|
-
(method_declaration
|
|
335
|
-
name: (name) @methodName
|
|
336
|
-
parameters: (formal_parameters) @methodParams) @methodDef
|
|
337
|
-
|
|
338
|
-
(class_declaration
|
|
339
|
-
name: (name) @className) @classDef
|
|
340
|
-
|
|
341
|
-
(interface_declaration
|
|
342
|
-
name: (name) @interfaceName) @interfaceDef
|
|
343
|
-
|
|
344
|
-
(trait_declaration
|
|
345
|
-
name: (name) @className) @classDef
|
|
346
|
-
`,
|
|
347
|
-
refs: `
|
|
348
|
-
(function_call_expression
|
|
349
|
-
function: (name) @callIdent) @callRef
|
|
350
|
-
|
|
351
|
-
(member_call_expression
|
|
352
|
-
name: (name) @callMethod) @callMethodRef
|
|
353
|
-
|
|
354
|
-
(object_creation_expression
|
|
355
|
-
(name) @newIdent) @newRef
|
|
356
|
-
`
|
|
357
|
-
},
|
|
358
|
-
swift: {
|
|
359
|
-
defs: `
|
|
360
|
-
(function_declaration
|
|
361
|
-
(simple_identifier) @funcName) @funcDef
|
|
362
|
-
|
|
363
|
-
(class_declaration
|
|
364
|
-
(type_identifier) @className) @classDef
|
|
365
|
-
|
|
366
|
-
(protocol_declaration
|
|
367
|
-
(type_identifier) @interfaceName) @interfaceDef
|
|
368
|
-
`,
|
|
369
|
-
refs: `
|
|
370
|
-
(call_expression
|
|
371
|
-
(simple_identifier) @callIdent) @callRef
|
|
372
|
-
|
|
373
|
-
(navigation_expression
|
|
374
|
-
(simple_identifier) @callMethod) @callMethodRef
|
|
375
|
-
|
|
376
|
-
(type_identifier) @typeIdent
|
|
377
|
-
`
|
|
378
|
-
},
|
|
379
|
-
lua: {
|
|
380
|
-
defs: `
|
|
381
|
-
(function_declaration
|
|
382
|
-
(identifier) @funcName) @funcDef
|
|
383
|
-
|
|
384
|
-
(function_declaration
|
|
385
|
-
(dot_index_expression) @funcName) @funcDef
|
|
386
|
-
`,
|
|
387
|
-
refs: `
|
|
388
|
-
(function_call (identifier) @callIdent) @callRef
|
|
389
|
-
|
|
390
|
-
(function_call (dot_index_expression) @callIdent) @callRef
|
|
391
|
-
`
|
|
392
|
-
},
|
|
393
|
-
ocaml: {
|
|
394
|
-
defs: `
|
|
395
|
-
(value_definition
|
|
396
|
-
(let_binding (value_name) @funcName)) @funcDef
|
|
397
|
-
|
|
398
|
-
(module_definition
|
|
399
|
-
(module_binding (module_name) @moduleName)) @moduleDef
|
|
400
|
-
`,
|
|
401
|
-
refs: `
|
|
402
|
-
(application_expression
|
|
403
|
-
(value_path (value_name) @callIdent)) @callRef
|
|
404
|
-
|
|
405
|
-
(value_path (value_name) @callIdent) @callRef
|
|
406
|
-
`
|
|
407
|
-
},
|
|
408
|
-
zig: {
|
|
409
|
-
defs: `
|
|
410
|
-
(function_declaration
|
|
411
|
-
(identifier) @funcName) @funcDef
|
|
412
|
-
`,
|
|
413
|
-
refs: `
|
|
414
|
-
(call_expression
|
|
415
|
-
(identifier) @callIdent) @callRef
|
|
416
|
-
`
|
|
417
|
-
},
|
|
418
|
-
bash: {
|
|
419
|
-
defs: `
|
|
420
|
-
(function_definition
|
|
421
|
-
name: (word) @funcName) @funcDef
|
|
422
|
-
`,
|
|
423
|
-
refs: `
|
|
424
|
-
(command
|
|
425
|
-
name: (command_name (word) @callIdent)) @callRef
|
|
426
|
-
`
|
|
427
|
-
},
|
|
428
|
-
cue: {
|
|
429
|
-
defs: `
|
|
430
|
-
(field
|
|
431
|
-
(label (identifier) @defName)
|
|
432
|
-
(#match? @defName "^#")) @defDef
|
|
433
|
-
|
|
434
|
-
(field
|
|
435
|
-
(label (identifier) @fieldName)
|
|
436
|
-
(value (_)) @fieldValue
|
|
437
|
-
(#not-match? @fieldName "^#")) @fieldDef
|
|
438
|
-
|
|
439
|
-
(let_clause
|
|
440
|
-
left: (identifier) @letName
|
|
441
|
-
right: (_) @letValue) @letDef
|
|
442
|
-
`,
|
|
443
|
-
refs: `
|
|
444
|
-
((identifier) @typeIdent
|
|
445
|
-
(#match? @typeIdent "^#"))
|
|
446
|
-
|
|
447
|
-
(call_expression
|
|
448
|
-
function: (identifier) @callIdent) @callRef
|
|
449
|
-
|
|
450
|
-
(call_expression
|
|
451
|
-
function: (selector_expression (identifier) (identifier) @callMethod)) @callMethodRef
|
|
452
|
-
`
|
|
453
|
-
}
|
|
454
|
-
};
|
|
455
|
-
SYMBOL_QUERIES.tsx = SYMBOL_QUERIES.typescript;
|
|
456
|
-
SYMBOL_QUERIES.javascript = {
|
|
457
|
-
defs: `
|
|
458
|
-
;; Function declarations: function foo(params) { }
|
|
459
|
-
(function_declaration
|
|
460
|
-
name: (identifier) @funcName
|
|
461
|
-
parameters: (formal_parameters) @funcParams
|
|
462
|
-
body: (statement_block) @funcBody) @funcDef
|
|
463
|
-
|
|
464
|
-
;; Arrow functions: const foo = (params) => { }
|
|
465
|
-
(variable_declarator
|
|
466
|
-
name: (identifier) @arrowName
|
|
467
|
-
value: (arrow_function
|
|
468
|
-
parameters: (formal_parameters) @arrowParams
|
|
469
|
-
body: (_) @arrowBody)) @arrowDef
|
|
470
|
-
|
|
471
|
-
;; Class declarations: class Foo { } — (identifier) name on this grammar.
|
|
472
|
-
(class_declaration
|
|
473
|
-
name: (identifier) @className) @classDef
|
|
474
|
-
|
|
475
|
-
;; Method definitions: class Foo { bar() { } }
|
|
476
|
-
(method_definition
|
|
477
|
-
name: (property_identifier) @methodName
|
|
478
|
-
parameters: (formal_parameters) @methodParams) @methodDef
|
|
479
|
-
`,
|
|
480
|
-
refs: `
|
|
481
|
-
;; Function/method calls: foo() or obj.bar()
|
|
482
|
-
(call_expression
|
|
483
|
-
function: (identifier) @callIdent) @callRef
|
|
484
|
-
|
|
485
|
-
(call_expression
|
|
486
|
-
function: (member_expression
|
|
487
|
-
object: (_)
|
|
488
|
-
property: (property_identifier) @callMethod)) @callMethodRef
|
|
489
|
-
|
|
490
|
-
;; New expressions: new Foo()
|
|
491
|
-
(new_expression
|
|
492
|
-
constructor: (identifier) @newIdent) @newRef
|
|
493
|
-
`
|
|
494
|
-
};
|
|
495
|
-
export function symbolExtractionGrammar(kind, filePath) {
|
|
496
|
-
if (!kind)
|
|
497
|
-
return;
|
|
498
|
-
const kindGrammar = KIND_TO_GRAMMAR[kind];
|
|
499
|
-
if (!kindGrammar)
|
|
500
|
-
return;
|
|
501
|
-
const byExtension = filePath ? EXTENSION_TO_GRAMMAR[path.extname(filePath).toLowerCase()] : undefined;
|
|
502
|
-
const grammar = byExtension ?? kindGrammar;
|
|
503
|
-
return grammar in SYMBOL_QUERIES ? grammar : undefined;
|
|
504
|
-
}
|
|
505
|
-
export function getSymbolQueryLanguages() {
|
|
506
|
-
return Object.keys(SYMBOL_QUERIES);
|
|
507
|
-
}
|
|
508
|
-
const IMPORT_QUERIES = {
|
|
509
|
-
typescript: `
|
|
510
|
-
(import_statement source: (string) @importSource)
|
|
511
|
-
(export_statement source: (string) @importSource)
|
|
512
|
-
`,
|
|
513
|
-
tsx: `
|
|
514
|
-
(import_statement source: (string) @importSource)
|
|
515
|
-
(export_statement source: (string) @importSource)
|
|
516
|
-
`,
|
|
517
|
-
c: `
|
|
518
|
-
(preproc_include path: (string_literal) @importSource)
|
|
519
|
-
(preproc_include path: (system_lib_string) @importSource)
|
|
520
|
-
`,
|
|
521
|
-
cpp: `
|
|
522
|
-
(preproc_include path: (string_literal) @importSource)
|
|
523
|
-
(preproc_include path: (system_lib_string) @importSource)
|
|
524
|
-
`,
|
|
525
|
-
python: `
|
|
526
|
-
(import_statement name: (dotted_name) @importSource)
|
|
527
|
-
(import_statement name: (aliased_import name: (dotted_name) @importSource))
|
|
528
|
-
(import_from_statement module_name: (dotted_name) @importSource)
|
|
529
|
-
(import_from_statement module_name: (relative_import) @importSource)
|
|
530
|
-
`,
|
|
531
|
-
go: `(import_spec path: (interpreted_string_literal) @importSource)`,
|
|
532
|
-
rust: `(use_declaration argument: (_) @importSource)`,
|
|
533
|
-
java: `(import_declaration (scoped_identifier) @importSource)`,
|
|
534
|
-
kotlin: `(import_header (identifier) @importSource)`,
|
|
535
|
-
csharp: `
|
|
536
|
-
(using_directive (identifier) @importSource)
|
|
537
|
-
(using_directive (qualified_name) @importSource)
|
|
538
|
-
`,
|
|
539
|
-
swift: `(import_declaration (identifier) @importSource)`,
|
|
540
|
-
php: `(namespace_use_clause (name) @importSource)`,
|
|
541
|
-
ocaml: `(open_module (module_path) @importSource)`,
|
|
542
|
-
dart: `(import_specification (configurable_uri (uri (string_literal) @importSource)))`,
|
|
543
|
-
lua: `
|
|
544
|
-
(function_call
|
|
545
|
-
(identifier) @_m
|
|
546
|
-
(arguments (string) @importSource)
|
|
547
|
-
(#match? @_m "^require$"))
|
|
548
|
-
`,
|
|
549
|
-
ruby: `
|
|
550
|
-
(call
|
|
551
|
-
method: (identifier) @_m
|
|
552
|
-
(argument_list (string (string_content) @importSource))
|
|
553
|
-
(#match? @_m "^require"))
|
|
554
|
-
`,
|
|
555
|
-
zig: `
|
|
556
|
-
(builtin_function (builtin_identifier) @_m
|
|
557
|
-
(arguments (string (string_content) @importSource))
|
|
558
|
-
(#match? @_m "^@import$"))
|
|
559
|
-
`,
|
|
560
|
-
elixir: `
|
|
561
|
-
(call target: (identifier) @_m
|
|
562
|
-
(arguments (alias) @importSource)
|
|
563
|
-
(#match? @_m "^(import|alias|require|use)$"))
|
|
564
|
-
`,
|
|
565
|
-
bash: `
|
|
566
|
-
(command (command_name (word) @_m)
|
|
567
|
-
(word) @importSource
|
|
568
|
-
(#match? @_m "^(source|\\.)$"))
|
|
569
|
-
`,
|
|
570
|
-
cue: `
|
|
571
|
-
(import_declaration (import_spec path: (string) @importSource))
|
|
572
|
-
(import_declaration (import_spec_list (import_spec path: (string) @importSource)))
|
|
573
|
-
`
|
|
574
|
-
};
|
|
575
|
-
IMPORT_QUERIES.javascript = IMPORT_QUERIES.typescript;
|
|
576
|
-
function parseImportMatch(match) {
|
|
577
|
-
for (const capture of match.captures) {
|
|
578
|
-
if (capture.name !== "importSource")
|
|
579
|
-
continue;
|
|
580
|
-
const raw = String(capture.node.text ?? "").trim();
|
|
581
|
-
const source = raw.replace(/^["'`]+|["'`]+$/g, "");
|
|
582
|
-
if (!source)
|
|
583
|
-
continue;
|
|
584
|
-
return { source, line: capture.node.startPosition.row + 1 };
|
|
585
|
-
}
|
|
586
|
-
return null;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
export class TreeSitterSymbolExtractor {
|
|
590
|
-
languageId;
|
|
591
|
-
client;
|
|
592
|
-
defQuery = null;
|
|
593
|
-
refQuery = null;
|
|
594
|
-
importQuery = null;
|
|
595
|
-
constructor(languageId, client) {
|
|
596
|
-
this.languageId = languageId;
|
|
597
|
-
this.client = client;
|
|
598
|
-
}
|
|
599
|
-
async init() {
|
|
600
|
-
try {
|
|
601
|
-
if (!await this.client.isLanguageSupported(this.languageId))
|
|
602
|
-
return false;
|
|
603
|
-
const language = this.client.getLanguage(this.languageId);
|
|
604
|
-
if (!language)
|
|
605
|
-
return false;
|
|
606
|
-
const { Query } = await loadWebTreeSitter();
|
|
607
|
-
const queries = SYMBOL_QUERIES[this.languageId];
|
|
608
|
-
if (queries) {
|
|
609
|
-
this.defQuery = this.compileQuery(Query, language, queries.defs, "defs");
|
|
610
|
-
this.refQuery = this.compileQuery(Query, language, queries.refs, "refs");
|
|
611
|
-
}
|
|
612
|
-
const importQuerySrc = IMPORT_QUERIES[this.languageId];
|
|
613
|
-
if (importQuerySrc) {
|
|
614
|
-
this.importQuery = this.compileQuery(Query, language, importQuerySrc, "imports");
|
|
615
|
-
}
|
|
616
|
-
return Boolean(this.defQuery || this.importQuery);
|
|
617
|
-
} catch (err) {
|
|
618
|
-
this.client.reportWasmAbort(err);
|
|
619
|
-
logTreeSitterDiagnostic({
|
|
620
|
-
subsystem: "symbol-extractor",
|
|
621
|
-
languageId: this.languageId,
|
|
622
|
-
message: `Failed to init ${this.languageId}: ${err instanceof Error ? err.message : String(err)}`
|
|
623
|
-
});
|
|
624
|
-
return false;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
compileQuery(Query, language, src, label) {
|
|
628
|
-
try {
|
|
629
|
-
return new Query(language, src);
|
|
630
|
-
} catch (err) {
|
|
631
|
-
if (this.client.reportWasmAbort(err))
|
|
632
|
-
throw err;
|
|
633
|
-
logTreeSitterDiagnostic({
|
|
634
|
-
subsystem: "symbol-extractor",
|
|
635
|
-
languageId: this.languageId,
|
|
636
|
-
message: `${this.languageId} ${label} query failed: ${err.message}`,
|
|
637
|
-
metadata: { query: label }
|
|
638
|
-
});
|
|
639
|
-
return null;
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
extract(tree, filePath, content) {
|
|
643
|
-
const symbols = [];
|
|
644
|
-
const refs = [];
|
|
645
|
-
const relativePath = path.relative(process.cwd(), filePath);
|
|
646
|
-
if (this.defQuery) {
|
|
647
|
-
for (const match of this.queryMatches(this.defQuery, tree.rootNode)) {
|
|
648
|
-
const symbol = this.parseDefMatch(match, relativePath, content);
|
|
649
|
-
if (symbol)
|
|
650
|
-
symbols.push(symbol);
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
if (this.refQuery) {
|
|
654
|
-
for (const match of this.queryMatches(this.refQuery, tree.rootNode)) {
|
|
655
|
-
const ref = this.parseRefMatch(match, relativePath);
|
|
656
|
-
if (ref)
|
|
657
|
-
refs.push(ref);
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
const imports = [];
|
|
661
|
-
if (this.importQuery) {
|
|
662
|
-
for (const match of this.queryMatches(this.importQuery, tree.rootNode)) {
|
|
663
|
-
const ref = parseImportMatch(match);
|
|
664
|
-
if (ref)
|
|
665
|
-
imports.push(ref);
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
return {
|
|
669
|
-
symbols,
|
|
670
|
-
refs,
|
|
671
|
-
imports,
|
|
672
|
-
coverage: {
|
|
673
|
-
definitions: this.defQuery ? "complete" : "unavailable",
|
|
674
|
-
references: this.refQuery ? "complete" : "unavailable",
|
|
675
|
-
imports: this.importQuery ? "complete" : "unavailable"
|
|
676
|
-
}
|
|
677
|
-
};
|
|
678
|
-
}
|
|
679
|
-
queryMatches(query, rootNode) {
|
|
680
|
-
try {
|
|
681
|
-
return query.matches(rootNode);
|
|
682
|
-
} catch (error) {
|
|
683
|
-
this.client.reportWasmAbort(error);
|
|
684
|
-
throw error;
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
parseDefMatch(match, filePath, content) {
|
|
688
|
-
const captures = {};
|
|
689
|
-
for (const capture of match.captures) {
|
|
690
|
-
captures[capture.name] = {
|
|
691
|
-
text: capture.node.text,
|
|
692
|
-
node: capture.node
|
|
693
|
-
};
|
|
694
|
-
}
|
|
695
|
-
let name;
|
|
696
|
-
let kind;
|
|
697
|
-
let params;
|
|
698
|
-
let defNode;
|
|
699
|
-
if (captures.funcName) {
|
|
700
|
-
name = captures.funcName.text;
|
|
701
|
-
kind = "function";
|
|
702
|
-
params = captures.funcParams?.text;
|
|
703
|
-
defNode = captures.funcDef?.node;
|
|
704
|
-
} else if (captures.arrowName) {
|
|
705
|
-
name = captures.arrowName.text;
|
|
706
|
-
kind = "function";
|
|
707
|
-
params = captures.arrowParams?.text;
|
|
708
|
-
defNode = captures.arrowDef?.node;
|
|
709
|
-
} else if (captures.className) {
|
|
710
|
-
name = captures.className.text;
|
|
711
|
-
kind = "class";
|
|
712
|
-
defNode = captures.classDef?.node;
|
|
713
|
-
} else if (captures.methodName) {
|
|
714
|
-
name = captures.methodName.text;
|
|
715
|
-
kind = "method";
|
|
716
|
-
params = captures.methodParams?.text;
|
|
717
|
-
defNode = captures.methodDef?.node;
|
|
718
|
-
} else if (captures.interfaceName) {
|
|
719
|
-
name = captures.interfaceName.text;
|
|
720
|
-
kind = "interface";
|
|
721
|
-
defNode = captures.interfaceDef?.node;
|
|
722
|
-
} else if (captures.typeName) {
|
|
723
|
-
name = captures.typeName.text;
|
|
724
|
-
kind = "type";
|
|
725
|
-
defNode = captures.typeDef?.node;
|
|
726
|
-
} else if (captures.moduleName) {
|
|
727
|
-
name = captures.moduleName.text;
|
|
728
|
-
kind = "class";
|
|
729
|
-
defNode = captures.moduleDef?.node;
|
|
730
|
-
} else if (captures.defName) {
|
|
731
|
-
name = captures.defName.text;
|
|
732
|
-
kind = "type";
|
|
733
|
-
defNode = captures.defDef?.node;
|
|
734
|
-
} else if (captures.fieldName) {
|
|
735
|
-
name = captures.fieldName.text;
|
|
736
|
-
kind = "property";
|
|
737
|
-
defNode = captures.fieldDef?.node;
|
|
738
|
-
} else if (captures.letName) {
|
|
739
|
-
name = captures.letName.text;
|
|
740
|
-
kind = "variable";
|
|
741
|
-
defNode = captures.letDef?.node;
|
|
742
|
-
}
|
|
743
|
-
if (!name || !kind || !defNode)
|
|
744
|
-
return null;
|
|
745
|
-
const isExported = this.isExported(defNode, content);
|
|
746
|
-
const signature = params ? this.extractSignature(params, kind) : undefined;
|
|
747
|
-
const local = this.isFunctionLocal(defNode);
|
|
748
|
-
const visibility = kind === "method" ? this.detectVisibility(defNode, name) : undefined;
|
|
749
|
-
const decorators = this.extractDecorators(defNode);
|
|
750
|
-
const isAsync = (kind === "function" || kind === "method") && this.isAsyncDecl(defNode);
|
|
751
|
-
const docInfo = this.extractDocCommentInfo(defNode);
|
|
752
|
-
return {
|
|
753
|
-
id: `${filePath}:${name}`,
|
|
754
|
-
name,
|
|
755
|
-
kind,
|
|
756
|
-
filePath,
|
|
757
|
-
line: defNode.startPosition.row + 1,
|
|
758
|
-
endLine: defNode.endPosition.row + 1,
|
|
759
|
-
column: defNode.startPosition.column + 1,
|
|
760
|
-
signature,
|
|
761
|
-
isExported,
|
|
762
|
-
...local ? { local: true } : {},
|
|
763
|
-
...visibility ? { visibility } : {},
|
|
764
|
-
...decorators.length > 0 ? { decorators } : {},
|
|
765
|
-
...isAsync ? { isAsync: true } : {},
|
|
766
|
-
...docInfo ? { doc: docInfo.text, docStartLine: docInfo.startLine } : {}
|
|
767
|
-
};
|
|
768
|
-
}
|
|
769
|
-
static COMMENT_NODE_KIND = "comment";
|
|
770
|
-
extractDocCommentInfo(declNode) {
|
|
771
|
-
const isComment = (n) => !!n && n.type === TreeSitterSymbolExtractor.COMMENT_NODE_KIND;
|
|
772
|
-
const isDeco = (n) => !!n && TreeSitterSymbolExtractor.DECORATOR_NODE_KINDS.has(n.type);
|
|
773
|
-
const samePos = (a, b) => a?.startPosition?.row === b?.startPosition?.row && a?.startPosition?.column === b?.startPosition?.column;
|
|
774
|
-
const sameStartRow = (a, b) => a?.startPosition?.row === b?.startPosition?.row;
|
|
775
|
-
let node = declNode;
|
|
776
|
-
for (let hops = 0;hops < 4; hops++) {
|
|
777
|
-
const parent = node.parent;
|
|
778
|
-
if (!parent || !sameStartRow(parent, node))
|
|
779
|
-
break;
|
|
780
|
-
node = parent;
|
|
781
|
-
}
|
|
782
|
-
const siblings = node.parent?.children ?? [];
|
|
783
|
-
const idx = siblings.findIndex((s) => samePos(s, node));
|
|
784
|
-
if (idx <= 0)
|
|
785
|
-
return;
|
|
786
|
-
let cursor = idx - 1;
|
|
787
|
-
while (cursor >= 0 && isDeco(siblings[cursor]))
|
|
788
|
-
cursor--;
|
|
789
|
-
let boundaryRow = node.startPosition?.row;
|
|
790
|
-
let end = -1;
|
|
791
|
-
let start = -1;
|
|
792
|
-
while (cursor >= 0 && isComment(siblings[cursor])) {
|
|
793
|
-
const candidate = siblings[cursor];
|
|
794
|
-
const gapRows = boundaryRow !== undefined && typeof candidate.endPosition?.row === "number" ? boundaryRow - candidate.endPosition.row : 0;
|
|
795
|
-
if (gapRows > 1)
|
|
796
|
-
break;
|
|
797
|
-
if (end < 0)
|
|
798
|
-
end = cursor;
|
|
799
|
-
start = cursor;
|
|
800
|
-
boundaryRow = candidate.startPosition?.row;
|
|
801
|
-
cursor--;
|
|
802
|
-
}
|
|
803
|
-
if (start < 0 || end < 0)
|
|
804
|
-
return;
|
|
805
|
-
const raw = siblings.slice(start, end + 1).map((n) => String(n.text ?? "")).join(`
|
|
806
|
-
`);
|
|
807
|
-
const text = this.summarizeDocComment(raw);
|
|
808
|
-
if (!text)
|
|
809
|
-
return;
|
|
810
|
-
const startLine = (siblings[start].startPosition?.row ?? 0) + 1;
|
|
811
|
-
return { text, startLine };
|
|
812
|
-
}
|
|
813
|
-
static DOC_MAX_CHARS = 120;
|
|
814
|
-
summarizeDocComment(raw) {
|
|
815
|
-
const cleaned = raw.replace(/^\s*\/\*\*?/, "").replace(/\*\/\s*$/, "").split(/\r?\n/).map((line) => line.replace(/^\s*(\*|\/\/\/?|#)\s?/, "").trimEnd()).filter((line) => line.trim().length > 0).join(" ").trim();
|
|
816
|
-
if (!cleaned)
|
|
817
|
-
return;
|
|
818
|
-
const sentenceMatch = cleaned.match(/^.*?[.!?](?:\s|$)/);
|
|
819
|
-
let first = (sentenceMatch ? sentenceMatch[0] : cleaned).trim();
|
|
820
|
-
first = first.replace(/\s+/g, " ");
|
|
821
|
-
if (first.length > TreeSitterSymbolExtractor.DOC_MAX_CHARS) {
|
|
822
|
-
first = `${first.slice(0, TreeSitterSymbolExtractor.DOC_MAX_CHARS - 1).trimEnd()}…`;
|
|
823
|
-
}
|
|
824
|
-
return first || undefined;
|
|
825
|
-
}
|
|
826
|
-
isAsyncDecl(node) {
|
|
827
|
-
const isAsyncTok = (n) => !!n && (n.type === "async" || n.type === "suspend" || /modifier/.test(String(n.type)) && /^(?:async|suspend)$/.test(String(n.text ?? "").trim()));
|
|
828
|
-
for (const child of node.children ?? []) {
|
|
829
|
-
if (isAsyncTok(child))
|
|
830
|
-
return true;
|
|
831
|
-
if (/modifiers/.test(String(child?.type))) {
|
|
832
|
-
for (const gc of child.children ?? []) {
|
|
833
|
-
if (isAsyncTok(gc))
|
|
834
|
-
return true;
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
return false;
|
|
839
|
-
}
|
|
840
|
-
static DECORATOR_NODE_KINDS = new Set([
|
|
841
|
-
"decorator",
|
|
842
|
-
"attribute_item",
|
|
843
|
-
"marker_annotation",
|
|
844
|
-
"annotation"
|
|
845
|
-
]);
|
|
846
|
-
static MODIFIERS_CONTAINER_KINDS = new Set(["modifiers"]);
|
|
847
|
-
extractDecorators(node) {
|
|
848
|
-
const isDeco = (n) => !!n && TreeSitterSymbolExtractor.DECORATOR_NODE_KINDS.has(n.type);
|
|
849
|
-
const text = (n) => {
|
|
850
|
-
const first = String(n?.text ?? "").split(/\r?\n/, 1)[0]?.trim() ?? "";
|
|
851
|
-
return first.length > 120 ? `${first.slice(0, 117)}…` : first;
|
|
852
|
-
};
|
|
853
|
-
const out = [];
|
|
854
|
-
for (const sib of node.parent?.children ?? []) {
|
|
855
|
-
if (sib.startIndex >= node.startIndex)
|
|
856
|
-
break;
|
|
857
|
-
if (isDeco(sib))
|
|
858
|
-
out.push(text(sib));
|
|
859
|
-
else if (sib.isNamed)
|
|
860
|
-
out.length = 0;
|
|
861
|
-
}
|
|
862
|
-
for (const child of node.children ?? []) {
|
|
863
|
-
if (isDeco(child))
|
|
864
|
-
out.push(text(child));
|
|
865
|
-
else if (TreeSitterSymbolExtractor.MODIFIERS_CONTAINER_KINDS.has(child?.type)) {
|
|
866
|
-
for (const gc of child.children ?? []) {
|
|
867
|
-
if (isDeco(gc))
|
|
868
|
-
out.push(text(gc));
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
return [...new Set(out.filter(Boolean))].slice(0, 8);
|
|
873
|
-
}
|
|
874
|
-
parseRefMatch(match, filePath) {
|
|
875
|
-
let name;
|
|
876
|
-
let refNode;
|
|
877
|
-
let referenceKind = "unknown";
|
|
878
|
-
for (const capture of match.captures) {
|
|
879
|
-
const captureName = String(capture.name);
|
|
880
|
-
if (captureName.endsWith("Ident") || captureName.endsWith("Method") || captureName.endsWith("Field")) {
|
|
881
|
-
name = capture.node.text;
|
|
882
|
-
refNode = capture.node;
|
|
883
|
-
if (captureName.startsWith("type"))
|
|
884
|
-
referenceKind = "type";
|
|
885
|
-
else if (captureName.startsWith("call") || captureName.startsWith("new")) {
|
|
886
|
-
referenceKind = "call";
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
if (captureName.endsWith("Ref") && !refNode) {
|
|
890
|
-
refNode = capture.node;
|
|
891
|
-
if (captureName.startsWith("type"))
|
|
892
|
-
referenceKind = "type";
|
|
893
|
-
else if (captureName.startsWith("call") || captureName.startsWith("new")) {
|
|
894
|
-
referenceKind = "call";
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
if (!name || !refNode)
|
|
899
|
-
return null;
|
|
900
|
-
return {
|
|
901
|
-
symbolId: `${filePath}:${name}`,
|
|
902
|
-
symbolName: name,
|
|
903
|
-
filePath,
|
|
904
|
-
line: refNode.startPosition.row + 1,
|
|
905
|
-
column: refNode.startPosition.column + 1,
|
|
906
|
-
referenceKind
|
|
907
|
-
};
|
|
908
|
-
}
|
|
909
|
-
isExported(node, content) {
|
|
910
|
-
const lines = content.split(`
|
|
911
|
-
`);
|
|
912
|
-
const lineIdx = node.startPosition.row;
|
|
913
|
-
const line = lines[lineIdx] || "";
|
|
914
|
-
return /^\s*export\b/.test(line) || this.hasExportModifier(node, content);
|
|
915
|
-
}
|
|
916
|
-
hasExportModifier(node, _content) {
|
|
917
|
-
let current = node.parent;
|
|
918
|
-
while (current) {
|
|
919
|
-
if (current.type === "statement_block")
|
|
920
|
-
return false;
|
|
921
|
-
if (current.type === "export_statement" || current.type === "export_declaration") {
|
|
922
|
-
return true;
|
|
923
|
-
}
|
|
924
|
-
current = current.parent;
|
|
925
|
-
}
|
|
926
|
-
return false;
|
|
927
|
-
}
|
|
928
|
-
isFunctionLocal(node) {
|
|
929
|
-
let current = node.parent;
|
|
930
|
-
while (current) {
|
|
931
|
-
if (current.type === "statement_block")
|
|
932
|
-
return true;
|
|
933
|
-
current = current.parent;
|
|
934
|
-
}
|
|
935
|
-
return false;
|
|
936
|
-
}
|
|
937
|
-
detectVisibility(node, nameText) {
|
|
938
|
-
if (nameText.startsWith("#"))
|
|
939
|
-
return "private";
|
|
940
|
-
for (const child of node?.children ?? []) {
|
|
941
|
-
if (child?.type === "accessibility_modifier") {
|
|
942
|
-
if (child.text === "private")
|
|
943
|
-
return "private";
|
|
944
|
-
if (child.text === "protected")
|
|
945
|
-
return "protected";
|
|
946
|
-
return;
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
return;
|
|
950
|
-
}
|
|
951
|
-
extractSignature(paramsText, kind) {
|
|
952
|
-
if (kind === "function" || kind === "method") {
|
|
953
|
-
return paramsText.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/.*$/gm, "").replace(/\s+/g, " ").trim();
|
|
954
|
-
}
|
|
955
|
-
return;
|
|
956
|
-
}
|
|
957
|
-
}
|