@mrclrchtr/supi-code-intelligence 1.8.0 → 1.9.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/README.md +17 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/README.md +13 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +97 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +53 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +30 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +76 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +186 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +11 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-messages.ts +119 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-provider-registry.ts +36 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +31 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context.ts +16 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +255 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +30 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path-utils.ts +40 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path.ts +2 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +170 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project.ts +15 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +86 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +29 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session.ts +4 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +15 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +41 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +226 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +9 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/substrate-types.ts +11 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/terminal.ts +60 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +116 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/types.ts +2 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +40 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +35 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +68 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +31 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +110 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/context.ts +41 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/runtime.ts +170 -0
- package/node_modules/@mrclrchtr/supi-core/README.md +3 -13
- package/node_modules/@mrclrchtr/supi-core/package.json +1 -7
- package/node_modules/@mrclrchtr/supi-lsp/README.md +20 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/README.md +13 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +97 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +57 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +30 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +76 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +186 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-messages.ts +119 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-provider-registry.ts +36 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +31 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context.ts +16 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +255 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +30 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path-utils.ts +40 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path.ts +2 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +170 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project.ts +15 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +86 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +29 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session.ts +4 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +15 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +41 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +226 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +9 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/substrate-types.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/terminal.ts +60 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +116 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/types.ts +2 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +40 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +35 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +68 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +31 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +110 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/context.ts +41 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/runtime.ts +170 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/README.md +3 -13
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -7
- package/node_modules/@mrclrchtr/supi-lsp/package.json +9 -6
- package/node_modules/@mrclrchtr/supi-lsp/src/handlers/session-lifecycle.ts +17 -7
- package/node_modules/@mrclrchtr/supi-lsp/src/lsp.ts +3 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/capability-index.ts +24 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/client-pool.ts +33 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/diagnostic-store.ts +51 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/recovery-coordinator.ts +37 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/workspace-router.ts +44 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +156 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registration.ts +39 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/tool/register-tools.ts +0 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +18 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/README.md +13 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +97 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +57 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +30 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +76 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +186 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +11 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-messages.ts +119 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-provider-registry.ts +36 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +31 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context.ts +16 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +255 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +30 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path-utils.ts +40 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +170 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project.ts +15 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +86 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +29 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session.ts +4 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +15 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +41 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +226 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +9 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/substrate-types.ts +11 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/terminal.ts +60 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +116 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/types.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +40 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +35 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +68 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +31 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +110 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/context.ts +41 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/runtime.ts +170 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/README.md +3 -13
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +9 -6
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/provider/tree-sitter-provider.ts +144 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/runtime-registration.ts +37 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tree-sitter.ts +18 -8
- package/package.json +8 -6
- package/src/api.ts +31 -16
- package/src/brief-focused.ts +2 -2
- package/src/brief.ts +2 -2
- package/src/code-intelligence.ts +13 -1
- package/src/index.ts +29 -16
- package/src/{architecture.ts → model.ts} +20 -61
- package/src/presentation/markdown/brief.ts +2 -2
- package/src/substrates/types.ts +22 -105
- package/src/targeting/resolve-file.ts +4 -7
- package/src/tool/execute-affected.ts +25 -1
- package/src/tool/execute-brief.ts +5 -4
- package/src/tool/execute-pattern.ts +4 -3
- package/src/tool/execute-relations.ts +22 -1
- package/src/types.ts +101 -3
- package/src/use-case/build-overview.ts +1 -1
- package/src/use-case/generate-affected.ts +25 -7
- package/src/use-case/generate-brief.ts +31 -14
- package/src/use-case/generate-pattern.ts +9 -9
- package/src/use-case/generate-relations.ts +66 -20
- package/src/use-case/types.ts +3 -3
- package/src/workspace/request-context.ts +139 -0
- package/node_modules/@mrclrchtr/supi-core/src/extension.ts +0 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/extension.ts +0 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/extension.ts +0 -1
- package/src/substrates/lsp-adapter.ts +0 -197
- package/src/substrates/tree-sitter-adapter.ts +0 -173
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// returns fully rendered content + details metadata.
|
|
4
4
|
|
|
5
5
|
import * as path from "node:path";
|
|
6
|
-
import { buildArchitectureModel, findModuleForPath, getDependents } from "../
|
|
6
|
+
import { buildArchitectureModel, findModuleForPath, getDependents } from "../model.ts";
|
|
7
7
|
import {
|
|
8
8
|
renderAffectedFileLevel,
|
|
9
9
|
renderAffectedSingle,
|
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
import { summarizePrioritySignalsForFiles } from "../prioritization-signals.ts";
|
|
12
12
|
import { resolveTarget } from "../resolve-target.ts";
|
|
13
13
|
import { isResolvedTargetGroup } from "../semantic-action-helpers.ts";
|
|
14
|
-
import type { SemanticSubstrate } from "../substrates/types.ts";
|
|
15
14
|
import type { ResolvedTarget, ResolvedTargetGroup } from "../target-resolution.ts";
|
|
16
15
|
import type { AffectedDetails, CodeIntelResult, ConfidenceMode } from "../types.ts";
|
|
16
|
+
import type { CodeProvider } from "../workspace/request-context.ts";
|
|
17
17
|
import {
|
|
18
18
|
aggregatePerTarget,
|
|
19
19
|
collectReferences,
|
|
@@ -31,6 +31,7 @@ export interface AffectedInput {
|
|
|
31
31
|
|
|
32
32
|
export interface AffectedDeps {
|
|
33
33
|
cwd: string;
|
|
34
|
+
provider: CodeProvider | null;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
/** Execute the affected use-case — target resolution, reference collection, analysis, and rendering. */
|
|
@@ -38,9 +39,26 @@ export async function executeAffected(
|
|
|
38
39
|
input: AffectedInput,
|
|
39
40
|
deps: AffectedDeps,
|
|
40
41
|
): Promise<CodeIntelResult> {
|
|
41
|
-
const semantic
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
const semantic = deps.provider;
|
|
43
|
+
if (!semantic) {
|
|
44
|
+
return {
|
|
45
|
+
content:
|
|
46
|
+
"**Error:** Affected analysis requires an active code provider (LSP). Enable LSP and retry.",
|
|
47
|
+
details: {
|
|
48
|
+
type: "affected" as const,
|
|
49
|
+
data: {
|
|
50
|
+
confidence: "unavailable",
|
|
51
|
+
directCount: 0,
|
|
52
|
+
downstreamCount: 0,
|
|
53
|
+
riskLevel: "low",
|
|
54
|
+
checkNext: [],
|
|
55
|
+
likelyTests: [],
|
|
56
|
+
omittedCount: 0,
|
|
57
|
+
nextQueries: ["Provide `file`, `line`, `character` or a `symbol` to resolve the target"],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
44
62
|
const target = await resolveTarget(input, deps.cwd, semantic);
|
|
45
63
|
|
|
46
64
|
if (typeof target === "string") {
|
|
@@ -90,7 +108,7 @@ async function executeSingleAffected(
|
|
|
90
108
|
symbolName: string,
|
|
91
109
|
input: AffectedInput,
|
|
92
110
|
cwd: string,
|
|
93
|
-
semantic:
|
|
111
|
+
semantic: CodeProvider,
|
|
94
112
|
): Promise<CodeIntelResult> {
|
|
95
113
|
const refs = await collectReferences(target, cwd, semantic);
|
|
96
114
|
const model = await buildArchitectureModel(cwd);
|
|
@@ -132,7 +150,7 @@ async function executeFileLevelAffected(
|
|
|
132
150
|
targetGroup: ResolvedTargetGroup,
|
|
133
151
|
input: AffectedInput,
|
|
134
152
|
cwd: string,
|
|
135
|
-
semantic:
|
|
153
|
+
semantic: CodeProvider,
|
|
136
154
|
): Promise<CodeIntelResult> {
|
|
137
155
|
const perTarget = await Promise.all(
|
|
138
156
|
targetGroup.targets.map(async (t) => ({
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
5
|
import * as path from "node:path";
|
|
6
|
-
import type { ArchitectureModel } from "../architecture.ts";
|
|
7
|
-
import { findModuleForPath } from "../architecture.ts";
|
|
8
6
|
import { generateFocusedBrief, generateProjectBrief } from "../brief.ts";
|
|
7
|
+
import type { ArchitectureModel } from "../model.ts";
|
|
8
|
+
import { findModuleForPath } from "../model.ts";
|
|
9
9
|
import { renderAnchoredBrief, renderSymbolBrief } from "../presentation/markdown/brief.ts";
|
|
10
10
|
import { normalizePath } from "../search-helpers.ts";
|
|
11
|
-
import type { SemanticSubstrate, StructuralSubstrate } from "../substrates/types.ts";
|
|
12
11
|
import type { TargetResolutionResult } from "../target-resolution.ts";
|
|
13
12
|
import { resolveSymbolTarget } from "../target-resolution.ts";
|
|
13
|
+
import type { CodeProvider } from "../workspace/request-context.ts";
|
|
14
14
|
import type { BriefDeps, BriefInput, BriefUseCaseResult } from "./types.ts";
|
|
15
15
|
|
|
16
16
|
// ── TreeSitterContext is an intermediate data shape from the use-case ──
|
|
@@ -100,7 +100,7 @@ async function executeAnchoredBrief(
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
const relPath = path.relative(deps.cwd, resolvedFile);
|
|
103
|
-
const context = await gatherTreeSitterContext(deps.
|
|
103
|
+
const context = await gatherTreeSitterContext(deps.provider, relPath, line, character);
|
|
104
104
|
|
|
105
105
|
const details = {
|
|
106
106
|
confidence: "structural" as const,
|
|
@@ -150,9 +150,24 @@ async function executeSymbolBrief(
|
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
const provider = deps.provider;
|
|
154
|
+
if (!provider) {
|
|
155
|
+
return {
|
|
156
|
+
content: `**Error:** Symbol discovery requires an active code provider. Use \`file\` + coordinates, or enable LSP and retry.`,
|
|
157
|
+
details: {
|
|
158
|
+
confidence: "unavailable",
|
|
159
|
+
focusTarget: symbol,
|
|
160
|
+
startHere: [],
|
|
161
|
+
publicSurfaces: [],
|
|
162
|
+
dependencySummary: null,
|
|
163
|
+
omittedCount: 0,
|
|
164
|
+
nextQueries: [
|
|
165
|
+
"Use `file` + coordinates for a precise symbol brief, or enable LSP and retry",
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
const resolved = await resolveSymbolTarget(symbol, deps.cwd, provider, {
|
|
156
171
|
path: scopePath,
|
|
157
172
|
});
|
|
158
173
|
|
|
@@ -196,7 +211,7 @@ async function executeSymbolBrief(
|
|
|
196
211
|
|
|
197
212
|
const mod = findModuleForPath(deps.model, target.file);
|
|
198
213
|
const context = await gatherTreeSitterContext(
|
|
199
|
-
deps.
|
|
214
|
+
deps.provider,
|
|
200
215
|
relPath,
|
|
201
216
|
target.displayLine,
|
|
202
217
|
target.displayCharacter,
|
|
@@ -233,7 +248,7 @@ async function executeSymbolBrief(
|
|
|
233
248
|
// ── Helpers ───────────────────────────────────────────────────────────
|
|
234
249
|
|
|
235
250
|
async function gatherTreeSitterContext(
|
|
236
|
-
|
|
251
|
+
provider: CodeProvider | null,
|
|
237
252
|
relPath: string,
|
|
238
253
|
line: number,
|
|
239
254
|
character: number,
|
|
@@ -243,8 +258,10 @@ async function gatherTreeSitterContext(
|
|
|
243
258
|
let imports: TreeSitterContext["imports"] = [];
|
|
244
259
|
let exports: TreeSitterContext["exports"] = [];
|
|
245
260
|
|
|
261
|
+
if (!provider) return { nodeInfo, outline, imports, exports };
|
|
262
|
+
|
|
246
263
|
try {
|
|
247
|
-
const nodeResult = await
|
|
264
|
+
const nodeResult = await provider.nodeAt(relPath, line, character);
|
|
248
265
|
if (nodeResult.kind === "success") {
|
|
249
266
|
nodeInfo = {
|
|
250
267
|
type: nodeResult.data.type,
|
|
@@ -254,7 +271,7 @@ async function gatherTreeSitterContext(
|
|
|
254
271
|
};
|
|
255
272
|
}
|
|
256
273
|
|
|
257
|
-
const outlineResult = await
|
|
274
|
+
const outlineResult = await provider.outline(relPath);
|
|
258
275
|
if (outlineResult.kind === "success") {
|
|
259
276
|
outline = outlineResult.data.map((item) => ({
|
|
260
277
|
name: item.name,
|
|
@@ -264,12 +281,12 @@ async function gatherTreeSitterContext(
|
|
|
264
281
|
}));
|
|
265
282
|
}
|
|
266
283
|
|
|
267
|
-
const importsResult = await
|
|
284
|
+
const importsResult = await provider.imports(relPath);
|
|
268
285
|
if (importsResult.kind === "success") {
|
|
269
286
|
imports = importsResult.data;
|
|
270
287
|
}
|
|
271
288
|
|
|
272
|
-
const exportsResult = await
|
|
289
|
+
const exportsResult = await provider.exports(relPath);
|
|
273
290
|
if (exportsResult.kind === "success") {
|
|
274
291
|
exports = exportsResult.data.map((item) => ({
|
|
275
292
|
name: item.name,
|
|
@@ -277,7 +294,7 @@ async function gatherTreeSitterContext(
|
|
|
277
294
|
}));
|
|
278
295
|
}
|
|
279
296
|
} catch {
|
|
280
|
-
//
|
|
297
|
+
// Provider not available
|
|
281
298
|
}
|
|
282
299
|
|
|
283
300
|
return { nodeInfo, outline, imports, exports };
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
import type { CodeQueryParams } from "../query-params.ts";
|
|
14
14
|
import type { RgMatch } from "../search-helpers.ts";
|
|
15
15
|
import { normalizePath, runRipgrep, runRipgrepDetailed } from "../search-helpers.ts";
|
|
16
|
-
import type { StructuralSubstrate } from "../substrates/types.ts";
|
|
17
16
|
import type { CodeIntelResult, SearchDetails } from "../types.ts";
|
|
17
|
+
import type { CodeProvider } from "../workspace/request-context.ts";
|
|
18
18
|
|
|
19
19
|
export interface PatternInput {
|
|
20
20
|
pattern: string;
|
|
@@ -28,7 +28,7 @@ export interface PatternInput {
|
|
|
28
28
|
|
|
29
29
|
export interface PatternDeps {
|
|
30
30
|
cwd: string;
|
|
31
|
-
|
|
31
|
+
provider: CodeProvider | null;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/** Execute the pattern search use-case. */
|
|
@@ -56,7 +56,7 @@ export async function executePattern(
|
|
|
56
56
|
deps.cwd,
|
|
57
57
|
relScope,
|
|
58
58
|
maxResults,
|
|
59
|
-
deps.
|
|
59
|
+
deps.provider,
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -117,9 +117,9 @@ async function executeStructuredSearch(
|
|
|
117
117
|
cwd: string,
|
|
118
118
|
relScope: string,
|
|
119
119
|
_maxResults: number,
|
|
120
|
-
|
|
120
|
+
provider: CodeProvider | null,
|
|
121
121
|
): Promise<CodeIntelResult> {
|
|
122
|
-
if (!
|
|
122
|
+
if (!provider) {
|
|
123
123
|
return {
|
|
124
124
|
content: `**Error:** Structured ${kind} search requires tree-sitter, which is not available.`,
|
|
125
125
|
details: undefined,
|
|
@@ -131,7 +131,7 @@ async function executeStructuredSearch(
|
|
|
131
131
|
scopePath,
|
|
132
132
|
cwd,
|
|
133
133
|
relScope,
|
|
134
|
-
|
|
134
|
+
provider,
|
|
135
135
|
);
|
|
136
136
|
|
|
137
137
|
if (typeof structured === "string") {
|
|
@@ -150,7 +150,7 @@ async function executeStructuredSearch(
|
|
|
150
150
|
input.pattern,
|
|
151
151
|
kind as "definition" | "export" | "import",
|
|
152
152
|
relScope,
|
|
153
|
-
|
|
153
|
+
provider,
|
|
154
154
|
structured ?? undefined,
|
|
155
155
|
);
|
|
156
156
|
return {
|
|
@@ -253,7 +253,7 @@ function getRegexMatches(options: {
|
|
|
253
253
|
export async function executePatternAction(
|
|
254
254
|
params: CodeQueryParams,
|
|
255
255
|
cwd: string,
|
|
256
|
-
|
|
256
|
+
provider?: CodeProvider | null,
|
|
257
257
|
): Promise<CodeIntelResult> {
|
|
258
258
|
return executePattern(
|
|
259
259
|
{
|
|
@@ -265,6 +265,6 @@ export async function executePatternAction(
|
|
|
265
265
|
contextLines: params.contextLines,
|
|
266
266
|
summary: params.summary,
|
|
267
267
|
},
|
|
268
|
-
{ cwd,
|
|
268
|
+
{ cwd, provider: provider ?? null },
|
|
269
269
|
);
|
|
270
270
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Relations orchestration use-case — dispatches by kind (callers/callees/implementations),
|
|
2
|
-
// coordinates target resolution and
|
|
2
|
+
// coordinates target resolution and provider access, and returns fully rendered results.
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import {
|
|
5
5
|
renderCalleesResult,
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
import { resolveTarget } from "../resolve-target.ts";
|
|
10
10
|
import { isInProjectPath, uriToFile } from "../search-helpers.ts";
|
|
11
11
|
import { isResolvedTargetGroup } from "../semantic-action-helpers.ts";
|
|
12
|
-
import type { SemanticSubstrate, StructuralSubstrate } from "../substrates/types.ts";
|
|
13
12
|
import type { ResolvedTarget, ResolvedTargetGroup } from "../target-resolution.ts";
|
|
14
13
|
import type { CodeIntelResult, SearchDetails } from "../types.ts";
|
|
14
|
+
import type { CodeProvider } from "../workspace/request-context.ts";
|
|
15
15
|
import { aggregatePerTarget, collectReferences } from "./support/semantic-references.ts";
|
|
16
16
|
export interface RelationsInput {
|
|
17
17
|
kind: "callers" | "callees" | "implementations";
|
|
@@ -26,6 +26,7 @@ export interface RelationsInput {
|
|
|
26
26
|
type RelationsResolutionParams = Omit<RelationsInput, "kind">;
|
|
27
27
|
export interface RelationsDeps {
|
|
28
28
|
cwd: string;
|
|
29
|
+
provider: CodeProvider | null;
|
|
29
30
|
}
|
|
30
31
|
export async function executeRelations(
|
|
31
32
|
input: RelationsInput,
|
|
@@ -45,9 +46,23 @@ async function executeCallers(
|
|
|
45
46
|
input: RelationsResolutionParams,
|
|
46
47
|
deps: RelationsDeps,
|
|
47
48
|
): Promise<CodeIntelResult> {
|
|
48
|
-
const semantic
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
const semantic = deps.provider;
|
|
50
|
+
if (!semantic) {
|
|
51
|
+
return {
|
|
52
|
+
content:
|
|
53
|
+
"**Error:** Caller discovery requires an active code provider (LSP). Enable LSP and retry.",
|
|
54
|
+
details: {
|
|
55
|
+
type: "search" as const,
|
|
56
|
+
data: {
|
|
57
|
+
confidence: "unavailable",
|
|
58
|
+
scope: null,
|
|
59
|
+
candidateCount: 0,
|
|
60
|
+
omittedCount: 0,
|
|
61
|
+
nextQueries: ["Provide `file`, `line`, `character` or a `symbol` to resolve the target"],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
51
66
|
const target = await resolveTarget(input, deps.cwd, semantic);
|
|
52
67
|
if (typeof target === "string") {
|
|
53
68
|
return {
|
|
@@ -73,7 +88,7 @@ async function executeSingleCallers(
|
|
|
73
88
|
target: ResolvedTarget,
|
|
74
89
|
input: RelationsResolutionParams,
|
|
75
90
|
cwd: string,
|
|
76
|
-
semantic:
|
|
91
|
+
semantic: CodeProvider,
|
|
77
92
|
): Promise<CodeIntelResult> {
|
|
78
93
|
const result = await collectReferences(target, cwd, semantic);
|
|
79
94
|
if (result.refs.length > 0) {
|
|
@@ -125,7 +140,7 @@ async function executeFileLevelCallers(
|
|
|
125
140
|
targetGroup: ResolvedTargetGroup,
|
|
126
141
|
input: RelationsResolutionParams,
|
|
127
142
|
cwd: string,
|
|
128
|
-
semantic:
|
|
143
|
+
semantic: CodeProvider,
|
|
129
144
|
): Promise<CodeIntelResult> {
|
|
130
145
|
const aggregated = await aggregatePerTarget(targetGroup.targets, (target) =>
|
|
131
146
|
collectReferences(target, cwd, semantic),
|
|
@@ -169,15 +184,32 @@ async function executeFileLevelCallers(
|
|
|
169
184
|
"Use `file` + coordinates to drill into one symbol precisely",
|
|
170
185
|
],
|
|
171
186
|
};
|
|
172
|
-
return {
|
|
187
|
+
return {
|
|
188
|
+
content: lines.join("\n"),
|
|
189
|
+
details: { type: "search" as const, data: details },
|
|
190
|
+
};
|
|
173
191
|
}
|
|
174
192
|
async function executeImplementations(
|
|
175
193
|
input: RelationsResolutionParams,
|
|
176
194
|
deps: RelationsDeps,
|
|
177
195
|
): Promise<CodeIntelResult> {
|
|
178
|
-
const semantic
|
|
179
|
-
|
|
180
|
-
|
|
196
|
+
const semantic = deps.provider;
|
|
197
|
+
if (!semantic) {
|
|
198
|
+
return {
|
|
199
|
+
content:
|
|
200
|
+
"**Error:** Implementation discovery requires an active code provider (LSP). Enable LSP and retry.",
|
|
201
|
+
details: {
|
|
202
|
+
type: "search" as const,
|
|
203
|
+
data: {
|
|
204
|
+
confidence: "unavailable",
|
|
205
|
+
scope: null,
|
|
206
|
+
candidateCount: 0,
|
|
207
|
+
omittedCount: 0,
|
|
208
|
+
nextQueries: ["Provide `file`, `line`, `character` or a `symbol` to resolve the target"],
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
}
|
|
181
213
|
const target = await resolveTarget(input, deps.cwd, semantic);
|
|
182
214
|
if (typeof target === "string") {
|
|
183
215
|
return {
|
|
@@ -225,7 +257,10 @@ async function executeImplementations(
|
|
|
225
257
|
"`code_brief` on containing modules for deeper context",
|
|
226
258
|
],
|
|
227
259
|
};
|
|
228
|
-
return {
|
|
260
|
+
return {
|
|
261
|
+
content,
|
|
262
|
+
details: { type: "search" as const, data: searchDetails },
|
|
263
|
+
};
|
|
229
264
|
}
|
|
230
265
|
return {
|
|
231
266
|
content: target.name
|
|
@@ -287,13 +322,24 @@ async function executeCallees(
|
|
|
287
322
|
input: RelationsResolutionParams,
|
|
288
323
|
deps: RelationsDeps,
|
|
289
324
|
): Promise<CodeIntelResult> {
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
325
|
+
const provider = deps.provider;
|
|
326
|
+
if (!provider) {
|
|
327
|
+
return {
|
|
328
|
+
content:
|
|
329
|
+
"**Error:** Callee discovery requires an active code provider. Enable LSP and tree-sitter and retry.",
|
|
330
|
+
details: {
|
|
331
|
+
type: "search" as const,
|
|
332
|
+
data: {
|
|
333
|
+
confidence: "unavailable",
|
|
334
|
+
scope: null,
|
|
335
|
+
candidateCount: 0,
|
|
336
|
+
omittedCount: 0,
|
|
337
|
+
nextQueries: ["Provide `file`, `line`, `character` or a `symbol` to resolve the target"],
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
const target = await resolveTarget(input, deps.cwd, provider);
|
|
297
343
|
if (typeof target === "string") {
|
|
298
344
|
return {
|
|
299
345
|
content: target,
|
|
@@ -326,7 +372,7 @@ async function executeCallees(
|
|
|
326
372
|
}
|
|
327
373
|
const relPath = path.relative(deps.cwd, target.file);
|
|
328
374
|
try {
|
|
329
|
-
const result = await
|
|
375
|
+
const result = await provider.calleesAt(relPath, target.displayLine, target.displayCharacter);
|
|
330
376
|
if (result.kind !== "success") {
|
|
331
377
|
return {
|
|
332
378
|
content: `No callee data available for ${relPath}:${target.displayLine}:${target.displayCharacter}.\n\nUse \`tree_sitter_callees\` with \`file\`, \`line\`, and \`character\` for structural drill-down.`,
|
package/src/use-case/types.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Shared typed data interfaces between use-case and presentation layers.
|
|
2
2
|
|
|
3
|
-
import type { ArchitectureModel } from "../
|
|
4
|
-
import type { StructuralSubstrate } from "../substrates/types.ts";
|
|
3
|
+
import type { ArchitectureModel } from "../model.ts";
|
|
5
4
|
import type { BriefDetails } from "../types.ts";
|
|
5
|
+
import type { CodeProvider } from "../workspace/request-context.ts";
|
|
6
6
|
|
|
7
7
|
// ── Overview use-case ────────────────────────────────────────────────
|
|
8
8
|
|
|
@@ -33,7 +33,7 @@ export type BriefInput =
|
|
|
33
33
|
|
|
34
34
|
export interface BriefDeps {
|
|
35
35
|
model: ArchitectureModel | null;
|
|
36
|
-
|
|
36
|
+
provider: CodeProvider | null;
|
|
37
37
|
cwd: string;
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Central access point for code-intelligence to read shared workspace
|
|
3
|
+
* runtime capability state from @mrclrchtr/supi-code-runtime.
|
|
4
|
+
*
|
|
5
|
+
* Replaces the old local provider registry/wiring layer. The substrate
|
|
6
|
+
* packages (supi-lsp, supi-tree-sitter) publish their capabilities into
|
|
7
|
+
* the shared runtime via getDefaultWorkspaceRuntime(). This module reads
|
|
8
|
+
* that same singleton to provide per-cwd capability state to the
|
|
9
|
+
* code_* tool use-cases.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
type CodeLocation,
|
|
14
|
+
type CodePosition,
|
|
15
|
+
type CodeResult,
|
|
16
|
+
type CodeSymbol,
|
|
17
|
+
getDefaultWorkspaceRuntime,
|
|
18
|
+
type SemanticProvider,
|
|
19
|
+
type StructuralProvider,
|
|
20
|
+
} from "@mrclrchtr/supi-code-runtime/api";
|
|
21
|
+
import type { CalleesData, ExportData, ImportData, NodeAtData, OutlineData } from "../types.ts";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Unified code analysis provider combining semantic (LSP-backed) and
|
|
25
|
+
* structural (tree-sitter-backed) operations.
|
|
26
|
+
*
|
|
27
|
+
* This is the same shape as the old CodeProvider interface, now backed
|
|
28
|
+
* by the shared workspace runtime instead of a local registry.
|
|
29
|
+
*/
|
|
30
|
+
export interface CodeProvider extends SemanticProvider, StructuralProvider {}
|
|
31
|
+
|
|
32
|
+
/** Availability state for the code provider in a workspace. */
|
|
33
|
+
export type CodeProviderState =
|
|
34
|
+
| { kind: "ready"; provider: CodeProvider }
|
|
35
|
+
| { kind: "unavailable"; reason: string };
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get the code provider state for a workspace cwd from the shared runtime.
|
|
39
|
+
*
|
|
40
|
+
* Returns `ready` if at least one capability (semantic or structural) is
|
|
41
|
+
* available. The provider object delegates to whichever capability is
|
|
42
|
+
* present — null / unsupported-language for the missing ones.
|
|
43
|
+
*
|
|
44
|
+
* Returns `unavailable` if no capabilities are registered.
|
|
45
|
+
*/
|
|
46
|
+
export function getCodeProvider(cwd: string): CodeProviderState {
|
|
47
|
+
const runtime = getDefaultWorkspaceRuntime();
|
|
48
|
+
const ws = runtime.getWorkspace(cwd);
|
|
49
|
+
|
|
50
|
+
const hasSemantic = ws.semantic.state.kind === "ready" && ws.semantic.provider !== null;
|
|
51
|
+
const hasStructural = ws.structural.state.kind === "ready" && ws.structural.provider !== null;
|
|
52
|
+
|
|
53
|
+
if (!hasSemantic && !hasStructural) {
|
|
54
|
+
return {
|
|
55
|
+
kind: "unavailable",
|
|
56
|
+
reason: "No code provider initialized for this workspace",
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
kind: "ready",
|
|
62
|
+
provider: createCompositeProvider(
|
|
63
|
+
(hasSemantic ? ws.semantic.provider : null) as SemanticProvider | null,
|
|
64
|
+
(hasStructural ? ws.structural.provider : null) as StructuralProvider | null,
|
|
65
|
+
),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Create a single CodeProvider that delegates semantic methods to the
|
|
71
|
+
* semantic (LSP) provider and structural methods to the structural
|
|
72
|
+
* (tree-sitter) provider.
|
|
73
|
+
*/
|
|
74
|
+
function createCompositeProvider(
|
|
75
|
+
semantic: SemanticProvider | null,
|
|
76
|
+
structural: StructuralProvider | null,
|
|
77
|
+
): CodeProvider {
|
|
78
|
+
return {
|
|
79
|
+
// Semantic methods
|
|
80
|
+
async references(filePath: string, position: CodePosition): Promise<CodeLocation[] | null> {
|
|
81
|
+
return semantic?.references(filePath, position) ?? null;
|
|
82
|
+
},
|
|
83
|
+
async implementation(filePath: string, position: CodePosition): Promise<CodeLocation[] | null> {
|
|
84
|
+
return semantic?.implementation(filePath, position) ?? null;
|
|
85
|
+
},
|
|
86
|
+
async documentSymbols(filePath: string): Promise<CodeSymbol[] | null> {
|
|
87
|
+
return semantic?.documentSymbols(filePath) ?? null;
|
|
88
|
+
},
|
|
89
|
+
async workspaceSymbols(query: string): Promise<CodeSymbol[] | null> {
|
|
90
|
+
return semantic?.workspaceSymbols(query) ?? null;
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
// Structural methods
|
|
94
|
+
async calleesAt(
|
|
95
|
+
file: string,
|
|
96
|
+
line: number,
|
|
97
|
+
character: number,
|
|
98
|
+
): Promise<CodeResult<CalleesData>> {
|
|
99
|
+
return (
|
|
100
|
+
structural?.calleesAt(file, line, character) ?? {
|
|
101
|
+
kind: "unavailable",
|
|
102
|
+
message: "Structural analysis not available. Use tree_sitter_callees.",
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
},
|
|
106
|
+
async exports(file: string): Promise<CodeResult<ExportData[]>> {
|
|
107
|
+
return (
|
|
108
|
+
structural?.exports(file) ?? {
|
|
109
|
+
kind: "unavailable",
|
|
110
|
+
message: "Structural analysis not available. Use tree_sitter_exports.",
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
},
|
|
114
|
+
async outline(file: string): Promise<CodeResult<OutlineData[]>> {
|
|
115
|
+
return (
|
|
116
|
+
structural?.outline(file) ?? {
|
|
117
|
+
kind: "unavailable",
|
|
118
|
+
message: "Structural analysis not available. Use tree_sitter_outline.",
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
},
|
|
122
|
+
async imports(file: string): Promise<CodeResult<ImportData[]>> {
|
|
123
|
+
return (
|
|
124
|
+
structural?.imports(file) ?? {
|
|
125
|
+
kind: "unavailable",
|
|
126
|
+
message: "Structural analysis not available. Use tree_sitter_imports.",
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
},
|
|
130
|
+
async nodeAt(file: string, line: number, character: number): Promise<CodeResult<NodeAtData>> {
|
|
131
|
+
return (
|
|
132
|
+
structural?.nodeAt(file, line, character) ?? {
|
|
133
|
+
kind: "unavailable",
|
|
134
|
+
message: "Structural analysis not available. Use tree_sitter_node_at.",
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { registerSettingsCommand as default } from "./settings/settings-command.ts";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { registerSettingsCommand as default } from "./settings/settings-command.ts";
|
package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/extension.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { registerSettingsCommand as default } from "./settings/settings-command.ts";
|