@zenstackhq/language 3.0.0-beta.1 → 3.0.0-beta.10
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.cjs +430 -264
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -20
- package/dist/index.d.ts +19 -20
- package/dist/index.js +382 -218
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs +104 -26
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +5 -5
- package/dist/utils.d.ts +5 -5
- package/dist/utils.js +98 -21
- package/dist/utils.js.map +1 -1
- package/package.json +8 -6
- package/res/stdlib.zmodel +26 -56
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
|
+
import { Model, DataSource, DataModel, TypeDef, Enum, Attribute, Expression, InvocationExpr, FunctionDecl } from './ast.cjs';
|
|
1
2
|
import { ValidationAcceptor, Module, DeepPartial } from 'langium';
|
|
2
|
-
import * as langium_lsp from 'langium/lsp';
|
|
3
3
|
import { LangiumServices, PartialLangiumServices, LangiumSharedServices, DefaultSharedModuleContext } from 'langium/lsp';
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Loads ZModel document from the given file name. Include the additional document
|
|
7
|
+
* files if given.
|
|
8
|
+
*/
|
|
9
|
+
declare function loadDocument(fileName: string, additionalModelFiles?: string[]): Promise<{
|
|
10
|
+
success: true;
|
|
11
|
+
model: Model;
|
|
12
|
+
warnings: string[];
|
|
13
|
+
} | {
|
|
14
|
+
success: false;
|
|
15
|
+
errors: string[];
|
|
16
|
+
warnings: string[];
|
|
17
|
+
}>;
|
|
5
18
|
|
|
6
19
|
/******************************************************************************
|
|
7
20
|
* This file was generated by langium-cli 3.5.0.
|
|
@@ -21,7 +34,6 @@ declare const ZModelLanguageMetaData: {
|
|
|
21
34
|
declare class ZModelValidator {
|
|
22
35
|
protected readonly services: ZModelServices;
|
|
23
36
|
constructor(services: ZModelServices);
|
|
24
|
-
private shouldCheck;
|
|
25
37
|
checkModel(node: Model, accept: ValidationAcceptor): void;
|
|
26
38
|
checkDataSource(node: DataSource, accept: ValidationAcceptor): void;
|
|
27
39
|
checkDataModel(node: DataModel, accept: ValidationAcceptor): void;
|
|
@@ -69,26 +81,13 @@ declare const ZModelSharedModule: Module<ZModelSharedServices, DeepPartial<ZMode
|
|
|
69
81
|
* @param context Optional module context with the LSP connection
|
|
70
82
|
* @returns An object wrapping the shared services and the language-specific services
|
|
71
83
|
*/
|
|
72
|
-
declare function createZModelLanguageServices(context: DefaultSharedModuleContext): {
|
|
84
|
+
declare function createZModelLanguageServices(context: DefaultSharedModuleContext, logToConsole?: boolean): {
|
|
73
85
|
shared: LangiumSharedServices;
|
|
74
86
|
ZModelLanguage: ZModelServices;
|
|
75
87
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
shared: langium_lsp.LangiumSharedServices;
|
|
88
|
+
declare function createZModelServices(logToConsole?: boolean): {
|
|
89
|
+
shared: LangiumSharedServices;
|
|
79
90
|
ZModelLanguage: ZModelServices;
|
|
80
91
|
};
|
|
81
|
-
declare class DocumentLoadError extends Error {
|
|
82
|
-
constructor(message: string);
|
|
83
|
-
}
|
|
84
|
-
declare function loadDocument(fileName: string, pluginModelFiles?: string[]): Promise<{
|
|
85
|
-
success: true;
|
|
86
|
-
model: Model;
|
|
87
|
-
warnings: string[];
|
|
88
|
-
} | {
|
|
89
|
-
success: false;
|
|
90
|
-
errors: string[];
|
|
91
|
-
warnings: string[];
|
|
92
|
-
}>;
|
|
93
92
|
|
|
94
|
-
export {
|
|
93
|
+
export { type ZModelAddedServices, ZModelLanguageMetaData, ZModelLanguageModule, type ZModelServices, ZModelSharedModule, type ZModelSharedServices, createZModelLanguageServices, createZModelServices, loadDocument };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
|
+
import { Model, DataSource, DataModel, TypeDef, Enum, Attribute, Expression, InvocationExpr, FunctionDecl } from './ast.js';
|
|
1
2
|
import { ValidationAcceptor, Module, DeepPartial } from 'langium';
|
|
2
|
-
import * as langium_lsp from 'langium/lsp';
|
|
3
3
|
import { LangiumServices, PartialLangiumServices, LangiumSharedServices, DefaultSharedModuleContext } from 'langium/lsp';
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Loads ZModel document from the given file name. Include the additional document
|
|
7
|
+
* files if given.
|
|
8
|
+
*/
|
|
9
|
+
declare function loadDocument(fileName: string, additionalModelFiles?: string[]): Promise<{
|
|
10
|
+
success: true;
|
|
11
|
+
model: Model;
|
|
12
|
+
warnings: string[];
|
|
13
|
+
} | {
|
|
14
|
+
success: false;
|
|
15
|
+
errors: string[];
|
|
16
|
+
warnings: string[];
|
|
17
|
+
}>;
|
|
5
18
|
|
|
6
19
|
/******************************************************************************
|
|
7
20
|
* This file was generated by langium-cli 3.5.0.
|
|
@@ -21,7 +34,6 @@ declare const ZModelLanguageMetaData: {
|
|
|
21
34
|
declare class ZModelValidator {
|
|
22
35
|
protected readonly services: ZModelServices;
|
|
23
36
|
constructor(services: ZModelServices);
|
|
24
|
-
private shouldCheck;
|
|
25
37
|
checkModel(node: Model, accept: ValidationAcceptor): void;
|
|
26
38
|
checkDataSource(node: DataSource, accept: ValidationAcceptor): void;
|
|
27
39
|
checkDataModel(node: DataModel, accept: ValidationAcceptor): void;
|
|
@@ -69,26 +81,13 @@ declare const ZModelSharedModule: Module<ZModelSharedServices, DeepPartial<ZMode
|
|
|
69
81
|
* @param context Optional module context with the LSP connection
|
|
70
82
|
* @returns An object wrapping the shared services and the language-specific services
|
|
71
83
|
*/
|
|
72
|
-
declare function createZModelLanguageServices(context: DefaultSharedModuleContext): {
|
|
84
|
+
declare function createZModelLanguageServices(context: DefaultSharedModuleContext, logToConsole?: boolean): {
|
|
73
85
|
shared: LangiumSharedServices;
|
|
74
86
|
ZModelLanguage: ZModelServices;
|
|
75
87
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
shared: langium_lsp.LangiumSharedServices;
|
|
88
|
+
declare function createZModelServices(logToConsole?: boolean): {
|
|
89
|
+
shared: LangiumSharedServices;
|
|
79
90
|
ZModelLanguage: ZModelServices;
|
|
80
91
|
};
|
|
81
|
-
declare class DocumentLoadError extends Error {
|
|
82
|
-
constructor(message: string);
|
|
83
|
-
}
|
|
84
|
-
declare function loadDocument(fileName: string, pluginModelFiles?: string[]): Promise<{
|
|
85
|
-
success: true;
|
|
86
|
-
model: Model;
|
|
87
|
-
warnings: string[];
|
|
88
|
-
} | {
|
|
89
|
-
success: false;
|
|
90
|
-
errors: string[];
|
|
91
|
-
warnings: string[];
|
|
92
|
-
}>;
|
|
93
92
|
|
|
94
|
-
export {
|
|
93
|
+
export { type ZModelAddedServices, ZModelLanguageMetaData, ZModelLanguageModule, type ZModelServices, ZModelSharedModule, type ZModelSharedServices, createZModelLanguageServices, createZModelServices, loadDocument };
|