@codingame/monaco-vscode-api 1.78.3 → 1.78.4-next.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.
Files changed (149) hide show
  1. package/dist/api2.js +69 -4
  2. package/dist/coffeescript.js +2 -9
  3. package/dist/contributions.js +110 -0
  4. package/dist/cpp.js +2 -16
  5. package/dist/csharp.js +2 -9
  6. package/dist/default-extensions/bat.js +5 -8
  7. package/dist/default-extensions/clojure.js +4 -7
  8. package/dist/default-extensions/coffeescript.js +5 -8
  9. package/dist/default-extensions/cpp.js +10 -15
  10. package/dist/default-extensions/csharp.js +5 -8
  11. package/dist/default-extensions/css.js +4 -7
  12. package/dist/default-extensions/dart.js +4 -7
  13. package/dist/default-extensions/diff.js +4 -7
  14. package/dist/default-extensions/docker.js +4 -7
  15. package/dist/default-extensions/fsharp.js +5 -8
  16. package/dist/default-extensions/go.js +4 -7
  17. package/dist/default-extensions/groovy.js +5 -8
  18. package/dist/default-extensions/handlebars.js +4 -7
  19. package/dist/default-extensions/hlsl.js +4 -7
  20. package/dist/default-extensions/html.js +6 -9
  21. package/dist/default-extensions/ini.js +5 -9
  22. package/dist/default-extensions/java.js +5 -8
  23. package/dist/default-extensions/javascript.js +8 -13
  24. package/dist/default-extensions/json.js +5 -9
  25. package/dist/default-extensions/julia.js +4 -7
  26. package/dist/default-extensions/latex.js +10 -10
  27. package/dist/default-extensions/less.js +4 -7
  28. package/dist/default-extensions/log.js +3 -6
  29. package/dist/default-extensions/lua.js +4 -7
  30. package/dist/default-extensions/make.js +4 -7
  31. package/dist/default-extensions/markdown-basics.js +5 -8
  32. package/dist/default-extensions/objective-c.js +5 -9
  33. package/dist/default-extensions/perl.js +6 -9
  34. package/dist/default-extensions/php.js +6 -9
  35. package/dist/default-extensions/powershell.js +4 -7
  36. package/dist/default-extensions/pug.js +4 -7
  37. package/dist/default-extensions/python.js +5 -8
  38. package/dist/default-extensions/r.js +4 -7
  39. package/dist/default-extensions/razor.js +4 -7
  40. package/dist/default-extensions/ruby.js +4 -7
  41. package/dist/default-extensions/rust.js +4 -7
  42. package/dist/default-extensions/scss.js +5 -8
  43. package/dist/default-extensions/shaderlab.js +4 -7
  44. package/dist/default-extensions/shellscript.js +4 -7
  45. package/dist/default-extensions/sql.js +4 -7
  46. package/dist/default-extensions/swift.js +5 -8
  47. package/dist/default-extensions/theme-abyss.js +3 -6
  48. package/dist/default-extensions/theme-defaults.js +11 -14
  49. package/dist/default-extensions/theme-kimbie-dark.js +3 -6
  50. package/dist/default-extensions/theme-monokai-dimmed.js +3 -6
  51. package/dist/default-extensions/theme-monokai.js +3 -6
  52. package/dist/default-extensions/theme-quietlight.js +3 -6
  53. package/dist/default-extensions/theme-red.js +3 -6
  54. package/dist/default-extensions/theme-seti.js +3 -6
  55. package/dist/default-extensions/theme-solarized-dark.js +3 -6
  56. package/dist/default-extensions/theme-solarized-light.js +3 -6
  57. package/dist/default-extensions/theme-tomorrow-night-blue.js +3 -6
  58. package/dist/default-extensions/typescript-basics.js +8 -13
  59. package/dist/default-extensions/typescript-language-features.js +6 -0
  60. package/dist/default-extensions/vb.js +5 -8
  61. package/dist/default-extensions/xml.js +6 -9
  62. package/dist/default-extensions/yaml.js +4 -9
  63. package/dist/extHost.js +19602 -0
  64. package/dist/extension-tools-b2d018a3.js +1037 -0
  65. package/dist/extensions.d.ts +9 -2
  66. package/dist/extensions2.js +77 -0
  67. package/dist/fsharp.js +2 -9
  68. package/dist/groovy.js +2 -9
  69. package/dist/html.js +2 -10
  70. package/dist/java.js +2 -9
  71. package/dist/javascript.js +2 -14
  72. package/dist/keybindings.js +3 -180
  73. package/dist/latex-cpp-embedded-language-configuration.js +2 -0
  74. package/dist/latex-language-configuration.js +2 -0
  75. package/dist/layout.js +41 -0
  76. package/dist/layoutService.js +12 -0
  77. package/dist/markdown-latex-combined-language-configuration.js +2 -0
  78. package/dist/missing-services.js +34881 -0
  79. package/dist/modelEditor.d.ts +136 -1398
  80. package/dist/monaco.d.ts +20 -16
  81. package/dist/monaco.js +370 -44
  82. package/dist/php.js +2 -10
  83. package/dist/polyfill.js +29 -10
  84. package/dist/rollup-extension-directory-plugin.d.ts +10 -0
  85. package/dist/rollup-extension-directory-plugin.js +82 -0
  86. package/dist/rollup-vsix-plugin.d.ts +4 -2
  87. package/dist/rollup-vsix-plugin.js +35 -26
  88. package/dist/services.d.ts +1 -1
  89. package/dist/swift.js +2 -9
  90. package/dist/textEditor.js +34 -0
  91. package/dist/variableResolver.js +586 -0
  92. package/dist/vb.js +2 -9
  93. package/package.json +13 -6
  94. package/dist/bat.js +0 -9
  95. package/dist/clojure.js +0 -8
  96. package/dist/coffeescript2.js +0 -2
  97. package/dist/cpp2.js +0 -2
  98. package/dist/csharp2.js +0 -2
  99. package/dist/css.js +0 -8
  100. package/dist/dart.js +0 -8
  101. package/dist/diff.js +0 -8
  102. package/dist/docker.js +0 -8
  103. package/dist/fsharp2.js +0 -2
  104. package/dist/go.js +0 -8
  105. package/dist/groovy2.js +0 -2
  106. package/dist/handlebars.js +0 -8
  107. package/dist/hlsl.js +0 -8
  108. package/dist/html2.js +0 -2
  109. package/dist/ini.js +0 -10
  110. package/dist/java2.js +0 -2
  111. package/dist/javascript2.js +0 -2
  112. package/dist/json.js +0 -10
  113. package/dist/julia.js +0 -8
  114. package/dist/latex.js +0 -11
  115. package/dist/less.js +0 -8
  116. package/dist/log.js +0 -7
  117. package/dist/lua.js +0 -8
  118. package/dist/make.js +0 -8
  119. package/dist/markdown-basics.js +0 -9
  120. package/dist/objective-c.js +0 -10
  121. package/dist/perl.js +0 -10
  122. package/dist/php2.js +0 -2
  123. package/dist/powershell.js +0 -8
  124. package/dist/pug.js +0 -8
  125. package/dist/python.js +0 -9
  126. package/dist/r.js +0 -8
  127. package/dist/razor.js +0 -8
  128. package/dist/ruby.js +0 -8
  129. package/dist/rust.js +0 -8
  130. package/dist/scss.js +0 -9
  131. package/dist/shaderlab.js +0 -8
  132. package/dist/shellscript.js +0 -8
  133. package/dist/sql.js +0 -8
  134. package/dist/swift2.js +0 -2
  135. package/dist/theme-abyss.js +0 -7
  136. package/dist/theme-defaults.js +0 -15
  137. package/dist/theme-kimbie-dark.js +0 -7
  138. package/dist/theme-monokai-dimmed.js +0 -7
  139. package/dist/theme-monokai.js +0 -7
  140. package/dist/theme-quietlight.js +0 -7
  141. package/dist/theme-red.js +0 -7
  142. package/dist/theme-seti.js +0 -7
  143. package/dist/theme-solarized-dark.js +0 -7
  144. package/dist/theme-solarized-light.js +0 -7
  145. package/dist/theme-tomorrow-night-blue.js +0 -7
  146. package/dist/typescript-basics.js +0 -14
  147. package/dist/vb2.js +0 -2
  148. package/dist/xml.js +0 -10
  149. package/dist/yaml.js +0 -10
@@ -0,0 +1,586 @@
1
+ import { Range$1, replaceAsync, VariableKind, VariableError, isAbsolute } from './missing-services.js';
2
+ import { equalsIgnoreCase } from 'monaco-editor/esm/vs/base/common/strings.js';
3
+ import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
4
+ import { coalesce } from 'monaco-editor/esm/vs/base/common/arrays.js';
5
+ import { CancellationToken } from 'monaco-editor/esm/vs/base/common/cancellation.js';
6
+ import { deepClone } from 'monaco-editor/esm/vs/base/common/objects.js';
7
+ import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
8
+ import { isWindows, isMacintosh, isLinux } from 'monaco-editor/esm/vs/base/common/platform.js';
9
+ import { isString, isObject, isUndefinedOrNull } from 'monaco-editor/esm/vs/base/common/types.js';
10
+ import { sep, basename, dirname, extname, relative } from 'monaco-editor/esm/vs/base/common/path.js';
11
+ import { localize } from 'monaco-editor/esm/vs/nls.js';
12
+ import { normalizeDriveLetter } from 'monaco-editor/esm/vs/base/common/labels.js';
13
+ import { cwd } from 'monaco-editor/esm/vs/base/common/process.js';
14
+ const _formatPIIRegexp = /{([^}]+)}/g;
15
+ function formatPII(value, excludePII, args) {
16
+ return value.replace(_formatPIIRegexp, function (match, group) {
17
+ if (excludePII && group.length > 0 && group[0] !== '_') {
18
+ return match;
19
+ }
20
+ return args && args.hasOwnProperty(group) ?
21
+ args[group] :
22
+ match;
23
+ });
24
+ }
25
+ function filterExceptionsFromTelemetry(data) {
26
+ const output = {};
27
+ for (const key of ( (Object.keys(data)))) {
28
+ if (!key.startsWith('!')) {
29
+ output[key] = data[key];
30
+ }
31
+ }
32
+ return output;
33
+ }
34
+ function isSessionAttach(session) {
35
+ return session.configuration.request === 'attach' && !getExtensionHostDebugSession(session) && (!session.parentSession || isSessionAttach(session.parentSession));
36
+ }
37
+ function getExtensionHostDebugSession(session) {
38
+ let type = session.configuration.type;
39
+ if (!type) {
40
+ return;
41
+ }
42
+ if (type === 'vslsShare') {
43
+ type = session.configuration.adapterProxy.configuration.type;
44
+ }
45
+ if (equalsIgnoreCase(type, 'extensionhost') || equalsIgnoreCase(type, 'pwa-extensionhost')) {
46
+ return session;
47
+ }
48
+ return session.parentSession ? getExtensionHostDebugSession(session.parentSession) : undefined;
49
+ }
50
+ function isDebuggerMainContribution(dbg) {
51
+ return dbg.type && (dbg.label || dbg.program || dbg.runtime);
52
+ }
53
+ function getExactExpressionStartAndEnd(lineContent, looseStart, looseEnd) {
54
+ let matchingExpression = undefined;
55
+ let startOffset = 0;
56
+ const expression = /([^()\[\]{}<>\s+\-/%~#^;=|,`!]|\->)+/g;
57
+ let result = null;
58
+ while (result = expression.exec(lineContent)) {
59
+ const start = result.index + 1;
60
+ const end = start + result[0].length;
61
+ if (start <= looseStart && end >= looseEnd) {
62
+ matchingExpression = result[0];
63
+ startOffset = start;
64
+ break;
65
+ }
66
+ }
67
+ if (matchingExpression) {
68
+ const subExpression = /\w+/g;
69
+ let subExpressionResult = null;
70
+ while (subExpressionResult = subExpression.exec(matchingExpression)) {
71
+ const subEnd = subExpressionResult.index + 1 + startOffset + subExpressionResult[0].length;
72
+ if (subEnd >= looseEnd) {
73
+ break;
74
+ }
75
+ }
76
+ if (subExpressionResult) {
77
+ matchingExpression = matchingExpression.substring(0, subExpression.lastIndex);
78
+ }
79
+ }
80
+ return matchingExpression ?
81
+ { start: startOffset, end: startOffset + matchingExpression.length - 1 } :
82
+ { start: 0, end: 0 };
83
+ }
84
+ async function getEvaluatableExpressionAtPosition(languageFeaturesService, model, position, token) {
85
+ if (languageFeaturesService.evaluatableExpressionProvider.has(model)) {
86
+ const supports = languageFeaturesService.evaluatableExpressionProvider.ordered(model);
87
+ const results = coalesce(await Promise.all(( (supports.map(async (support) => {
88
+ try {
89
+ return await support.provideEvaluatableExpression(model, position, token ?? CancellationToken.None);
90
+ }
91
+ catch (err) {
92
+ return undefined;
93
+ }
94
+ })))));
95
+ if (results.length > 0) {
96
+ let matchingExpression = results[0].expression;
97
+ const range = results[0].range;
98
+ if (!matchingExpression) {
99
+ const lineContent = model.getLineContent(position.lineNumber);
100
+ matchingExpression = lineContent.substring(range.startColumn - 1, range.endColumn - 1);
101
+ }
102
+ return { range, matchingExpression };
103
+ }
104
+ }
105
+ else {
106
+ const lineContent = model.getLineContent(position.lineNumber);
107
+ const { start, end } = getExactExpressionStartAndEnd(lineContent, position.column, position.column);
108
+ const matchingExpression = lineContent.substring(start - 1, end);
109
+ return {
110
+ matchingExpression,
111
+ range: ( (new Range$1(
112
+ position.lineNumber,
113
+ start,
114
+ position.lineNumber,
115
+ start + matchingExpression.length
116
+ )))
117
+ };
118
+ }
119
+ return null;
120
+ }
121
+ const _schemePattern = /^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/;
122
+ function isUri(s) {
123
+ return !!(s && s.match(_schemePattern));
124
+ }
125
+ function stringToUri(source) {
126
+ if (typeof source.path === 'string') {
127
+ if (typeof source.sourceReference === 'number' && source.sourceReference > 0) ;
128
+ else {
129
+ if (isUri(source.path)) {
130
+ return ( URI.parse(source.path));
131
+ }
132
+ else {
133
+ if (isAbsolute(source.path)) {
134
+ return URI.file(source.path);
135
+ }
136
+ }
137
+ }
138
+ }
139
+ return source.path;
140
+ }
141
+ function uriToString(source) {
142
+ if (typeof source.path === 'object') {
143
+ const u = URI.revive(source.path);
144
+ if (u) {
145
+ if (u.scheme === Schemas.file) {
146
+ return u.fsPath;
147
+ }
148
+ else {
149
+ return (
150
+ (u.toString())
151
+ );
152
+ }
153
+ }
154
+ }
155
+ return source.path;
156
+ }
157
+ function convertToDAPaths(message, toUri) {
158
+ const fixPath = toUri ? stringToUri : uriToString;
159
+ const msg = deepClone(message);
160
+ convertPaths(msg, (toDA, source) => {
161
+ if (toDA && source) {
162
+ source.path = fixPath(source);
163
+ }
164
+ });
165
+ return msg;
166
+ }
167
+ function convertToVSCPaths(message, toUri) {
168
+ const fixPath = toUri ? stringToUri : uriToString;
169
+ const msg = deepClone(message);
170
+ convertPaths(msg, (toDA, source) => {
171
+ if (!toDA && source) {
172
+ source.path = fixPath(source);
173
+ }
174
+ });
175
+ return msg;
176
+ }
177
+ function convertPaths(msg, fixSourcePath) {
178
+ switch (msg.type) {
179
+ case 'event': {
180
+ const event = msg;
181
+ switch (event.event) {
182
+ case 'output':
183
+ fixSourcePath(false, event.body.source);
184
+ break;
185
+ case 'loadedSource':
186
+ fixSourcePath(false, event.body.source);
187
+ break;
188
+ case 'breakpoint':
189
+ fixSourcePath(false, event.body.breakpoint.source);
190
+ break;
191
+ }
192
+ break;
193
+ }
194
+ case 'request': {
195
+ const request = msg;
196
+ switch (request.command) {
197
+ case 'setBreakpoints':
198
+ fixSourcePath(true, request.arguments.source);
199
+ break;
200
+ case 'breakpointLocations':
201
+ fixSourcePath(true, request.arguments.source);
202
+ break;
203
+ case 'source':
204
+ fixSourcePath(true, request.arguments.source);
205
+ break;
206
+ case 'gotoTargets':
207
+ fixSourcePath(true, request.arguments.source);
208
+ break;
209
+ case 'launchVSCode':
210
+ request.arguments.args.forEach((arg) => fixSourcePath(false, arg));
211
+ break;
212
+ }
213
+ break;
214
+ }
215
+ case 'response': {
216
+ const response = msg;
217
+ if (response.success && response.body) {
218
+ switch (response.command) {
219
+ case 'stackTrace':
220
+ response.body.stackFrames.forEach(frame => fixSourcePath(false, frame.source));
221
+ break;
222
+ case 'loadedSources':
223
+ response.body.sources.forEach(source => fixSourcePath(false, source));
224
+ break;
225
+ case 'scopes':
226
+ response.body.scopes.forEach(scope => fixSourcePath(false, scope.source));
227
+ break;
228
+ case 'setFunctionBreakpoints':
229
+ response.body.breakpoints.forEach(bp => fixSourcePath(false, bp.source));
230
+ break;
231
+ case 'setBreakpoints':
232
+ response.body.breakpoints.forEach(bp => fixSourcePath(false, bp.source));
233
+ break;
234
+ case 'disassemble':
235
+ {
236
+ const di = response;
237
+ di.body?.instructions.forEach(di => fixSourcePath(false, di.location));
238
+ }
239
+ break;
240
+ }
241
+ }
242
+ break;
243
+ }
244
+ }
245
+ }
246
+ function getVisibleAndSorted(array) {
247
+ return array.filter(config => !config.presentation?.hidden).sort((first, second) => {
248
+ if (!first.presentation) {
249
+ if (!second.presentation) {
250
+ return 0;
251
+ }
252
+ return 1;
253
+ }
254
+ if (!second.presentation) {
255
+ return -1;
256
+ }
257
+ if (!first.presentation.group) {
258
+ if (!second.presentation.group) {
259
+ return compareOrders(first.presentation.order, second.presentation.order);
260
+ }
261
+ return 1;
262
+ }
263
+ if (!second.presentation.group) {
264
+ return -1;
265
+ }
266
+ if (first.presentation.group !== second.presentation.group) {
267
+ return first.presentation.group.localeCompare(second.presentation.group);
268
+ }
269
+ return compareOrders(first.presentation.order, second.presentation.order);
270
+ });
271
+ }
272
+ function compareOrders(first, second) {
273
+ if (typeof first !== 'number') {
274
+ if (typeof second !== 'number') {
275
+ return 0;
276
+ }
277
+ return 1;
278
+ }
279
+ if (typeof second !== 'number') {
280
+ return -1;
281
+ }
282
+ return first - second;
283
+ }
284
+ async function saveAllBeforeDebugStart(configurationService, editorService) {
285
+ const saveBeforeStartConfig = configurationService.getValue('debug.saveBeforeStart', { overrideIdentifier: editorService.activeTextEditorLanguageId });
286
+ if (saveBeforeStartConfig !== 'none') {
287
+ await editorService.saveAll();
288
+ if (saveBeforeStartConfig === 'allEditorsInActiveGroup') {
289
+ const activeEditor = editorService.activeEditorPane;
290
+ if (activeEditor && activeEditor.input.resource?.scheme === Schemas.untitled) {
291
+ await editorService.save({ editor: activeEditor.input, groupId: activeEditor.group.id });
292
+ }
293
+ }
294
+ }
295
+ await configurationService.reloadConfiguration();
296
+ }
297
+ class AbstractVariableResolverService {
298
+ constructor(_context, _labelService, _userHomePromise, _envVariablesPromise) {
299
+ this._contributedVariables = ( (new Map()));
300
+ this._context = _context;
301
+ this._labelService = _labelService;
302
+ this._userHomePromise = _userHomePromise;
303
+ if (_envVariablesPromise) {
304
+ this._envVariablesPromise = _envVariablesPromise.then(envVariables => {
305
+ return this.prepareEnv(envVariables);
306
+ });
307
+ }
308
+ }
309
+ prepareEnv(envVariables) {
310
+ if (isWindows) {
311
+ const ev = Object.create(null);
312
+ ( (Object.keys(envVariables))).forEach(key => {
313
+ ev[key.toLowerCase()] = envVariables[key];
314
+ });
315
+ return ev;
316
+ }
317
+ return envVariables;
318
+ }
319
+ resolveWithEnvironment(environment, root, value) {
320
+ return this.recursiveResolve({ env: this.prepareEnv(environment), userHome: undefined }, root ? root.uri : undefined, value);
321
+ }
322
+ async resolveAsync(root, value) {
323
+ const environment = {
324
+ env: await this._envVariablesPromise,
325
+ userHome: await this._userHomePromise
326
+ };
327
+ return this.recursiveResolve(environment, root ? root.uri : undefined, value);
328
+ }
329
+ async resolveAnyBase(workspaceFolder, config, commandValueMapping, resolvedVariables) {
330
+ const result = deepClone(config);
331
+ if (isWindows && result.windows) {
332
+ ( (Object.keys(result.windows))).forEach(key => result[key] = result.windows[key]);
333
+ }
334
+ else if (isMacintosh && result.osx) {
335
+ ( (Object.keys(result.osx))).forEach(key => result[key] = result.osx[key]);
336
+ }
337
+ else if (isLinux && result.linux) {
338
+ ( (Object.keys(result.linux))).forEach(key => result[key] = result.linux[key]);
339
+ }
340
+ delete result.windows;
341
+ delete result.osx;
342
+ delete result.linux;
343
+ const environmentPromises = {
344
+ env: await this._envVariablesPromise,
345
+ userHome: await this._userHomePromise
346
+ };
347
+ return this.recursiveResolve(environmentPromises, workspaceFolder ? workspaceFolder.uri : undefined, result, commandValueMapping, resolvedVariables);
348
+ }
349
+ async resolveAnyAsync(workspaceFolder, config, commandValueMapping) {
350
+ return this.resolveAnyBase(workspaceFolder, config, commandValueMapping);
351
+ }
352
+ async resolveAnyMap(workspaceFolder, config, commandValueMapping) {
353
+ const resolvedVariables = ( (new Map()));
354
+ const newConfig = await this.resolveAnyBase(workspaceFolder, config, commandValueMapping, resolvedVariables);
355
+ return { newConfig, resolvedVariables };
356
+ }
357
+ resolveWithInteractionReplace(folder, config, section, variables) {
358
+ throw new Error('resolveWithInteractionReplace not implemented.');
359
+ }
360
+ resolveWithInteraction(folder, config, section, variables) {
361
+ throw new Error('resolveWithInteraction not implemented.');
362
+ }
363
+ contributeVariable(variable, resolution) {
364
+ if (this._contributedVariables.has(variable)) {
365
+ throw new Error('Variable ' + variable + ' is contributed twice.');
366
+ }
367
+ else {
368
+ this._contributedVariables.set(variable, resolution);
369
+ }
370
+ }
371
+ async recursiveResolve(environment, folderUri, value, commandValueMapping, resolvedVariables) {
372
+ if (isString(value)) {
373
+ return this.resolveString(environment, folderUri, value, commandValueMapping, resolvedVariables);
374
+ }
375
+ else if (Array.isArray(value)) {
376
+ return Promise.all(( (value.map(
377
+ s => this.recursiveResolve(environment, folderUri, s, commandValueMapping, resolvedVariables)
378
+ ))));
379
+ }
380
+ else if (isObject(value)) {
381
+ const result = Object.create(null);
382
+ const replaced = await Promise.all(( (( (Object.keys(value))).map(async (key) => {
383
+ const replaced = await this.resolveString(environment, folderUri, key, commandValueMapping, resolvedVariables);
384
+ return [replaced, await this.recursiveResolve(environment, folderUri, value[key], commandValueMapping, resolvedVariables)];
385
+ }))));
386
+ for (const [key, value] of replaced) {
387
+ result[key] = value;
388
+ }
389
+ return result;
390
+ }
391
+ return value;
392
+ }
393
+ resolveString(environment, folderUri, value, commandValueMapping, resolvedVariables) {
394
+ return replaceAsync(value, AbstractVariableResolverService.VARIABLE_REGEXP, async (match, variable) => {
395
+ if (variable.includes(AbstractVariableResolverService.VARIABLE_LHS)) {
396
+ return match;
397
+ }
398
+ let resolvedValue = await this.evaluateSingleVariable(environment, match, variable, folderUri, commandValueMapping);
399
+ resolvedVariables?.set(variable, resolvedValue);
400
+ if ((resolvedValue !== match) && isString(resolvedValue) && resolvedValue.match(AbstractVariableResolverService.VARIABLE_REGEXP)) {
401
+ resolvedValue = await this.resolveString(environment, folderUri, resolvedValue, commandValueMapping, resolvedVariables);
402
+ }
403
+ return resolvedValue;
404
+ });
405
+ }
406
+ fsPath(displayUri) {
407
+ return this._labelService ? this._labelService.getUriLabel(displayUri, { noPrefix: true }) : displayUri.fsPath;
408
+ }
409
+ async evaluateSingleVariable(environment, match, variable, folderUri, commandValueMapping) {
410
+ let argument;
411
+ const parts = variable.split(':');
412
+ if (parts.length > 1) {
413
+ variable = parts[0];
414
+ argument = parts[1];
415
+ }
416
+ const getFilePath = (variableKind) => {
417
+ const filePath = this._context.getFilePath();
418
+ if (filePath) {
419
+ return normalizeDriveLetter(filePath);
420
+ }
421
+ throw new VariableError(variableKind, (localize('canNotResolveFile', "Variable {0} can not be resolved. Please open an editor.", match)));
422
+ };
423
+ const getFolderPathForFile = (variableKind) => {
424
+ const filePath = getFilePath(variableKind);
425
+ if (this._context.getWorkspaceFolderPathForFile) {
426
+ const folderPath = this._context.getWorkspaceFolderPathForFile();
427
+ if (folderPath) {
428
+ return normalizeDriveLetter(folderPath);
429
+ }
430
+ }
431
+ throw new VariableError(variableKind, localize('canNotResolveFolderForFile', "Variable {0}: can not find workspace folder of '{1}'.", match, basename(filePath)));
432
+ };
433
+ const getFolderUri = (variableKind) => {
434
+ if (argument) {
435
+ const folder = this._context.getFolderUri(argument);
436
+ if (folder) {
437
+ return folder;
438
+ }
439
+ throw new VariableError(variableKind, localize('canNotFindFolder', "Variable {0} can not be resolved. No such folder '{1}'.", match, argument));
440
+ }
441
+ if (folderUri) {
442
+ return folderUri;
443
+ }
444
+ if (this._context.getWorkspaceFolderCount() > 1) {
445
+ throw new VariableError(variableKind, localize('canNotResolveWorkspaceFolderMultiRoot', "Variable {0} can not be resolved in a multi folder workspace. Scope this variable using ':' and a workspace folder name.", match));
446
+ }
447
+ throw new VariableError(variableKind, localize('canNotResolveWorkspaceFolder', "Variable {0} can not be resolved. Please open a folder.", match));
448
+ };
449
+ switch (variable) {
450
+ case 'env':
451
+ if (argument) {
452
+ if (environment.env) {
453
+ const env = environment.env[isWindows ? argument.toLowerCase() : argument];
454
+ if (isString(env)) {
455
+ return env;
456
+ }
457
+ }
458
+ return '';
459
+ }
460
+ throw new VariableError(VariableKind.Env, localize('missingEnvVarName', "Variable {0} can not be resolved because no environment variable name is given.", match));
461
+ case 'config':
462
+ if (argument) {
463
+ const config = this._context.getConfigurationValue(folderUri, argument);
464
+ if (isUndefinedOrNull(config)) {
465
+ throw new VariableError(VariableKind.Config, localize('configNotFound', "Variable {0} can not be resolved because setting '{1}' not found.", match, argument));
466
+ }
467
+ if (isObject(config)) {
468
+ throw new VariableError(VariableKind.Config, localize('configNoString', "Variable {0} can not be resolved because '{1}' is a structured value.", match, argument));
469
+ }
470
+ return config;
471
+ }
472
+ throw new VariableError(VariableKind.Config, localize('missingConfigName', "Variable {0} can not be resolved because no settings name is given.", match));
473
+ case 'command':
474
+ return this.resolveFromMap(VariableKind.Command, match, argument, commandValueMapping, 'command');
475
+ case 'input':
476
+ return this.resolveFromMap(VariableKind.Input, match, argument, commandValueMapping, 'input');
477
+ case 'extensionInstallFolder':
478
+ if (argument) {
479
+ const ext = await this._context.getExtension(argument);
480
+ if (!ext) {
481
+ throw new VariableError(VariableKind.ExtensionInstallFolder, localize('extensionNotInstalled', "Variable {0} can not be resolved because the extension {1} is not installed.", match, argument));
482
+ }
483
+ return this.fsPath(ext.extensionLocation);
484
+ }
485
+ throw new VariableError(VariableKind.ExtensionInstallFolder, localize('missingExtensionName', "Variable {0} can not be resolved because no extension name is given.", match));
486
+ default: {
487
+ switch (variable) {
488
+ case 'workspaceRoot':
489
+ case 'workspaceFolder':
490
+ return normalizeDriveLetter(this.fsPath(getFolderUri(VariableKind.WorkspaceFolder)));
491
+ case 'cwd':
492
+ return ((folderUri || argument) ? normalizeDriveLetter(this.fsPath(getFolderUri(VariableKind.Cwd))) : cwd());
493
+ case 'workspaceRootFolderName':
494
+ case 'workspaceFolderBasename':
495
+ return normalizeDriveLetter(basename(this.fsPath(getFolderUri(VariableKind.WorkspaceFolderBasename))));
496
+ case 'userHome': {
497
+ if (environment.userHome) {
498
+ return environment.userHome;
499
+ }
500
+ throw new VariableError(VariableKind.UserHome, localize('canNotResolveUserHome', "Variable {0} can not be resolved. UserHome path is not defined", match));
501
+ }
502
+ case 'lineNumber': {
503
+ const lineNumber = this._context.getLineNumber();
504
+ if (lineNumber) {
505
+ return lineNumber;
506
+ }
507
+ throw new VariableError(VariableKind.LineNumber, localize('canNotResolveLineNumber', "Variable {0} can not be resolved. Make sure to have a line selected in the active editor.", match));
508
+ }
509
+ case 'selectedText': {
510
+ const selectedText = this._context.getSelectedText();
511
+ if (selectedText) {
512
+ return selectedText;
513
+ }
514
+ throw new VariableError(VariableKind.SelectedText, localize('canNotResolveSelectedText', "Variable {0} can not be resolved. Make sure to have some text selected in the active editor.", match));
515
+ }
516
+ case 'file':
517
+ return getFilePath(VariableKind.File);
518
+ case 'fileWorkspaceFolder':
519
+ return getFolderPathForFile(VariableKind.FileWorkspaceFolder);
520
+ case 'relativeFile':
521
+ if (folderUri || argument) {
522
+ return relative(this.fsPath(getFolderUri(VariableKind.RelativeFile)), getFilePath(VariableKind.RelativeFile));
523
+ }
524
+ return getFilePath(VariableKind.RelativeFile);
525
+ case 'relativeFileDirname': {
526
+ const dirname$1 = dirname(getFilePath(VariableKind.RelativeFileDirname));
527
+ if (folderUri || argument) {
528
+ const relative$1 = relative(this.fsPath(getFolderUri(VariableKind.RelativeFileDirname)), dirname$1);
529
+ return relative$1.length === 0 ? '.' : relative$1;
530
+ }
531
+ return dirname$1;
532
+ }
533
+ case 'fileDirname':
534
+ return dirname(getFilePath(VariableKind.FileDirname));
535
+ case 'fileExtname':
536
+ return extname(getFilePath(VariableKind.FileExtname));
537
+ case 'fileBasename':
538
+ return basename(getFilePath(VariableKind.FileBasename));
539
+ case 'fileBasenameNoExtension': {
540
+ const basename$1 = basename(getFilePath(VariableKind.FileBasenameNoExtension));
541
+ return (basename$1.slice(0, basename$1.length - extname(basename$1).length));
542
+ }
543
+ case 'fileDirnameBasename':
544
+ return basename(dirname(getFilePath(VariableKind.FileDirnameBasename)));
545
+ case 'execPath': {
546
+ const ep = this._context.getExecPath();
547
+ if (ep) {
548
+ return ep;
549
+ }
550
+ return match;
551
+ }
552
+ case 'execInstallFolder': {
553
+ const ar = this._context.getAppRoot();
554
+ if (ar) {
555
+ return ar;
556
+ }
557
+ return match;
558
+ }
559
+ case 'pathSeparator':
560
+ return sep;
561
+ default:
562
+ try {
563
+ const key = argument ? `${variable}:${argument}` : variable;
564
+ return this.resolveFromMap(VariableKind.Unknown, match, key, commandValueMapping, undefined);
565
+ }
566
+ catch (error) {
567
+ return match;
568
+ }
569
+ }
570
+ }
571
+ }
572
+ }
573
+ resolveFromMap(variableKind, match, argument, commandValueMapping, prefix) {
574
+ if (argument && commandValueMapping) {
575
+ const v = (prefix === undefined) ? commandValueMapping[argument] : commandValueMapping[prefix + ':' + argument];
576
+ if (typeof v === 'string') {
577
+ return v;
578
+ }
579
+ throw new VariableError(variableKind, localize('noValueForCommand', "Variable {0} can not be resolved because the command has no value.", match));
580
+ }
581
+ return match;
582
+ }
583
+ }
584
+ AbstractVariableResolverService.VARIABLE_LHS = '${';
585
+ AbstractVariableResolverService.VARIABLE_REGEXP = /\$\{(.*?)\}/g;
586
+ export { AbstractVariableResolverService, convertToDAPaths, convertToVSCPaths, filterExceptionsFromTelemetry, formatPII, getEvaluatableExpressionAtPosition, getExtensionHostDebugSession, getVisibleAndSorted, isDebuggerMainContribution, isSessionAttach, isUri, saveAllBeforeDebugStart };
package/dist/vb.js CHANGED
@@ -1,9 +1,2 @@
1
- import { registerExtension } from './api2.js';
2
- import { onExtHostInitialized } from './polyfill.js';
3
- var manifest = {name:"vb",displayName:"%displayName%",description:"%description%",version:"1.0.0",publisher:"vscode",license:"MIT",engines:{vscode:"*"},scripts:{"update-grammar":"node ../node_modules/vscode-grammar-updater/bin textmate/asp.vb.net.tmbundle Syntaxes/ASP%20VB.net.plist ./syntaxes/asp-vb-net.tmlanguage.json"},contributes:{languages:[{id:"vb",extensions:[".vb",".brs",".vbs",".bas",".vba"],aliases:["Visual Basic","vb"],configuration:"./language-configuration.json"}],grammars:[{language:"vb",scopeName:"source.asp.vb.net",path:"./syntaxes/asp-vb-net.tmlanguage.json"}],snippets:[{language:"vb",path:"./snippets/vb.code-snippets"}]},repository:{type:"git",url:"https://github.com/microsoft/vscode.git"}};
4
- onExtHostInitialized(() => {
5
- const { registerFile } = registerExtension(manifest);
6
- registerFile('./language-configuration.json', async () => await import('./language-configuration38.js').then(module => module.default ?? module)),
7
- registerFile('./syntaxes/asp-vb-net.tmlanguage.json', async () => await import('./asp-vb-net.tmlanguage.js').then(module => module.default ?? module)),
8
- registerFile('./snippets/vb.code-snippets', async () => await import('./vb2.js').then(module => module.default ?? module));
9
- });
1
+ var vb = "{\n\t\"For Next Loop\": {\n\t\t\"prefix\": \"for\",\n\t\t\"body\": [\n\t\t\t\"For ${1:index} As ${2:ObjectType} = ${3:lower} To ${4:Upper}\",\n\t\t\t\"\\t$0\",\n\t\t\t\"Next ${1:index}\"\n\t\t],\n\t\t\"description\": \"For Next Loop\"\n\t},\n\t\"For Each...Next\": {\n\t\t\"prefix\": \"fore\",\n\t\t\"body\": [\n\t\t\t\"For Each ${1:Variable} As ${2:ObjectType} In ${3:Collection}\",\n\t\t\t\"\\t$0\",\n\t\t\t\"Next\"\n\t\t],\n\t\t\"description\": \"For Each...Next\"\n\t},\n\t\"For i...Next i\": {\n\t\t\"prefix\": \"fori\",\n\t\t\"body\": [\n\t\t\t\"For i As ${1:Integer} = ${2:Lower} To ${3:Upper}\",\n\t\t\t\"\\t$0\",\n\t\t\t\"Next i\"\n\t\t],\n\t\t\"description\": \"For i...Next i\"\n\t},\n\t\"For j...Next j\": {\n\t\t\"prefix\": \"forj\",\n\t\t\"body\": [\n\t\t\t\"For j As ${1:Integer} = ${2:Lower} To ${3:Upper}\",\n\t\t\t\"\\t$0\",\n\t\t\t\"Next j\"\n\t\t],\n\t\t\"description\": \"For j...Next j\"\n\t},\n\t\"Public Function...\": {\n\t\t\"prefix\": \"pf\",\n\t\t\"body\": [\n\t\t\t\"Public Function ${1:FunctionName}(${2:ParameterList}) As ${3:ReturnType}\",\n\t\t\t\"\\tTry\",\n\t\t\t\"\\t\\t$0\",\n\t\t\t\"\\tCatch ex As Exception\",\n\t\t\t\"\\tEnd Try\",\n\t\t\t\"\\tReturn ${3:ReturnValue}\",\n\t\t\t\"End Function\"\n\t\t],\n\t\t\"description\": \"Public Function...\"\n\t},\n\t\"Public Sub ...\": {\n\t\t\"prefix\": \"ps\",\n\t\t\"body\": [\n\t\t\t\"Public Sub ${1:ProcedureName}(${2:ParameterList})\",\n\t\t\t\"\\tTry\",\n\t\t\t\"\\t\\t$0\",\n\t\t\t\"\\tCatch ex As Exception\",\n\t\t\t\"\\tEnd Try\",\n\t\t\t\"End Sub\"\n\t\t],\n\t\t\"description\": \"Public Sub ...\"\n\t},\n\t\"While ... End While\": {\n\t\t\"prefix\": \"while\",\n\t\t\"body\": [\n\t\t\t\"While ${1:Boolean}\",\n\t\t\t\"\\t$0\",\n\t\t\t\"End While\"\n\t\t],\n\t\t\"description\": \"While ... End While\"\n\t},\n\t\"Region Start\": {\n\t\t\"prefix\": \"#Region\",\n\t\t\"body\": [\n\t\t\t\"#Region $0\"\n\t\t],\n\t\t\"description\": \"Folding Region Start\"\n\t},\n\t\"Region End\": {\n\t\t\"prefix\": \"#End Region\",\n\t\t\"body\": [\n\t\t\t\"#End Region\"\n\t\t],\n\t\t\"description\": \"Folding Region End\"\n\t}\n}\n";
2
+ export { vb as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-api",
3
- "version": "1.78.3",
3
+ "version": "1.78.4-next.1",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor",
6
6
  "keywords": [],
@@ -94,6 +94,10 @@
94
94
  "./rollup-vsix-plugin": {
95
95
  "types": "./dist/rollup-vsix-plugin.d.ts",
96
96
  "default": "./dist/rollup-vsix-plugin.js"
97
+ },
98
+ "./rollup-extension-directory-plugin": {
99
+ "types": "./dist/rollup-extension-directory-plugin.d.ts",
100
+ "default": "./dist/rollup-extension-directory-plugin.js"
97
101
  }
98
102
  },
99
103
  "typesVersions": {
@@ -150,7 +154,10 @@
150
154
  "./dist/webpack-loader.d.ts"
151
155
  ],
152
156
  "rollup-vsix-plugin": [
153
- "./dist/vsix-rollup-plugin.d.ts"
157
+ "./dist/rollup-vsix-plugin.d.ts"
158
+ ],
159
+ "rollup-extension_directory-plugin": [
160
+ "./dist/rollup-extension_directory-plugin.d.ts"
154
161
  ]
155
162
  }
156
163
  },
@@ -159,14 +166,14 @@
159
166
  "README.md"
160
167
  ],
161
168
  "scripts": {
162
- "build": "npm run lint && npm run clean && npm run compile && npm run generate-types && npm run compile-webpack-loader && npm run compile-rollup-vsix-plugin",
163
- "compile": "NODE_OPTIONS=--max_old_space_size=8192 rollup --config rollup/rollup.config.ts --configPlugin 'typescript={tsconfig: `tsconfig.rollup.json`}' --vscode-version ${npm_package_config_vscode_version}",
169
+ "build": "npm run lint && npm run clean && npm run compile-rollup-plugins && npm run compile && npm run generate-types && npm run compile-webpack-loader",
170
+ "compile": "NODE_OPTIONS=--max_old_space_size=8192 rollup --config rollup/rollup.config.ts --configPlugin 'typescript={tsconfig: `tsconfig.rollup-config.json`}' --vscode-version ${npm_package_config_vscode_version}",
164
171
  "clean": "rm -rf dist/",
165
172
  "compile-webpack-loader": "tsc --target es2020 -lib es2020 --module commonjs --skipLibCheck --moduleResolution node --declaration --outDir dist src/webpack-loader.ts && mv dist/webpack-loader.js dist/webpack-loader.cjs",
166
- "compile-rollup-vsix-plugin": "tsc --target es2020 -lib es2020 --module esnext --skipLibCheck --moduleResolution node --declaration --outDir dist src/rollup-vsix-plugin.ts",
173
+ "compile-rollup-plugins": "rollup --config rollup/rollup.rollup-plugins.config.ts --configPlugin 'typescript={tsconfig: `tsconfig.rollup-config.json`, include: [`./rollup/rollup.rollup-plugins.config.ts`]}'",
167
174
  "preprepare": "./scripts/install-vscode",
168
175
  "lint": "eslint {/src/**/*.ts,./rollup/*.ts,./*.ts}",
169
- "generate-types": "tsc --project tsconfig.types.json && rollup --config rollup/rollup.types.config.ts --configPlugin 'typescript={tsconfig: `tsconfig.rollup.json`}' && rm -rf ./dist/types",
176
+ "generate-types": "tsc --project tsconfig.types.json && rollup --config rollup/rollup.types.config.ts --configPlugin 'typescript={tsconfig: `tsconfig.rollup-config.json`}' && rm -rf ./dist/types",
170
177
  "release": "node --loader ts-node/esm release.ts ${npm_package_config_vscode_version}"
171
178
  },
172
179
  "config": {
package/dist/bat.js DELETED
@@ -1,9 +0,0 @@
1
- import { registerExtension } from './api2.js';
2
- import { onExtHostInitialized } from './polyfill.js';
3
- var manifest = {name:"bat",displayName:"%displayName%",description:"%description%",version:"1.0.0",publisher:"vscode",license:"MIT",engines:{vscode:"^1.52.0"},scripts:{"update-grammar":"node ../node_modules/vscode-grammar-updater/bin mmims/language-batchfile grammars/batchfile.cson ./syntaxes/batchfile.tmLanguage.json"},contributes:{languages:[{id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],configuration:"./language-configuration.json"}],grammars:[{language:"bat",scopeName:"source.batchfile",path:"./syntaxes/batchfile.tmLanguage.json"}],snippets:[{language:"bat",path:"./snippets/batchfile.code-snippets"}]},repository:{type:"git",url:"https://github.com/microsoft/vscode.git"}};
4
- onExtHostInitialized(() => {
5
- const { registerFile } = registerExtension(manifest);
6
- registerFile('./language-configuration.json', async () => await import('./language-configuration.js').then(module => module.default ?? module)),
7
- registerFile('./syntaxes/batchfile.tmLanguage.json', async () => await import('./batchfile.tmLanguage.js').then(module => module.default ?? module)),
8
- registerFile('./snippets/batchfile.code-snippets', async () => await import('./batchfile.js').then(module => module.default ?? module));
9
- });