@mrclrchtr/supi-code-intelligence 12.0.0 → 14.0.0
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/CHANGELOG.md +35 -0
- package/README.md +7 -5
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +10 -0
- package/node_modules/@mrclrchtr/supi-core/package.json +3 -1
- package/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
- package/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
- package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +78 -13
- package/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +41 -9
- package/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-core/src/session.ts +3 -0
- package/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-core/src/side-run.ts +46 -0
- package/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-lsp/README.md +6 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +10 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +3 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +78 -13
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +41 -9
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/session.ts +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/side-run.ts +46 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-lsp/package.json +8 -8
- package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-cache.ts +102 -47
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-refresh.ts +20 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-request.ts +4 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-timing.ts +14 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-typescript.ts +8 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +50 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-disk-stamp.ts +60 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-state.ts +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-sync.ts +21 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-file-state.ts +17 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-input-admission.ts +7 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-barrier.ts +53 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +12 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/client/transport.ts +24 -8
- package/node_modules/@mrclrchtr/supi-lsp/src/config/server-config.ts +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-extends.ts +2 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-path.ts +2 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-scope.ts +17 -5
- package/node_modules/@mrclrchtr/supi-lsp/src/config/typescript-module.ts +17 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/debug-telemetry.ts +64 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +42 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-client-state.ts +2 -17
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-project-info.ts +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-removal-ledger.ts +52 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-typescript-coverage.ts +27 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-symbol.ts +16 -112
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +561 -103
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/typescript-file-local.ts +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/workspace-symbol-collection.ts +163 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/workspace-symbol-row-limit.ts +72 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-symbol-mapper.ts +13 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-controller.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostic-surface.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostics.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +53 -9
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-transition-debug.ts +11 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +10 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +3 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +78 -13
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +41 -9
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/session.ts +3 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/side-run.ts +46 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm.map +6 -6
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts +7 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts.map +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts +7 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm.map +5 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +5 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/kotlin/tree-sitter-kotlin.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/latex/tree-sitter-latex.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm.json +3 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +1 -1
- package/node_modules/fast-xml-parser/CHANGELOG.md +886 -0
- package/node_modules/fast-xml-parser/LICENSE +21 -0
- package/node_modules/fast-xml-parser/README.md +204 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.d.cts +774 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/README.md +92 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/package.json +57 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityDecoder.js +644 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityEncoder.js +239 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/all-entities.js +53 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entities.js +1139 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entityTries.js +60 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.d.ts +358 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.js +29 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/CHANGELOG.md +52 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/README.md +77 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.d.cts +270 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/package.json +77 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.d.ts +270 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.js +609 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/orderedJs2Xml.js +360 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/util.js +23 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/README.md +632 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/package.json +56 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/html.js +102 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/log.js +98 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/nosql.js +114 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/redos.js +60 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/shell.js +105 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql-strict.js +47 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql.js +95 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/svg.js +81 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/xml.js +79 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.cjs +27 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.d.ts +103 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.js +292 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/util/decode-entities.js +48 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/README.md +947 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.d.cts +725 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/package.json +79 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Expression.js +232 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/ExpressionSet.js +225 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Matcher.js +663 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.d.ts +589 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.js +30 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/CHANGELOG.md +63 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/README.md +113 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/README.md +142 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/anynum.js +135 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/digitTable.js +116 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/package.json +42 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/package.json +36 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/strnum.js +176 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/README.md +287 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/package.json +56 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.d.ts +108 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.js +382 -0
- package/node_modules/fast-xml-parser/package.json +93 -0
- package/node_modules/fast-xml-parser/src/cli/cli.js +97 -0
- package/node_modules/fast-xml-parser/src/cli/man.js +17 -0
- package/node_modules/fast-xml-parser/src/cli/read.js +43 -0
- package/node_modules/fast-xml-parser/src/fxp.d.ts +754 -0
- package/node_modules/fast-xml-parser/src/fxp.js +14 -0
- package/node_modules/fast-xml-parser/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-parser/src/util.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
- package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +106 -0
- package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
- package/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
- package/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
- package/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
- package/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
- package/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
- package/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
- package/node_modules/fast-xml-parser/src/validator.js +518 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +6 -0
- package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +426 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +164 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +907 -0
- package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +77 -0
- package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +177 -0
- package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +54 -0
- package/package.json +10 -8
- package/src/analysis/evidence.ts +331 -73
- package/src/analysis/health/diagnostics.ts +66 -18
- package/src/analysis/health/evidence-reason.ts +44 -0
- package/src/analysis/health/server-status.ts +32 -9
- package/src/analysis/health/signals.ts +1 -0
- package/src/analysis/instruction-files.ts +11 -7
- package/src/analysis/search/exclusions.ts +18 -4
- package/src/analysis/search/pattern.ts +3 -3
- package/src/analysis/target/anchored.ts +3 -6
- package/src/analysis/target/file-outline-omissions.ts +17 -2
- package/src/analysis/target/symbol-selection.ts +100 -0
- package/src/analysis/target/symbol.ts +83 -49
- package/src/analysis/target/types.ts +12 -10
- package/src/analysis/workspace/cmake-parser.ts +207 -0
- package/src/analysis/workspace/cmake.ts +141 -0
- package/src/analysis/workspace/maven.ts +310 -0
- package/src/analysis/workspace/membership.ts +100 -26
- package/src/analysis/workspace/metadata.ts +6 -1
- package/src/analysis/workspace/observe.ts +6 -0
- package/src/analysis/workspace/types.ts +11 -3
- package/src/app/app.ts +37 -21
- package/src/diagnostics/coverage.ts +49 -0
- package/src/diagnostics/evidence.ts +10 -2
- package/src/extension.ts +1 -2
- package/src/headless.ts +4 -2
- package/src/session/health-types.ts +2 -0
- package/src/session/health-workflow.ts +6 -0
- package/src/session/input/common.ts +1 -1
- package/src/session/orientation/collect.ts +42 -7
- package/src/session/orientation/context-facts.ts +3 -3
- package/src/session/orientation/context-sections.ts +13 -15
- package/src/session/orientation/facts.ts +5 -8
- package/src/session/orientation-types.ts +5 -0
- package/src/session/orientation-workflow.ts +12 -17
- package/src/session/target-workflow.ts +38 -25
- package/src/tool/code_find/render.ts +10 -11
- package/src/tool/code_find/result.ts +11 -8
- package/src/tool/code_graph/display.ts +5 -6
- package/src/tool/code_graph/format.ts +8 -24
- package/src/tool/code_graph/result.ts +16 -75
- package/src/tool/code_graph/section.ts +21 -33
- package/src/tool/code_graph/structured.ts +3 -0
- package/src/tool/code_graph/tui.ts +10 -5
- package/src/tool/code_health/diagnostic-tui.ts +49 -0
- package/src/tool/code_health/guidance.ts +27 -0
- package/src/tool/code_health/markdown.ts +63 -9
- package/src/tool/code_health/result.ts +20 -9
- package/src/tool/code_health/structured-schema.ts +15 -0
- package/src/tool/code_health/structured.ts +9 -1
- package/src/tool/code_health/tui.ts +33 -40
- package/src/tool/code_inspect/result.ts +23 -18
- package/src/tool/code_inspect/structured.ts +2 -19
- package/src/tool/code_orientation/markdown.ts +6 -1
- package/src/tool/code_orientation/result.ts +53 -100
- package/src/tool/code_orientation/structured-schema.ts +16 -12
- package/src/tool/code_orientation/structured-workspace.ts +13 -7
- package/src/tool/code_orientation/structured.ts +31 -39
- package/src/tool/code_orientation/workspace-format.ts +4 -10
- package/src/tool/code_orientation/workspace-instructions.ts +4 -5
- package/src/tool/code_orientation/workspace-observations.ts +2 -2
- package/src/tool/code_orientation/workspace-output.ts +16 -7
- package/src/tool/code_orientation/workspace-projects.ts +7 -10
- package/src/tool/code_orientation/workspace-sections.ts +13 -19
- package/src/tool/code_resolve/markdown.ts +4 -46
- package/src/tool/code_resolve/result.ts +45 -73
- package/src/tool/code_resolve/structured.ts +6 -1
- package/src/tool/infra/truncate.ts +2 -16
- package/src/tool/result/candidate-selection.ts +157 -0
- package/src/tool/result/display.ts +41 -45
- package/src/tool/result/errors.ts +1 -0
- package/src/tool/result/model-budget.ts +26 -1
- package/src/tool/result/refactor.ts +11 -8
- package/src/tool/result/structured.ts +2 -1
- package/src/tool/result/types.ts +9 -8
- package/src/tool/schemas.ts +15 -20
- package/src/ui/footer.ts +147 -44
- package/src/ui/status-overlay.ts +13 -8
- package/src/ui/status-presentation.ts +4 -7
- package/src/ui/tui/candidate-selection.ts +40 -95
- package/src/ui/tui/common.ts +16 -70
- package/src/ui/tui/display.ts +6 -24
- package/src/tool/result/candidate-row.ts +0 -49
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
unavailableCodeQuery,
|
|
12
12
|
} from "@mrclrchtr/supi-code-runtime/api";
|
|
13
13
|
import * as projectRoots from "@mrclrchtr/supi-core/project";
|
|
14
|
-
import * as ts from "typescript";
|
|
15
14
|
import {
|
|
16
15
|
LspClient,
|
|
17
16
|
type LspClientLifecycleTransitionKind,
|
|
@@ -50,7 +49,8 @@ import type {
|
|
|
50
49
|
} from "../config/types.ts";
|
|
51
50
|
import { FileChangeType } from "../config/types.ts";
|
|
52
51
|
import { inspectTypeScriptLaunch } from "../config/typescript-launch.ts";
|
|
53
|
-
import {
|
|
52
|
+
import { getTypeScript } from "../config/typescript-module.ts";
|
|
53
|
+
import { type BatchedRequestControl, boundCwd, RequestTimingBatch } from "../debug-telemetry.ts";
|
|
54
54
|
import {
|
|
55
55
|
accumulateOutstandingDiagnostics,
|
|
56
56
|
collectDiagnosticSummaryCounts,
|
|
@@ -60,6 +60,7 @@ import {
|
|
|
60
60
|
import {
|
|
61
61
|
type DiagnosticEvidenceDocument,
|
|
62
62
|
type DiagnosticEvidenceSummary,
|
|
63
|
+
preferEvidenceDocument,
|
|
63
64
|
summarizeDiagnosticEvidence,
|
|
64
65
|
} from "../diagnostics/evidence.ts";
|
|
65
66
|
import {
|
|
@@ -120,6 +121,7 @@ import {
|
|
|
120
121
|
type StartupRetryRouteResult,
|
|
121
122
|
} from "./manager-process-crash-report.ts";
|
|
122
123
|
import { buildProjectServerInfo } from "./manager-project-info.ts";
|
|
124
|
+
import { RemovedTrackedFileLedger } from "./manager-removal-ledger.ts";
|
|
123
125
|
import type {
|
|
124
126
|
ActiveCoverageSummaryEntry,
|
|
125
127
|
CoverageSummaryEntry,
|
|
@@ -140,15 +142,19 @@ import {
|
|
|
140
142
|
type WorkspaceRecoveryResult,
|
|
141
143
|
} from "./manager-workspace-recovery.ts";
|
|
142
144
|
import {
|
|
143
|
-
collectWorkspaceSymbols,
|
|
144
145
|
findWorkspaceSymbolWarmTargets,
|
|
145
146
|
getWorkspaceSymbolWarmPosition,
|
|
146
147
|
isWithinAnyScope,
|
|
148
|
+
limitWorkspaceSymbolWarmRoots,
|
|
149
|
+
} from "./manager-workspace-symbol.ts";
|
|
150
|
+
import { isFileLocalTopLevelDeclaration } from "./typescript-file-local.ts";
|
|
151
|
+
import {
|
|
152
|
+
collectWorkspaceSymbols,
|
|
153
|
+
joinWorkspaceSymbolReasons,
|
|
147
154
|
type WorkspaceSymbolCollection,
|
|
148
155
|
workspaceSymbolCollectionResult,
|
|
149
156
|
workspaceSymbolCoverageGap,
|
|
150
|
-
} from "./
|
|
151
|
-
import { isFileLocalTopLevelDeclaration } from "./typescript-file-local.ts";
|
|
157
|
+
} from "./workspace-symbol-collection.ts";
|
|
152
158
|
|
|
153
159
|
type UnavailableReason = "missing-command" | "start-failed" | "runtime-error";
|
|
154
160
|
|
|
@@ -268,6 +274,8 @@ type FileClientRequestOptions = {
|
|
|
268
274
|
recoverProcessCrash?: boolean;
|
|
269
275
|
/** Control only this caller's wait for a shared replacement. */
|
|
270
276
|
control?: CodeRequestControl;
|
|
277
|
+
/** Receives why a routed client could not open the file; not called for interruptions. */
|
|
278
|
+
onOpenFailure?: (reason: string) => void;
|
|
271
279
|
};
|
|
272
280
|
|
|
273
281
|
interface FileReadinessResult {
|
|
@@ -400,6 +408,8 @@ export class LspManager {
|
|
|
400
408
|
private retiredRoutes = new Set<string>();
|
|
401
409
|
/** Runtime-owned cleanup for clients removed by route retirement. */
|
|
402
410
|
private retiredClientShutdowns = new Set<Promise<void>>();
|
|
411
|
+
/** Tracked files removed from disk until a diagnostic report shows them. */
|
|
412
|
+
private readonly removedTrackedFiles = new RemovedTrackedFileLedger();
|
|
403
413
|
/** Shared diagnostic-recovery restart for each replaceable client route. */
|
|
404
414
|
private pendingRestarts = new Map<string, Promise<{ files: string[]; restarted: boolean }>>();
|
|
405
415
|
/** Monotonic ownership generation for each replaceable client route. */
|
|
@@ -416,6 +426,31 @@ export class LspManager {
|
|
|
416
426
|
* are not reopened, but they do not prove project coverage.
|
|
417
427
|
*/
|
|
418
428
|
private warmedWorkspaceSymbolFiles = new Map<string, ProjectMembership>();
|
|
429
|
+
/**
|
|
430
|
+
* Routes and scopes whose every project root was probed, with the coverage
|
|
431
|
+
* limit that pass left behind (`null` when none). `workspace/symbol` on a
|
|
432
|
+
* TypeScript server searches only loaded projects, so a result is complete
|
|
433
|
+
* only after such a pass.
|
|
434
|
+
*/
|
|
435
|
+
private warmedWorkspaceSymbolRoutes = new Map<string, string | null>();
|
|
436
|
+
/** In-flight all-roots warm-up passes; concurrent queries wait instead of reopening files. */
|
|
437
|
+
private pendingWorkspaceSymbolRouteWarmups = new Map<string, Promise<void>>();
|
|
438
|
+
/**
|
|
439
|
+
* Background all-roots passes by client key (`clientKey`, not the warm-pass
|
|
440
|
+
* route key); no caller owns them, so shutdown and route restart abort them.
|
|
441
|
+
*/
|
|
442
|
+
private backgroundWorkspaceSymbolWarmups = new Map<
|
|
443
|
+
string,
|
|
444
|
+
/** `loading` turns true once the client is ready and the pass opens files. */
|
|
445
|
+
{ abort: AbortController; loading: boolean }
|
|
446
|
+
>();
|
|
447
|
+
/**
|
|
448
|
+
* Advances when a warm-up opens a file on any route. Rows collected across
|
|
449
|
+
* an advance may miss the project that open loaded.
|
|
450
|
+
*/
|
|
451
|
+
private workspaceSymbolLoadGeneration = 0;
|
|
452
|
+
/** Advances on a project-config change; a pass that spans one must not be recorded. */
|
|
453
|
+
private projectConfigGeneration = 0;
|
|
419
454
|
/** Project roots whose semantic state was warmed with a readiness probe. */
|
|
420
455
|
private warmedSemanticProjects = new Set<string>();
|
|
421
456
|
/** In-flight warm-up probes keyed by project key so concurrent callers share one probe. */
|
|
@@ -582,6 +617,14 @@ export class LspManager {
|
|
|
582
617
|
);
|
|
583
618
|
}
|
|
584
619
|
|
|
620
|
+
/** Return the open document text last synchronized to the server, without starting one. */
|
|
621
|
+
getOpenDocumentContent(filePath: string): string | null {
|
|
622
|
+
const resolvedPath = resolveSessionPath(this.cwd, filePath);
|
|
623
|
+
return (
|
|
624
|
+
this.getExistingClientForFile(resolvedPath)?.getOpenDocumentContent(resolvedPath) ?? null
|
|
625
|
+
);
|
|
626
|
+
}
|
|
627
|
+
|
|
585
628
|
/**
|
|
586
629
|
* Coverage gap for a project-wide TypeScript request answered by `client`.
|
|
587
630
|
*
|
|
@@ -732,6 +775,7 @@ export class LspManager {
|
|
|
732
775
|
},
|
|
733
776
|
this.cwd,
|
|
734
777
|
this.fileAssociations,
|
|
778
|
+
(filePath) => this.removedTrackedFiles.record(filePath),
|
|
735
779
|
);
|
|
736
780
|
return client;
|
|
737
781
|
}
|
|
@@ -1526,7 +1570,7 @@ export class LspManager {
|
|
|
1526
1570
|
try {
|
|
1527
1571
|
recordDebugEvent({
|
|
1528
1572
|
source: "lsp",
|
|
1529
|
-
level: outcome === "failure" || outcome === "exhausted" ? "warning" : "
|
|
1573
|
+
level: outcome === "failure" || outcome === "exhausted" ? "warning" : "info",
|
|
1530
1574
|
category: "runtime.recovery",
|
|
1531
1575
|
message: `LSP process-crash recovery ${outcome}`,
|
|
1532
1576
|
cwd: boundCwd(this.cwd),
|
|
@@ -1579,7 +1623,11 @@ export class LspManager {
|
|
|
1579
1623
|
private async performStart(route: FileRoute, routeGeneration: number): Promise<LspClient | null> {
|
|
1580
1624
|
const { serverName, serverConfig, root, key } = route;
|
|
1581
1625
|
// Client.start resolves again at actual spawn time, including every retry.
|
|
1582
|
-
if (this.recordUnavailableLaunch(route))
|
|
1626
|
+
if (this.recordUnavailableLaunch(route)) {
|
|
1627
|
+
// No client lifecycle runs for an unlaunchable route; publish its new status here.
|
|
1628
|
+
this.publishLifecycle("startup");
|
|
1629
|
+
return null;
|
|
1630
|
+
}
|
|
1583
1631
|
|
|
1584
1632
|
// Spawn new client
|
|
1585
1633
|
const client = this.createClient(serverName, serverConfig, root, key);
|
|
@@ -1611,6 +1659,7 @@ export class LspManager {
|
|
|
1611
1659
|
...(error instanceof Error && error.message ? { failureMessage: error.message } : {}),
|
|
1612
1660
|
});
|
|
1613
1661
|
if (this.clients.get(key) === client) this.clients.delete(key);
|
|
1662
|
+
this.publishLifecycle("startup");
|
|
1614
1663
|
return null;
|
|
1615
1664
|
}
|
|
1616
1665
|
}
|
|
@@ -1712,6 +1761,8 @@ export class LspManager {
|
|
|
1712
1761
|
.getDiagnosticSnapshot()
|
|
1713
1762
|
.documents.map((document) => uriToFile(document.uri));
|
|
1714
1763
|
const files = [...new Set([...openFiles, ...trackedDiagnosticFiles])];
|
|
1764
|
+
// Before the shutdown wait: a running pass would start a client for its next file.
|
|
1765
|
+
this.abortBackgroundWorkspaceSymbolWarmup(key);
|
|
1715
1766
|
try {
|
|
1716
1767
|
await client.shutdown();
|
|
1717
1768
|
} catch {
|
|
@@ -1792,6 +1843,7 @@ export class LspManager {
|
|
|
1792
1843
|
client: this.clients.get(key),
|
|
1793
1844
|
unavailableReason: this.getUnavailableReason(key, serverName, root) ?? undefined,
|
|
1794
1845
|
statusReason: this.processCrashRecoveries.get(key)?.statusReason,
|
|
1846
|
+
loadingProjects: this.backgroundWorkspaceSymbolWarmups.get(key)?.loading === true,
|
|
1795
1847
|
includeOpenFile: (file) => this.isAutomaticScopePath(file),
|
|
1796
1848
|
},
|
|
1797
1849
|
this.cwd,
|
|
@@ -2206,7 +2258,7 @@ export class LspManager {
|
|
|
2206
2258
|
).slice(0, MAX_BULK_TRACK_FILES);
|
|
2207
2259
|
if (selected.length === 0) return { outcomes: [] };
|
|
2208
2260
|
|
|
2209
|
-
this.
|
|
2261
|
+
const endTrackedFilesBatch = this.beginTrackedFilesBatch();
|
|
2210
2262
|
const outcomes = new Array<BulkTrackFileOutcome>(selected.length);
|
|
2211
2263
|
const workerCount = Math.min(MAX_CONCURRENT_BULK_TRACKS, selected.length);
|
|
2212
2264
|
let nextIndex = 0;
|
|
@@ -2229,14 +2281,25 @@ export class LspManager {
|
|
|
2229
2281
|
await Promise.allSettled(workers);
|
|
2230
2282
|
throw error;
|
|
2231
2283
|
} finally {
|
|
2232
|
-
|
|
2233
|
-
if (this.trackedFilesBatchDepth === 0 && this.trackedFilesBatchChanged) {
|
|
2234
|
-
this.trackedFilesBatchChanged = false;
|
|
2235
|
-
this.publishLifecycle("tracked-files");
|
|
2236
|
-
}
|
|
2284
|
+
endTrackedFilesBatch();
|
|
2237
2285
|
}
|
|
2238
2286
|
}
|
|
2239
2287
|
|
|
2288
|
+
/**
|
|
2289
|
+
* Hold back `tracked-files` transitions until the returned function runs,
|
|
2290
|
+
* then publish one for the whole batch. Opening many files otherwise
|
|
2291
|
+
* publishes one transition, and one `runtime.transition` debug event, each.
|
|
2292
|
+
*/
|
|
2293
|
+
private beginTrackedFilesBatch(): () => void {
|
|
2294
|
+
this.trackedFilesBatchDepth++;
|
|
2295
|
+
return () => {
|
|
2296
|
+
this.trackedFilesBatchDepth--;
|
|
2297
|
+
if (this.trackedFilesBatchDepth > 0 || !this.trackedFilesBatchChanged) return;
|
|
2298
|
+
this.trackedFilesBatchChanged = false;
|
|
2299
|
+
if (!this.shuttingDown) this.publishLifecycle("tracked-files");
|
|
2300
|
+
};
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2240
2303
|
private async trackBulkFile(
|
|
2241
2304
|
filePath: string,
|
|
2242
2305
|
control?: CodeRequestControl,
|
|
@@ -2308,6 +2371,24 @@ export class LspManager {
|
|
|
2308
2371
|
closeFile(filePath: string): void {
|
|
2309
2372
|
closeFileAcrossClients(this.clients.values(), resolveSessionPath(this.cwd, filePath));
|
|
2310
2373
|
}
|
|
2374
|
+
/**
|
|
2375
|
+
* Return tracked files removed from disk since a report last showed them.
|
|
2376
|
+
*
|
|
2377
|
+
* The read does not consume the removals; call
|
|
2378
|
+
* {@link acknowledgeRemovedTrackedFiles} after a report delivered them.
|
|
2379
|
+
*/
|
|
2380
|
+
peekRemovedTrackedFiles(scope: string | null = null): string[] {
|
|
2381
|
+
this.pruneMissingFiles();
|
|
2382
|
+
return this.removedTrackedFiles.peek(
|
|
2383
|
+
scope === null ? null : resolveSessionPath(this.cwd, scope),
|
|
2384
|
+
);
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
/** Forget removals that a delivered diagnostic report has shown. */
|
|
2388
|
+
acknowledgeRemovedTrackedFiles(files: readonly string[]): void {
|
|
2389
|
+
this.removedTrackedFiles.acknowledge(files.map((file) => resolveSessionPath(this.cwd, file)));
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2311
2392
|
/** Remove any missing files from open-document and diagnostic state. */
|
|
2312
2393
|
pruneMissingFiles(): string[] {
|
|
2313
2394
|
const removed = pruneMissingFilesFromClients(this.clients.values());
|
|
@@ -2456,7 +2537,12 @@ export class LspManager {
|
|
|
2456
2537
|
*/
|
|
2457
2538
|
noteWorkspaceChanges(changes: FileEvent[]): void {
|
|
2458
2539
|
if (changes.length > 0) this.invalidationEpoch++;
|
|
2459
|
-
if (invalidateProjectConfigCaches(changes))
|
|
2540
|
+
if (invalidateProjectConfigCaches(changes)) {
|
|
2541
|
+
this.typeScriptProjectConfigs.clear();
|
|
2542
|
+
// A new or changed project config can add a root that was never probed.
|
|
2543
|
+
this.warmedWorkspaceSymbolRoutes.clear();
|
|
2544
|
+
this.projectConfigGeneration++;
|
|
2545
|
+
}
|
|
2460
2546
|
this.notifyWorkspaceFileChanges(changes);
|
|
2461
2547
|
}
|
|
2462
2548
|
|
|
@@ -2623,10 +2709,14 @@ export class LspManager {
|
|
|
2623
2709
|
/** Shut down all running LSP servers. */
|
|
2624
2710
|
async shutdownAll(): Promise<void> {
|
|
2625
2711
|
this.shuttingDown = true;
|
|
2712
|
+
for (const key of Array.from(this.backgroundWorkspaceSymbolWarmups.keys())) {
|
|
2713
|
+
this.abortBackgroundWorkspaceSymbolWarmup(key);
|
|
2714
|
+
}
|
|
2626
2715
|
const clients = Array.from(this.clients.values());
|
|
2627
2716
|
const shutdowns = clients.map((client) => client.shutdown().catch(() => {}));
|
|
2628
2717
|
await Promise.all([...shutdowns, ...this.retiredClientShutdowns]);
|
|
2629
2718
|
this.retiredClientShutdowns.clear();
|
|
2719
|
+
this.removedTrackedFiles.clear();
|
|
2630
2720
|
// Dispose every client so pending or active progress tokens and
|
|
2631
2721
|
// readiness promises cannot outlive the manager.
|
|
2632
2722
|
for (const client of clients) client.dispose();
|
|
@@ -2643,6 +2733,8 @@ export class LspManager {
|
|
|
2643
2733
|
this.unavailable.clear();
|
|
2644
2734
|
this.knownRoots.clear();
|
|
2645
2735
|
this.warmedWorkspaceSymbolFiles.clear();
|
|
2736
|
+
this.warmedWorkspaceSymbolRoutes.clear();
|
|
2737
|
+
this.pendingWorkspaceSymbolRouteWarmups.clear();
|
|
2646
2738
|
this.warmedSemanticProjects.clear();
|
|
2647
2739
|
this.pendingWarmProbes.clear();
|
|
2648
2740
|
this.typeScriptProjectConfigs.clear();
|
|
@@ -2767,6 +2859,7 @@ export class LspManager {
|
|
|
2767
2859
|
snapshot.documents.map((document) => ({
|
|
2768
2860
|
file: relativeFilePathFromUri(document.uri, this.cwd),
|
|
2769
2861
|
status: document.status,
|
|
2862
|
+
...(document.reason ? { reason: document.reason } : {}),
|
|
2770
2863
|
})),
|
|
2771
2864
|
),
|
|
2772
2865
|
);
|
|
@@ -2821,6 +2914,7 @@ export class LspManager {
|
|
|
2821
2914
|
evidenceDocuments.push({
|
|
2822
2915
|
file: relativeFilePathFromUri(document.uri, this.cwd),
|
|
2823
2916
|
status: document.status,
|
|
2917
|
+
...(document.reason ? { reason: document.reason } : {}),
|
|
2824
2918
|
});
|
|
2825
2919
|
}
|
|
2826
2920
|
for (const entry of snapshot.entries) {
|
|
@@ -2898,6 +2992,7 @@ export class LspManager {
|
|
|
2898
2992
|
snapshot.documents.map((document) => ({
|
|
2899
2993
|
file: relativeFilePathFromUri(document.uri, this.cwd),
|
|
2900
2994
|
status: document.status,
|
|
2995
|
+
...(document.reason ? { reason: document.reason } : {}),
|
|
2901
2996
|
})),
|
|
2902
2997
|
);
|
|
2903
2998
|
const evidence = this.toWorkspaceDiagnosticEvidence(evidenceDocuments);
|
|
@@ -2942,7 +3037,7 @@ export class LspManager {
|
|
|
2942
3037
|
}
|
|
2943
3038
|
|
|
2944
3039
|
return {
|
|
2945
|
-
caseSensitiveFileNames:
|
|
3040
|
+
caseSensitiveFileNames: getTypeScript().sys.useCaseSensitiveFileNames,
|
|
2946
3041
|
counts: accumulator.counts,
|
|
2947
3042
|
basisCounts: accumulator.basisCounts,
|
|
2948
3043
|
entries: accumulator.entries,
|
|
@@ -2956,10 +3051,7 @@ export class LspManager {
|
|
|
2956
3051
|
for (const document of documents) {
|
|
2957
3052
|
const file = path.relative(this.cwd, path.resolve(this.cwd, document.file));
|
|
2958
3053
|
if (!this.isAutomaticScopePath(file)) continue;
|
|
2959
|
-
|
|
2960
|
-
if (!existing || evidenceStatusRank(document.status) > evidenceStatusRank(existing.status)) {
|
|
2961
|
-
byFile.set(file, { file, status: document.status });
|
|
2962
|
-
}
|
|
3054
|
+
byFile.set(file, preferEvidenceDocument(byFile.get(file), { ...document, file }));
|
|
2963
3055
|
}
|
|
2964
3056
|
return summarizeDiagnosticEvidence(
|
|
2965
3057
|
Array.from(byFile.values()).sort((a, b) => a.file.localeCompare(b.file)),
|
|
@@ -2993,12 +3085,17 @@ export class LspManager {
|
|
|
2993
3085
|
Array.from(clients).filter((client) => routeMatches(client)),
|
|
2994
3086
|
value,
|
|
2995
3087
|
control,
|
|
3088
|
+
// A scope equal to the session root narrows nothing, so advising a scope still helps.
|
|
3089
|
+
resolvedScopes?.some((scope) => path.resolve(scope) !== path.resolve(this.cwd)) ?? false,
|
|
2996
3090
|
),
|
|
2997
3091
|
demand,
|
|
2998
3092
|
);
|
|
2999
3093
|
return this.filterWorkspaceSymbolCollection(collection, resolvedScopes);
|
|
3000
3094
|
};
|
|
3095
|
+
const loadsBefore = this.workspaceSymbolLoadGeneration;
|
|
3001
3096
|
const initial = await collect(this.clients.values(), query);
|
|
3097
|
+
// A pass that opened files while these rows were collected may have loaded projects they miss.
|
|
3098
|
+
const initialStale = loadsBefore !== this.workspaceSymbolLoadGeneration;
|
|
3002
3099
|
// Allowed out-of-scope rows do not show that the server knows the scope yet.
|
|
3003
3100
|
const hasScopedResult = (collection: WorkspaceSymbolCollection) =>
|
|
3004
3101
|
collection.hasSupport &&
|
|
@@ -3009,9 +3106,14 @@ export class LspManager {
|
|
|
3009
3106
|
);
|
|
3010
3107
|
// Rows from a route whose warm-up reached only inferred projects may come
|
|
3011
3108
|
// from those files alone, so they cannot end the search early.
|
|
3109
|
+
const answered = hasScopedResult(initial) && !this.hasInferredOnlyWarmRoute(routeMatches);
|
|
3110
|
+
// A route that searches only loaded projects can answer from one project
|
|
3111
|
+
// and miss the same name in another, so its rows do not end the search either.
|
|
3012
3112
|
if (
|
|
3013
3113
|
!initial.hasSupport ||
|
|
3014
|
-
(
|
|
3114
|
+
(answered &&
|
|
3115
|
+
!initialStale &&
|
|
3116
|
+
!this.hasUnconfirmedWorkspaceSymbolRoute(routeMatches, resolvedScopes))
|
|
3015
3117
|
) {
|
|
3016
3118
|
return workspaceSymbolCollectionResult(initial);
|
|
3017
3119
|
}
|
|
@@ -3026,14 +3128,76 @@ export class LspManager {
|
|
|
3026
3128
|
collect,
|
|
3027
3129
|
hasResult: hasScopedResult,
|
|
3028
3130
|
routeMatches,
|
|
3131
|
+
scopes: resolvedScopes,
|
|
3132
|
+
skipFirstResultRoutes: answered,
|
|
3133
|
+
initialStale,
|
|
3029
3134
|
query,
|
|
3030
3135
|
control,
|
|
3031
3136
|
});
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
warmed.
|
|
3035
|
-
|
|
3036
|
-
|
|
3137
|
+
let collection = warmed.collection ?? initial;
|
|
3138
|
+
if (!warmed.coverageConfirmed) {
|
|
3139
|
+
collection = workspaceSymbolCoverageGap(collection, warmed.inferredProbeCount);
|
|
3140
|
+
}
|
|
3141
|
+
if (warmed.coverageGaps.length > 0) {
|
|
3142
|
+
collection = {
|
|
3143
|
+
...collection,
|
|
3144
|
+
coverageGap: joinWorkspaceSymbolReasons([collection.coverageGap, ...warmed.coverageGaps]),
|
|
3145
|
+
};
|
|
3146
|
+
}
|
|
3147
|
+
return workspaceSymbolCollectionResult(collection);
|
|
3148
|
+
}
|
|
3149
|
+
|
|
3150
|
+
/**
|
|
3151
|
+
* Load every project of the routes whose `workspace/symbol` searches only
|
|
3152
|
+
* loaded projects, without a query. Runs in the background after startup so
|
|
3153
|
+
* the first symbol query finds the projects loaded; a query that arrives
|
|
3154
|
+
* during the pass waits for it. Resolves when the pass ends, so startup must
|
|
3155
|
+
* not await it. Never rejects.
|
|
3156
|
+
*/
|
|
3157
|
+
async startWorkspaceSymbolWarmup(): Promise<void> {
|
|
3158
|
+
const routes = Array.from(this.clients.entries()).filter(
|
|
3159
|
+
([key, client]) =>
|
|
3160
|
+
this.warmsEveryWorkspaceSymbolProject(client) &&
|
|
3161
|
+
!this.backgroundWorkspaceSymbolWarmups.has(key),
|
|
3162
|
+
);
|
|
3163
|
+
await Promise.all(
|
|
3164
|
+
routes.map(async ([key, client]) => {
|
|
3165
|
+
const warmup = { abort: new AbortController(), loading: false };
|
|
3166
|
+
this.backgroundWorkspaceSymbolWarmups.set(key, warmup);
|
|
3167
|
+
const control = { signal: warmup.abort.signal };
|
|
3168
|
+
try {
|
|
3169
|
+
await client.getReady(control);
|
|
3170
|
+
if (this.clients.get(key) !== client) return;
|
|
3171
|
+
warmup.loading = true;
|
|
3172
|
+
this.publishLifecycle("readiness");
|
|
3173
|
+
await this.warmWorkspaceSymbolProjectsUntilResult({
|
|
3174
|
+
findWarmTargets: (root, rootMarkers, fileTypes) =>
|
|
3175
|
+
findWorkspaceSymbolWarmTargets(root, rootMarkers, fileTypes, {
|
|
3176
|
+
policy: this.automaticPathPolicy,
|
|
3177
|
+
}),
|
|
3178
|
+
getWarmPosition: getWorkspaceSymbolWarmPosition,
|
|
3179
|
+
// No query waits for rows: the pass only loads projects.
|
|
3180
|
+
collect: async () => ({
|
|
3181
|
+
results: [],
|
|
3182
|
+
hasSupport: true,
|
|
3183
|
+
completedClientCount: 0,
|
|
3184
|
+
failures: [],
|
|
3185
|
+
}),
|
|
3186
|
+
hasResult: () => false,
|
|
3187
|
+
routeMatches: (candidate) => candidate === client,
|
|
3188
|
+
skipFirstResultRoutes: true,
|
|
3189
|
+
query: "",
|
|
3190
|
+
control,
|
|
3191
|
+
});
|
|
3192
|
+
} catch {
|
|
3193
|
+
// The first symbol query runs the pass when the background one fails or is aborted.
|
|
3194
|
+
} finally {
|
|
3195
|
+
if (this.backgroundWorkspaceSymbolWarmups.get(key) === warmup) {
|
|
3196
|
+
this.backgroundWorkspaceSymbolWarmups.delete(key);
|
|
3197
|
+
if (warmup.loading && !this.shuttingDown) this.publishLifecycle("readiness");
|
|
3198
|
+
}
|
|
3199
|
+
}
|
|
3200
|
+
}),
|
|
3037
3201
|
);
|
|
3038
3202
|
}
|
|
3039
3203
|
|
|
@@ -3216,10 +3380,83 @@ export class LspManager {
|
|
|
3216
3380
|
return client;
|
|
3217
3381
|
} catch (error) {
|
|
3218
3382
|
if (isCodeRequestInterruption(error, options.control)) throw error;
|
|
3383
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
3384
|
+
this.recordOpenFailureEvent(client.name, resolvedPath, reason, options.control);
|
|
3385
|
+
options.onOpenFailure?.(reason);
|
|
3219
3386
|
return null;
|
|
3220
3387
|
}
|
|
3221
3388
|
}
|
|
3222
3389
|
|
|
3390
|
+
/**
|
|
3391
|
+
* Record a routed client that could not open a file. The caller only sees
|
|
3392
|
+
* an unavailable result, so this event is the trace of the cause.
|
|
3393
|
+
*/
|
|
3394
|
+
private recordOpenFailureEvent(
|
|
3395
|
+
serverName: string,
|
|
3396
|
+
file: string,
|
|
3397
|
+
reason: string,
|
|
3398
|
+
control?: CodeRequestControl,
|
|
3399
|
+
): void {
|
|
3400
|
+
try {
|
|
3401
|
+
recordDebugEvent({
|
|
3402
|
+
operationId: control?.operationId,
|
|
3403
|
+
source: "lsp",
|
|
3404
|
+
level: "warning",
|
|
3405
|
+
category: "document.open-failed",
|
|
3406
|
+
message: "LSP client could not open a document",
|
|
3407
|
+
cwd: boundCwd(this.cwd),
|
|
3408
|
+
data: {
|
|
3409
|
+
server: truncateIdentity(serverName),
|
|
3410
|
+
file: truncateIdentity(displayRelativeFilePath(file, this.cwd)),
|
|
3411
|
+
reason: truncateIdentity(reason),
|
|
3412
|
+
},
|
|
3413
|
+
});
|
|
3414
|
+
} catch {
|
|
3415
|
+
// Telemetry must never change query behavior.
|
|
3416
|
+
}
|
|
3417
|
+
}
|
|
3418
|
+
|
|
3419
|
+
/**
|
|
3420
|
+
* Record one finished all-roots warm-up pass. Per-file probes are `debug`
|
|
3421
|
+
* events and are not persisted; this summary is. `requests` holds the
|
|
3422
|
+
* completed protocol requests of the pass by method: only an all-roots
|
|
3423
|
+
* pass records this summary, so only its probes batch their timings.
|
|
3424
|
+
*/
|
|
3425
|
+
private recordWarmPassEvent(
|
|
3426
|
+
serverName: string,
|
|
3427
|
+
pass: {
|
|
3428
|
+
roots: number;
|
|
3429
|
+
loadedRoots: number;
|
|
3430
|
+
inferredProbes: number;
|
|
3431
|
+
failedProbes: number;
|
|
3432
|
+
limited: boolean;
|
|
3433
|
+
startedAt: number;
|
|
3434
|
+
requestTimings: RequestTimingBatch;
|
|
3435
|
+
},
|
|
3436
|
+
control?: CodeRequestControl,
|
|
3437
|
+
): void {
|
|
3438
|
+
try {
|
|
3439
|
+
const { startedAt, requestTimings, ...counts } = pass;
|
|
3440
|
+
const requests = requestTimings.snapshot();
|
|
3441
|
+
recordDebugEvent({
|
|
3442
|
+
operationId: control?.operationId,
|
|
3443
|
+
source: "lsp",
|
|
3444
|
+
level: "info",
|
|
3445
|
+
category: "workspace-symbol.warm-pass",
|
|
3446
|
+
message: `Workspace-symbol warm-up loaded ${pass.loadedRoots} of ${pass.roots} project roots`,
|
|
3447
|
+
cwd: boundCwd(this.cwd),
|
|
3448
|
+
data: {
|
|
3449
|
+
server: truncateIdentity(serverName),
|
|
3450
|
+
...counts,
|
|
3451
|
+
elapsedMs: Math.max(0, Date.now() - startedAt),
|
|
3452
|
+
...(requests ? { requests } : {}),
|
|
3453
|
+
},
|
|
3454
|
+
});
|
|
3455
|
+
} catch {
|
|
3456
|
+
// Telemetry must never change query behavior.
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3459
|
+
|
|
3223
3460
|
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: warm-up coordinates client/project iteration, targeted semantic nudges, and early-return queries in one place.
|
|
3224
3461
|
private async warmWorkspaceSymbolProjectsUntilResult(options: {
|
|
3225
3462
|
findWarmTargets: (
|
|
@@ -3234,6 +3471,12 @@ export class LspManager {
|
|
|
3234
3471
|
/** Stop warming once a collection contains a row that answers the request. */
|
|
3235
3472
|
hasResult: (collection: WorkspaceSymbolCollection) => boolean;
|
|
3236
3473
|
routeMatches?: (client: LspClient) => boolean;
|
|
3474
|
+
/** Absolute request scopes, identifying the all-roots pass. */
|
|
3475
|
+
scopes?: readonly string[];
|
|
3476
|
+
/** The initial rows already answer the request for routes that index their workspace. */
|
|
3477
|
+
skipFirstResultRoutes?: boolean;
|
|
3478
|
+
/** The caller's rows predate a recorded pass; collect again before returning. */
|
|
3479
|
+
initialStale?: boolean;
|
|
3237
3480
|
query: string;
|
|
3238
3481
|
control?: CodeRequestControl;
|
|
3239
3482
|
}): Promise<{
|
|
@@ -3241,9 +3484,14 @@ export class LspManager {
|
|
|
3241
3484
|
/** False only when every probe the server classified landed in an inferred project. */
|
|
3242
3485
|
coverageConfirmed: boolean;
|
|
3243
3486
|
inferredProbeCount: number;
|
|
3487
|
+
/** Coverage limits of all-roots passes: roots past the limit, or a config change during the pass. */
|
|
3488
|
+
coverageGaps: string[];
|
|
3244
3489
|
}> {
|
|
3245
3490
|
const { findWarmTargets, getWarmPosition, collect, hasResult, routeMatches, query, control } =
|
|
3246
3491
|
options;
|
|
3492
|
+
const coverageGaps: string[] = [];
|
|
3493
|
+
/** An all-roots pass opened a project after the last collection. */
|
|
3494
|
+
let collectionStale = options.initialStale === true;
|
|
3247
3495
|
let latestCollection: WorkspaceSymbolCollection | null = null;
|
|
3248
3496
|
// A route with no inferred probe keeps today's evidence: non-TypeScript
|
|
3249
3497
|
// servers index the workspace, and `unknown` cannot prove a gap.
|
|
@@ -3253,97 +3501,257 @@ export class LspManager {
|
|
|
3253
3501
|
collection: latestCollection,
|
|
3254
3502
|
coverageConfirmed: routeCoverage.every(Boolean),
|
|
3255
3503
|
inferredProbeCount,
|
|
3504
|
+
coverageGaps,
|
|
3256
3505
|
});
|
|
3257
3506
|
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3507
|
+
const warmClients = this.workspaceSymbolWarmClients(
|
|
3508
|
+
routeMatches,
|
|
3509
|
+
options.skipFirstResultRoutes === true,
|
|
3510
|
+
);
|
|
3511
|
+
for (const client of warmClients) {
|
|
3512
|
+
const allRoots = this.warmsEveryWorkspaceSymbolProject(client);
|
|
3513
|
+
if (!allRoots && collectionStale) {
|
|
3514
|
+
latestCollection = await collect(this.clients.values(), query);
|
|
3515
|
+
collectionStale = false;
|
|
3516
|
+
if (hasResult(latestCollection)) return outcome();
|
|
3517
|
+
}
|
|
3263
3518
|
const serverConfig = this.config.servers[client.name];
|
|
3264
3519
|
if (!serverConfig) continue;
|
|
3265
3520
|
|
|
3266
|
-
const
|
|
3267
|
-
client.
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3521
|
+
const pass = allRoots
|
|
3522
|
+
? await this.joinOrBeginWorkspaceSymbolRouteWarmup(client, options.scopes, control)
|
|
3523
|
+
: null;
|
|
3524
|
+
if (pass && "recorded" in pass) {
|
|
3525
|
+
if (pass.recorded) coverageGaps.push(pass.recorded);
|
|
3526
|
+
// Another query's pass may have loaded projects after this query's rows.
|
|
3527
|
+
collectionStale ||= pass.waited;
|
|
3528
|
+
continue;
|
|
3529
|
+
}
|
|
3272
3530
|
// Marker roots whose program an earlier candidate already loaded.
|
|
3273
3531
|
const coveredRoots = new Set<string>();
|
|
3274
|
-
let
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
if (previous !== undefined) {
|
|
3286
|
-
coveredRoots.add(target.projectRoot);
|
|
3287
|
-
continue;
|
|
3288
|
-
}
|
|
3289
|
-
|
|
3290
|
-
const openedClient = await this.ensureFileOpen(target.file, { control });
|
|
3291
|
-
if (!openedClient) {
|
|
3292
|
-
this.recordWarmProbeEvent(client.name, target.file, "open-failed", control);
|
|
3293
|
-
continue;
|
|
3294
|
-
}
|
|
3295
|
-
|
|
3296
|
-
// A cancelled pass must not mark projects warmed on its way out.
|
|
3297
|
-
throwIfCodeRequestInterrupted(control);
|
|
3298
|
-
const available = await this.probeDocumentSymbols(
|
|
3299
|
-
openedClient,
|
|
3300
|
-
target.file,
|
|
3301
|
-
getWarmPosition,
|
|
3302
|
-
control,
|
|
3532
|
+
let routeInferredProbes = 0;
|
|
3533
|
+
let failedProbes = 0;
|
|
3534
|
+
let rootLimitGap: string | null = null;
|
|
3535
|
+
let roots = 0;
|
|
3536
|
+
const configGeneration = this.projectConfigGeneration;
|
|
3537
|
+
const timing = { startedAt: Date.now(), requestTimings: new RequestTimingBatch() };
|
|
3538
|
+
try {
|
|
3539
|
+
const candidates = findWarmTargets(
|
|
3540
|
+
client.root,
|
|
3541
|
+
serverConfig.rootMarkers,
|
|
3542
|
+
serverConfig.fileTypes,
|
|
3303
3543
|
);
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3544
|
+
const limited = allRoots
|
|
3545
|
+
? limitWorkspaceSymbolWarmRoots(candidates)
|
|
3546
|
+
: { targets: candidates.slice(0, 24), gap: null };
|
|
3547
|
+
rootLimitGap = limited.gap;
|
|
3548
|
+
roots = new Set(limited.targets.map((target) => target.projectRoot)).size;
|
|
3549
|
+
for (const target of limited.targets) {
|
|
3550
|
+
if (coveredRoots.has(target.projectRoot)) continue;
|
|
3551
|
+
// A file probe does not load every program under the route root.
|
|
3552
|
+
const fileKey = `${client.name}:${path.resolve(target.file)}`;
|
|
3553
|
+
const previous = this.warmedWorkspaceSymbolFiles.get(fileKey);
|
|
3554
|
+
if (previous === "inferred") {
|
|
3555
|
+
routeInferredProbes++;
|
|
3556
|
+
inferredProbeCount++;
|
|
3557
|
+
continue;
|
|
3558
|
+
}
|
|
3559
|
+
if (previous !== undefined) {
|
|
3560
|
+
coveredRoots.add(target.projectRoot);
|
|
3561
|
+
continue;
|
|
3562
|
+
}
|
|
3321
3563
|
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3564
|
+
const membership = await this.probeWorkspaceSymbolWarmFile(
|
|
3565
|
+
client.name,
|
|
3566
|
+
target.file,
|
|
3567
|
+
getWarmPosition,
|
|
3568
|
+
{ control, requestTimings: allRoots ? timing.requestTimings : undefined },
|
|
3569
|
+
);
|
|
3570
|
+
if (membership === null) {
|
|
3571
|
+
failedProbes++;
|
|
3572
|
+
continue;
|
|
3573
|
+
}
|
|
3574
|
+
this.warmedWorkspaceSymbolFiles.set(fileKey, membership);
|
|
3575
|
+
if (membership === "inferred") {
|
|
3576
|
+
// The file loaded only its own inferred project; workspace/symbol
|
|
3577
|
+
// still cannot see the configured program, so try the next file
|
|
3578
|
+
// without collecting: a hit here could come from that inferred
|
|
3579
|
+
// project alone and would hide the configured program's rows.
|
|
3580
|
+
routeInferredProbes++;
|
|
3581
|
+
inferredProbeCount++;
|
|
3582
|
+
continue;
|
|
3583
|
+
}
|
|
3584
|
+
|
|
3585
|
+
coveredRoots.add(target.projectRoot);
|
|
3586
|
+
if (allRoots) {
|
|
3587
|
+
// Another root may declare the same name, so keep loading before collecting.
|
|
3588
|
+
collectionStale = true;
|
|
3589
|
+
continue;
|
|
3590
|
+
}
|
|
3591
|
+
latestCollection = await collect(this.clients.values(), query);
|
|
3592
|
+
if (hasResult(latestCollection)) {
|
|
3593
|
+
return { ...outcome(), coverageConfirmed: true };
|
|
3594
|
+
}
|
|
3326
3595
|
}
|
|
3596
|
+
} finally {
|
|
3597
|
+
pass?.finish();
|
|
3598
|
+
}
|
|
3599
|
+
const covered = coveredRoots.size > 0 || routeInferredProbes === 0;
|
|
3600
|
+
routeCoverage.push(covered);
|
|
3601
|
+
if (!allRoots) continue;
|
|
3602
|
+
if (rootLimitGap) coverageGaps.push(rootLimitGap);
|
|
3603
|
+
// A failed probe is retried, and an inferred-only route recounted, by the next query.
|
|
3604
|
+
if (configGeneration !== this.projectConfigGeneration) {
|
|
3605
|
+
// The change may have added a root this pass never saw; the next query runs its own pass.
|
|
3606
|
+
coverageGaps.push(PROJECT_CONFIG_CHANGED_GAP);
|
|
3607
|
+
} else if (pass && failedProbes === 0 && covered) {
|
|
3608
|
+
this.warmedWorkspaceSymbolRoutes.set(pass.routeKey, rootLimitGap);
|
|
3327
3609
|
}
|
|
3328
|
-
|
|
3610
|
+
const counts = { roots, loadedRoots: coveredRoots.size, failedProbes };
|
|
3611
|
+
this.recordWarmPassEvent(
|
|
3612
|
+
client.name,
|
|
3613
|
+
{
|
|
3614
|
+
...counts,
|
|
3615
|
+
inferredProbes: routeInferredProbes,
|
|
3616
|
+
limited: rootLimitGap !== null,
|
|
3617
|
+
...timing,
|
|
3618
|
+
},
|
|
3619
|
+
control,
|
|
3620
|
+
);
|
|
3329
3621
|
}
|
|
3330
3622
|
|
|
3331
|
-
if (inferredProbeCount > 0 && latestCollection === null) {
|
|
3623
|
+
if (collectionStale || (inferredProbeCount > 0 && latestCollection === null)) {
|
|
3332
3624
|
latestCollection = await collect(this.clients.values(), query);
|
|
3333
3625
|
}
|
|
3334
3626
|
// A completed-empty retry replaces an earlier failure too.
|
|
3335
3627
|
return outcome();
|
|
3336
3628
|
}
|
|
3337
3629
|
|
|
3630
|
+
/**
|
|
3631
|
+
* Routes to warm for a symbol query. All-roots routes go first so a
|
|
3632
|
+
* first-result route cannot end the search before them.
|
|
3633
|
+
*/
|
|
3634
|
+
private workspaceSymbolWarmClients(
|
|
3635
|
+
routeMatches: ((client: LspClient) => boolean) | undefined,
|
|
3636
|
+
skipFirstResultRoutes: boolean,
|
|
3637
|
+
): LspClient[] {
|
|
3638
|
+
const clients = Array.from(this.clients.values()).filter(
|
|
3639
|
+
(client) =>
|
|
3640
|
+
(!routeMatches || routeMatches(client)) &&
|
|
3641
|
+
client.status === "running" &&
|
|
3642
|
+
Boolean(client.serverCapabilities?.workspaceSymbolProvider) &&
|
|
3643
|
+
this.config.servers[client.name] !== undefined,
|
|
3644
|
+
);
|
|
3645
|
+
const allRoots = clients.filter((client) => this.warmsEveryWorkspaceSymbolProject(client));
|
|
3646
|
+
return skipFirstResultRoutes
|
|
3647
|
+
? allRoots
|
|
3648
|
+
: [...allRoots, ...clients.filter((client) => !allRoots.includes(client))];
|
|
3649
|
+
}
|
|
3650
|
+
|
|
3651
|
+
/**
|
|
3652
|
+
* Wait for in-flight all-roots passes on this route, then report the
|
|
3653
|
+
* recorded pass or register this query's own. The last check and the
|
|
3654
|
+
* registration share one synchronous step: with an await between them,
|
|
3655
|
+
* concurrent queries each see no pass and each start one.
|
|
3656
|
+
*/
|
|
3657
|
+
private async joinOrBeginWorkspaceSymbolRouteWarmup(
|
|
3658
|
+
client: LspClient,
|
|
3659
|
+
scopes: readonly string[] | undefined,
|
|
3660
|
+
control?: CodeRequestControl,
|
|
3661
|
+
): Promise<
|
|
3662
|
+
{ waited: boolean; recorded: string | null } | { routeKey: string; finish: () => void }
|
|
3663
|
+
> {
|
|
3664
|
+
const routeKey = this.workspaceSymbolRouteWarmKey(client, scopes);
|
|
3665
|
+
let waited = false;
|
|
3666
|
+
for (
|
|
3667
|
+
let running = this.pendingWorkspaceSymbolRouteWarmups.get(routeKey);
|
|
3668
|
+
running !== undefined;
|
|
3669
|
+
running = this.pendingWorkspaceSymbolRouteWarmups.get(routeKey)
|
|
3670
|
+
) {
|
|
3671
|
+
waited = true;
|
|
3672
|
+
await raceRequestControl(running, control);
|
|
3673
|
+
}
|
|
3674
|
+
const recorded = this.warmedWorkspaceSymbolRoute(client, scopes);
|
|
3675
|
+
if (recorded !== undefined) return { waited, recorded };
|
|
3676
|
+
|
|
3677
|
+
let release = () => {};
|
|
3678
|
+
const pending = new Promise<void>((resolve) => {
|
|
3679
|
+
release = resolve;
|
|
3680
|
+
});
|
|
3681
|
+
this.pendingWorkspaceSymbolRouteWarmups.set(routeKey, pending);
|
|
3682
|
+
// The pass opens one file per project root; publish their tracking once.
|
|
3683
|
+
const endTrackedFilesBatch = this.beginTrackedFilesBatch();
|
|
3684
|
+
return {
|
|
3685
|
+
routeKey,
|
|
3686
|
+
finish: () => {
|
|
3687
|
+
endTrackedFilesBatch();
|
|
3688
|
+
if (this.pendingWorkspaceSymbolRouteWarmups.get(routeKey) === pending) {
|
|
3689
|
+
this.pendingWorkspaceSymbolRouteWarmups.delete(routeKey);
|
|
3690
|
+
}
|
|
3691
|
+
release();
|
|
3692
|
+
},
|
|
3693
|
+
};
|
|
3694
|
+
}
|
|
3695
|
+
|
|
3696
|
+
/**
|
|
3697
|
+
* Open one warm-up file and report the project the server placed it in;
|
|
3698
|
+
* `null` when the file could not be opened or probed. With
|
|
3699
|
+
* `probe.requestTimings`, the probe's completed requests are added to that
|
|
3700
|
+
* batch.
|
|
3701
|
+
*/
|
|
3702
|
+
private async probeWorkspaceSymbolWarmFile(
|
|
3703
|
+
serverName: string,
|
|
3704
|
+
file: string,
|
|
3705
|
+
getWarmPosition: (
|
|
3706
|
+
symbols: import("../config/types.ts").DocumentSymbol[] | SymbolInformation[] | null,
|
|
3707
|
+
) => import("../config/types.ts").Position | null,
|
|
3708
|
+
probe: { control?: CodeRequestControl; requestTimings?: RequestTimingBatch },
|
|
3709
|
+
): Promise<ProjectMembership | null> {
|
|
3710
|
+
const { control, requestTimings } = probe;
|
|
3711
|
+
const openedClient = await this.ensureFileOpen(file, { control });
|
|
3712
|
+
if (!openedClient) {
|
|
3713
|
+
this.recordWarmProbeEvent(serverName, file, "open-failed", control);
|
|
3714
|
+
return null;
|
|
3715
|
+
}
|
|
3716
|
+
this.workspaceSymbolLoadGeneration++;
|
|
3717
|
+
// A cancelled pass must not mark projects warmed on its way out.
|
|
3718
|
+
throwIfCodeRequestInterrupted(control);
|
|
3719
|
+
const requestControl: BatchedRequestControl | undefined = requestTimings
|
|
3720
|
+
? { ...control, requestTimings }
|
|
3721
|
+
: control;
|
|
3722
|
+
if (!(await this.probeDocumentSymbols(openedClient, file, getWarmPosition, requestControl))) {
|
|
3723
|
+
this.recordWarmProbeEvent(serverName, file, "probe-unavailable", control);
|
|
3724
|
+
return null;
|
|
3725
|
+
}
|
|
3726
|
+
const reported = await openedClient.projectMembership(file, requestControl);
|
|
3727
|
+
throwIfCodeRequestInterrupted(control);
|
|
3728
|
+
// The native server reports no membership. It does not keep a project loaded
|
|
3729
|
+
// for an open file that project excludes, so the pass tries the next candidate.
|
|
3730
|
+
const excluded =
|
|
3731
|
+
reported === "unknown" &&
|
|
3732
|
+
serverName === "typescript" &&
|
|
3733
|
+
getFileScopeDecision(file, this.cwd).status === "excluded";
|
|
3734
|
+
const membership = excluded ? "inferred" : reported;
|
|
3735
|
+
// An all-roots pass counts its loaded roots in the `warm-pass` summary.
|
|
3736
|
+
if (!requestTimings || membership === "inferred") {
|
|
3737
|
+
this.recordWarmProbeEvent(serverName, file, excluded ? "excluded" : membership, control);
|
|
3738
|
+
}
|
|
3739
|
+
return membership;
|
|
3740
|
+
}
|
|
3741
|
+
|
|
3338
3742
|
/**
|
|
3339
3743
|
* Record one workspace-symbol warm-up probe: which file was opened and
|
|
3340
3744
|
* whether the server placed it in a configured project. `unknown` means the
|
|
3341
|
-
* route cannot report membership (non-TypeScript or native TS7).
|
|
3745
|
+
* route cannot report membership (non-TypeScript or native TS7). `excluded`
|
|
3746
|
+
* is a native TS7 probe of a file its nearest project config excludes; the
|
|
3747
|
+
* pass treats it like `inferred`. An all-roots pass records only probes that
|
|
3748
|
+
* did not load a root: failed opens, unavailable probes, and inferred or
|
|
3749
|
+
* excluded files.
|
|
3342
3750
|
*/
|
|
3343
3751
|
private recordWarmProbeEvent(
|
|
3344
3752
|
serverName: string,
|
|
3345
3753
|
file: string,
|
|
3346
|
-
outcome: ProjectMembership | "open-failed" | "probe-unavailable",
|
|
3754
|
+
outcome: ProjectMembership | "excluded" | "open-failed" | "probe-unavailable",
|
|
3347
3755
|
control?: CodeRequestControl,
|
|
3348
3756
|
): void {
|
|
3349
3757
|
try {
|
|
@@ -3469,13 +3877,71 @@ export class LspManager {
|
|
|
3469
3877
|
return `${serverName}:${path.resolve(projectRoot)}`;
|
|
3470
3878
|
}
|
|
3471
3879
|
|
|
3880
|
+
private abortBackgroundWorkspaceSymbolWarmup(key: string): void {
|
|
3881
|
+
this.backgroundWorkspaceSymbolWarmups.get(key)?.abort.abort();
|
|
3882
|
+
this.backgroundWorkspaceSymbolWarmups.delete(key);
|
|
3883
|
+
}
|
|
3884
|
+
|
|
3472
3885
|
private clearWarmedWorkspaceSymbolFiles(serverName: string, root: string): void {
|
|
3886
|
+
// The route is restarting or retiring: its background pass must not keep opening files.
|
|
3887
|
+
this.abortBackgroundWorkspaceSymbolWarmup(clientKey(serverName, root));
|
|
3473
3888
|
const prefix = `${serverName}:${path.resolve(root)}`;
|
|
3474
3889
|
for (const key of Array.from(this.warmedWorkspaceSymbolFiles.keys())) {
|
|
3475
3890
|
if (key === prefix || key.startsWith(`${prefix}${path.sep}`)) {
|
|
3476
3891
|
this.warmedWorkspaceSymbolFiles.delete(key);
|
|
3477
3892
|
}
|
|
3478
3893
|
}
|
|
3894
|
+
for (const key of Array.from(this.warmedWorkspaceSymbolRoutes.keys())) {
|
|
3895
|
+
if (key.startsWith(`${prefix}\0`)) this.warmedWorkspaceSymbolRoutes.delete(key);
|
|
3896
|
+
}
|
|
3897
|
+
}
|
|
3898
|
+
|
|
3899
|
+
/**
|
|
3900
|
+
* True for routes whose `workspace/symbol` searches only loaded projects.
|
|
3901
|
+
* Other servers index their workspace, so one answering row is enough.
|
|
3902
|
+
*/
|
|
3903
|
+
private warmsEveryWorkspaceSymbolProject(client: LspClient): boolean {
|
|
3904
|
+
return client.name === "typescript";
|
|
3905
|
+
}
|
|
3906
|
+
|
|
3907
|
+
/**
|
|
3908
|
+
* Identity of one all-roots pass. A scope that contains the route root
|
|
3909
|
+
* selects every project root, so it shares the unscoped pass: `code_find`
|
|
3910
|
+
* passes the workspace root as its default scope, symbol targets pass none.
|
|
3911
|
+
*/
|
|
3912
|
+
private workspaceSymbolRouteWarmKey(client: LspClient, scopes?: readonly string[]): string {
|
|
3913
|
+
const root = path.resolve(client.root);
|
|
3914
|
+
const prefix = `${client.name}:${root}`;
|
|
3915
|
+
const narrowing = scopes?.some((scope) => projectRoots.isWithinOrEqual(scope, root))
|
|
3916
|
+
? []
|
|
3917
|
+
: [...(scopes ?? [])];
|
|
3918
|
+
return `${prefix}\0${narrowing.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0)).join("\0")}`;
|
|
3919
|
+
}
|
|
3920
|
+
|
|
3921
|
+
/** The recorded all-roots pass for these scopes; an unscoped pass covers every scope. */
|
|
3922
|
+
private warmedWorkspaceSymbolRoute(
|
|
3923
|
+
client: LspClient,
|
|
3924
|
+
scopes?: readonly string[],
|
|
3925
|
+
): string | null | undefined {
|
|
3926
|
+
const key = this.workspaceSymbolRouteWarmKey(client, scopes);
|
|
3927
|
+
return this.warmedWorkspaceSymbolRoutes.has(key)
|
|
3928
|
+
? this.warmedWorkspaceSymbolRoutes.get(key)
|
|
3929
|
+
: this.warmedWorkspaceSymbolRoutes.get(this.workspaceSymbolRouteWarmKey(client));
|
|
3930
|
+
}
|
|
3931
|
+
|
|
3932
|
+
/** True when a matching route still needs an all-roots pass or carries its coverage limit. */
|
|
3933
|
+
private hasUnconfirmedWorkspaceSymbolRoute(
|
|
3934
|
+
routeMatches: (client: LspClient) => boolean,
|
|
3935
|
+
scopes?: readonly string[],
|
|
3936
|
+
): boolean {
|
|
3937
|
+
return Array.from(this.clients.values()).some(
|
|
3938
|
+
(client) =>
|
|
3939
|
+
routeMatches(client) &&
|
|
3940
|
+
client.status === "running" &&
|
|
3941
|
+
Boolean(client.serverCapabilities?.workspaceSymbolProvider) &&
|
|
3942
|
+
this.warmsEveryWorkspaceSymbolProject(client) &&
|
|
3943
|
+
this.warmedWorkspaceSymbolRoute(client, scopes) !== null,
|
|
3944
|
+
);
|
|
3479
3945
|
}
|
|
3480
3946
|
|
|
3481
3947
|
private clearWarmedSemanticProjects(serverName: string, root: string): void {
|
|
@@ -3497,6 +3963,10 @@ export class LspManager {
|
|
|
3497
3963
|
}
|
|
3498
3964
|
}
|
|
3499
3965
|
|
|
3966
|
+
/** Coverage limit of an all-roots pass that a project-config change overtook. */
|
|
3967
|
+
const PROJECT_CONFIG_CHANGED_GAP =
|
|
3968
|
+
"Workspace-symbol coverage is limited: a project config changed while projects were loading. Retry to include every project.";
|
|
3969
|
+
|
|
3500
3970
|
/** Invalidate parsed project configs; returns whether any config changed. */
|
|
3501
3971
|
function invalidateProjectConfigCaches(changes: readonly FileEvent[]): boolean {
|
|
3502
3972
|
let changed = false;
|
|
@@ -3520,6 +3990,7 @@ function collectClientDiagnosticEvidenceDocuments(
|
|
|
3520
3990
|
snapshot.documents.map((document) => ({
|
|
3521
3991
|
file: relativeFilePathFromUri(document.uri, cwd),
|
|
3522
3992
|
status: document.status,
|
|
3993
|
+
...(document.reason ? { reason: document.reason } : {}),
|
|
3523
3994
|
})),
|
|
3524
3995
|
);
|
|
3525
3996
|
}
|
|
@@ -3549,16 +4020,3 @@ function collectOutstandingDiagnosticSummaryEntries(
|
|
|
3549
4020
|
a.file.localeCompare(b.file),
|
|
3550
4021
|
);
|
|
3551
4022
|
}
|
|
3552
|
-
|
|
3553
|
-
function evidenceStatusRank(status: DiagnosticEvidenceDocument["status"]): number {
|
|
3554
|
-
switch (status) {
|
|
3555
|
-
case "confirmed":
|
|
3556
|
-
return 1;
|
|
3557
|
-
case "unconfirmed":
|
|
3558
|
-
return 2;
|
|
3559
|
-
case "failed":
|
|
3560
|
-
return 3;
|
|
3561
|
-
case "removed":
|
|
3562
|
-
return 4;
|
|
3563
|
-
}
|
|
3564
|
-
}
|