@valtzu/codemirror-lang-el 0.7.0 → 0.9.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/CHANGELOG.md +13 -0
- package/README.md +18 -25
- package/dist/index.cjs +181 -112
- package/dist/index.d.cts +73 -4
- package/dist/index.d.ts +73 -4
- package/dist/index.js +189 -123
- package/package.json +8 -13
- package/dist/complete.cjs +0 -224
- package/dist/complete.d.cts +0 -3
- package/dist/complete.d.ts +0 -3
- package/dist/complete.js +0 -220
- package/dist/linter.cjs +0 -207
- package/dist/linter.d.cts +0 -8
- package/dist/linter.d.ts +0 -8
- package/dist/linter.js +0 -202
- package/dist/tooltip.cjs +0 -258
- package/dist/tooltip.d.cts +0 -7
- package/dist/tooltip.d.ts +0 -7
- package/dist/tooltip.js +0 -253
- package/dist/utils.cjs +0 -150
- package/dist/utils.d.cts +0 -53
- package/dist/utils.d.ts +0 -53
- package/dist/utils.js +0 -141
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { LRLanguage, LanguageSupport } from
|
|
2
|
-
import
|
|
1
|
+
import { LRLanguage, LanguageSupport } from '@codemirror/language';
|
|
2
|
+
import * as _codemirror_state from '@codemirror/state';
|
|
3
|
+
import { EditorState, StateField, Extension } from '@codemirror/state';
|
|
4
|
+
import { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
|
|
5
|
+
import { SyntaxNode } from '@lezer/common';
|
|
6
|
+
import { Tooltip } from '@codemirror/view';
|
|
7
|
+
|
|
3
8
|
/**
|
|
4
9
|
* Represents a variable or a property of an object
|
|
5
10
|
*/
|
|
@@ -14,7 +19,7 @@ interface ELIdentifier {
|
|
|
14
19
|
*/
|
|
15
20
|
interface ELFunction {
|
|
16
21
|
name: string;
|
|
17
|
-
args
|
|
22
|
+
args?: ELParameter[];
|
|
18
23
|
info?: string;
|
|
19
24
|
returnType?: string[];
|
|
20
25
|
}
|
|
@@ -36,6 +41,70 @@ interface ExpressionLanguageConfig {
|
|
|
36
41
|
identifiers?: ELIdentifier[];
|
|
37
42
|
functions?: ELFunction[];
|
|
38
43
|
}
|
|
44
|
+
interface ELKeyword {
|
|
45
|
+
name: string;
|
|
46
|
+
detail?: string;
|
|
47
|
+
info?: string;
|
|
48
|
+
}
|
|
49
|
+
declare enum ELScalar {
|
|
50
|
+
Bool = "bool",
|
|
51
|
+
Number = "number",
|
|
52
|
+
String = "string",
|
|
53
|
+
Null = "null",
|
|
54
|
+
Any = "any"
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare function expressionLanguageCompletion(context: CompletionContext): CompletionResult | null;
|
|
58
|
+
|
|
59
|
+
declare const complete_d_expressionLanguageCompletion: typeof expressionLanguageCompletion;
|
|
60
|
+
declare namespace complete_d {
|
|
61
|
+
export { complete_d_expressionLanguageCompletion as expressionLanguageCompletion };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare const expressionLanguageLinter: _codemirror_state.Extension;
|
|
65
|
+
|
|
66
|
+
declare const linter_d_expressionLanguageLinter: typeof expressionLanguageLinter;
|
|
67
|
+
declare namespace linter_d {
|
|
68
|
+
export { linter_d_expressionLanguageLinter as expressionLanguageLinter };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare const Function: number;
|
|
72
|
+
declare const Method: number;
|
|
73
|
+
declare const Property: number;
|
|
74
|
+
declare const Variable: number;
|
|
75
|
+
|
|
76
|
+
declare const createInfoElement: (html: string) => HTMLDivElement;
|
|
77
|
+
declare function resolveFunctionDefinition(node: SyntaxNode | null, state: EditorState, config: ExpressionLanguageConfig): ELFunction | undefined;
|
|
78
|
+
declare const resolveIdentifier: (nodeTypeId: typeof Method | typeof Property | typeof Function | typeof Variable, identifier?: string, config?: {
|
|
79
|
+
identifiers?: ELIdentifier[];
|
|
80
|
+
functions?: ELFunction[];
|
|
81
|
+
}) => ELIdentifier | ELFunction | undefined;
|
|
82
|
+
declare function resolveTypes(state: EditorState, node: SyntaxNode | undefined | null, config: ExpressionLanguageConfig): Set<string>;
|
|
83
|
+
declare function getExpressionLanguageConfig(state: EditorState): ExpressionLanguageConfig;
|
|
84
|
+
declare const keywords: ELKeyword[];
|
|
85
|
+
|
|
86
|
+
declare const utils_d_createInfoElement: typeof createInfoElement;
|
|
87
|
+
declare const utils_d_getExpressionLanguageConfig: typeof getExpressionLanguageConfig;
|
|
88
|
+
declare const utils_d_keywords: typeof keywords;
|
|
89
|
+
declare const utils_d_resolveFunctionDefinition: typeof resolveFunctionDefinition;
|
|
90
|
+
declare const utils_d_resolveIdentifier: typeof resolveIdentifier;
|
|
91
|
+
declare const utils_d_resolveTypes: typeof resolveTypes;
|
|
92
|
+
declare namespace utils_d {
|
|
93
|
+
export { utils_d_createInfoElement as createInfoElement, utils_d_getExpressionLanguageConfig as getExpressionLanguageConfig, utils_d_keywords as keywords, utils_d_resolveFunctionDefinition as resolveFunctionDefinition, utils_d_resolveIdentifier as resolveIdentifier, utils_d_resolveTypes as resolveTypes };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare const cursorTooltipField: StateField<readonly Tooltip[]>;
|
|
97
|
+
declare const keywordTooltip: _codemirror_state.Extension & {
|
|
98
|
+
active: StateField<readonly Tooltip[]>;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
declare const tooltip_d_cursorTooltipField: typeof cursorTooltipField;
|
|
102
|
+
declare const tooltip_d_keywordTooltip: typeof keywordTooltip;
|
|
103
|
+
declare namespace tooltip_d {
|
|
104
|
+
export { tooltip_d_cursorTooltipField as cursorTooltipField, tooltip_d_keywordTooltip as keywordTooltip };
|
|
105
|
+
}
|
|
106
|
+
|
|
39
107
|
declare const ELLanguage: LRLanguage;
|
|
40
108
|
declare function expressionlanguage(config?: ExpressionLanguageConfig, extensions?: Extension[]): LanguageSupport;
|
|
41
|
-
|
|
109
|
+
|
|
110
|
+
export { type ELFunction, type ELIdentifier, type ELKeyword, ELLanguage, type ELParameter, ELScalar, type ELType, type ExpressionLanguageConfig, complete_d as _complete, linter_d as _linter, tooltip_d as _tooltip, utils_d as _utils, expressionlanguage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { LRLanguage, LanguageSupport } from
|
|
2
|
-
import
|
|
1
|
+
import { LRLanguage, LanguageSupport } from '@codemirror/language';
|
|
2
|
+
import * as _codemirror_state from '@codemirror/state';
|
|
3
|
+
import { EditorState, StateField, Extension } from '@codemirror/state';
|
|
4
|
+
import { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
|
|
5
|
+
import { SyntaxNode } from '@lezer/common';
|
|
6
|
+
import { Tooltip } from '@codemirror/view';
|
|
7
|
+
|
|
3
8
|
/**
|
|
4
9
|
* Represents a variable or a property of an object
|
|
5
10
|
*/
|
|
@@ -14,7 +19,7 @@ interface ELIdentifier {
|
|
|
14
19
|
*/
|
|
15
20
|
interface ELFunction {
|
|
16
21
|
name: string;
|
|
17
|
-
args
|
|
22
|
+
args?: ELParameter[];
|
|
18
23
|
info?: string;
|
|
19
24
|
returnType?: string[];
|
|
20
25
|
}
|
|
@@ -36,6 +41,70 @@ interface ExpressionLanguageConfig {
|
|
|
36
41
|
identifiers?: ELIdentifier[];
|
|
37
42
|
functions?: ELFunction[];
|
|
38
43
|
}
|
|
44
|
+
interface ELKeyword {
|
|
45
|
+
name: string;
|
|
46
|
+
detail?: string;
|
|
47
|
+
info?: string;
|
|
48
|
+
}
|
|
49
|
+
declare enum ELScalar {
|
|
50
|
+
Bool = "bool",
|
|
51
|
+
Number = "number",
|
|
52
|
+
String = "string",
|
|
53
|
+
Null = "null",
|
|
54
|
+
Any = "any"
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare function expressionLanguageCompletion(context: CompletionContext): CompletionResult | null;
|
|
58
|
+
|
|
59
|
+
declare const complete_d_expressionLanguageCompletion: typeof expressionLanguageCompletion;
|
|
60
|
+
declare namespace complete_d {
|
|
61
|
+
export { complete_d_expressionLanguageCompletion as expressionLanguageCompletion };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare const expressionLanguageLinter: _codemirror_state.Extension;
|
|
65
|
+
|
|
66
|
+
declare const linter_d_expressionLanguageLinter: typeof expressionLanguageLinter;
|
|
67
|
+
declare namespace linter_d {
|
|
68
|
+
export { linter_d_expressionLanguageLinter as expressionLanguageLinter };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare const Function: number;
|
|
72
|
+
declare const Method: number;
|
|
73
|
+
declare const Property: number;
|
|
74
|
+
declare const Variable: number;
|
|
75
|
+
|
|
76
|
+
declare const createInfoElement: (html: string) => HTMLDivElement;
|
|
77
|
+
declare function resolveFunctionDefinition(node: SyntaxNode | null, state: EditorState, config: ExpressionLanguageConfig): ELFunction | undefined;
|
|
78
|
+
declare const resolveIdentifier: (nodeTypeId: typeof Method | typeof Property | typeof Function | typeof Variable, identifier?: string, config?: {
|
|
79
|
+
identifiers?: ELIdentifier[];
|
|
80
|
+
functions?: ELFunction[];
|
|
81
|
+
}) => ELIdentifier | ELFunction | undefined;
|
|
82
|
+
declare function resolveTypes(state: EditorState, node: SyntaxNode | undefined | null, config: ExpressionLanguageConfig): Set<string>;
|
|
83
|
+
declare function getExpressionLanguageConfig(state: EditorState): ExpressionLanguageConfig;
|
|
84
|
+
declare const keywords: ELKeyword[];
|
|
85
|
+
|
|
86
|
+
declare const utils_d_createInfoElement: typeof createInfoElement;
|
|
87
|
+
declare const utils_d_getExpressionLanguageConfig: typeof getExpressionLanguageConfig;
|
|
88
|
+
declare const utils_d_keywords: typeof keywords;
|
|
89
|
+
declare const utils_d_resolveFunctionDefinition: typeof resolveFunctionDefinition;
|
|
90
|
+
declare const utils_d_resolveIdentifier: typeof resolveIdentifier;
|
|
91
|
+
declare const utils_d_resolveTypes: typeof resolveTypes;
|
|
92
|
+
declare namespace utils_d {
|
|
93
|
+
export { utils_d_createInfoElement as createInfoElement, utils_d_getExpressionLanguageConfig as getExpressionLanguageConfig, utils_d_keywords as keywords, utils_d_resolveFunctionDefinition as resolveFunctionDefinition, utils_d_resolveIdentifier as resolveIdentifier, utils_d_resolveTypes as resolveTypes };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare const cursorTooltipField: StateField<readonly Tooltip[]>;
|
|
97
|
+
declare const keywordTooltip: _codemirror_state.Extension & {
|
|
98
|
+
active: StateField<readonly Tooltip[]>;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
declare const tooltip_d_cursorTooltipField: typeof cursorTooltipField;
|
|
102
|
+
declare const tooltip_d_keywordTooltip: typeof keywordTooltip;
|
|
103
|
+
declare namespace tooltip_d {
|
|
104
|
+
export { tooltip_d_cursorTooltipField as cursorTooltipField, tooltip_d_keywordTooltip as keywordTooltip };
|
|
105
|
+
}
|
|
106
|
+
|
|
39
107
|
declare const ELLanguage: LRLanguage;
|
|
40
108
|
declare function expressionlanguage(config?: ExpressionLanguageConfig, extensions?: Extension[]): LanguageSupport;
|
|
41
|
-
|
|
109
|
+
|
|
110
|
+
export { type ELFunction, type ELIdentifier, type ELKeyword, ELLanguage, type ELParameter, ELScalar, type ELType, type ExpressionLanguageConfig, complete_d as _complete, linter_d as _linter, tooltip_d as _tooltip, utils_d as _utils, expressionlanguage };
|