sheel-deer 1.0.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.
Files changed (90) hide show
  1. package/.vscode/launch.json +51 -0
  2. package/.vscode/settings.json +94 -0
  3. package/.vscode/tasks.json +57 -0
  4. package/App.elen +70 -0
  5. package/README.MD +0 -0
  6. package/Test.elen +24 -0
  7. package/compile-all-ts.js +76 -0
  8. package/dist/index.es.js +1 -0
  9. package/dist/index.umd.js +1 -0
  10. package/elen/App.elen +7 -0
  11. package/elen/LICENSE +15 -0
  12. package/elen/dist/extension.js +130 -0
  13. package/elen/dist/init.js +28 -0
  14. package/elen/elen-1.0.0.vsix +0 -0
  15. package/elen/extension.ts +122 -0
  16. package/elen/icon-theme.json +2423 -0
  17. package/elen/icon.svg +1 -0
  18. package/elen/images/icon.svg +1 -0
  19. package/elen/init.ts +28 -0
  20. package/elen/language-configuration.json +26 -0
  21. package/elen/package-lock.json +549 -0
  22. package/elen/package.json +52 -0
  23. package/elen/seti.woff +0 -0
  24. package/elen/src/App.elen +0 -0
  25. package/elen/syntaxes/elen.tmLanguage.json +312 -0
  26. package/elen/tsconfig.json +14 -0
  27. package/elen-icon-theme/LICENSE +15 -0
  28. package/elen-icon-theme/README.md +18 -0
  29. package/elen-icon-theme/elen-icon-theme-1.0.0.vsix +0 -0
  30. package/elen-icon-theme/elen-icon-theme-1.0.1.vsix +0 -0
  31. package/elen-icon-theme/elen-icon-theme-1.0.13.vsix +0 -0
  32. package/elen-icon-theme/elen-icon-theme-1.0.15.vsix +0 -0
  33. package/elen-icon-theme/elen-icon-theme-1.0.16.vsix +0 -0
  34. package/elen-icon-theme/elen-icon-theme-1.0.17.vsix +0 -0
  35. package/elen-icon-theme/elen-icon-theme-1.0.18.vsix +0 -0
  36. package/elen-icon-theme/elen-icon-theme-1.0.19.vsix +0 -0
  37. package/elen-icon-theme/elen-icon-theme-1.0.2.vsix +0 -0
  38. package/elen-icon-theme/elen-icon-theme-1.0.20.vsix +0 -0
  39. package/elen-icon-theme/elen-icon-theme-1.0.3.vsix +0 -0
  40. package/elen-icon-theme/elen-icon-theme-1.0.4.vsix +0 -0
  41. package/elen-icon-theme/elen-icon-theme-1.0.5.vsix +0 -0
  42. package/elen-icon-theme/elen-icon-theme-1.0.6.vsix +0 -0
  43. package/elen-icon-theme/elen-icon-theme-1.0.7.vsix +0 -0
  44. package/elen-icon-theme/elen-icon-theme-1.0.8.vsix +0 -0
  45. package/elen-icon-theme/elen-icon-theme-1.0.9.vsix +0 -0
  46. package/elen-icon-theme/extension.js +226 -0
  47. package/elen-icon-theme/icon-theme.json +2425 -0
  48. package/elen-icon-theme/icon.svg +1 -0
  49. package/elen-icon-theme/images/icon.svg +1 -0
  50. package/elen-icon-theme/package.json +36 -0
  51. package/elen-icon-theme/seti.woff +0 -0
  52. package/icon.svg +8 -0
  53. package/index.html +11 -0
  54. package/init-start-page.ts +59 -0
  55. package/logo.html +15 -0
  56. package/package.json +42 -0
  57. package/server.ts +31 -0
  58. package/shells/data-page/Elen.ts +23 -0
  59. package/squarings/.json +132 -0
  60. package/squarings/App.json +59 -0
  61. package/squarings/Test.json +27 -0
  62. package/src/base/Component.ts +113 -0
  63. package/src/classes/BinaryData.ts +81 -0
  64. package/src/classes/DataModel.ts +386 -0
  65. package/src/classes/DataTypes.ts +116 -0
  66. package/src/components/squaring.ts +226 -0
  67. package/src/components/vtm.ts +231 -0
  68. package/src/data/ascii.ts +134 -0
  69. package/src/data/binary-resources.ts +209 -0
  70. package/src/events/event-handler.js +34 -0
  71. package/src/index.ts +1 -0
  72. package/src/methods/app-template.ts +7 -0
  73. package/src/methods/array-helpers.ts +176 -0
  74. package/src/methods/css-template.ts +5 -0
  75. package/src/methods/errors-helpers.ts +26 -0
  76. package/src/methods/html-template.ts +22 -0
  77. package/src/methods/parsers.ts +1012 -0
  78. package/src/methods/square.ts +80 -0
  79. package/src/methods/ts-template.ts +36 -0
  80. package/src/methods/using-template.ts +3 -0
  81. package/src/models/ascii.ts +26 -0
  82. package/src/models/data-stream.ts +5 -0
  83. package/src/models/data-type-model.ts +22 -0
  84. package/src/models/template-binary-model.ts +5 -0
  85. package/src/routes.ts +9 -0
  86. package/syntaxes/enel.tmLanguage.json +28 -0
  87. package/tsconfig.json +68 -0
  88. package/viewController/Inital.elen +8 -0
  89. package/vite.config.ts +25 -0
  90. package/vue.config.js +30 -0
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "elen",
3
+ "displayName": "Elen",
4
+ "description": "Language support for .elen files.",
5
+ "version": "1.0.0",
6
+ "publisher": "koick",
7
+ "license": "ISC",
8
+ "author": "",
9
+ "type": "commonjs",
10
+ "main": "./dist/extension.js",
11
+ "activationEvents": [
12
+ "onLanguage:elen"
13
+ ],
14
+ "scripts": {
15
+ "vscode:prepublish": "npm run compile",
16
+ "compile": "tsc -p ./",
17
+ "start": "npx tsc --outDir dist && node dist/init.js",
18
+ "watch": "tsc -watch -p ./"
19
+ },
20
+ "devDependencies": {
21
+ "typescript": "^4.0.0",
22
+ "vscode": "^1.1.37"
23
+ },
24
+ "engines": {
25
+ "vscode": "^1.50.0"
26
+ },
27
+ "categories": [
28
+ "Programming Languages"
29
+ ],
30
+ "contributes": {
31
+ "languages": [
32
+ {
33
+ "id": "elen",
34
+ "aliases": [
35
+ "elen",
36
+ "elen"
37
+ ],
38
+ "extensions": [
39
+ ".elen"
40
+ ],
41
+ "configuration": "./language-configuration.json"
42
+ }
43
+ ],
44
+ "grammars": [
45
+ {
46
+ "language": "elen",
47
+ "scopeName": "source.elen",
48
+ "path": "./syntaxes/elen.tmLanguage.json"
49
+ }
50
+ ]
51
+ }
52
+ }
package/elen/seti.woff ADDED
Binary file
File without changes
@@ -0,0 +1,312 @@
1
+ {
2
+ "scopeName": "source.elen",
3
+ "name": "Elen",
4
+ "patterns": [
5
+ {
6
+ "include": "#comments"
7
+ },
8
+ {
9
+ "include": "#decorators"
10
+ },
11
+ {
12
+ "include": "#shell"
13
+ },
14
+ {
15
+ "include": "#routes"
16
+ },
17
+ {
18
+ "include": "#template"
19
+ },
20
+ {
21
+ "include": "#style"
22
+ },
23
+ {
24
+ "include": "#tag"
25
+ },
26
+ {
27
+ "include": "#strings"
28
+ },
29
+ {
30
+ "include": "#numbers"
31
+ },
32
+ {
33
+ "include": "#keywords"
34
+ },
35
+ {
36
+ "include": "#types"
37
+ },
38
+ {
39
+ "include": "#operators"
40
+ },
41
+ {
42
+ "include": "#variables"
43
+ }
44
+ ],
45
+ "repository": {
46
+ "comments": {
47
+ "patterns": [
48
+ {
49
+ "name": "comment.line.double-slash",
50
+ "match": "//.*$"
51
+ },
52
+ {
53
+ "name": "comment.block",
54
+ "begin": "/\\*",
55
+ "end": "\\*/"
56
+ }
57
+ ]
58
+ },
59
+ "shell": {
60
+ "name": "meta.tag.shell.elen",
61
+ "begin": "(<)(shell)(>)",
62
+ "beginCaptures": {
63
+ "1": {
64
+ "name": "punctuation.definition.tag.begin.elen"
65
+ },
66
+ "2": {
67
+ "name": "entity.name.tag.shell.elen"
68
+ },
69
+ "3": {
70
+ "name": "punctuation.definition.tag.end.elen"
71
+ }
72
+ },
73
+ "end": "(<)(/)(shell)(>)",
74
+ "endCaptures": {
75
+ "1": {
76
+ "name": "punctuation.definition.tag.begin.elen"
77
+ },
78
+ "2": {
79
+ "name": "punctuation.definition.tag.begin.elen"
80
+ },
81
+ "3": {
82
+ "name": "entity.name.tag.shell.elen"
83
+ },
84
+ "4": {
85
+ "name": "punctuation.definition.tag.end.elen"
86
+ }
87
+ },
88
+ "contentName": "source.ts",
89
+ "patterns": [
90
+ {
91
+ "include": "source.ts"
92
+ }
93
+ ]
94
+ },
95
+ "routes": {
96
+ "name": "meta.tag.routes.elen",
97
+ "begin": "(<)(routes)(>)",
98
+ "beginCaptures": {
99
+ "1": {
100
+ "name": "punctuation.definition.tag.begin.elen"
101
+ },
102
+ "2": {
103
+ "name": "entity.name.tag.routes.elen"
104
+ },
105
+ "3": {
106
+ "name": "punctuation.definition.tag.end.elen"
107
+ }
108
+ },
109
+ "end": "(<)(/)(routes)(>)",
110
+ "endCaptures": {
111
+ "1": {
112
+ "name": "punctuation.definition.tag.begin.elen"
113
+ },
114
+ "2": {
115
+ "name": "punctuation.definition.tag.begin.elen"
116
+ },
117
+ "3": {
118
+ "name": "entity.name.tag.routes.elen"
119
+ },
120
+ "4": {
121
+ "name": "punctuation.definition.tag.end.elen"
122
+ }
123
+ }
124
+ },
125
+ "template": {
126
+ "name": "meta.tag.template.elen",
127
+ "begin": "(<template>)",
128
+ "beginCaptures": {
129
+ "1": {
130
+ "name": "punctuation.definition.tag.begin.elen"
131
+ }
132
+ },
133
+ "end": "(</template>)",
134
+ "endCaptures": {
135
+ "1": {
136
+ "name": "punctuation.definition.tag.end.elen"
137
+ }
138
+ },
139
+ "patterns": [
140
+ {
141
+ "include": "source.html"
142
+ }
143
+ ]
144
+ },
145
+ "style": {
146
+ "name": "meta.tag.style.elen",
147
+ "begin": "(<visual>)",
148
+ "beginCaptures": {
149
+ "1": {
150
+ "name": "punctuation.definition.tag.begin.elen"
151
+ }
152
+ },
153
+ "end": "(</visual>)",
154
+ "endCaptures": {
155
+ "1": {
156
+ "name": "punctuation.definition.tag.end.elen"
157
+ }
158
+ },
159
+ "patterns": [
160
+ {
161
+ "include": "source.css"
162
+ }
163
+ ]
164
+ },
165
+ "tag": {
166
+ "name": "meta.tag.elen",
167
+ "begin": "(</?)([A-Za-z][A-Za-z0-9-]*)",
168
+ "beginCaptures": {
169
+ "1": {
170
+ "name": "punctuation.definition.tag.begin.elen"
171
+ },
172
+ "2": {
173
+ "name": "entity.name.tag.elen"
174
+ }
175
+ },
176
+ "end": "(/?>)",
177
+ "endCaptures": {
178
+ "1": {
179
+ "name": "punctuation.definition.tag.end.elen"
180
+ }
181
+ }
182
+ },
183
+ "strings": {
184
+ "patterns": [
185
+ {
186
+ "name": "string.quoted.double.elen",
187
+ "begin": "\"",
188
+ "end": "\"",
189
+ "patterns": [
190
+ {
191
+ "name": "constant.character.escape",
192
+ "match": "\\\\."
193
+ }
194
+ ]
195
+ },
196
+ {
197
+ "name": "string.quoted.single.elen",
198
+ "begin": "'",
199
+ "end": "'",
200
+ "patterns": [
201
+ {
202
+ "name": "constant.character.escape",
203
+ "match": "\\\\."
204
+ }
205
+ ]
206
+ },
207
+ {
208
+ "name": "string.template.backtick.elen",
209
+ "begin": "`",
210
+ "end": "`",
211
+ "patterns": [
212
+ {
213
+ "name": "constant.character.escape",
214
+ "match": "\\\\."
215
+ }
216
+ ]
217
+ }
218
+ ]
219
+ },
220
+ "numbers": {
221
+ "patterns": [
222
+ {
223
+ "name": "constant.numeric.hex",
224
+ "match": "\\b0[xX][0-9a-fA-F]+\\b"
225
+ },
226
+ {
227
+ "name": "constant.numeric.binary",
228
+ "match": "\\b0[bB][01]+\\b"
229
+ },
230
+ {
231
+ "name": "constant.numeric.float",
232
+ "match": "\\b\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b"
233
+ }
234
+ ]
235
+ },
236
+ "operators": {
237
+ "patterns": [
238
+ {
239
+ "name": "keyword.operator",
240
+ "match": "(?:\\+|-|\\*|/|%|=|==|===|!=|!==|<|>|<=|>=|&&|\\|\\||!|&|\\||\\^|~|<<|>>|>>>|\\?|:)"
241
+ }
242
+ ]
243
+ },
244
+ "keywords": {
245
+ "patterns": [
246
+ {
247
+ "name": "keyword.control",
248
+ "match": "\\b(?:if|else|for|while|return|function|import|from|export|class|extends|implements|interface|break|continue|switch|case|default|throw|try|catch|finally|typeof|instanceof|in|of|override|public|private|protected|static|readonly|abstract|async|await)\\b"
249
+ },
250
+ {
251
+ "name": "keyword.other",
252
+ "match": "\\b(?:new|let|const|var|true|false|this|super|null|undefined)\\b"
253
+ }
254
+ ]
255
+ },
256
+ "types": {
257
+ "patterns": [
258
+ {
259
+ "name": "storage.type",
260
+ "match": "\\b(?:string|boolean|number|void|any|unknown|never|object|Boolean|Array|Object|Promise|Map|Set|Date|RegExp)\\b"
261
+ },
262
+ {
263
+ "name": "support.class.elen",
264
+ "match": "\\bComponent\\b"
265
+ },
266
+ {
267
+ "name": "constant.language",
268
+ "match": "\\b(?:true|false|null|undefined|NaN|Infinity)\\b"
269
+ }
270
+ ]
271
+ },
272
+ "decorators": {
273
+ "patterns": [
274
+ {
275
+ "name": "meta.decorator.annotation.elen",
276
+ "match": "\\b@(input|output|component|components)\\b"
277
+ },
278
+ {
279
+ "name": "support.type.decorator-target.elen",
280
+ "match": "(?<=\\b@(input|output|component|components)\\s)[A-Za-z_][A-Za-z0-9_]*"
281
+ },
282
+ {
283
+ "name": "meta.decorator.elen",
284
+ "match": "\\B@[A-Za-z_][A-Za-z0-9_]*\\b"
285
+ }
286
+ ]
287
+ },
288
+ "variables": {
289
+ "patterns": [
290
+ {
291
+ "name": "entity.name.class",
292
+ "match": "\\bclass\\s+([A-Z][a-zA-Z0-9_]*)\\b",
293
+ "captures": {
294
+ "1": {
295
+ "name": "entity.name.class"
296
+ }
297
+ }
298
+ },
299
+ {
300
+ "name": "entity.name.type",
301
+ "match": "\\b[A-Z][a-zA-Z0-9_]*\\b"
302
+ },
303
+ {
304
+ "name": "variable.other",
305
+ "match": "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b"
306
+ }
307
+ ]
308
+ }
309
+ },
310
+ "fileTypes": ["elen"],
311
+ "uuid": "b1e1e1e1-e1e1-4e1e-8e1e-1e1e1e1e1e1e"
312
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "commonjs",
5
+ "outDir": "dist",
6
+ "strict": true,
7
+ "esModuleInterop": true,
8
+ "forceConsistentCasingInFileNames": true,
9
+ "skipLibCheck": true,
10
+ "types": ["node"]
11
+ },
12
+ "include": ["*.ts", "*.elen"],
13
+ "exclude": ["dist"]
14
+ }
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2026 koick
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,18 @@
1
+ # Elen File Icon Theme
2
+
3
+ This extension provides a custom file icon for all `.elen` files in VS Code.
4
+
5
+ ## How to use
6
+ 1. Open this folder in VS Code.
7
+ 2. Run `F5` to launch an Extension Development Host.
8
+ 3. In the new window, open the Command Palette (`Ctrl+Shift+P`), search for `File Icon Theme`, and select `Elen File Icons`.
9
+ 4. All `.elen` files will now show the custom icon in the Explorer.
10
+
11
+ ## Re-initialize configuration
12
+ If you want to restore the expected `.elen` icon setup after changing getTemplateBinaryData, run `Elen: Re-Initialize Icon Configuration` from the Command Palette.
13
+
14
+ The command will:
15
+ - set `workbench.iconTheme` to `elen-icons`
16
+ - ensure `files.associations["*.elen"]` is `elen`
17
+
18
+ The active icon file is `elen-icon-theme/icon.svg`. After changing that file, run `Developer: Reload Window` to refresh the Explorer icons.
@@ -0,0 +1,226 @@
1
+ const fs = require('fs/promises');
2
+ const path = require('path');
3
+ const vscode = require('vscode');
4
+
5
+ const COMMAND_ID = 'elenIconTheme.reinitializeConfiguration';
6
+ const ELEN_ICON_THEME_IDS = ['elen-icons-v2'];
7
+ const FALLBACK_ICON_THEME_ID = 'vs-seti';
8
+ const ACTIVE_ICON_FILE = 'icon-live-v2.svg';
9
+ const SOURCE_ICON_CANDIDATES = [
10
+ 'elen-icon-theme/icon.svg',
11
+ 'elen-icon-theme/images/icon.svg',
12
+ 'elen/icon.svg',
13
+ 'elen/images/icon.svg'
14
+ ];
15
+ const WATCHED_ICON_FILES = [
16
+ 'elen-icon-theme/icon.svg',
17
+ 'elen-icon-theme/images/icon.svg',
18
+ 'elen-icon-theme/icon-theme.json',
19
+ 'elen/icon.svg',
20
+ 'elen/images/icon.svg'
21
+ ];
22
+
23
+ function getAvailableIconThemeId() {
24
+ for (const extension of vscode.extensions.all) {
25
+ const iconThemes = extension.packageJSON?.contributes?.iconThemes;
26
+
27
+ if (!Array.isArray(iconThemes)) {
28
+ continue;
29
+ }
30
+
31
+ for (const iconTheme of iconThemes) {
32
+ if (ELEN_ICON_THEME_IDS.includes(iconTheme.id)) {
33
+ return iconTheme.id;
34
+ }
35
+ }
36
+ }
37
+
38
+ return ELEN_ICON_THEME_IDS[0];
39
+ }
40
+
41
+ function hasWorkspaceFolder() {
42
+ return Boolean(vscode.workspace.workspaceFolders?.length);
43
+ }
44
+
45
+ function getPreferredTarget(section, key) {
46
+ const configuration = vscode.workspace.getConfiguration(section);
47
+ const inspection = configuration.inspect(key);
48
+
49
+ if (inspection?.workspaceFolderValue !== undefined) {
50
+ return vscode.ConfigurationTarget.WorkspaceFolder;
51
+ }
52
+
53
+ if (inspection?.workspaceValue !== undefined) {
54
+ return vscode.ConfigurationTarget.Workspace;
55
+ }
56
+
57
+ if (inspection?.globalValue !== undefined) {
58
+ return vscode.ConfigurationTarget.Global;
59
+ }
60
+
61
+ return hasWorkspaceFolder()
62
+ ? vscode.ConfigurationTarget.Workspace
63
+ : vscode.ConfigurationTarget.Global;
64
+ }
65
+
66
+ function isThemeAvailable(themeId) {
67
+ for (const extension of vscode.extensions.all) {
68
+ const iconThemes = extension.packageJSON?.contributes?.iconThemes;
69
+
70
+ if (!Array.isArray(iconThemes)) {
71
+ continue;
72
+ }
73
+
74
+ if (iconThemes.some((iconTheme) => iconTheme.id === themeId)) {
75
+ return true;
76
+ }
77
+ }
78
+
79
+ return false;
80
+ }
81
+
82
+ async function pathExists(filePath) {
83
+ try {
84
+ await fs.access(filePath);
85
+ return true;
86
+ } catch {
87
+ return false;
88
+ }
89
+ }
90
+
91
+ async function getPreferredIconSourcePath(context) {
92
+ for (const workspaceFolder of vscode.workspace.workspaceFolders || []) {
93
+ for (const relativePath of SOURCE_ICON_CANDIDATES) {
94
+ const candidatePath = path.join(workspaceFolder.uri.fsPath, ...relativePath.split('/'));
95
+
96
+ if (await pathExists(candidatePath)) {
97
+ return candidatePath;
98
+ }
99
+ }
100
+ }
101
+
102
+ return path.join(context.extensionPath, 'icon.svg');
103
+ }
104
+
105
+ async function synchronizeLiveIcon(context) {
106
+ const sourcePath = await getPreferredIconSourcePath(context);
107
+ const targetPath = path.join(context.extensionPath, ACTIVE_ICON_FILE);
108
+ const sourceContent = await fs.readFile(sourcePath, 'utf8');
109
+ let currentContent = '';
110
+
111
+ if (await pathExists(targetPath)) {
112
+ currentContent = await fs.readFile(targetPath, 'utf8');
113
+ }
114
+
115
+ if (currentContent !== sourceContent) {
116
+ await fs.writeFile(targetPath, sourceContent, 'utf8');
117
+ }
118
+ }
119
+
120
+ async function reinitializeConfiguration(context, options = {}) {
121
+ const { forceRefresh = false, silent = false } = options;
122
+ const iconThemeId = getAvailableIconThemeId();
123
+
124
+ if (!isThemeAvailable(iconThemeId)) {
125
+ if (!silent) {
126
+ vscode.window.showErrorMessage(
127
+ 'Elen icon theme is not available. Ensure the elen-icon-theme extension is installed and enabled.'
128
+ );
129
+ }
130
+ return;
131
+ }
132
+
133
+ const workbenchConfig = vscode.workspace.getConfiguration('workbench');
134
+ const filesConfig = vscode.workspace.getConfiguration('files');
135
+ const iconThemeTarget = getPreferredTarget('workbench', 'iconTheme');
136
+ const associationsTarget = getPreferredTarget('files', 'associations');
137
+ const associations = filesConfig.get('associations') || {};
138
+ const nextAssociations = {
139
+ ...associations,
140
+ '*.elen': 'elen'
141
+ };
142
+
143
+ try {
144
+ await synchronizeLiveIcon(context);
145
+
146
+ const currentThemeId = workbenchConfig.get('iconTheme');
147
+
148
+ if (forceRefresh && currentThemeId === iconThemeId && isThemeAvailable(FALLBACK_ICON_THEME_ID)) {
149
+ await workbenchConfig.update('iconTheme', FALLBACK_ICON_THEME_ID, iconThemeTarget);
150
+ }
151
+
152
+ await workbenchConfig.update('iconTheme', iconThemeId, iconThemeTarget);
153
+ await filesConfig.update('associations', nextAssociations, associationsTarget);
154
+
155
+ if (!silent) {
156
+ vscode.window.showInformationMessage(
157
+ `Elen icon configuration has been re-initialized with ${iconThemeId}.`
158
+ );
159
+ }
160
+ } catch (error) {
161
+ const message = error instanceof Error ? error.message : String(error);
162
+
163
+ if (!silent) {
164
+ vscode.window.showErrorMessage(`Failed to re-initialize Elen icon configuration: ${message}`);
165
+ }
166
+ }
167
+ }
168
+
169
+ function registerIconFileWatchers(context) {
170
+ let refreshTimer;
171
+
172
+ const scheduleRefresh = () => {
173
+ clearTimeout(refreshTimer);
174
+ refreshTimer = setTimeout(() => {
175
+ void reinitializeConfiguration(context, { forceRefresh: true, silent: true });
176
+ }, 250);
177
+ };
178
+
179
+ context.subscriptions.push({
180
+ dispose() {
181
+ clearTimeout(refreshTimer);
182
+ }
183
+ });
184
+
185
+ for (const workspaceFolder of vscode.workspace.workspaceFolders || []) {
186
+ for (const relativePath of WATCHED_ICON_FILES) {
187
+ const watcher = vscode.workspace.createFileSystemWatcher(
188
+ new vscode.RelativePattern(workspaceFolder, relativePath)
189
+ );
190
+
191
+ watcher.onDidChange(scheduleRefresh, null, context.subscriptions);
192
+ watcher.onDidCreate(scheduleRefresh, null, context.subscriptions);
193
+ watcher.onDidDelete(scheduleRefresh, null, context.subscriptions);
194
+ context.subscriptions.push(watcher);
195
+ }
196
+ }
197
+ }
198
+
199
+ function activate(context) {
200
+ context.subscriptions.push(
201
+ vscode.commands.registerCommand(COMMAND_ID, () => reinitializeConfiguration(context))
202
+ );
203
+
204
+ registerIconFileWatchers(context);
205
+
206
+ async function ensureConfigurationOnStartup() {
207
+ const currentThemeId = vscode.workspace.getConfiguration('workbench').get('iconTheme');
208
+ const shouldRefreshCurrentTheme = ELEN_ICON_THEME_IDS.includes(currentThemeId);
209
+ const shouldMigrateLegacyTheme = currentThemeId === 'elen-icons' || currentThemeId === 'elen-language-icons';
210
+
211
+ if (!shouldRefreshCurrentTheme && !shouldMigrateLegacyTheme) {
212
+ return;
213
+ }
214
+
215
+ await reinitializeConfiguration(context, { forceRefresh: true, silent: true });
216
+ }
217
+
218
+ void ensureConfigurationOnStartup();
219
+ }
220
+
221
+ function deactivate() {}
222
+
223
+ module.exports = {
224
+ activate,
225
+ deactivate
226
+ };