@athrio/loom 0.0.12 → 0.0.14
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/dist/{LanguageLoader-BzlRnQhO.js → LanguageLoader-BAPSmTv0.js} +19 -11
- package/dist/{LanguageLoader-BzlRnQhO.js.map → LanguageLoader-BAPSmTv0.js.map} +1 -1
- package/dist/LanguageLoader-BF5irHbe.js +3 -0
- package/dist/{LanguageService-BTCvgdWm.js → LanguageService-C3_9lh8E.js} +2 -2
- package/dist/{LanguageService-BTCvgdWm.js.map → LanguageService-C3_9lh8E.js.map} +1 -1
- package/dist/{LoomFormatter-Bu8L8cdR.js → LoomFormatter-CcAXsbSL.js} +13 -5
- package/dist/{LoomFormatter-Bu8L8cdR.js.map → LoomFormatter-CcAXsbSL.js.map} +1 -1
- package/dist/{LoomServer-DXIree_1.js → LoomServer-DpleSkxj.js} +28 -12
- package/dist/{LoomServer-DXIree_1.js.map → LoomServer-DpleSkxj.js.map} +1 -1
- package/dist/{LoomStore-pA-ohGNX.js → LoomStore-Bcx6V9HH.js} +106 -22
- package/dist/LoomStore-Bcx6V9HH.js.map +1 -0
- package/dist/{Runtime-XT-nb-2w.js → Runtime-B-1DeuX_.js} +1 -1
- package/dist/{Runtime-Byw6clui.js → Runtime-CE2kCsKX.js} +3 -3
- package/dist/{Runtime-Byw6clui.js.map → Runtime-CE2kCsKX.js.map} +1 -1
- package/dist/_virtual_tree-sitter-loom-CFLf84Ng.js +15 -0
- package/dist/{dist-D3YSXNOO.js → dist-NXZtp5_0.js} +2 -2
- package/dist/{dist-D3YSXNOO.js.map → dist-NXZtp5_0.js.map} +1 -1
- package/dist/main.js +375 -52
- package/dist/main.js.map +1 -1
- package/package.json +3 -1
- package/dist/LanguageLoader-DJZBFaqF.js +0 -3
- package/dist/LoomStore-pA-ohGNX.js.map +0 -1
- package/dist/tree-sitter-loom/editors/helix/queries/loom/highlights.scm +0 -120
- package/dist/tree-sitter-loom/editors/helix/queries/loom/injections.scm +0 -413
- package/dist/tree-sitter-loom/queries/highlights.scm +0 -120
- package/dist/tree-sitter-loom/queries/injections.scm +0 -85
- package/dist/tree-sitter-loom/src/parser.c +0 -4689
- package/dist/tree-sitter-loom/src/scanner.c +0 -293
- package/dist/tree-sitter-loom/src/tree_sitter/alloc.h +0 -54
- package/dist/tree-sitter-loom/src/tree_sitter/array.h +0 -330
- package/dist/tree-sitter-loom/src/tree_sitter/parser.h +0 -286
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { r as __exportAll } from "./rolldown-runtime-YU9U6SYh.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Nr as TaggedError, Oi as Service, Sn as die, mr as effect } from "./dist-NXZtp5_0.js";
|
|
4
4
|
//#region ../loom-lang-services/src/LanguageService.ts
|
|
5
5
|
var LanguageService_exports = /* @__PURE__ */ __exportAll({
|
|
6
6
|
Composition: () => Composition,
|
|
@@ -34,4 +34,4 @@ var defineLanguageService = (service) => {
|
|
|
34
34
|
//#endregion
|
|
35
35
|
export { defineLanguageService as a, TypescriptSdk as i, FrameQuery as n, isLanguageService as o, LanguageService_exports as r, Composition as t };
|
|
36
36
|
|
|
37
|
-
//# sourceMappingURL=LanguageService-
|
|
37
|
+
//# sourceMappingURL=LanguageService-C3_9lh8E.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageService-
|
|
1
|
+
{"version":3,"file":"LanguageService-C3_9lh8E.js","names":[],"sources":["../../loom-lang-services/src/LanguageService.ts"],"sourcesContent":["import type { LanguageServicePlugin } from '@volar/language-service'\nimport { Context, Data, Effect, Layer } from 'effect'\nimport { type Diagnostic } from '@athrio/loom-ast/LoomNode'\nimport type { SemanticToken } from '@athrio/loom-ast/LoomSymbol'\n\nexport class ServiceError extends Data.TaggedError('ServiceError')<{\n readonly service: string\n readonly reason: string\n}> {}\n\nexport interface LanguageService {\n readonly id: string\n readonly displayName: string\n readonly extensions: ReadonlyArray<string>\n readonly plugins: (\n context: LanguageServiceContext,\n ) => Effect.Effect<ReadonlyArray<LanguageServicePlugin>, ServiceError, HostCapabilities>\n readonly format?: (request: FormatRequest) => Effect.Effect<string, ServiceError>\n}\n\nexport interface FormatRequest {\n readonly code: string\n readonly path: string\n readonly width: number\n}\n\nexport class TypescriptSdk extends Context.Service<TypescriptSdk>()('TypescriptSdk', {\n make: Effect.die('TypescriptSdk must be provided by the host') as Effect.Effect<\n typeof import('typescript')\n >,\n}) {\n static readonly layer = Layer.effect(this, this.make)\n}\n\nexport interface FrameLocation {\n readonly path: string\n readonly range: {\n readonly start: { readonly line: number; readonly character: number }\n readonly end: { readonly line: number; readonly character: number }\n }\n}\n\nexport interface FrameToken {\n readonly range: FrameLocation['range']\n readonly type: SemanticToken\n}\n\nexport interface FrameQueryApi {\n readonly diagnostics: (path: string) => ReadonlyArray<Diagnostic>\n readonly definition: (path: string, offset: number) => FrameLocation | undefined\n readonly references: (path: string, offset: number) => ReadonlyArray<FrameLocation>\n readonly rename: (path: string, offset: number) => ReadonlyArray<FrameLocation>\n readonly renameRange: (path: string, offset: number) => FrameLocation | undefined\n readonly navigationRange: (path: string, offset: number) => FrameLocation | undefined\n readonly semanticTokens: (path: string) => ReadonlyArray<FrameToken>\n readonly format: (path: string, text: string) => Promise<string>\n}\n\nexport class FrameQuery extends Context.Service<FrameQuery>()('FrameQuery', {\n make: Effect.die('FrameQuery must be provided by the host') as Effect.Effect<FrameQueryApi>,\n}) {\n static readonly layer = Layer.effect(this, this.make)\n}\n\nexport interface ComposedFile {\n readonly path: string\n readonly content: string\n readonly loomPath: string\n readonly rootId: string\n readonly heading: FrameLocation\n}\n\nexport interface CompositionApi {\n readonly rootsFor: (path: string) => ReadonlyArray<ComposedFile>\n}\n\nexport class Composition extends Context.Service<Composition>()('Composition', {\n make: Effect.die('Composition must be provided by the host') as Effect.Effect<CompositionApi>,\n}) {\n static readonly layer = Layer.effect(this, this.make)\n}\n\nexport type HostCapabilities = TypescriptSdk | FrameQuery | Composition\n\nexport interface LanguageServiceContext {\n readonly settings: Record<string, unknown>\n}\n\nexport const isLanguageService = (value: unknown): value is LanguageService =>\n typeof value === 'object' &&\n value !== null &&\n typeof (value as LanguageService).id === 'string' &&\n typeof (value as LanguageService).displayName === 'string' &&\n Array.isArray((value as LanguageService).extensions) &&\n typeof (value as LanguageService).plugins === 'function'\n\nexport const defineLanguageService = (service: LanguageService): LanguageService => {\n if (!isLanguageService(service)) {\n throw new Error(\n 'defineLanguageService: the value does not satisfy the LanguageService contract',\n )\n }\n return service\n}\n"],"mappings":";;;;;;;;;;;;AAKA,IAAa,eAAb,cAAkC,YAAiB,cAAc,CAAC,CAG/D,CAAC;AAkBJ,IAAa,gBAAb,cAAmC,QAA+B,CAAC,CAAC,iBAAiB,EACnF,MAAM,IAAW,4CAA4C,EAG/D,CAAC,CAAC,CAAC;;eACuB,OAAa,MAAM,KAAK,IAAI;;AACtD;AA0BA,IAAa,aAAb,cAAgC,QAA4B,CAAC,CAAC,cAAc,EAC1E,MAAM,IAAW,yCAAyC,EAC5D,CAAC,CAAC,CAAC;;eACuB,OAAa,MAAM,KAAK,IAAI;;AACtD;AAcA,IAAa,cAAb,cAAiC,QAA6B,CAAC,CAAC,eAAe,EAC7E,MAAM,IAAW,0CAA0C,EAC7D,CAAC,CAAC,CAAC;;eACuB,OAAa,MAAM,KAAK,IAAI;;AACtD;AAQA,IAAa,qBAAqB,UAChC,OAAO,UAAU,YACjB,UAAU,QACV,OAAQ,MAA0B,OAAO,YACzC,OAAQ,MAA0B,gBAAgB,YAClD,MAAM,QAAS,MAA0B,UAAU,KACnD,OAAQ,MAA0B,YAAY;AAEhD,IAAa,yBAAyB,YAA8C;CAClF,IAAI,CAAC,kBAAkB,OAAO,GAC5B,MAAM,IAAI,MACR,gFACF;CAEF,OAAO;AACT"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { o as __toESM, t as __commonJSMin } from "./rolldown-runtime-YU9U6SYh.js";
|
|
3
|
-
import { $
|
|
4
|
-
import {
|
|
3
|
+
import { $r as get, An as forEach, Bi as getOrElse$1, Br as dropRight, Bt as Struct, Dt as ArraySchema, Fi as filter, Ft as Number$1, Gi as isSome, Gr as filter$1, Gt as Unknown, Hi as getOrThrowWith, Ii as flatMap$1, Ir as chop, It as Option, Ji as match, Jt as decodeUnknownResult, Kn as orDie, Kr as findFirst, Li as flatMapNullishOr, Lr as dedupe, Lt as ReadonlyMap, Mi as all, Mt as Int, Nn as fromNullishOr$1, Nr as TaggedError, Nt as Literal, Oi as Service, On as flatMap$2, Ot as Boolean$1, Pi as exists, Pn as gen, Pr as taggedEnum, Pt as Literals, Qi as toArray, Qr as fromIterable, Qt as optional, Ri as fromNullishOr, Rn as logError, Rt as Record, S as withReturnType, Si as zip, Ti as match$1, Tn as fail, U as make, Ui as getOrUndefined, Ur as ensure, Ut as Tuple, Vi as getOrThrow, Vn as map$1, Vr as dropWhile, W as mapAccum, Wi as isNone, Wr as every, Wt as Union, X as runCollect, Xi as orElse$1, Xr as flatMap, Xt as isGreaterThan, Yi as none, Yr as findLastIndex, Zi as some, Zr as flatten, Zt as makeFilter, _ as orElse, _i as reverse, _n as catchCause, ai as isArray, ar as sync, b as when, bi as span$2, bn as catchTags, ci as last, d as get$1, di as mapAccum$1, ea as Number$2, ei as getSomes, en as tag, et as unfold, f as make$1, fn as andThen, g as exhaustive, gi as reduce, gr as provide, h as defined, hi as range, hr as mergeAll, ia as flip, ii as headNonEmpty, li as lastNonEmpty, lr as try_, m as update, mr as effect, na as combine, ni as groupWith, nn as withConstructorDefault, oa as mapInput, oi as isReadonlyArrayNonEmpty, p as modifyEffect, pi as matchLeft, pn as as, qi as map$2, qn as orElseSucceed, qr as findFirstIndex, qt as decodeUnknownOption, ra as combineAll, ri as head, rr as succeed, si as join$1, ta as String$2, ui as map$3, v as tag$1, vi as some$1, wi as getOrElse, x as whenOr, xi as takeRight, y as value, ya as pipe, yi as sort, yn as catchTag, zr as drop, zt as String$1 } from "./dist-NXZtp5_0.js";
|
|
4
|
+
import { b as symbolsOf, o as isWorkspace, v as profileOf, y as symbolAt } from "./LoomStore-Bcx6V9HH.js";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
7
7
|
//#region ../loom-ast/src/ast/LoomNode.ts
|
|
@@ -8131,7 +8131,7 @@ var storeDirName = ".loom";
|
|
|
8131
8131
|
var manifestName = "config.yaml";
|
|
8132
8132
|
var defaultCorpus = "corpus";
|
|
8133
8133
|
var findWorkspace = (dir) => {
|
|
8134
|
-
if (existsSync(resolve(dir, storeDirName))) return dir;
|
|
8134
|
+
if (existsSync(resolve(dir, storeDirName, manifestName))) return dir;
|
|
8135
8135
|
const parent = dirname(dir);
|
|
8136
8136
|
return parent === dir ? void 0 : findWorkspace(parent);
|
|
8137
8137
|
};
|
|
@@ -8193,6 +8193,14 @@ var LoomConfig = class extends Service()("LoomConfig", { make: succeed({
|
|
|
8193
8193
|
const store = resolve(workspace, storeDirName);
|
|
8194
8194
|
mkdirSync(store, { recursive: true });
|
|
8195
8195
|
writeFileSync(resolve(store, manifestName), stringify(manifest));
|
|
8196
|
+
}),
|
|
8197
|
+
edit: (workspace, path, value) => sync(() => {
|
|
8198
|
+
const store = resolve(workspace, storeDirName);
|
|
8199
|
+
const file = resolve(store, manifestName);
|
|
8200
|
+
mkdirSync(store, { recursive: true });
|
|
8201
|
+
const document = parseDocument(existsSync(file) ? readFileSync(file, "utf8") : "");
|
|
8202
|
+
document.setIn(path, value);
|
|
8203
|
+
writeFileSync(file, document.toString());
|
|
8196
8204
|
})
|
|
8197
8205
|
}) }) {
|
|
8198
8206
|
static {
|
|
@@ -8494,7 +8502,7 @@ var storeDirs = /* @__PURE__ */ new Set([
|
|
|
8494
8502
|
".git"
|
|
8495
8503
|
]);
|
|
8496
8504
|
var projectScope = (own, git) => ({
|
|
8497
|
-
opens: (dir) => !storeDirs.has(basename(dir)) && !
|
|
8505
|
+
opens: (dir) => !storeDirs.has(basename(dir)) && !isWorkspace(dir) && !ignores(own, git, dir, true),
|
|
8498
8506
|
keeps: (loom) => !ignores(own, git, loom, false),
|
|
8499
8507
|
into: (dir) => projectScope(own, entering(dir, git))
|
|
8500
8508
|
});
|
|
@@ -9382,4 +9390,4 @@ var LoomFormatter = class extends Service()("LoomFormatter", { make: gen(functio
|
|
|
9382
9390
|
//#endregion
|
|
9383
9391
|
export { holds as a, storeDirs as c, ReadError as d, stringSnapshot as i, PackageConfig as l, DocumentSource as n, loomsIn as o, LoomCompiler as r, projectIn as s, LoomFormatter as t, LoomConfig as u };
|
|
9384
9392
|
|
|
9385
|
-
//# sourceMappingURL=LoomFormatter-
|
|
9393
|
+
//# sourceMappingURL=LoomFormatter-CcAXsbSL.js.map
|