@invinite-org/chartlang-language-service 1.3.0 → 1.4.1

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/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nexport { createLanguageService } from \"./createLanguageService.js\";\nexport type {\n ChartlangLanguageService,\n CompletionItem,\n DefinitionLocation,\n HoverDoc,\n LanguageServiceOptions,\n LspDiagnostic,\n LspRange,\n LspSeverity,\n SignatureHelp,\n} from \"./types.js\";\n"]}
package/dist/types.d.ts CHANGED
@@ -141,6 +141,18 @@ export type LanguageServiceOptions = Readonly<{
141
141
  * boundary instead of loading the Node-only compiler graph locally.
142
142
  */
143
143
  compileToDiagnostics?: (source: string) => Promise<ReadonlyArray<LspDiagnostic>>;
144
+ /**
145
+ * Forwarded to the local Node compiler's `inMemoryModules` option when
146
+ * `compileToDiagnostics` is NOT injected. Lets a host that runs the
147
+ * compiler where the workspace `@invinite-org/chartlang-*` packages are
148
+ * not resolvable on disk (e.g. a bundled serverless function) supply
149
+ * pre-bundled package sources, so the local diagnostics compile resolves
150
+ * them from memory instead of failing on the filesystem. Ignored when
151
+ * `compileToDiagnostics` is provided.
152
+ *
153
+ * @since 1.2
154
+ */
155
+ inMemoryModules?: Readonly<Record<string, string>>;
144
156
  }>;
145
157
  /**
146
158
  * Headless language-service surface consumed by the editor extensions
@@ -1 +1 @@
1
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AG,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5E,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAAC;IAC7D,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC;IAC9E,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC;IACvE,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAAC;IACzE,qBAAqB,IAAI,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAC9D,CAAC,CAAC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { Capabilities } from \"@invinite-org/chartlang-adapter-kit\";\nimport type { IntervalDescriptor } from \"@invinite-org/chartlang-core\";\n\n/**\n * One-based editor range used by language-service diagnostics.\n *\n * @since 0.4\n * @stable\n * @example\n * const range: LspRange = { startLine: 1, startColumn: 1, endLine: 1, endColumn: 4 };\n * void range;\n */\nexport type LspRange = Readonly<{\n startLine: number;\n startColumn: number;\n endLine: number;\n endColumn: number;\n}>;\n\n/**\n * Diagnostic severity values consumed by editor adapters.\n *\n * @since 0.4\n * @stable\n * @example\n * const severity: LspSeverity = \"warning\";\n * void severity;\n */\nexport type LspSeverity = \"error\" | \"warning\" | \"info\" | \"hint\";\n\n/**\n * LSP-shaped diagnostic emitted by the headless language service.\n *\n * @since 0.4\n * @stable\n * @example\n * const diagnostic: LspDiagnostic = {\n * range: { startLine: 1, startColumn: 1, endLine: 1, endColumn: 1 },\n * severity: \"error\",\n * code: \"unbounded-loop\",\n * message: \"while loops are not allowed\",\n * };\n * void diagnostic;\n */\nexport type LspDiagnostic = Readonly<{\n range: LspRange;\n severity: LspSeverity;\n code: string;\n message: string;\n relatedCallsite?: string;\n}>;\n\n/**\n * Hover payload rendered by editor integrations.\n *\n * @since 0.4\n * @stable\n * @example\n * const hover: HoverDoc = { title: \"ta.ema(source, length)\", summary: \"EMA.\" };\n * void hover;\n */\nexport type HoverDoc = Readonly<{\n title: string;\n summary: string;\n paramTable?: ReadonlyArray<{ name: string; type: string; doc: string }>;\n examples?: ReadonlyArray<string>;\n}>;\n\n/**\n * Completion item returned by the language-service completion source.\n *\n * @since 0.4\n * @stable\n * @example\n * const item: CompletionItem = {\n * label: \"ta.ema\",\n * kind: \"function\",\n * insertText: \"ta.ema\",\n * };\n * void item;\n */\nexport type CompletionItem = Readonly<{\n label: string;\n kind: \"function\" | \"namespace\" | \"property\" | \"enumMember\" | \"keyword\";\n insertText: string;\n detail?: string;\n doc?: HoverDoc;\n}>;\n\n/**\n * Signature-help payload for primitive calls.\n *\n * @since 0.4\n * @stable\n * @example\n * const help: SignatureHelp = {\n * label: \"request.security(opts)\",\n * parameters: [{ name: \"opts\", doc: \"Request options.\" }],\n * activeParameter: 0,\n * };\n * void help;\n */\nexport type SignatureHelp = Readonly<{\n label: string;\n parameters: ReadonlyArray<{ name: string; doc: string }>;\n activeParameter: number;\n}>;\n\n/**\n * Definition target for primitive jump-to-definition.\n *\n * @since 0.4\n * @stable\n * @example\n * const location: DefinitionLocation = {\n * file: \"packages/core/dist/index.d.ts\",\n * line: 1,\n * column: 1,\n * };\n * void location;\n */\nexport type DefinitionLocation = Readonly<{\n file: string;\n line: number;\n column: number;\n}>;\n\n/**\n * Options accepted by the language-service factory.\n *\n * @since 0.4\n * @stable\n * @example\n * const opts: LanguageServiceOptions = {};\n * void opts;\n */\nexport type LanguageServiceOptions = Readonly<{\n targetCapabilities?: Capabilities;\n /**\n * Optional host-provided diagnostics compiler. Browser consumers\n * should use this to route compilation through a server / worker\n * boundary instead of loading the Node-only compiler graph locally.\n */\n compileToDiagnostics?: (source: string) => Promise<ReadonlyArray<LspDiagnostic>>;\n /**\n * Forwarded to the local Node compiler's `inMemoryModules` option when\n * `compileToDiagnostics` is NOT injected. Lets a host that runs the\n * compiler where the workspace `@invinite-org/chartlang-*` packages are\n * not resolvable on disk (e.g. a bundled serverless function) supply\n * pre-bundled package sources, so the local diagnostics compile resolves\n * them from memory instead of failing on the filesystem. Ignored when\n * `compileToDiagnostics` is provided.\n *\n * @since 1.2\n */\n inMemoryModules?: Readonly<Record<string, string>>;\n}>;\n\n/**\n * Headless language-service surface consumed by the editor extensions\n * and any embedding consumer. The {@link createLanguageService} factory\n * returns a value of this exact shape; consumers can also supply their\n * own implementation (for example a server-backed `compileToDiagnostics`\n * that POSTs to a build endpoint) and inject it into\n * `createChartlangEditor` via `opts.service`.\n *\n * @since 0.4\n * @stable\n * @example\n * const stub: ChartlangLanguageService = {\n * compileToDiagnostics: async () => [],\n * getHoverDoc: () => null,\n * getCompletions: () => [],\n * getSignatureHelp: () => null,\n * getDefinition: () => null,\n * getAvailableIntervals: () => [],\n * };\n * void stub;\n */\nexport type ChartlangLanguageService = Readonly<{\n compileToDiagnostics(source: string): Promise<ReadonlyArray<LspDiagnostic>>;\n getHoverDoc(source: string, offset: number): HoverDoc | null;\n getCompletions(source: string, offset: number): ReadonlyArray<CompletionItem>;\n getSignatureHelp(source: string, offset: number): SignatureHelp | null;\n getDefinition(source: string, offset: number): DefinitionLocation | null;\n getAvailableIntervals(): ReadonlyArray<IntervalDescriptor>;\n}>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invinite-org/chartlang-language-service",
3
- "version": "1.3.0",
3
+ "version": "1.4.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Headless editor intelligence — hover, completions, diagnostics, signature help",
@@ -20,9 +20,9 @@
20
20
  ],
21
21
  "dependencies": {
22
22
  "typescript": "^5.6.0",
23
- "@invinite-org/chartlang-compiler": "1.1.0",
24
- "@invinite-org/chartlang-adapter-kit": "1.2.0",
25
- "@invinite-org/chartlang-core": "1.1.0"
23
+ "@invinite-org/chartlang-adapter-kit": "1.2.1",
24
+ "@invinite-org/chartlang-compiler": "1.2.1",
25
+ "@invinite-org/chartlang-core": "1.1.1"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public",