@shipwithai/loopnote 0.0.0-stage → 2.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/LICENSE +21 -0
- package/README.md +202 -2
- package/THIRD_PARTY_NOTICES.md +580 -0
- package/dist/bin/loopnote.mjs +5 -0
- package/dist/cli/confirm.js +38 -0
- package/dist/cli/picker.js +342 -0
- package/dist/cli/request.js +120 -0
- package/dist/cli/run.js +970 -0
- package/dist/contracts/api.js +640 -0
- package/dist/contracts/comparison.js +178 -0
- package/dist/contracts/draft.js +606 -0
- package/dist/contracts/request.js +124 -0
- package/dist/domain/anchor.js +122 -0
- package/dist/domain/comparison-key.js +51 -0
- package/dist/domain/errors.js +43 -0
- package/dist/domain/path-bytes.js +82 -0
- package/dist/domain/product-identity.js +66 -0
- package/dist/domain/source.js +4 -0
- package/dist/draft/mutate-draft.js +87 -0
- package/dist/export/render-review-markdown.js +163 -0
- package/dist/export/review-export.js +273 -0
- package/dist/git/availability.js +92 -0
- package/dist/git/candidates.js +413 -0
- package/dist/git/comparison.js +263 -0
- package/dist/git/exact-patch.js +702 -0
- package/dist/git/ignore-status.js +23 -0
- package/dist/git/inventory.js +160 -0
- package/dist/git/numstat.js +111 -0
- package/dist/git/objects.js +95 -0
- package/dist/git/raw-diff.js +84 -0
- package/dist/git/repository.js +144 -0
- package/dist/git/runner.js +145 -0
- package/dist/git/selector-drift.js +169 -0
- package/dist/git/standalone-resolution.js +174 -0
- package/dist/git/worktree-content.js +97 -0
- package/dist/git/worktree-inventory.js +391 -0
- package/dist/native/directory_exchange.node +0 -0
- package/dist/server/app.js +171 -0
- package/dist/server/attached-completion.js +85 -0
- package/dist/server/capabilities.js +1572 -0
- package/dist/server/draft-loader.js +134 -0
- package/dist/server/draft-recovery.js +5 -0
- package/dist/server/draft-store.js +380 -0
- package/dist/server/export-store.js +291 -0
- package/dist/server/gitignore-capability.js +197 -0
- package/dist/server/image-content.js +101 -0
- package/dist/server/lifecycle.js +72 -0
- package/dist/server/native-exchange-capability.js +45 -0
- package/dist/server/patch-snapshot.js +500 -0
- package/dist/server/routes.js +418 -0
- package/dist/server/security.js +123 -0
- package/dist/server/snapshot-fs.js +58 -0
- package/dist/server/support-client.js +76 -0
- package/dist/server/support-store.js +194 -0
- package/dist/server/worktree-snapshot.js +553 -0
- package/dist/web/assets/abap-08VXUWAP.js +1 -0
- package/dist/web/assets/apex-BWPQTe0t.js +1 -0
- package/dist/web/assets/azcli-Bc_sGQ0U.js +1 -0
- package/dist/web/assets/bat-i0X4ZdIN.js +1 -0
- package/dist/web/assets/bicep-B5-_aFwp.js +2 -0
- package/dist/web/assets/cameligo-DMUM7wLl.js +1 -0
- package/dist/web/assets/clojure-Cm7r79vr.js +1 -0
- package/dist/web/assets/codicon-ngg6Pgfi.ttf +0 -0
- package/dist/web/assets/coffee-Ba7i2nA0.js +1 -0
- package/dist/web/assets/cpp-C7h46wYY.js +1 -0
- package/dist/web/assets/csharp-BKxtCVv1.js +1 -0
- package/dist/web/assets/csp-bTuwJoIa.js +1 -0
- package/dist/web/assets/css-DIMkf-bt.js +3 -0
- package/dist/web/assets/css.worker-yKcq13f2.js +89 -0
- package/dist/web/assets/cssMode-CpBTfhMg.js +1 -0
- package/dist/web/assets/cypher-CVaqCwHa.js +1 -0
- package/dist/web/assets/dart-onAF5SnQ.js +1 -0
- package/dist/web/assets/dockerfile-DZFCIeNp.js +1 -0
- package/dist/web/assets/ecl-D05T4iGw.js +1 -0
- package/dist/web/assets/editor.worker-tytyn86m.js +26 -0
- package/dist/web/assets/elixir-6RTg0lbw.js +1 -0
- package/dist/web/assets/flow9-C5_-GSwl.js +1 -0
- package/dist/web/assets/freemarker2-skQ63wb7.js +3 -0
- package/dist/web/assets/fsharp-C8Ef5oNN.js +1 -0
- package/dist/web/assets/go-C-y9NEjX.js +1 -0
- package/dist/web/assets/graphql-fmXr3nnJ.js +1 -0
- package/dist/web/assets/handlebars-CqvPAZY8.js +1 -0
- package/dist/web/assets/hcl-CpzslTdj.js +1 -0
- package/dist/web/assets/html-BDAqstpo.js +1 -0
- package/dist/web/assets/html.worker-DSJ9zmd7.js +502 -0
- package/dist/web/assets/htmlMode-BRYA3pnT.js +1 -0
- package/dist/web/assets/index-CCeYBqPo.js +1111 -0
- package/dist/web/assets/index-CRj9ojWJ.css +1 -0
- package/dist/web/assets/ini-sBoK_t0W.js +1 -0
- package/dist/web/assets/java-BEtHBSE6.js +1 -0
- package/dist/web/assets/javascript-1Ywytw67.js +1 -0
- package/dist/web/assets/json.worker-Oa9UrkKE.js +58 -0
- package/dist/web/assets/jsonMode-AO1C_0kX.js +7 -0
- package/dist/web/assets/julia-Bri6UV-V.js +1 -0
- package/dist/web/assets/kotlin-BOotOW0E.js +1 -0
- package/dist/web/assets/less-B9JPFI3C.js +2 -0
- package/dist/web/assets/lexon-CfSJPG6W.js +1 -0
- package/dist/web/assets/liquid-CkkqyyGc.js +1 -0
- package/dist/web/assets/lspLanguageFeatures-CYOFEMZp.js +4 -0
- package/dist/web/assets/lua-CsQS60Ue.js +1 -0
- package/dist/web/assets/m3-D-oSqn_W.js +1 -0
- package/dist/web/assets/markdown-Cimd5fb3.js +1 -0
- package/dist/web/assets/mdx-Bd3Wlfqw.js +1 -0
- package/dist/web/assets/mips-CIPQ_RoX.js +1 -0
- package/dist/web/assets/msdax-DauUninz.js +1 -0
- package/dist/web/assets/mysql-SOo6toE5.js +1 -0
- package/dist/web/assets/objective-c-FvmIjYaQ.js +1 -0
- package/dist/web/assets/pascal-DrH0SRf2.js +1 -0
- package/dist/web/assets/pascaligo-D-ptJ9y-.js +1 -0
- package/dist/web/assets/perl-oz_6vUea.js +1 -0
- package/dist/web/assets/pgsql-DTj74zXo.js +1 -0
- package/dist/web/assets/php-nr791fC2.js +1 -0
- package/dist/web/assets/pla-CopQ2nXW.js +1 -0
- package/dist/web/assets/postiats-43DmfD33.js +1 -0
- package/dist/web/assets/powerquery-D3hlyOfw.js +1 -0
- package/dist/web/assets/powershell-DmHpPYUd.js +1 -0
- package/dist/web/assets/protobuf-C531GsRP.js +2 -0
- package/dist/web/assets/pug-Z5eAx3Zn.js +1 -0
- package/dist/web/assets/python-CET4IumD.js +1 -0
- package/dist/web/assets/qsharp-DkqhCAOL.js +1 -0
- package/dist/web/assets/r-BwWrilGY.js +1 -0
- package/dist/web/assets/razor-d-reaHeT.js +1 -0
- package/dist/web/assets/redis-ClamHrr6.js +1 -0
- package/dist/web/assets/redshift-DT7zqm-g.js +1 -0
- package/dist/web/assets/restructuredtext-BYgofb2h.js +1 -0
- package/dist/web/assets/ruby-DezsRK8O.js +1 -0
- package/dist/web/assets/rust-DdL9SqIa.js +1 -0
- package/dist/web/assets/sb-CcwsVR0C.js +1 -0
- package/dist/web/assets/scala-DHpiXF5c.js +1 -0
- package/dist/web/assets/scheme-BeGwcela.js +1 -0
- package/dist/web/assets/scss-gp-XZpBa.js +3 -0
- package/dist/web/assets/shell-CC2rA5mh.js +1 -0
- package/dist/web/assets/solidity-BEEn4gHE.js +1 -0
- package/dist/web/assets/sophia-CRfGWb83.js +1 -0
- package/dist/web/assets/sparql-D_Lu-MrJ.js +1 -0
- package/dist/web/assets/sql-NEE52Syq.js +1 -0
- package/dist/web/assets/st-DbInun42.js +1 -0
- package/dist/web/assets/swift-Bxkupp3x.js +1 -0
- package/dist/web/assets/systemverilog-Bz4Y3fRF.js +1 -0
- package/dist/web/assets/tcl-DISqw1ZD.js +1 -0
- package/dist/web/assets/ts.worker-BtjBFNHX.js +67734 -0
- package/dist/web/assets/tsMode-DLxSAtkD.js +11 -0
- package/dist/web/assets/twig-De2hgUGE.js +1 -0
- package/dist/web/assets/typescript-DprEVA-S.js +1 -0
- package/dist/web/assets/typespec-B8J7ngcE.js +1 -0
- package/dist/web/assets/vb-DV3o63ZY.js +1 -0
- package/dist/web/assets/wgsl-DpFanUEy.js +298 -0
- package/dist/web/assets/xml-B7ZwKOhJ.js +1 -0
- package/dist/web/assets/yaml-OQ9Asg7B.js +1 -0
- package/dist/web/index.html +14 -0
- package/package.json +87 -4
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { lstat, mkdir, rename } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { ChangedFileSchema, GitObjectIdSchema, } from '../contracts/comparison.js';
|
|
6
|
+
import { decodeBase64url } from '../domain/path-bytes.js';
|
|
7
|
+
import { blobOid } from '../git/exact-patch.js';
|
|
8
|
+
import { createObjectReader } from '../git/objects.js';
|
|
9
|
+
import { createGitRunner } from '../git/runner.js';
|
|
10
|
+
import { createWorktreeChangedFileInventory } from '../git/worktree-inventory.js';
|
|
11
|
+
import { classifyStandaloneGitState, createStandaloneChangedFileInventory, resolveStandaloneArguments, } from '../git/standalone-resolution.js';
|
|
12
|
+
import { resolveWorktreeSideContent } from '../git/worktree-content.js';
|
|
13
|
+
import { boundedFileBytes, digest, isMissing, syncDirectory, writeOwned, MAX_SIDE_BYTES } from './snapshot-fs.js';
|
|
14
|
+
const SNAPSHOT_VERSION = 1;
|
|
15
|
+
const MAX_SNAPSHOT_FILES = 10_000;
|
|
16
|
+
const MAX_SNAPSHOT_BYTES = 64 * 1024 * 1024;
|
|
17
|
+
const MAX_MANIFEST_BYTES = 16 * 1024 * 1024;
|
|
18
|
+
const strictText = new TextDecoder('utf-8', { fatal: true });
|
|
19
|
+
const WorktreeExactPathSchema = z.strictObject({
|
|
20
|
+
bytesBase64url: z.string().regex(/^[A-Za-z0-9_-]+$/u),
|
|
21
|
+
display: z.string(),
|
|
22
|
+
utf8: z.string().optional(),
|
|
23
|
+
}).readonly();
|
|
24
|
+
export const WorktreeSnapshotSideSchema = z.discriminatedUnion('exists', [
|
|
25
|
+
z.strictObject({
|
|
26
|
+
exists: z.literal(false),
|
|
27
|
+
mode: z.string().regex(/^[0-7]{6}$/u),
|
|
28
|
+
blobOid: GitObjectIdSchema,
|
|
29
|
+
byteLength: z.literal(0),
|
|
30
|
+
}).readonly(),
|
|
31
|
+
z.strictObject({
|
|
32
|
+
exists: z.literal(true),
|
|
33
|
+
path: WorktreeExactPathSchema,
|
|
34
|
+
mode: z.string().regex(/^[0-7]{6}$/u),
|
|
35
|
+
blobOid: GitObjectIdSchema,
|
|
36
|
+
language: z.string().min(1),
|
|
37
|
+
byteLength: z.number().int().nonnegative().max(MAX_SIDE_BYTES),
|
|
38
|
+
sha256: z.string().regex(/^[0-9a-f]{64}$/u),
|
|
39
|
+
}).readonly(),
|
|
40
|
+
]).readonly();
|
|
41
|
+
export const WorktreeSnapshotEntrySchema = z.strictObject({
|
|
42
|
+
file: ChangedFileSchema,
|
|
43
|
+
preimage: WorktreeSnapshotSideSchema,
|
|
44
|
+
postimage: WorktreeSnapshotSideSchema,
|
|
45
|
+
captureStatus: z.enum(['captured', 'changed-during-capture']),
|
|
46
|
+
}).readonly();
|
|
47
|
+
export const WorktreeSnapshotManifestSchema = z.strictObject({
|
|
48
|
+
version: z.literal(SNAPSHOT_VERSION),
|
|
49
|
+
sourceKind: z.enum(['staged', 'unstaged', 'worktree', 'standalone']),
|
|
50
|
+
repositoryIdentity: z.string().min(1),
|
|
51
|
+
baseCommitOid: GitObjectIdSchema.optional(),
|
|
52
|
+
standaloneArguments: z.array(z.string().min(1)).max(256).optional(),
|
|
53
|
+
objectFormat: z.enum(['sha1', 'sha256']),
|
|
54
|
+
entries: z.array(WorktreeSnapshotEntrySchema).max(MAX_SNAPSHOT_FILES).readonly(),
|
|
55
|
+
chain: z.array(z.string().regex(/^[0-9a-f]{64}$/u)).min(1).readonly(),
|
|
56
|
+
provenanceDigest: z.string().regex(/^[0-9a-f]{64}$/u),
|
|
57
|
+
}).superRefine((manifest, context) => {
|
|
58
|
+
const hasBase = manifest.baseCommitOid !== undefined;
|
|
59
|
+
const isNoBaseKind = manifest.sourceKind === 'unstaged' || manifest.sourceKind === 'standalone';
|
|
60
|
+
if (isNoBaseKind) {
|
|
61
|
+
if (hasBase) {
|
|
62
|
+
context.addIssue({
|
|
63
|
+
code: 'custom',
|
|
64
|
+
message: 'Unstaged and Standalone snapshots must not carry a base commit.',
|
|
65
|
+
path: ['baseCommitOid'],
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else if (!hasBase) {
|
|
70
|
+
context.addIssue({
|
|
71
|
+
code: 'custom',
|
|
72
|
+
message: 'Staged and Working tree snapshots require a base commit.',
|
|
73
|
+
path: ['baseCommitOid'],
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
const hasStandaloneArguments = manifest.standaloneArguments !== undefined;
|
|
77
|
+
const isStandalone = manifest.sourceKind === 'standalone';
|
|
78
|
+
if (isStandalone && !hasStandaloneArguments) {
|
|
79
|
+
context.addIssue({
|
|
80
|
+
code: 'custom',
|
|
81
|
+
message: 'Standalone snapshots require standaloneArguments.',
|
|
82
|
+
path: ['standaloneArguments'],
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
else if (!isStandalone && hasStandaloneArguments) {
|
|
86
|
+
context.addIssue({
|
|
87
|
+
code: 'custom',
|
|
88
|
+
message: 'Only Standalone snapshots may have standaloneArguments.',
|
|
89
|
+
path: ['standaloneArguments'],
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}).readonly();
|
|
93
|
+
export class WorktreeSnapshotError extends Error {
|
|
94
|
+
code;
|
|
95
|
+
retryable;
|
|
96
|
+
constructor(code, retryable) {
|
|
97
|
+
super(code === 'retryable-read'
|
|
98
|
+
? 'Frozen worktree snapshot file temporarily unavailable.'
|
|
99
|
+
: 'Frozen worktree snapshot is unavailable.');
|
|
100
|
+
this.code = code;
|
|
101
|
+
this.retryable = retryable;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function manifestDigest(manifest) {
|
|
105
|
+
return digest(Buffer.from(JSON.stringify(manifest), 'utf8'));
|
|
106
|
+
}
|
|
107
|
+
// The chain-entry digest covers one capture's own content only (never the
|
|
108
|
+
// `chain` array itself, which wraps a sequence of these digests) — computed
|
|
109
|
+
// identically at every capture site so the chain stays a meaningful,
|
|
110
|
+
// reproducible fingerprint sequence (D-18).
|
|
111
|
+
function captureDigest(manifest) {
|
|
112
|
+
return digest(Buffer.from(JSON.stringify(manifest), 'utf8'));
|
|
113
|
+
}
|
|
114
|
+
function languageForPath(path) {
|
|
115
|
+
const extension = path?.utf8?.split('.').at(-1);
|
|
116
|
+
return extension === undefined
|
|
117
|
+
? 'plaintext'
|
|
118
|
+
: extension === 'ts'
|
|
119
|
+
? 'typescript'
|
|
120
|
+
: extension === 'js'
|
|
121
|
+
? 'javascript'
|
|
122
|
+
: extension === 'json'
|
|
123
|
+
? 'json'
|
|
124
|
+
: extension === 'md'
|
|
125
|
+
? 'markdown'
|
|
126
|
+
: 'plaintext';
|
|
127
|
+
}
|
|
128
|
+
function side(bytes, path, mode, entryBlobOid) {
|
|
129
|
+
return bytes === undefined
|
|
130
|
+
? WorktreeSnapshotSideSchema.parse({ exists: false, mode, blobOid: entryBlobOid, byteLength: 0 })
|
|
131
|
+
: WorktreeSnapshotSideSchema.parse({
|
|
132
|
+
exists: true,
|
|
133
|
+
path,
|
|
134
|
+
mode,
|
|
135
|
+
blobOid: entryBlobOid,
|
|
136
|
+
language: languageForPath(path),
|
|
137
|
+
byteLength: bytes.byteLength,
|
|
138
|
+
sha256: digest(bytes),
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
function pathKey(file) {
|
|
142
|
+
return (file.newPath ?? file.oldPath)?.bytesBase64url ?? file.id;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Bracket-and-retry capture of one worktree-resident side's bytes (Required
|
|
146
|
+
* Focus 3(a)): `lstat` before, produce bytes, `lstat` after, retry on
|
|
147
|
+
* mismatch up to `maxAttempts` total attempts with `retryDelayMs` between
|
|
148
|
+
* attempts. Returns `{ torn: true }` (never a partial/mixed buffer) if the
|
|
149
|
+
* file is still unstable after every attempt.
|
|
150
|
+
*/
|
|
151
|
+
async function captureFileWithRetry(readBytes, statPath, dependencies = {}, maxAttempts = 3, // 1 initial + 2 retries (D-09 discretion)
|
|
152
|
+
retryDelayMs = 10) {
|
|
153
|
+
for (let attempt = 0; attempt < maxAttempts; attempt += 1) {
|
|
154
|
+
try {
|
|
155
|
+
const before = await lstat(statPath);
|
|
156
|
+
await dependencies.onAttempt?.(attempt);
|
|
157
|
+
const bytes = await readBytes(before);
|
|
158
|
+
const after = await lstat(statPath);
|
|
159
|
+
if (before.size === after.size && before.mtimeMs === after.mtimeMs) {
|
|
160
|
+
return { bytes, sha256: digest(bytes) };
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
if (!isMissing(error))
|
|
165
|
+
throw error;
|
|
166
|
+
// ENOENT: file disappeared/replaced mid-capture — legitimate race, fall through to retry.
|
|
167
|
+
}
|
|
168
|
+
if (attempt < maxAttempts - 1) {
|
|
169
|
+
const { promise, resolve } = Promise.withResolvers();
|
|
170
|
+
setTimeout(resolve, retryDelayMs);
|
|
171
|
+
await promise;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return { torn: true };
|
|
175
|
+
}
|
|
176
|
+
async function readObjectBackedSide(objectReader, oid) {
|
|
177
|
+
const content = await objectReader.read(oid, { maxBytes: MAX_SIDE_BYTES });
|
|
178
|
+
return content.kind === 'available' ? Buffer.from(content.bytes) : undefined;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Enumerates the expected/observed `ChangedFile` set for one capture pass.
|
|
182
|
+
* Standalone sessions have no git diff to enumerate — they resolve their
|
|
183
|
+
* original pathspec arguments fresh (picking up additions/removals since
|
|
184
|
+
* the prior pass) via `resolveStandaloneArguments`/`classifyStandaloneGitState`
|
|
185
|
+
* /`createStandaloneChangedFileInventory` instead of
|
|
186
|
+
* `createWorktreeChangedFileInventory`. Every other sourceKind is unchanged.
|
|
187
|
+
*
|
|
188
|
+
* WR-02: a standalone argument's only match can vanish inside the window
|
|
189
|
+
* between `captureWorktreeManifest`'s own two `inventoryForScope` calls —
|
|
190
|
+
* the pre-capture "expected" pass and the post-capture "observed" pass —
|
|
191
|
+
* not just between two top-level `WorktreeSnapshot.refresh()` calls
|
|
192
|
+
* (CR-01). Both enumeration passes therefore always tolerate that
|
|
193
|
+
* disappearance, so the file surfaces as `'changed-during-capture'` like
|
|
194
|
+
* every other D-10 race instead of throwing "did not match any file" and
|
|
195
|
+
* crashing the capture — including the very first capture at session
|
|
196
|
+
* startup. The strict "reject typos/missing files up front" check stays
|
|
197
|
+
* exactly one layer up, in `launchStandaloneSession`'s own pre-scope
|
|
198
|
+
* `resolveStandaloneArguments` call (`src/cli/run.ts`), which never routes
|
|
199
|
+
* through this function.
|
|
200
|
+
*/
|
|
201
|
+
async function inventoryForScope(scope, repositoryRoot, runner, objectReader) {
|
|
202
|
+
if (scope.sourceKind === 'standalone') {
|
|
203
|
+
const resolved = await resolveStandaloneArguments(repositoryRoot, scope.standaloneArguments, { runner }, { toleratesNoMatch: true });
|
|
204
|
+
const gitStates = await classifyStandaloneGitState(repositoryRoot, resolved, { runner });
|
|
205
|
+
return createStandaloneChangedFileInventory(repositoryRoot, resolved, gitStates, scope.objectFormat, {
|
|
206
|
+
runner,
|
|
207
|
+
objectReader,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
return createWorktreeChangedFileInventory({
|
|
211
|
+
sourceKind: scope.sourceKind,
|
|
212
|
+
repositoryRoot,
|
|
213
|
+
mergeBaseOid: scope.mergeBaseOid,
|
|
214
|
+
objectFormat: scope.objectFormat,
|
|
215
|
+
}, { runner, objectReader });
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Implements Required Focus 3(b): enumerate the expected file set once,
|
|
219
|
+
* capture every file's content (object-backed sides via `ObjectReader`,
|
|
220
|
+
* worktree-resident sides via `resolveWorktreeSideContent`/bounded raw read
|
|
221
|
+
* wrapped in `captureFileWithRetry`), then enumerate the observed file set a
|
|
222
|
+
* second time and force any expected-but-now-missing file to
|
|
223
|
+
* `'changed-during-capture'` rather than silently dropping it (D-10).
|
|
224
|
+
*/
|
|
225
|
+
async function captureWorktreeManifest(scope, repositoryRoot, dependencies = {}) {
|
|
226
|
+
const runner = dependencies.runner ?? createGitRunner();
|
|
227
|
+
const objectReader = dependencies.objectReader ?? createObjectReader(repositoryRoot, { runner });
|
|
228
|
+
await dependencies.onCaptureStart?.();
|
|
229
|
+
const expected = await inventoryForScope(scope, repositoryRoot, runner, objectReader);
|
|
230
|
+
if (expected.length > MAX_SNAPSHOT_FILES)
|
|
231
|
+
throw new WorktreeSnapshotError('snapshot-unavailable', false);
|
|
232
|
+
const intermediate = [];
|
|
233
|
+
let totalBytes = 0;
|
|
234
|
+
for (const file of expected) {
|
|
235
|
+
if (file.availability.kind !== 'text') {
|
|
236
|
+
intermediate.push({ file, torn: false });
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
const preimageBytes = file.oldMode === '000000'
|
|
240
|
+
? undefined
|
|
241
|
+
: await readObjectBackedSide(objectReader, file.oldBlobOid);
|
|
242
|
+
let postimageBytes;
|
|
243
|
+
let torn = false;
|
|
244
|
+
if (file.newMode !== '000000') {
|
|
245
|
+
if (scope.sourceKind === 'staged') {
|
|
246
|
+
postimageBytes = await readObjectBackedSide(objectReader, file.newBlobOid);
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
const path = file.newPath ?? file.oldPath;
|
|
250
|
+
if (path === undefined)
|
|
251
|
+
throw new Error('Changed file is missing a path for its existing side.');
|
|
252
|
+
const resolvedDiskPath = Buffer.concat([
|
|
253
|
+
Buffer.from(repositoryRoot, 'utf8'),
|
|
254
|
+
Buffer.from('/'),
|
|
255
|
+
Buffer.from(decodeBase64url(path.bytesBase64url)),
|
|
256
|
+
]);
|
|
257
|
+
const pathString = path.utf8 ?? path.display;
|
|
258
|
+
const endpoint = scope.sourceKind === 'unstaged' ? undefined : scope.baseCommitOid;
|
|
259
|
+
const captured = await captureFileWithRetry(async (before) => {
|
|
260
|
+
try {
|
|
261
|
+
const result = await resolveWorktreeSideContent({ repositoryRoot, path: pathString, scope: 'worktree', endpoint, objectFormat: scope.objectFormat }, { runner });
|
|
262
|
+
return result.bytes;
|
|
263
|
+
}
|
|
264
|
+
catch {
|
|
265
|
+
return boundedFileBytes(resolvedDiskPath, before.size);
|
|
266
|
+
}
|
|
267
|
+
}, resolvedDiskPath, { onAttempt: (attempt) => dependencies.onFileReadAttempt?.(file.id, attempt) });
|
|
268
|
+
if ('torn' in captured) {
|
|
269
|
+
torn = true;
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
postimageBytes = captured.bytes;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
totalBytes += (preimageBytes?.byteLength ?? 0) + (postimageBytes?.byteLength ?? 0);
|
|
277
|
+
if (totalBytes > MAX_SNAPSHOT_BYTES)
|
|
278
|
+
throw new WorktreeSnapshotError('snapshot-unavailable', false);
|
|
279
|
+
intermediate.push({ file, torn, preimageBytes, postimageBytes });
|
|
280
|
+
}
|
|
281
|
+
await dependencies.onBeforeObservedEnumeration?.();
|
|
282
|
+
const observed = await inventoryForScope(scope, repositoryRoot, runner, objectReader);
|
|
283
|
+
const observedKeys = new Set(observed.map((file) => pathKey(file)));
|
|
284
|
+
const entries = [];
|
|
285
|
+
const contents = new Map();
|
|
286
|
+
for (const record of intermediate) {
|
|
287
|
+
const disappeared = !observedKeys.has(pathKey(record.file));
|
|
288
|
+
const captureStatus = record.torn || disappeared ? 'changed-during-capture' : 'captured';
|
|
289
|
+
const frozenFile = ChangedFileSchema.parse(captureStatus === 'changed-during-capture'
|
|
290
|
+
? { ...record.file, availability: { kind: 'unsupported', reason: 'changed-during-capture' } }
|
|
291
|
+
: record.file);
|
|
292
|
+
const preimageBytes = captureStatus === 'captured' ? record.preimageBytes : undefined;
|
|
293
|
+
const postimageBytes = captureStatus === 'captured' ? record.postimageBytes : undefined;
|
|
294
|
+
const preimageBlobOid = frozenFile.oldMode === '000000' || preimageBytes === undefined
|
|
295
|
+
? frozenFile.oldBlobOid
|
|
296
|
+
: scope.sourceKind === 'staged'
|
|
297
|
+
? frozenFile.oldBlobOid
|
|
298
|
+
: blobOid(preimageBytes, scope.objectFormat);
|
|
299
|
+
const postimageBlobOid = frozenFile.newMode === '000000' || postimageBytes === undefined
|
|
300
|
+
? frozenFile.newBlobOid
|
|
301
|
+
: scope.sourceKind === 'staged'
|
|
302
|
+
? frozenFile.newBlobOid
|
|
303
|
+
: blobOid(postimageBytes, scope.objectFormat);
|
|
304
|
+
entries.push(WorktreeSnapshotEntrySchema.parse({
|
|
305
|
+
file: frozenFile,
|
|
306
|
+
preimage: side(preimageBytes, frozenFile.oldPath, frozenFile.oldMode, preimageBlobOid),
|
|
307
|
+
postimage: side(postimageBytes, frozenFile.newPath, frozenFile.newMode, postimageBlobOid),
|
|
308
|
+
captureStatus,
|
|
309
|
+
}));
|
|
310
|
+
if (preimageBytes !== undefined || postimageBytes !== undefined) {
|
|
311
|
+
contents.set(frozenFile.id, Object.freeze({ preimage: preimageBytes, postimage: postimageBytes }));
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return {
|
|
315
|
+
manifest: {
|
|
316
|
+
version: SNAPSHOT_VERSION,
|
|
317
|
+
sourceKind: scope.sourceKind,
|
|
318
|
+
repositoryIdentity: repositoryRoot,
|
|
319
|
+
...(scope.baseCommitOid === undefined ? {} : { baseCommitOid: scope.baseCommitOid }),
|
|
320
|
+
...(scope.sourceKind === 'standalone' ? { standaloneArguments: scope.standaloneArguments } : {}),
|
|
321
|
+
objectFormat: scope.objectFormat,
|
|
322
|
+
entries: Object.freeze(entries),
|
|
323
|
+
},
|
|
324
|
+
contents,
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Resolves the live index path via `git rev-parse --git-path index` (never
|
|
329
|
+
* a hardcoded `.git/index`, for linked-worktree correctness — Required
|
|
330
|
+
* Focus 3(c)) and returns its stat identity.
|
|
331
|
+
*/
|
|
332
|
+
async function indexIdentity(repositoryRoot, runner) {
|
|
333
|
+
const result = await runner.run(['rev-parse', '--git-path', 'index'], { cwd: repositoryRoot });
|
|
334
|
+
const indexPath = result.stdout.toString('utf8').trim();
|
|
335
|
+
const resolved = indexPath.startsWith('/') ? indexPath : join(repositoryRoot, indexPath);
|
|
336
|
+
const info = await lstat(resolved);
|
|
337
|
+
return { size: info.size, mtimeMs: info.mtimeMs };
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Implements D-11: `lstat` the index before and after a whole capture; on
|
|
341
|
+
* mismatch, retry the entire capture once; if the retry's own bracket also
|
|
342
|
+
* disagrees, return the retry's best-effort result with a distinct
|
|
343
|
+
* `indexRaceNotice` (never conflated with the per-file torn-file signal).
|
|
344
|
+
*/
|
|
345
|
+
async function captureWithIndexRaceGuard(scope, repositoryRoot, runner, dependencies = {}) {
|
|
346
|
+
for (let attempt = 0; attempt < 2; attempt += 1) { // D-11: "retry the whole capture once"
|
|
347
|
+
const before = await indexIdentity(repositoryRoot, runner);
|
|
348
|
+
const captured = await captureWorktreeManifest(scope, repositoryRoot, dependencies);
|
|
349
|
+
await dependencies.onBeforeIndexRecheck?.(attempt);
|
|
350
|
+
const after = await indexIdentity(repositoryRoot, runner);
|
|
351
|
+
const stable = before.size === after.size && before.mtimeMs === after.mtimeMs;
|
|
352
|
+
if (stable)
|
|
353
|
+
return { ...captured, indexRaceNotice: false };
|
|
354
|
+
if (attempt === 1)
|
|
355
|
+
return { ...captured, indexRaceNotice: true };
|
|
356
|
+
}
|
|
357
|
+
throw new Error('unreachable');
|
|
358
|
+
}
|
|
359
|
+
async function resolveMergeBaseOid(repositoryRoot, baseCommitOid, runner) {
|
|
360
|
+
const result = await runner.run(['merge-base', baseCommitOid, 'HEAD'], { cwd: repositoryRoot });
|
|
361
|
+
return result.stdout.toString('utf8').trim();
|
|
362
|
+
}
|
|
363
|
+
async function writeContentIfAbsent(path, bytes) {
|
|
364
|
+
try {
|
|
365
|
+
await writeOwned(path, bytes);
|
|
366
|
+
}
|
|
367
|
+
catch (error) {
|
|
368
|
+
if (!(typeof error === 'object' && error !== null && 'code' in error && error.code === 'EEXIST'))
|
|
369
|
+
throw error;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
function contentPath(root, sha256) {
|
|
373
|
+
return join(root, 'content', `${sha256}.bin`);
|
|
374
|
+
}
|
|
375
|
+
async function writeManifestEntryContents(root, entries, contents) {
|
|
376
|
+
await mkdir(join(root, 'content'), { recursive: true, mode: 0o700 });
|
|
377
|
+
for (const entry of entries) {
|
|
378
|
+
const record = contents.get(entry.file.id);
|
|
379
|
+
if (record === undefined)
|
|
380
|
+
continue;
|
|
381
|
+
if (entry.preimage.exists && record.preimage !== undefined) {
|
|
382
|
+
await writeContentIfAbsent(contentPath(root, entry.preimage.sha256), record.preimage);
|
|
383
|
+
}
|
|
384
|
+
if (entry.postimage.exists && record.postimage !== undefined) {
|
|
385
|
+
await writeContentIfAbsent(contentPath(root, entry.postimage.sha256), record.postimage);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
await syncDirectory(join(root, 'content'));
|
|
389
|
+
}
|
|
390
|
+
async function writeManifest(root, manifest) {
|
|
391
|
+
const temporaryPath = join(root, `manifest.json.tmp-${randomUUID()}`);
|
|
392
|
+
await writeOwned(temporaryPath, Buffer.from(JSON.stringify(manifest), 'utf8'));
|
|
393
|
+
await rename(temporaryPath, join(root, 'manifest.json'));
|
|
394
|
+
await syncDirectory(root);
|
|
395
|
+
}
|
|
396
|
+
function entryKey(entry) {
|
|
397
|
+
return pathKey(entry.file);
|
|
398
|
+
}
|
|
399
|
+
function entryContentFingerprint(entry) {
|
|
400
|
+
return [
|
|
401
|
+
entry.captureStatus,
|
|
402
|
+
entry.preimage.exists ? entry.preimage.sha256 : '',
|
|
403
|
+
entry.postimage.exists ? entry.postimage.sha256 : '',
|
|
404
|
+
].join(':');
|
|
405
|
+
}
|
|
406
|
+
function entryDisplay(entry) {
|
|
407
|
+
return entry.file.newPath?.display ?? entry.file.oldPath?.display ?? entryKey(entry);
|
|
408
|
+
}
|
|
409
|
+
function diffManifestEntries(previous, next) {
|
|
410
|
+
const previousByKey = new Map(previous.map((entry) => [entryKey(entry), entry]));
|
|
411
|
+
const nextByKey = new Map(next.map((entry) => [entryKey(entry), entry]));
|
|
412
|
+
const added = [];
|
|
413
|
+
const removed = [];
|
|
414
|
+
const modified = [];
|
|
415
|
+
for (const [key, entry] of nextByKey) {
|
|
416
|
+
const prior = previousByKey.get(key);
|
|
417
|
+
if (prior === undefined) {
|
|
418
|
+
added.push(entryDisplay(entry));
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
if (entryContentFingerprint(prior) !== entryContentFingerprint(entry))
|
|
422
|
+
modified.push(entryDisplay(entry));
|
|
423
|
+
}
|
|
424
|
+
for (const [key, entry] of previousByKey) {
|
|
425
|
+
if (!nextByKey.has(key))
|
|
426
|
+
removed.push(entryDisplay(entry));
|
|
427
|
+
}
|
|
428
|
+
return Object.freeze({ added: Object.freeze(added), removed: Object.freeze(removed), modified: Object.freeze(modified) });
|
|
429
|
+
}
|
|
430
|
+
export class WorktreeSnapshot {
|
|
431
|
+
manifest;
|
|
432
|
+
root;
|
|
433
|
+
dependencies;
|
|
434
|
+
indexRaceNotice;
|
|
435
|
+
constructor(manifest, root, indexRaceNotice, dependencies = {}) {
|
|
436
|
+
this.manifest = manifest;
|
|
437
|
+
this.root = root;
|
|
438
|
+
this.indexRaceNotice = indexRaceNotice;
|
|
439
|
+
this.dependencies = dependencies;
|
|
440
|
+
}
|
|
441
|
+
async verifiedManifest() {
|
|
442
|
+
const manifestPath = join(this.root, 'manifest.json');
|
|
443
|
+
const info = await lstat(manifestPath);
|
|
444
|
+
if (!info.isFile() || info.isSymbolicLink() || info.size <= 0 || info.size > MAX_MANIFEST_BYTES) {
|
|
445
|
+
throw new WorktreeSnapshotError('snapshot-unavailable', false);
|
|
446
|
+
}
|
|
447
|
+
const parsed = WorktreeSnapshotManifestSchema.parse(JSON.parse(strictText.decode(await boundedFileBytes(Buffer.from(manifestPath), info.size))));
|
|
448
|
+
const { provenanceDigest, ...withoutDigest } = parsed;
|
|
449
|
+
if (provenanceDigest !== manifestDigest(withoutDigest) || provenanceDigest !== this.manifest.provenanceDigest) {
|
|
450
|
+
throw new WorktreeSnapshotError('snapshot-unavailable', false);
|
|
451
|
+
}
|
|
452
|
+
return this.manifest;
|
|
453
|
+
}
|
|
454
|
+
async readSide(side_) {
|
|
455
|
+
if (!side_.exists)
|
|
456
|
+
return undefined;
|
|
457
|
+
try {
|
|
458
|
+
const path = contentPath(this.root, side_.sha256);
|
|
459
|
+
const info = await lstat(path);
|
|
460
|
+
if (!info.isFile() || info.isSymbolicLink())
|
|
461
|
+
throw new WorktreeSnapshotError('snapshot-unavailable', false);
|
|
462
|
+
const bytes = await boundedFileBytes(Buffer.from(path), side_.byteLength);
|
|
463
|
+
if (digest(bytes) !== side_.sha256)
|
|
464
|
+
throw new WorktreeSnapshotError('snapshot-unavailable', false);
|
|
465
|
+
return bytes;
|
|
466
|
+
}
|
|
467
|
+
catch (error) {
|
|
468
|
+
if (error instanceof WorktreeSnapshotError)
|
|
469
|
+
throw error;
|
|
470
|
+
if (isMissing(error))
|
|
471
|
+
throw new WorktreeSnapshotError('snapshot-unavailable', false);
|
|
472
|
+
throw new WorktreeSnapshotError('retryable-read', true);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
async files() {
|
|
476
|
+
return (await this.verifiedManifest()).entries.map((entry) => entry.file);
|
|
477
|
+
}
|
|
478
|
+
async readContent(fileId) {
|
|
479
|
+
const manifest = await this.verifiedManifest();
|
|
480
|
+
const entry = manifest.entries.find((candidate) => candidate.file.id === fileId);
|
|
481
|
+
if (entry === undefined)
|
|
482
|
+
return undefined;
|
|
483
|
+
return Object.freeze({
|
|
484
|
+
file: entry.file,
|
|
485
|
+
preimage: await this.readSide(entry.preimage),
|
|
486
|
+
preimageBlobOid: entry.preimage.blobOid,
|
|
487
|
+
postimage: await this.readSide(entry.postimage),
|
|
488
|
+
postimageBlobOid: entry.postimage.blobOid,
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
async session() {
|
|
492
|
+
const manifest = await this.verifiedManifest();
|
|
493
|
+
return Object.freeze({
|
|
494
|
+
sourceKind: manifest.sourceKind,
|
|
495
|
+
chain: manifest.chain,
|
|
496
|
+
changedFileCount: manifest.entries.length,
|
|
497
|
+
indexRaceNotice: this.indexRaceNotice,
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Freeze-then-observe-then-mutate (RESEARCH.md Pattern 3): re-captures the
|
|
502
|
+
* current file set and appends the new capture's digest to the existing
|
|
503
|
+
* chain (D-18) — never replacing or discarding any prior chain entry's
|
|
504
|
+
* content (D-20) — returning the path-keyed added/removed/modified delta
|
|
505
|
+
* relative to the immediately preceding chain entry (SNAP-04).
|
|
506
|
+
*/
|
|
507
|
+
async refresh() {
|
|
508
|
+
const previous = await this.verifiedManifest(); // chain-tip manifest before this call
|
|
509
|
+
const runner = this.dependencies.runner ?? createGitRunner();
|
|
510
|
+
const repositoryRoot = previous.repositoryIdentity;
|
|
511
|
+
const mergeBaseOid = previous.sourceKind === 'unstaged' || previous.baseCommitOid === undefined
|
|
512
|
+
? undefined
|
|
513
|
+
: await resolveMergeBaseOid(repositoryRoot, previous.baseCommitOid, runner);
|
|
514
|
+
const scope = {
|
|
515
|
+
kind: 'uncommitted',
|
|
516
|
+
sourceKind: previous.sourceKind,
|
|
517
|
+
repositoryRoot,
|
|
518
|
+
objectFormat: previous.objectFormat,
|
|
519
|
+
baseCommitOid: previous.baseCommitOid,
|
|
520
|
+
mergeBaseOid,
|
|
521
|
+
standaloneArguments: previous.standaloneArguments,
|
|
522
|
+
changedFiles: [],
|
|
523
|
+
};
|
|
524
|
+
const { manifest: nextBase, contents, indexRaceNotice } = await captureWithIndexRaceGuard(scope, repositoryRoot, runner, this.dependencies); // Pattern 1 + Pattern 4 (retry); see `inventoryForScope` (WR-02/CR-01) for why
|
|
525
|
+
// a vanished standalone argument is always tolerated inside the capture itself.
|
|
526
|
+
const nextDigest = captureDigest(nextBase);
|
|
527
|
+
const nextManifestDraft = { ...nextBase, chain: Object.freeze([...previous.chain, nextDigest]) }; // D-18: append, don't replace
|
|
528
|
+
const nextManifest = WorktreeSnapshotManifestSchema.parse({
|
|
529
|
+
...nextManifestDraft,
|
|
530
|
+
provenanceDigest: manifestDigest(nextManifestDraft),
|
|
531
|
+
});
|
|
532
|
+
const delta = diffManifestEntries(previous.entries, nextManifest.entries); // path-keyed set comparison
|
|
533
|
+
await writeManifestEntryContents(this.root, nextManifest.entries, contents); // D-20: never touches digestA's content
|
|
534
|
+
await writeManifest(this.root, nextManifest);
|
|
535
|
+
this.manifest = nextManifest;
|
|
536
|
+
this.indexRaceNotice = indexRaceNotice;
|
|
537
|
+
return Object.freeze({ ...delta, indexRaceNotice });
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
export async function materializeWorktreeSnapshot(scope, options, dependencies = {}) {
|
|
541
|
+
const runner = dependencies.runner ?? createGitRunner();
|
|
542
|
+
const { manifest: base, contents, indexRaceNotice } = await captureWithIndexRaceGuard(scope, scope.repositoryRoot, runner, dependencies);
|
|
543
|
+
const chainDigest = captureDigest(base);
|
|
544
|
+
const manifestDraft = { ...base, chain: Object.freeze([chainDigest]) }; // the first capture is always a singleton chain
|
|
545
|
+
const manifest = WorktreeSnapshotManifestSchema.parse({
|
|
546
|
+
...manifestDraft,
|
|
547
|
+
provenanceDigest: manifestDigest(manifestDraft),
|
|
548
|
+
});
|
|
549
|
+
await mkdir(options.root, { recursive: true, mode: 0o700 });
|
|
550
|
+
await writeManifestEntryContents(options.root, manifest.entries, contents);
|
|
551
|
+
await writeManifest(options.root, manifest);
|
|
552
|
+
return new WorktreeSnapshot(manifest, options.root, indexRaceNotice, dependencies);
|
|
553
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={comments:{lineComment:`*`},brackets:[[`[`,`]`],[`(`,`)`]]},t={defaultToken:`invalid`,ignoreCase:!0,tokenPostfix:`.abap`,keywords:`abap-source.abbreviated.abstract.accept.accepting.according.activation.actual.add.add-corresponding.adjacent.after.alias.aliases.align.all.allocate.alpha.analysis.analyzer.and.append.appendage.appending.application.archive.area.arithmetic.as.ascending.aspect.assert.assign.assigned.assigning.association.asynchronous.at.attributes.authority.authority-check.avg.back.background.backup.backward.badi.base.before.begin.between.big.binary.bintohex.bit.black.blank.blanks.blob.block.blocks.blue.bound.boundaries.bounds.boxed.break-point.buffer.by.bypassing.byte.byte-order.call.calling.case.cast.casting.catch.center.centered.chain.chain-input.chain-request.change.changing.channels.character.char-to-hex.check.checkbox.ci_.circular.class.class-coding.class-data.class-events.class-methods.class-pool.cleanup.clear.client.clob.clock.close.coalesce.code.coding.col_background.col_group.col_heading.col_key.col_negative.col_normal.col_positive.col_total.collect.color.column.columns.comment.comments.commit.common.communication.comparing.component.components.compression.compute.concat.concat_with_space.concatenate.cond.condense.condition.connect.connection.constants.context.contexts.continue.control.controls.conv.conversion.convert.copies.copy.corresponding.country.cover.cpi.create.creating.critical.currency.currency_conversion.current.cursor.cursor-selection.customer.customer-function.dangerous.data.database.datainfo.dataset.date.dats_add_days.dats_add_months.dats_days_between.dats_is_valid.daylight.dd/mm/yy.dd/mm/yyyy.ddmmyy.deallocate.decimal_shift.decimals.declarations.deep.default.deferred.define.defining.definition.delete.deleting.demand.department.descending.describe.destination.detail.dialog.directory.disconnect.display.display-mode.distinct.divide.divide-corresponding.division.do.dummy.duplicate.duplicates.duration.during.dynamic.dynpro.edit.editor-call.else.elseif.empty.enabled.enabling.encoding.end.endat.endcase.endcatch.endchain.endclass.enddo.endenhancement.end-enhancement-section.endexec.endform.endfunction.endian.endif.ending.endinterface.end-lines.endloop.endmethod.endmodule.end-of-definition.end-of-editing.end-of-file.end-of-page.end-of-selection.endon.endprovide.endselect.end-test-injection.end-test-seam.endtry.endwhile.endwith.engineering.enhancement.enhancement-point.enhancements.enhancement-section.entries.entry.enum.environment.equiv.errormessage.errors.escaping.event.events.exact.except.exception.exceptions.exception-table.exclude.excluding.exec.execute.exists.exit.exit-command.expand.expanding.expiration.explicit.exponent.export.exporting.extend.extended.extension.extract.fail.fetch.field.field-groups.fields.field-symbol.field-symbols.file.filter.filters.filter-table.final.find.first.first-line.fixed-point.fkeq.fkge.flush.font.for.form.format.forward.found.frame.frames.free.friends.from.function.functionality.function-pool.further.gaps.generate.get.giving.gkeq.gkge.global.grant.green.group.groups.handle.handler.harmless.hashed.having.hdb.header.headers.heading.head-lines.help-id.help-request.hextobin.hide.high.hint.hold.hotspot.icon.id.identification.identifier.ids.if.ignore.ignoring.immediately.implementation.implementations.implemented.implicit.import.importing.in.inactive.incl.include.includes.including.increment.index.index-line.infotypes.inheriting.init.initial.initialization.inner.inout.input.insert.instance.instances.instr.intensified.interface.interface-pool.interfaces.internal.intervals.into.inverse.inverted-date.is.iso.job.join.keep.keeping.kernel.key.keys.keywords.kind.language.last.late.layout.leading.leave.left.left-justified.leftplus.leftspace.legacy.length.let.level.levels.like.line.lines.line-count.linefeed.line-selection.line-size.list.listbox.list-processing.little.llang.load.load-of-program.lob.local.locale.locator.logfile.logical.log-point.long.loop.low.lower.lpad.lpi.ltrim.mail.main.major-id.mapping.margin.mark.mask.match.matchcode.max.maximum.medium.members.memory.mesh.message.message-id.messages.messaging.method.methods.min.minimum.minor-id.mm/dd/yy.mm/dd/yyyy.mmddyy.mode.modif.modifier.modify.module.move.move-corresponding.multiply.multiply-corresponding.name.nametab.native.nested.nesting.new.new-line.new-page.new-section.next.no.no-display.no-extension.no-gap.no-gaps.no-grouping.no-heading.no-scrolling.no-sign.no-title.no-topofpage.no-zero.node.nodes.non-unicode.non-unique.not.null.number.object.objects.obligatory.occurrence.occurrences.occurs.of.off.offset.ole.on.only.open.option.optional.options.or.order.other.others.out.outer.output.output-length.overflow.overlay.pack.package.pad.padding.page.pages.parameter.parameters.parameter-table.part.partially.pattern.percentage.perform.performing.person.pf1.pf10.pf11.pf12.pf13.pf14.pf15.pf2.pf3.pf4.pf5.pf6.pf7.pf8.pf9.pf-status.pink.places.pool.pos_high.pos_low.position.pragmas.precompiled.preferred.preserving.primary.print.print-control.priority.private.procedure.process.program.property.protected.provide.public.push.pushbutton.put.queue-only.quickinfo.radiobutton.raise.raising.range.ranges.read.reader.read-only.receive.received.receiver.receiving.red.redefinition.reduce.reduced.ref.reference.refresh.regex.reject.remote.renaming.replace.replacement.replacing.report.request.requested.reserve.reset.resolution.respecting.responsible.result.results.resumable.resume.retry.return.returncode.returning.returns.right.right-justified.rightplus.rightspace.risk.rmc_communication_failure.rmc_invalid_status.rmc_system_failure.role.rollback.rows.rpad.rtrim.run.sap.sap-spool.saving.scale_preserving.scale_preserving_scientific.scan.scientific.scientific_with_leading_zero.scroll.scroll-boundary.scrolling.search.secondary.seconds.section.select.selection.selections.selection-screen.selection-set.selection-sets.selection-table.select-options.send.separate.separated.set.shared.shift.short.shortdump-id.sign_as_postfix.single.size.skip.skipping.smart.some.sort.sortable.sorted.source.specified.split.spool.spots.sql.sqlscript.stable.stamp.standard.starting.start-of-editing.start-of-selection.state.statement.statements.static.statics.statusinfo.step-loop.stop.structure.structures.style.subkey.submatches.submit.subroutine.subscreen.subtract.subtract-corresponding.suffix.sum.summary.summing.supplied.supply.suppress.switch.switchstates.symbol.syncpoints.syntax.syntax-check.syntax-trace.system-call.system-exceptions.system-exit.tab.tabbed.table.tables.tableview.tabstrip.target.task.tasks.test.testing.test-injection.test-seam.text.textpool.then.throw.time.times.timestamp.timezone.tims_is_valid.title.titlebar.title-lines.to.tokenization.tokens.top-lines.top-of-page.trace-file.trace-table.trailing.transaction.transfer.transformation.translate.transporting.trmac.truncate.truncation.try.tstmp_add_seconds.tstmp_current_utctimestamp.tstmp_is_valid.tstmp_seconds_between.type.type-pool.type-pools.types.uline.unassign.under.unicode.union.unique.unit_conversion.unix.unpack.until.unwind.up.update.upper.user.user-command.using.utf-8.valid.value.value-request.values.vary.varying.verification-message.version.via.view.visible.wait.warning.when.whenever.where.while.width.window.windows.with.with-heading.without.with-title.word.work.write.writer.xml.xsd.yellow.yes.yymmdd.zero.zone.abap_system_timezone.abap_user_timezone.access.action.adabas.adjust_numbers.allow_precision_loss.allowed.amdp.applicationuser.as_geo_json.as400.associations.balance.behavior.breakup.bulk.cds.cds_client.check_before_save.child.clients.corr.corr_spearman.cross.cycles.datn_add_days.datn_add_months.datn_days_between.dats_from_datn.dats_tims_to_tstmp.dats_to_datn.db2.db6.ddl.dense_rank.depth.deterministic.discarding.entities.entity.error.failed.finalize.first_value.fltp_to_dec.following.fractional.full.graph.grouping.hierarchy.hierarchy_ancestors.hierarchy_ancestors_aggregate.hierarchy_descendants.hierarchy_descendants_aggregate.hierarchy_siblings.incremental.indicators.lag.last_value.lead.leaves.like_regexpr.link.locale_sap.lock.locks.many.mapped.matched.measures.median.mssqlnt.multiple.nodetype.ntile.nulls.occurrences_regexpr.one.operations.oracle.orphans.over.parent.parents.partition.pcre.period.pfcg_mapping.preceding.privileged.product.projection.rank.redirected.replace_regexpr.reported.response.responses.root.row.row_number.sap_system_date.save.schema.session.sets.shortdump.siblings.spantree.start.stddev.string_agg.subtotal.sybase.tims_from_timn.tims_to_timn.to_blob.to_clob.total.trace-entry.tstmp_to_dats.tstmp_to_dst.tstmp_to_tims.tstmpl_from_utcl.tstmpl_to_utcl.unbounded.utcl_add_seconds.utcl_current.utcl_seconds_between.uuid.var.verbatim`.split(`.`),builtinFunctions:`abs.acos.asin.atan.bit-set.boolc.boolx.ceil.char_off.charlen.cmax.cmin.concat_lines_of.contains.contains_any_not_of.contains_any_of.cos.cosh.count.count_any_not_of.count_any_of.dbmaxlen.distance.escape.exp.find_any_not_of.find_any_of.find_end.floor.frac.from_mixed.ipow.line_exists.line_index.log.log10.matches.nmax.nmin.numofchar.repeat.rescale.reverse.round.segment.shift_left.shift_right.sign.sin.sinh.sqrt.strlen.substring.substring_after.substring_before.substring_from.substring_to.tan.tanh.to_lower.to_mixed.to_upper.trunc.utclong_add.utclong_current.utclong_diff.xsdbool.xstrlen`.split(`.`),typeKeywords:`b.c.d.decfloat16.decfloat34.f.i.int8.n.p.s.string.t.utclong.x.xstring.any.clike.csequence.decfloat.numeric.simple.xsequence.accp.char.clnt.cuky.curr.datn.dats.d16d.d16n.d16r.d34d.d34n.d34r.dec.df16_dec.df16_raw.df34_dec.df34_raw.fltp.geom_ewkb.int1.int2.int4.lang.lchr.lraw.numc.quan.raw.rawstring.sstring.timn.tims.unit.utcl.df16_scl.df34_scl.prec.varc.abap_bool.abap_false.abap_true.abap_undefined.me.screen.space.super.sy.syst.table_line.*sys*`.split(`.`),builtinMethods:[`class_constructor`,`constructor`],derivedTypes:[`%CID`,`%CID_REF`,`%CONTROL`,`%DATA`,`%ELEMENT`,`%FAIL`,`%KEY`,`%MSG`,`%PARAM`,`%PID`,`%PID_ASSOC`,`%PID_PARENT`,`%_HINTS`],cdsLanguage:[`@AbapAnnotation`,`@AbapCatalog`,`@AccessControl`,`@API`,`@ClientDependent`,`@ClientHandling`,`@CompatibilityContract`,`@DataAging`,`@EndUserText`,`@Environment`,`@LanguageDependency`,`@MappingRole`,`@Metadata`,`@MetadataExtension`,`@ObjectModel`,`@Scope`,`@Semantics`,`$EXTENSION`,`$SELF`],selectors:[`->`,`->*`,`=>`,`~`,`~*`],operators:` +. -./.*.**.div.mod.=.#.@.+=.-=.*=./=.**=.&&=.?=.&.&&.bit-and.bit-not.bit-or.bit-xor.m.o.z.<. >.<=.>=.<>.><.=<.=>.bt.byte-ca.byte-cn.byte-co.byte-cs.byte-na.byte-ns.ca.cn.co.cp.cs.eq.ge.gt.le.lt.na.nb.ne.np.ns.*/.*:.--./*.//`.split(`.`),symbols:/[=><!~?&+\-*\/\^%#@]+/,tokenizer:{root:[[/[a-z_\/$%@]([\w\/$%]|-(?!>))*/,{cases:{"@typeKeywords":`type`,"@keywords":`keyword`,"@cdsLanguage":`annotation`,"@derivedTypes":`type`,"@builtinFunctions":`type`,"@builtinMethods":`type`,"@operators":`key`,"@default":`identifier`}}],[/<[\w]+>/,`identifier`],[/##[\w|_]+/,`comment`],{include:`@whitespace`},[/[:,.]/,`delimiter`],[/[{}()\[\]]/,`@brackets`],[/@symbols/,{cases:{"@selectors":`tag`,"@operators":`key`,"@default":``}}],[/'/,{token:`string`,bracket:`@open`,next:`@stringquote`}],[/`/,{token:`string`,bracket:`@open`,next:`@stringping`}],[/\|/,{token:`string`,bracket:`@open`,next:`@stringtemplate`}],[/\d+/,`number`]],stringtemplate:[[/[^\\\|]+/,`string`],[/\\\|/,`string`],[/\|/,{token:`string`,bracket:`@close`,next:`@pop`}]],stringping:[[/[^\\`]+/,`string`],[/`/,{token:`string`,bracket:`@close`,next:`@pop`}]],stringquote:[[/[^\\']+/,`string`],[/'/,{token:`string`,bracket:`@close`,next:`@pop`}]],whitespace:[[/[ \t\r\n]+/,``],[/^\*.*$/,`comment`],[/\".*$/,`comment`]]}};export{e as conf,t as language};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:`//`,blockComment:[`/*`,`*/`]},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`},{open:`<`,close:`>`}],folding:{markers:{start:RegExp(`^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))`),end:RegExp(`^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))`)}}},t=`abstract.activate.and.any.array.as.asc.assert.autonomous.begin.bigdecimal.blob.boolean.break.bulk.by.case.cast.catch.char.class.collect.commit.const.continue.convertcurrency.decimal.default.delete.desc.do.double.else.end.enum.exception.exit.export.extends.false.final.finally.float.for.from.future.get.global.goto.group.having.hint.if.implements.import.in.inner.insert.instanceof.int.interface.into.join.last_90_days.last_month.last_n_days.last_week.like.limit.list.long.loop.map.merge.native.new.next_90_days.next_month.next_n_days.next_week.not.null.nulls.number.object.of.on.or.outer.override.package.parallel.pragma.private.protected.public.retrieve.return.returning.rollback.savepoint.search.select.set.short.sort.stat.static.strictfp.super.switch.synchronized.system.testmethod.then.this.this_month.this_week.throw.throws.today.tolabel.tomorrow.transaction.transient.trigger.true.try.type.undelete.update.upsert.using.virtual.void.volatile.webservice.when.where.while.yesterday`.split(`.`),n=e=>e.charAt(0).toUpperCase()+e.substr(1),r=[];t.forEach(e=>{r.push(e),r.push(e.toUpperCase()),r.push(n(e))});var i={defaultToken:``,tokenPostfix:`.apex`,keywords:r,operators:`=.>.<.!.~.?.:.==.<=.>=.!=.&&.||.++.--.+.-.*./.&.|.^.%.<<.>>.>>>.+=.-=.*=./=.&=.|=.^=.%=.<<=.>>=.>>>=`.split(`.`),symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,tokenizer:{root:[[/[a-z_$][\w$]*/,{cases:{"@keywords":{token:`keyword.$0`},"@default":`identifier`}}],[/[A-Z][\w\$]*/,{cases:{"@keywords":{token:`keyword.$0`},"@default":`type.identifier`}}],{include:`@whitespace`},[/[{}()\[\]]/,`@brackets`],[/[<>](?!@symbols)/,`@brackets`],[/@symbols/,{cases:{"@operators":`delimiter`,"@default":``}}],[/@\s*[a-zA-Z_\$][\w\$]*/,`annotation`],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,`number.float`],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,`number.float`],[/(@digits)[fFdD]/,`number.float`],[/(@digits)[lL]?/,`number`],[/[;,.]/,`delimiter`],[/"([^"\\]|\\.)*$/,`string.invalid`],[/'([^'\\]|\\.)*$/,`string.invalid`],[/"/,`string`,`@string."`],[/'/,`string`,`@string.'`],[/'[^\\']'/,`string`],[/(')(@escapes)(')/,[`string`,`string.escape`,`string`]],[/'/,`string.invalid`]],whitespace:[[/[ \t\r\n]+/,``],[/\/\*\*(?!\/)/,`comment.doc`,`@apexdoc`],[/\/\*/,`comment`,`@comment`],[/\/\/.*$/,`comment`]],comment:[[/[^\/*]+/,`comment`],[/\*\//,`comment`,`@pop`],[/[\/*]/,`comment`]],apexdoc:[[/[^\/*]+/,`comment.doc`],[/\*\//,`comment.doc`,`@pop`],[/[\/*]/,`comment.doc`]],string:[[/[^\\"']+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/["']/,{cases:{"$#==$S2":{token:`string`,next:`@pop`},"@default":`string`}}]]}};export{e as conf,i as language};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={comments:{lineComment:`#`}},t={defaultToken:`keyword`,ignoreCase:!0,tokenPostfix:`.azcli`,str:/[^#\s]/,tokenizer:{root:[{include:`@comment`},[/\s-+@str*\s*/,{cases:{"@eos":{token:`key.identifier`,next:`@popall`},"@default":{token:`key.identifier`,next:`@type`}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:`key.identifier`,next:`@popall`},"@default":{token:`key.identifier`,next:`@type`}}}]],type:[{include:`@comment`},[/-+@str*\s*/,{cases:{"@eos":{token:`key.identifier`,next:`@popall`},"@default":`key.identifier`}}],[/@str+\s*/,{cases:{"@eos":{token:`string`,next:`@popall`},"@default":`string`}}]],comment:[[/#.*$/,{cases:{"@eos":{token:`comment`,next:`@popall`}}}]]}};export{e as conf,t as language};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={comments:{lineComment:`REM`},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`}],surroundingPairs:[{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`}],folding:{markers:{start:RegExp(`^\\s*(::\\s*|REM\\s+)#region`),end:RegExp(`^\\s*(::\\s*|REM\\s+)#endregion`)}}},t={defaultToken:``,ignoreCase:!0,tokenPostfix:`.bat`,brackets:[{token:`delimiter.bracket`,open:`{`,close:`}`},{token:`delimiter.parenthesis`,open:`(`,close:`)`},{token:`delimiter.square`,open:`[`,close:`]`}],keywords:/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,symbols:/[=><!~?&|+\-*\/\^;\.,]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^(\s*)(rem(?:\s.*|))$/,[``,`comment`]],[/(\@?)(@keywords)(?!\w)/,[{token:`keyword`},{token:`keyword.$2`}]],[/[ \t\r\n]+/,``],[/setlocal(?!\w)/,`keyword.tag-setlocal`],[/endlocal(?!\w)/,`keyword.tag-setlocal`],[/[a-zA-Z_]\w*/,``],[/:\w*/,`metatag`],[/%[^%]+%/,`variable`],[/%%[\w]+(?!\w)/,`variable`],[/[{}()\[\]]/,`@brackets`],[/@symbols/,`delimiter`],[/\d*\.\d+([eE][\-+]?\d+)?/,`number.float`],[/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/,`number.hex`],[/\d+/,`number`],[/[;,.]/,`delimiter`],[/"/,`string`,`@string."`],[/'/,`string`,`@string.'`]],string:[[/[^\\"'%]+/,{cases:{"@eos":{token:`string`,next:`@popall`},"@default":`string`}}],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/%[\w ]+%/,`variable`],[/%%[\w]+(?!\w)/,`variable`],[/["']/,{cases:{"$#==$S2":{token:`string`,next:`@pop`},"@default":`string`}}],[/$/,`string`,`@popall`]]}};export{e as conf,t as language};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=(e=>`\\b${e}\\b`)(`[_a-zA-Z][_a-zA-Z0-9]*`),t=[`targetScope`,`resource`,`module`,`param`,`var`,`output`,`for`,`in`,`if`,`existing`],n=[`true`,`false`,`null`],r=`[ \\t\\r\\n]`,i=`[0-9]+`,a={comments:{lineComment:`//`,blockComment:[`/*`,`*/`]},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`'`,close:`'`},{open:`'''`,close:`'''`}],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`'`,close:`'`,notIn:[`string`,`comment`]},{open:`'''`,close:`'''`,notIn:[`string`,`comment`]}],autoCloseBefore:`:.,=}])'
|
|
2
|
+
`,indentationRules:{increaseIndentPattern:RegExp(`^((?!\\/\\/).)*(\\{[^}"'\`]*|\\([^)"'\`]*|\\[[^\\]"'\`]*)$`),decreaseIndentPattern:RegExp(`^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$`)}},o={defaultToken:``,tokenPostfix:`.bicep`,brackets:[{open:`{`,close:`}`,token:`delimiter.curly`},{open:`[`,close:`]`,token:`delimiter.square`},{open:`(`,close:`)`,token:`delimiter.parenthesis`}],symbols:/[=><!~?:&|+\-*/^%]+/,keywords:t,namedLiterals:n,escapes:"\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\${)",tokenizer:{root:[{include:`@expression`},{include:`@whitespace`}],stringVerbatim:[{regex:`(|'|'')[^']`,action:{token:`string`}},{regex:`'''`,action:{token:`string.quote`,next:`@pop`}}],stringLiteral:[{regex:"\\${",action:{token:`delimiter.bracket`,next:`@bracketCounting`}},{regex:`[^\\\\'$]+`,action:{token:`string`}},{regex:`@escapes`,action:{token:`string.escape`}},{regex:`\\\\.`,action:{token:`string.escape.invalid`}},{regex:`'`,action:{token:`string`,next:`@pop`}}],bracketCounting:[{regex:`{`,action:{token:`delimiter.bracket`,next:`@bracketCounting`}},{regex:`}`,action:{token:`delimiter.bracket`,next:`@pop`}},{include:`expression`}],comment:[{regex:`[^\\*]+`,action:{token:`comment`}},{regex:`\\*\\/`,action:{token:`comment`,next:`@pop`}},{regex:`[\\/*]`,action:{token:`comment`}}],whitespace:[{regex:r},{regex:`\\/\\*`,action:{token:`comment`,next:`@comment`}},{regex:`\\/\\/.*$`,action:{token:`comment`}}],expression:[{regex:`'''`,action:{token:`string.quote`,next:`@stringVerbatim`}},{regex:`'`,action:{token:`string.quote`,next:`@stringLiteral`}},{regex:i,action:{token:`number`}},{regex:e,action:{cases:{"@keywords":{token:`keyword`},"@namedLiterals":{token:`keyword`},"@default":{token:`identifier`}}}}]}};export{a as conf,o as language};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={comments:{lineComment:`//`,blockComment:[`(*`,`*)`]},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`],[`<`,`>`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`<`,close:`>`},{open:`'`,close:`'`},{open:`"`,close:`"`},{open:`(*`,close:`*)`}],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`<`,close:`>`},{open:`'`,close:`'`},{open:`"`,close:`"`},{open:`(*`,close:`*)`}]},t={defaultToken:``,tokenPostfix:`.cameligo`,ignoreCase:!0,brackets:[{open:`{`,close:`}`,token:`delimiter.curly`},{open:`[`,close:`]`,token:`delimiter.square`},{open:`(`,close:`)`,token:`delimiter.parenthesis`},{open:`<`,close:`>`,token:`delimiter.angle`}],keywords:`abs.assert.block.Bytes.case.Crypto.Current.else.failwith.false.for.fun.if.in.let.let%entry.let%init.List.list.Map.map.match.match%nat.mod.not.operation.Operation.of.record.Set.set.sender.skip.source.String.then.to.true.type.with`.split(`.`),typeKeywords:[`int`,`unit`,`string`,`tz`,`nat`,`bool`],operators:[`=`,`>`,`<`,`<=`,`>=`,`<>`,`:`,`:=`,`and`,`mod`,`or`,`+`,`-`,`*`,`/`,`@`,`&`,`^`,`%`,`->`,`<-`,`&&`,`||`],symbols:/[=><:@\^&|+\-*\/\^%]+/,tokenizer:{root:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:`keyword.$0`},"@default":`identifier`}}],{include:`@whitespace`},[/[{}()\[\]]/,`@brackets`],[/[<>](?!@symbols)/,`@brackets`],[/@symbols/,{cases:{"@operators":`delimiter`,"@default":``}}],[/\d*\.\d+([eE][\-+]?\d+)?/,`number.float`],[/\$[0-9a-fA-F]{1,16}/,`number.hex`],[/\d+/,`number`],[/[;,.]/,`delimiter`],[/'([^'\\]|\\.)*$/,`string.invalid`],[/'/,`string`,`@string`],[/'[^\\']'/,`string`],[/'/,`string.invalid`],[/\#\d+/,`string`]],comment:[[/[^\(\*]+/,`comment`],[/\*\)/,`comment`,`@pop`],[/\(\*/,`comment`]],string:[[/[^\\']+/,`string`],[/\\./,`string.escape.invalid`],[/'/,{token:`string.quote`,bracket:`@close`,next:`@pop`}]],whitespace:[[/[ \t\r\n]+/,`white`],[/\(\*/,`comment`,`@comment`],[/\/\/.*$/,`comment`]]}};export{e as conf,t as language};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={comments:{lineComment:`;;`},brackets:[[`[`,`]`],[`(`,`)`],[`{`,`}`]],autoClosingPairs:[{open:`[`,close:`]`},{open:`"`,close:`"`},{open:`(`,close:`)`},{open:`{`,close:`}`}],surroundingPairs:[{open:`[`,close:`]`},{open:`"`,close:`"`},{open:`(`,close:`)`},{open:`{`,close:`}`}]},t={defaultToken:``,ignoreCase:!0,tokenPostfix:`.clj`,brackets:[{open:`[`,close:`]`,token:`delimiter.square`},{open:`(`,close:`)`,token:`delimiter.parenthesis`},{open:`{`,close:`}`,token:`delimiter.curly`}],constants:[`true`,`false`,`nil`],numbers:/^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,characters:/^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,escapes:/^\\(?:["'\\bfnrt]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,qualifiedSymbols:/^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/,specialForms:[`.`,`catch`,`def`,`do`,`if`,`monitor-enter`,`monitor-exit`,`new`,`quote`,`recur`,`set!`,`throw`,`try`,`var`],coreSymbols:`*,*',*1,*2,*3,*agent*,*allow-unresolved-vars*,*assert*,*clojure-version*,*command-line-args*,*compile-files*,*compile-path*,*compiler-options*,*data-readers*,*default-data-reader-fn*,*e,*err*,*file*,*flush-on-newline*,*fn-loader*,*in*,*math-context*,*ns*,*out*,*print-dup*,*print-length*,*print-level*,*print-meta*,*print-namespace-maps*,*print-readably*,*read-eval*,*reader-resolver*,*source-path*,*suppress-read*,*unchecked-math*,*use-context-classloader*,*verbose-defrecords*,*warn-on-reflection*,+,+',-,-',->,->>,->ArrayChunk,->Eduction,->Vec,->VecNode,->VecSeq,-cache-protocol-fn,-reset-methods,..,/,<,<=,=,==,>,>=,EMPTY-NODE,Inst,StackTraceElement->vec,Throwable->map,accessor,aclone,add-classpath,add-watch,agent,agent-error,agent-errors,aget,alength,alias,all-ns,alter,alter-meta!,alter-var-root,amap,ancestors,and,any?,apply,areduce,array-map,as->,aset,aset-boolean,aset-byte,aset-char,aset-double,aset-float,aset-int,aset-long,aset-short,assert,assoc,assoc!,assoc-in,associative?,atom,await,await-for,await1,bases,bean,bigdec,bigint,biginteger,binding,bit-and,bit-and-not,bit-clear,bit-flip,bit-not,bit-or,bit-set,bit-shift-left,bit-shift-right,bit-test,bit-xor,boolean,boolean-array,boolean?,booleans,bound-fn,bound-fn*,bound?,bounded-count,butlast,byte,byte-array,bytes,bytes?,case,cast,cat,char,char-array,char-escape-string,char-name-string,char?,chars,chunk,chunk-append,chunk-buffer,chunk-cons,chunk-first,chunk-next,chunk-rest,chunked-seq?,class,class?,clear-agent-errors,clojure-version,coll?,comment,commute,comp,comparator,compare,compare-and-set!,compile,complement,completing,concat,cond,cond->,cond->>,condp,conj,conj!,cons,constantly,construct-proxy,contains?,count,counted?,create-ns,create-struct,cycle,dec,dec',decimal?,declare,dedupe,default-data-readers,definline,definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecord,defstruct,deftype,delay,delay?,deliver,denominator,deref,derive,descendants,destructure,disj,disj!,dissoc,dissoc!,distinct,distinct?,doall,dorun,doseq,dosync,dotimes,doto,double,double-array,double?,doubles,drop,drop-last,drop-while,eduction,empty,empty?,ensure,ensure-reduced,enumeration-seq,error-handler,error-mode,eval,even?,every-pred,every?,ex-data,ex-info,extend,extend-protocol,extend-type,extenders,extends?,false?,ffirst,file-seq,filter,filterv,find,find-keyword,find-ns,find-protocol-impl,find-protocol-method,find-var,first,flatten,float,float-array,float?,floats,flush,fn,fn?,fnext,fnil,for,force,format,frequencies,future,future-call,future-cancel,future-cancelled?,future-done?,future?,gen-class,gen-interface,gensym,get,get-in,get-method,get-proxy-class,get-thread-bindings,get-validator,group-by,halt-when,hash,hash-combine,hash-map,hash-ordered-coll,hash-set,hash-unordered-coll,ident?,identical?,identity,if-let,if-not,if-some,ifn?,import,in-ns,inc,inc',indexed?,init-proxy,inst-ms,inst-ms*,inst?,instance?,int,int-array,int?,integer?,interleave,intern,interpose,into,into-array,ints,io!,isa?,iterate,iterator-seq,juxt,keep,keep-indexed,key,keys,keyword,keyword?,last,lazy-cat,lazy-seq,let,letfn,line-seq,list,list*,list?,load,load-file,load-reader,load-string,loaded-libs,locking,long,long-array,longs,loop,macroexpand,macroexpand-1,make-array,make-hierarchy,map,map-entry?,map-indexed,map?,mapcat,mapv,max,max-key,memfn,memoize,merge,merge-with,meta,method-sig,methods,min,min-key,mix-collection-hash,mod,munge,name,namespace,namespace-munge,nat-int?,neg-int?,neg?,newline,next,nfirst,nil?,nnext,not,not-any?,not-empty,not-every?,not=,ns,ns-aliases,ns-imports,ns-interns,ns-map,ns-name,ns-publics,ns-refers,ns-resolve,ns-unalias,ns-unmap,nth,nthnext,nthrest,num,number?,numerator,object-array,odd?,or,parents,partial,partition,partition-all,partition-by,pcalls,peek,persistent!,pmap,pop,pop!,pop-thread-bindings,pos-int?,pos?,pr,pr-str,prefer-method,prefers,primitives-classnames,print,print-ctor,print-dup,print-method,print-simple,print-str,printf,println,println-str,prn,prn-str,promise,proxy,proxy-call-with-super,proxy-mappings,proxy-name,proxy-super,push-thread-bindings,pvalues,qualified-ident?,qualified-keyword?,qualified-symbol?,quot,rand,rand-int,rand-nth,random-sample,range,ratio?,rational?,rationalize,re-find,re-groups,re-matcher,re-matches,re-pattern,re-seq,read,read-line,read-string,reader-conditional,reader-conditional?,realized?,record?,reduce,reduce-kv,reduced,reduced?,reductions,ref,ref-history-count,ref-max-history,ref-min-history,ref-set,refer,refer-clojure,reify,release-pending-sends,rem,remove,remove-all-methods,remove-method,remove-ns,remove-watch,repeat,repeatedly,replace,replicate,require,reset!,reset-meta!,reset-vals!,resolve,rest,restart-agent,resultset-seq,reverse,reversible?,rseq,rsubseq,run!,satisfies?,second,select-keys,send,send-off,send-via,seq,seq?,seqable?,seque,sequence,sequential?,set,set-agent-send-executor!,set-agent-send-off-executor!,set-error-handler!,set-error-mode!,set-validator!,set?,short,short-array,shorts,shuffle,shutdown-agents,simple-ident?,simple-keyword?,simple-symbol?,slurp,some,some->,some->>,some-fn,some?,sort,sort-by,sorted-map,sorted-map-by,sorted-set,sorted-set-by,sorted?,special-symbol?,spit,split-at,split-with,str,string?,struct,struct-map,subs,subseq,subvec,supers,swap!,swap-vals!,symbol,symbol?,sync,tagged-literal,tagged-literal?,take,take-last,take-nth,take-while,test,the-ns,thread-bound?,time,to-array,to-array-2d,trampoline,transduce,transient,tree-seq,true?,type,unchecked-add,unchecked-add-int,unchecked-byte,unchecked-char,unchecked-dec,unchecked-dec-int,unchecked-divide-int,unchecked-double,unchecked-float,unchecked-inc,unchecked-inc-int,unchecked-int,unchecked-long,unchecked-multiply,unchecked-multiply-int,unchecked-negate,unchecked-negate-int,unchecked-remainder-int,unchecked-short,unchecked-subtract,unchecked-subtract-int,underive,unquote,unquote-splicing,unreduced,unsigned-bit-shift-right,update,update-in,update-proxy,uri?,use,uuid?,val,vals,var-get,var-set,var?,vary-meta,vec,vector,vector-of,vector?,volatile!,volatile?,vreset!,vswap!,when,when-first,when-let,when-not,when-some,while,with-bindings,with-bindings*,with-in-str,with-loading-context,with-local-vars,with-meta,with-open,with-out-str,with-precision,with-redefs,with-redefs-fn,xml-seq,zero?,zipmap`.split(`,`),tokenizer:{root:[{include:`@whitespace`},[/@numbers/,`number`],[/@characters/,`string`],{include:`@string`},[/[()\[\]{}]/,`@brackets`],[/\/#"(?:\.|(?:")|[^"\n])*"\/g/,`regexp`],[/[#'@^`~]/,`meta`],[/@qualifiedSymbols/,{cases:{"^:.+$":`constant`,"@specialForms":`keyword`,"@coreSymbols":`keyword`,"@constants":`constant`,"@default":`identifier`}}]],whitespace:[[/[\s,]+/,`white`],[/;.*$/,`comment`],[/\(comment\b/,`comment`,`@comment`]],comment:[[/\(/,`comment`,`@push`],[/\)/,`comment`,`@pop`],[/[^()]/,`comment`]],string:[[/"/,`string`,`@multiLineString`]],multiLineString:[[/"/,`string`,`@popall`],[/@escapes/,`string.escape`],[/./,`string`]]}};export{e as conf,t as language};
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{blockComment:[`###`,`###`],lineComment:`#`},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],folding:{markers:{start:RegExp(`^\\s*#region\\b`),end:RegExp(`^\\s*#endregion\\b`)}}},t={defaultToken:``,ignoreCase:!0,tokenPostfix:`.coffee`,brackets:[{open:`{`,close:`}`,token:`delimiter.curly`},{open:`[`,close:`]`,token:`delimiter.square`},{open:`(`,close:`)`,token:`delimiter.parenthesis`}],regEx:/\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,keywords:`and.or.is.isnt.not.on.yes.@.no.off.true.false.null.this.new.delete.typeof.in.instanceof.return.throw.break.continue.debugger.if.else.switch.for.while.do.try.catch.finally.class.extends.super.undefined.then.unless.until.loop.of.by.when`.split(`.`),symbols:/[=><!~?&%|+\-*\/\^\.,\:]+/,escapes:/\\(?:[abfnrtv\\"'$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/\@[a-zA-Z_]\w*/,`variable.predefined`],[/[a-zA-Z_]\w*/,{cases:{this:`variable.predefined`,"@keywords":{token:`keyword.$0`},"@default":``}}],[/[ \t\r\n]+/,``],[/###/,`comment`,`@comment`],[/#.*$/,`comment`],[`///`,{token:`regexp`,next:`@hereregexp`}],[/^(\s*)(@regEx)/,[``,`regexp`]],[/(\()(\s*)(@regEx)/,[`@brackets`,``,`regexp`]],[/(\,)(\s*)(@regEx)/,[`delimiter`,``,`regexp`]],[/(\=)(\s*)(@regEx)/,[`delimiter`,``,`regexp`]],[/(\:)(\s*)(@regEx)/,[`delimiter`,``,`regexp`]],[/(\[)(\s*)(@regEx)/,[`@brackets`,``,`regexp`]],[/(\!)(\s*)(@regEx)/,[`delimiter`,``,`regexp`]],[/(\&)(\s*)(@regEx)/,[`delimiter`,``,`regexp`]],[/(\|)(\s*)(@regEx)/,[`delimiter`,``,`regexp`]],[/(\?)(\s*)(@regEx)/,[`delimiter`,``,`regexp`]],[/(\{)(\s*)(@regEx)/,[`@brackets`,``,`regexp`]],[/(\;)(\s*)(@regEx)/,[``,``,`regexp`]],[/}/,{cases:{"$S2==interpolatedstring":{token:`string`,next:`@pop`},"@default":`@brackets`}}],[/[{}()\[\]]/,`@brackets`],[/@symbols/,`delimiter`],[/\d+[eE]([\-+]?\d+)?/,`number.float`],[/\d+\.\d+([eE][\-+]?\d+)?/,`number.float`],[/0[xX][0-9a-fA-F]+/,`number.hex`],[/0[0-7]+(?!\d)/,`number.octal`],[/\d+/,`number`],[/[,.]/,`delimiter`],[/"""/,`string`,`@herestring."""`],[/'''/,`string`,`@herestring.'''`],[/"/,{cases:{"@eos":`string`,"@default":{token:`string`,next:`@string."`}}}],[/'/,{cases:{"@eos":`string`,"@default":{token:`string`,next:`@string.'`}}}]],string:[[/[^"'\#\\]+/,`string`],[/@escapes/,`string.escape`],[/\./,`string.escape.invalid`],[/\./,`string.escape.invalid`],[/#{/,{cases:{'$S2=="':{token:`string`,next:`root.interpolatedstring`},"@default":`string`}}],[/["']/,{cases:{"$#==$S2":{token:`string`,next:`@pop`},"@default":`string`}}],[/#/,`string`]],herestring:[[/("""|''')/,{cases:{"$1==$S2":{token:`string`,next:`@pop`},"@default":`string`}}],[/[^#\\'"]+/,`string`],[/['"]+/,`string`],[/@escapes/,`string.escape`],[/\./,`string.escape.invalid`],[/#{/,{token:`string.quote`,next:`root.interpolatedstring`}],[/#/,`string`]],comment:[[/[^#]+/,`comment`],[/###/,`comment`,`@pop`],[/#/,`comment`]],hereregexp:[[/[^\\\/#]+/,`regexp`],[/\\./,`regexp`],[/#.*$/,`comment`],[`///[igm]*`,{token:`regexp`,next:`@pop`}],[/\//,`regexp`]]}};export{e as conf,t as language};
|