@mrclrchtr/supi-lsp 9.1.2 → 11.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/README.md +88 -2
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/README.md +743 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/index.js +17 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/constants.js +184 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/parse.js +1425 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/picomatch.js +361 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/scan.js +403 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/utils.js +72 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/package.json +83 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/posix.js +3 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +4 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +11 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/file-associations.ts +190 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +22 -0
- package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/package.json +3 -3
- package/src/api.ts +1 -0
- package/src/client/client-diagnostic-host.ts +3 -0
- package/src/client/client-diagnostics.ts +6 -4
- package/src/client/client-request-enrollment.ts +66 -22
- package/src/client/client-semantic-input-barrier.ts +37 -5
- package/src/client/client.ts +136 -43
- package/src/manager/manager.ts +261 -22
- package/src/provider/refactor-planning.ts +13 -0
- package/src/provider/semantic-edit-discovery.ts +151 -0
- package/src/provider/semantic-edit-normalizer.ts +97 -129
- package/src/provider/semantic-edit-protocol.ts +132 -0
- package/src/session/runtime-controller.ts +8 -1
- package/src/session/runtime-registry.ts +7 -20
- package/src/session/runtime-rename.ts +172 -0
- package/src/session/workspace-lsp-runtime.ts +14 -0
- package/src/utils.ts +12 -11
|
@@ -56,12 +56,26 @@ export type SemanticReadinessResult =
|
|
|
56
56
|
processCrashRecovery?: ProcessCrashRecoveryReport;
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
/** Synchronized content evidence captured by one semantic mutation transaction. */
|
|
60
|
+
export interface RoutedMutationDocumentSnapshot {
|
|
61
|
+
/** Absolute path of the open document. */
|
|
62
|
+
readonly file: string;
|
|
63
|
+
/** Client version for the synchronized buffer. */
|
|
64
|
+
readonly version: number;
|
|
65
|
+
/** SHA-256 fingerprint of the text sent to the language server. */
|
|
66
|
+
readonly contentFingerprint: string;
|
|
67
|
+
/** SHA-256 fingerprint of the disk text read by the input barrier. */
|
|
68
|
+
readonly diskContentFingerprint: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
59
71
|
/** One mutation response and the exact provider roots from its semantic route. */
|
|
60
72
|
export interface RoutedMutationResponse<T> {
|
|
61
73
|
/** Provider response from the routed client. */
|
|
62
74
|
readonly value: T;
|
|
63
75
|
/** Roots that the routed client owns for this mutation response. */
|
|
64
76
|
readonly authorizedMutationRoots: readonly string[];
|
|
77
|
+
/** Request-scoped input snapshots for the affected documents, when captured. */
|
|
78
|
+
readonly documentSnapshots?: readonly RoutedMutationDocumentSnapshot[];
|
|
65
79
|
/** Honest reason when the routed server could not provide the operation. */
|
|
66
80
|
readonly reason?: string;
|
|
67
81
|
}
|
package/src/utils.ts
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
4
|
import * as path from "node:path";
|
|
5
|
+
import {
|
|
6
|
+
type CFamilyFileAssociationResolver,
|
|
7
|
+
defaultCFamilyLanguage,
|
|
8
|
+
} from "@mrclrchtr/supi-code-runtime/api";
|
|
5
9
|
|
|
6
10
|
// ── Language ID Detection ─────────────────────────────────────────────
|
|
7
11
|
|
|
@@ -19,15 +23,6 @@ const EXT_TO_LANGUAGE: Record<string, string> = {
|
|
|
19
23
|
rs: "rust",
|
|
20
24
|
go: "go",
|
|
21
25
|
mod: "go.mod",
|
|
22
|
-
c: "c",
|
|
23
|
-
h: "c",
|
|
24
|
-
cpp: "cpp",
|
|
25
|
-
hpp: "cpp",
|
|
26
|
-
cc: "cpp",
|
|
27
|
-
cxx: "cpp",
|
|
28
|
-
hxx: "cpp",
|
|
29
|
-
"c++": "cpp",
|
|
30
|
-
"h++": "cpp",
|
|
31
26
|
json: "json",
|
|
32
27
|
yaml: "yaml",
|
|
33
28
|
yml: "yaml",
|
|
@@ -58,8 +53,14 @@ const EXT_TO_LANGUAGE: Record<string, string> = {
|
|
|
58
53
|
zig: "zig",
|
|
59
54
|
};
|
|
60
55
|
|
|
61
|
-
/** Detect the LSP languageId from a file path. */
|
|
62
|
-
export function detectLanguageId(
|
|
56
|
+
/** Detect the LSP languageId from a file path and optional workspace snapshot. */
|
|
57
|
+
export function detectLanguageId(
|
|
58
|
+
filePath: string,
|
|
59
|
+
associations?: CFamilyFileAssociationResolver,
|
|
60
|
+
): string {
|
|
61
|
+
const cFamilyLanguage =
|
|
62
|
+
associations?.languageForFile(filePath) ?? defaultCFamilyLanguage(path.extname(filePath));
|
|
63
|
+
if (cFamilyLanguage) return cFamilyLanguage;
|
|
63
64
|
const ext = path.extname(filePath).slice(1).toLowerCase();
|
|
64
65
|
return EXT_TO_LANGUAGE[ext] ?? ext;
|
|
65
66
|
}
|