@athrio/loom 0.0.12 → 0.0.13
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-DJGDopcP.js +3 -0
- package/dist/{LanguageLoader-BzlRnQhO.js → LanguageLoader-kZ-5Qbwr.js} +19 -11
- package/dist/{LanguageLoader-BzlRnQhO.js.map → LanguageLoader-kZ-5Qbwr.js.map} +1 -1
- package/dist/{LanguageService-BTCvgdWm.js → LanguageService-CcElIYBZ.js} +2 -2
- package/dist/{LanguageService-BTCvgdWm.js.map → LanguageService-CcElIYBZ.js.map} +1 -1
- package/dist/{LoomFormatter-Bu8L8cdR.js → LoomFormatter-D6wh-SLN.js} +11 -3
- package/dist/{LoomFormatter-Bu8L8cdR.js.map → LoomFormatter-D6wh-SLN.js.map} +1 -1
- package/dist/{LoomServer-DXIree_1.js → LoomServer-C54yIIo1.js} +28 -12
- package/dist/{LoomServer-DXIree_1.js.map → LoomServer-C54yIIo1.js.map} +1 -1
- package/dist/{LoomStore-pA-ohGNX.js → LoomStore-axDgE8RF.js} +103 -21
- package/dist/LoomStore-axDgE8RF.js.map +1 -0
- package/dist/{Runtime-XT-nb-2w.js → Runtime-Cj1Rsxs1.js} +1 -1
- package/dist/{Runtime-Byw6clui.js → Runtime-D4WijrpR.js} +3 -3
- package/dist/{Runtime-Byw6clui.js.map → Runtime-D4WijrpR.js.map} +1 -1
- package/dist/_virtual_tree-sitter-loom-CFLf84Ng.js +15 -0
- package/dist/{dist-D3YSXNOO.js → dist-LBqwqmSY.js} +2 -2
- package/dist/{dist-D3YSXNOO.js.map → dist-LBqwqmSY.js.map} +1 -1
- package/dist/main.js +224 -49
- 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 { Di as Service, Nr as TaggedError, Sn as die, mr as effect } from "./dist-LBqwqmSY.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-CcElIYBZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageService-
|
|
1
|
+
{"version":3,"file":"LanguageService-CcElIYBZ.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 { $i as
|
|
4
|
-
import {
|
|
3
|
+
import { $i as Number$2, $r as getSomes, An as forEach, Bi as getOrThrow, Br as dropWhile, Bt as Struct, Ci as getOrElse, Di as Service, Dt as ArraySchema, Fi as flatMap$1, Ft as Number$1, Gr as findFirst, Gt as Unknown, Hi as getOrUndefined, Hr as ensure, Ii as flatMapNullishOr, Ir as chop, It as Option, Ji as none, Jr as findLastIndex, Jt as decodeUnknownResult, Ki as map$2, Kn as orDie, Kr as findFirstIndex, Li as fromNullishOr, Lr as dedupe, Lt as ReadonlyMap, Mt as Int, Ni as exists, Nn as fromNullishOr$1, Nr as TaggedError, Nt as Literal, On as flatMap$2, Ot as Boolean$1, Pi as filter, Pn as gen, Pr as taggedEnum, Pt as Literals, Qr as get, Qt as optional, Rn as logError, Rr as drop, Rt as Record, S as withReturnType, Tn as fail, U as make, Ui as isNone, Ur as every, Ut as Tuple, Vi as getOrThrowWith, Vn as map$1, W as mapAccum, Wi as isSome, Wr as filter$1, Wt as Union, X as runCollect, Xi as some, Xr as flatten, Xt as isGreaterThan, Yi as orElse$1, Yr as flatMap, Zi as toArray, Zr as fromIterable, Zt as makeFilter, _ as orElse, _a as pipe, _i as some$1, _n as catchCause, aa as mapInput, ai as isReadonlyArrayNonEmpty, ar as sync, b as when, bi as takeRight, bn as catchTags, ci as lastNonEmpty, d as get$1, ea as String$2, en as tag, et as unfold, f as make$1, fi as matchLeft, fn as andThen, g as exhaustive, gi as reverse, gr as provide, h as defined, hi as reduce, hr as mergeAll, ii as isArray, ji as all, li as map$3, lr as try_, m as update, mi as range, mr as effect, na as combineAll, ni as head, nn as withConstructorDefault, oi as join$1, p as modifyEffect, pn as as, qi as match, qn as orElseSucceed, qt as decodeUnknownOption, ra as flip, ri as headNonEmpty, rr as succeed, si as last, ta as combine, ti as groupWith, ui as mapAccum$1, v as tag$1, vi as sort, wi as match$1, x as whenOr, xi as zip, y as value, yi as span$2, yn as catchTag, zi as getOrElse$1, zr as dropRight, zt as String$1 } from "./dist-LBqwqmSY.js";
|
|
4
|
+
import { _ as profileOf, v as symbolAt, y as symbolsOf } from "./LoomStore-axDgE8RF.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
|
|
@@ -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 {
|
|
@@ -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-D6wh-SLN.js.map
|