@wire-dsl/language-support 0.0.2
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/INTEGRATION-GUIDE.md +218 -0
- package/LICENSE +36 -0
- package/README.md +55 -0
- package/dist/completions.d.ts +86 -0
- package/dist/completions.d.ts.map +1 -0
- package/dist/completions.js +416 -0
- package/dist/completions.js.map +1 -0
- package/dist/components.d.ts +39 -0
- package/dist/components.d.ts.map +1 -0
- package/dist/components.js +271 -0
- package/dist/components.js.map +1 -0
- package/dist/context-detection.d.ts +56 -0
- package/dist/context-detection.d.ts.map +1 -0
- package/dist/context-detection.js +147 -0
- package/dist/context-detection.js.map +1 -0
- package/dist/document-parser.d.ts +63 -0
- package/dist/document-parser.d.ts.map +1 -0
- package/dist/document-parser.js +264 -0
- package/dist/document-parser.js.map +1 -0
- package/dist/documentation.d.ts +30 -0
- package/dist/documentation.d.ts.map +1 -0
- package/dist/documentation.js +121 -0
- package/dist/documentation.js.map +1 -0
- package/dist/generate-grammar.d.ts +28 -0
- package/dist/generate-grammar.d.ts.map +1 -0
- package/dist/generate-grammar.js +136 -0
- package/dist/generate-grammar.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +75 -0
- package/dist/index.js.map +1 -0
- package/package.json +90 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire DSL Language Support
|
|
3
|
+
* Shared language definitions, syntax, and code intelligence for Monaco, VS Code, and other editors
|
|
4
|
+
*/
|
|
5
|
+
// Import for internal use
|
|
6
|
+
import { COMPONENTS, KEYWORDS } from './components';
|
|
7
|
+
// Re-export new core modules
|
|
8
|
+
export { COMPONENTS, LAYOUTS, PROPERTY_VALUES, KEYWORDS, } from './components';
|
|
9
|
+
export { getComponentDocumentation, getLayoutDocumentation, getPropertyDocumentation, getKeywordDocumentation, } from './documentation';
|
|
10
|
+
export { extractComponentDefinitions, getTokenAtPosition, isComponentReference, extractComponentReferences, extractScreenDefinitions, getPositionOfDefinition, findComponentReferences, } from './document-parser';
|
|
11
|
+
export { determineScope, detectComponentContext, getComponentPropertiesForCompletion as getAvailableProperties, getAlreadyDeclaredProperties, } from './context-detection';
|
|
12
|
+
export { KEYWORD_COMPLETIONS, CONTAINER_COMPLETIONS, COMPONENT_COMPLETIONS, PROPERTY_COMPLETIONS, isPropertyContext, getComponentPropertiesForCompletion, getPropertyValueSuggestions, getScopeBasedCompletions, detectComponentKeyword, detectPropertyValueContext, getAvailableComponents, getComponentProperties, } from './completions';
|
|
13
|
+
// Build ALL_KEYWORDS using ACTUAL Wire DSL keywords
|
|
14
|
+
export const ALL_KEYWORDS = [
|
|
15
|
+
// Top-level keywords
|
|
16
|
+
...KEYWORDS.topLevel.map(name => ({
|
|
17
|
+
name,
|
|
18
|
+
type: 'keyword',
|
|
19
|
+
description: `Wire DSL keyword: ${name}`,
|
|
20
|
+
})),
|
|
21
|
+
// Screen keyword
|
|
22
|
+
...KEYWORDS.screen.map(name => ({
|
|
23
|
+
name,
|
|
24
|
+
type: 'keyword',
|
|
25
|
+
description: `Wire DSL keyword: ${name}`,
|
|
26
|
+
})),
|
|
27
|
+
// Layout keyword
|
|
28
|
+
...KEYWORDS.layout.map(name => ({
|
|
29
|
+
name,
|
|
30
|
+
type: 'keyword',
|
|
31
|
+
description: `Wire DSL keyword: ${name}`,
|
|
32
|
+
})),
|
|
33
|
+
// Component keyword
|
|
34
|
+
...KEYWORDS.component.map(name => ({
|
|
35
|
+
name,
|
|
36
|
+
type: 'keyword',
|
|
37
|
+
description: `Wire DSL keyword: ${name}`,
|
|
38
|
+
})),
|
|
39
|
+
// Cell keyword
|
|
40
|
+
...KEYWORDS.cell.map(name => ({
|
|
41
|
+
name,
|
|
42
|
+
type: 'keyword',
|
|
43
|
+
description: `Wire DSL keyword: ${name}`,
|
|
44
|
+
})),
|
|
45
|
+
// Special keywords
|
|
46
|
+
...KEYWORDS.special.map(name => ({
|
|
47
|
+
name,
|
|
48
|
+
type: 'keyword',
|
|
49
|
+
description: `Wire DSL keyword: ${name}`,
|
|
50
|
+
})),
|
|
51
|
+
// Components from metadata
|
|
52
|
+
...Object.entries(COMPONENTS).map(([name, meta]) => ({
|
|
53
|
+
name,
|
|
54
|
+
type: 'component',
|
|
55
|
+
description: meta.description || `Component: ${name}`,
|
|
56
|
+
})),
|
|
57
|
+
];
|
|
58
|
+
/**
|
|
59
|
+
* Get completions for a given prefix
|
|
60
|
+
* @param prefix Filter by prefix (e.g., 'but' → ['button', ...])
|
|
61
|
+
* @returns Array of completion suggestions
|
|
62
|
+
*/
|
|
63
|
+
export function getCompletions(prefix = '') {
|
|
64
|
+
const lowerPrefix = prefix.toLowerCase();
|
|
65
|
+
return ALL_KEYWORDS
|
|
66
|
+
.filter(kw => kw.name.toLowerCase().startsWith(lowerPrefix))
|
|
67
|
+
.map(kw => ({
|
|
68
|
+
label: kw.name,
|
|
69
|
+
kind: kw.type === 'component' ? 'Class' : 'Keyword',
|
|
70
|
+
detail: kw.description,
|
|
71
|
+
documentation: kw.description,
|
|
72
|
+
sortText: kw.name,
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,0BAA0B;AAC1B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEpD,6BAA6B;AAC7B,OAAO,EACL,UAAU,EACV,OAAO,EACP,eAAe,EACf,QAAQ,GAGT,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,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
|
|
2
|
+
"name": "@wire-dsl/language-support",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Wire DSL language definitions for Monaco, VS Code, and other editors. Keywords, components, properties, autocompletion, grammar, and document parsing.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=18.0.0"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"./completions": {
|
|
17
|
+
"import": "./dist/completions.js",
|
|
18
|
+
"types": "./dist/completions.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./grammar": {
|
|
21
|
+
"import": "./dist/grammar.js",
|
|
22
|
+
"types": "./dist/grammar.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./components": {
|
|
25
|
+
"import": "./dist/components.js",
|
|
26
|
+
"types": "./dist/components.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./documentation": {
|
|
29
|
+
"import": "./dist/documentation.js",
|
|
30
|
+
"types": "./dist/documentation.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"./document-parser": {
|
|
33
|
+
"import": "./dist/document-parser.js",
|
|
34
|
+
"types": "./dist/document-parser.d.ts"
|
|
35
|
+
},
|
|
36
|
+
"./context-detection": {
|
|
37
|
+
"import": "./dist/context-detection.js",
|
|
38
|
+
"types": "./dist/context-detection.d.ts"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"wire.tmLanguage.json",
|
|
44
|
+
"README.md",
|
|
45
|
+
"LICENSE",
|
|
46
|
+
"INTEGRATION-GUIDE.md"
|
|
47
|
+
],
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "https://github.com/Wire-DSL/wire-dsl.git",
|
|
51
|
+
"directory": "packages/language-support"
|
|
52
|
+
},
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/Wire-DSL/wire-dsl/issues"
|
|
55
|
+
},
|
|
56
|
+
"homepage": "https://github.com/Wire-DSL/wire-dsl/tree/main/packages/language-support",
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"access": "public",
|
|
59
|
+
"registry": "https://registry.npmjs.org/"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@types/node": "25.0.9",
|
|
64
|
+
"typescript": "5.9.3"
|
|
65
|
+
},
|
|
66
|
+
"keywords": [
|
|
67
|
+
"wire-dsl",
|
|
68
|
+
"language",
|
|
69
|
+
"syntax-highlighting",
|
|
70
|
+
"autocomplete",
|
|
71
|
+
"intellisense",
|
|
72
|
+
"monaco-editor",
|
|
73
|
+
"vscode-extension",
|
|
74
|
+
"lsp",
|
|
75
|
+
"code-intelligence",
|
|
76
|
+
"dsl",
|
|
77
|
+
"domain-specific-language",
|
|
78
|
+
"components",
|
|
79
|
+
"metadata",
|
|
80
|
+
"documentation",
|
|
81
|
+
"parser"
|
|
82
|
+
],
|
|
83
|
+
"author": "Wire-DSL Contributors",
|
|
84
|
+
"license": "MIT",
|
|
85
|
+
"scripts": {
|
|
86
|
+
"build": "tsc",
|
|
87
|
+
"type-check": "tsc --noEmit",
|
|
88
|
+
"dev": "tsc --watch"
|
|
89
|
+
}
|
|
90
|
+
}
|