@codingame/monaco-vscode-api 1.76.9 → 1.78.0-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 (332) hide show
  1. package/README.md +87 -49
  2. package/dist/Bibtex.tmLanguage.js +2 -0
  3. package/dist/Handlebars.tmLanguage.js +2 -0
  4. package/dist/JSON.tmLanguage.js +2 -0
  5. package/dist/JSONC.tmLanguage.js +2 -0
  6. package/dist/JavaScript.tmLanguage.js +2 -0
  7. package/dist/JavaScriptReact.tmLanguage.js +2 -0
  8. package/dist/LaTeX.tmLanguage.js +2 -0
  9. package/dist/MagicPython.tmLanguage.js +2 -0
  10. package/dist/MagicRegExp.tmLanguage.js +2 -0
  11. package/dist/Red-color-theme.js +2 -0
  12. package/dist/Regular Expressions (JavaScript).js +2 -0
  13. package/dist/TeX.tmLanguage.js +2 -0
  14. package/dist/TypeScript.tmLanguage.js +2 -0
  15. package/dist/TypeScriptReact.tmLanguage.js +2 -0
  16. package/dist/_.contribution.js +1 -1
  17. package/dist/abyss-color-theme.js +2 -0
  18. package/dist/api.js +1 -3
  19. package/dist/api2.js +421 -18091
  20. package/dist/asp-vb-net.tmlanguage.js +2 -0
  21. package/dist/assets/diffLineDeleted.mp3 +0 -0
  22. package/dist/assets/diffLineInserted.mp3 +0 -0
  23. package/dist/assets/diffLineModified.mp3 +0 -0
  24. package/dist/audioCue.js +108 -478
  25. package/dist/bat.js +9 -0
  26. package/dist/batchfile.js +2 -0
  27. package/dist/batchfile.tmLanguage.js +2 -0
  28. package/dist/button.js +35 -8
  29. package/dist/c.js +2 -0
  30. package/dist/c.tmLanguage.js +2 -0
  31. package/dist/clojure.js +8 -0
  32. package/dist/clojure.tmLanguage.js +2 -0
  33. package/dist/coffeescript.js +9 -0
  34. package/dist/coffeescript.tmLanguage.js +2 -0
  35. package/dist/coffeescript2.js +2 -0
  36. package/dist/configuration.d.ts +269 -4
  37. package/dist/configuration.js +4326 -328
  38. package/dist/configuration2.js +14 -324
  39. package/dist/cpp-grammar-bailout.tmLanguage.js +2 -0
  40. package/dist/cpp.embedded.macro.tmLanguage.js +2 -0
  41. package/dist/cpp.js +16 -0
  42. package/dist/cpp.tmLanguage.js +2 -0
  43. package/dist/cpp2.js +2 -0
  44. package/dist/csharp.js +9 -0
  45. package/dist/csharp.tmLanguage.js +2 -0
  46. package/dist/csharp2.js +2 -0
  47. package/dist/cshtml.tmLanguage.js +2 -0
  48. package/dist/css.js +8 -0
  49. package/dist/css.tmLanguage.js +2 -0
  50. package/dist/cuda-cpp.tmLanguage.js +2 -0
  51. package/dist/dark_plus.js +2 -0
  52. package/dist/dark_plus_experimental.js +2 -0
  53. package/dist/dark_vs.js +2 -0
  54. package/dist/dart.js +8 -0
  55. package/dist/dart.tmLanguage.js +2 -0
  56. package/dist/debug.js +12113 -12209
  57. package/dist/default-extensions/bat.js +12 -0
  58. package/dist/default-extensions/clojure.js +11 -0
  59. package/dist/default-extensions/coffeescript.js +12 -0
  60. package/dist/default-extensions/cpp.js +19 -0
  61. package/dist/default-extensions/csharp.js +12 -0
  62. package/dist/default-extensions/css.js +11 -0
  63. package/dist/default-extensions/dart.js +11 -0
  64. package/dist/default-extensions/diff.js +11 -0
  65. package/dist/default-extensions/docker.js +11 -0
  66. package/dist/default-extensions/fsharp.js +12 -0
  67. package/dist/default-extensions/go.js +11 -0
  68. package/dist/default-extensions/groovy.js +12 -0
  69. package/dist/default-extensions/handlebars.js +11 -0
  70. package/dist/default-extensions/hlsl.js +11 -0
  71. package/dist/default-extensions/html.js +13 -0
  72. package/dist/default-extensions/ini.js +13 -0
  73. package/dist/default-extensions/java.js +12 -0
  74. package/dist/default-extensions/javascript.js +17 -0
  75. package/dist/default-extensions/json.js +13 -0
  76. package/dist/default-extensions/julia.js +11 -0
  77. package/dist/default-extensions/latex.js +14 -0
  78. package/dist/default-extensions/less.js +11 -0
  79. package/dist/default-extensions/log.js +10 -0
  80. package/dist/default-extensions/lua.js +11 -0
  81. package/dist/default-extensions/make.js +11 -0
  82. package/dist/default-extensions/markdown-basics.js +12 -0
  83. package/dist/default-extensions/objective-c.js +13 -0
  84. package/dist/default-extensions/perl.js +13 -0
  85. package/dist/default-extensions/php.js +13 -0
  86. package/dist/default-extensions/powershell.js +11 -0
  87. package/dist/default-extensions/pug.js +11 -0
  88. package/dist/default-extensions/python.js +12 -0
  89. package/dist/default-extensions/r.js +11 -0
  90. package/dist/default-extensions/razor.js +11 -0
  91. package/dist/default-extensions/ruby.js +11 -0
  92. package/dist/default-extensions/rust.js +11 -0
  93. package/dist/default-extensions/scss.js +12 -0
  94. package/dist/default-extensions/shaderlab.js +11 -0
  95. package/dist/default-extensions/shellscript.js +11 -0
  96. package/dist/default-extensions/sql.js +11 -0
  97. package/dist/default-extensions/swift.js +12 -0
  98. package/dist/default-extensions/theme-abyss.js +10 -0
  99. package/dist/default-extensions/theme-defaults.js +18 -0
  100. package/dist/default-extensions/theme-kimbie-dark.js +10 -0
  101. package/dist/default-extensions/theme-monokai-dimmed.js +10 -0
  102. package/dist/default-extensions/theme-monokai.js +10 -0
  103. package/dist/default-extensions/theme-quietlight.js +10 -0
  104. package/dist/default-extensions/theme-red.js +10 -0
  105. package/dist/default-extensions/theme-seti.js +10 -0
  106. package/dist/default-extensions/theme-solarized-dark.js +10 -0
  107. package/dist/default-extensions/theme-solarized-light.js +10 -0
  108. package/dist/default-extensions/theme-tomorrow-night-blue.js +10 -0
  109. package/dist/default-extensions/typescript-basics.js +17 -0
  110. package/dist/default-extensions/vb.js +12 -0
  111. package/dist/default-extensions/xml.js +13 -0
  112. package/dist/default-extensions/yaml.js +13 -0
  113. package/dist/dialogs.js +11 -216
  114. package/dist/diff.js +8 -0
  115. package/dist/diff.tmLanguage.js +2 -0
  116. package/dist/dimmed-monokai-color-theme.js +2 -0
  117. package/dist/docker.js +8 -0
  118. package/dist/docker.tmLanguage.js +2 -0
  119. package/dist/dom.js +101 -0
  120. package/dist/extensionManagement.js +4 -0
  121. package/dist/extensions.d.ts +368 -23
  122. package/dist/extensions.js +4 -85
  123. package/dist/extensionsRegistry.js +63 -64
  124. package/dist/files.d.ts +845 -0
  125. package/dist/files.js +1805 -1151
  126. package/dist/files2.js +32 -0
  127. package/dist/fsharp.js +9 -0
  128. package/dist/fsharp.tmLanguage.js +2 -0
  129. package/dist/fsharp2.js +2 -0
  130. package/dist/go.js +8 -0
  131. package/dist/go.tmLanguage.js +2 -0
  132. package/dist/groovy.js +9 -0
  133. package/dist/groovy.tmLanguage.js +2 -0
  134. package/dist/groovy2.js +2 -0
  135. package/dist/handlebars.js +8 -0
  136. package/dist/hc_black.js +2 -0
  137. package/dist/hc_light.js +2 -0
  138. package/dist/hlsl.js +8 -0
  139. package/dist/hlsl.tmLanguage.js +2 -0
  140. package/dist/html-derivative.tmLanguage.js +2 -0
  141. package/dist/html.js +10 -0
  142. package/dist/html.tmLanguage.js +2 -0
  143. package/dist/html.tmLanguage2.js +2 -0
  144. package/dist/html2.js +2 -0
  145. package/dist/ini.js +10 -0
  146. package/dist/ini.language-configuration.js +2 -0
  147. package/dist/ini.tmLanguage.js +2 -0
  148. package/dist/injection.js +1 -1
  149. package/dist/java.js +9 -0
  150. package/dist/java.tmLanguage.js +2 -0
  151. package/dist/java2.js +2 -0
  152. package/dist/javascript-language-configuration.js +2 -0
  153. package/dist/javascript.js +14 -0
  154. package/dist/javascript2.js +2 -0
  155. package/dist/jsdoc.js.injection.tmLanguage.js +2 -0
  156. package/dist/jsdoc.ts.injection.tmLanguage.js +2 -0
  157. package/dist/json.js +10 -0
  158. package/dist/jsonErrorMessages.js +1 -1
  159. package/dist/julia.js +8 -0
  160. package/dist/julia.tmLanguage.js +2 -0
  161. package/dist/keybindings.d.ts +1 -10
  162. package/dist/keybindings.js +291 -353
  163. package/dist/kimbie-dark-color-theme.js +2 -0
  164. package/dist/language-configuration.js +2 -0
  165. package/dist/language-configuration10.js +2 -0
  166. package/dist/language-configuration11.js +2 -0
  167. package/dist/language-configuration12.js +2 -0
  168. package/dist/language-configuration13.js +2 -0
  169. package/dist/language-configuration14.js +2 -0
  170. package/dist/language-configuration15.js +2 -0
  171. package/dist/language-configuration16.js +2 -0
  172. package/dist/language-configuration17.js +2 -0
  173. package/dist/language-configuration18.js +2 -0
  174. package/dist/language-configuration19.js +2 -0
  175. package/dist/language-configuration2.js +2 -0
  176. package/dist/language-configuration20.js +2 -0
  177. package/dist/language-configuration21.js +2 -0
  178. package/dist/language-configuration22.js +2 -0
  179. package/dist/language-configuration23.js +2 -0
  180. package/dist/language-configuration24.js +2 -0
  181. package/dist/language-configuration25.js +2 -0
  182. package/dist/language-configuration26.js +2 -0
  183. package/dist/language-configuration27.js +2 -0
  184. package/dist/language-configuration28.js +2 -0
  185. package/dist/language-configuration29.js +2 -0
  186. package/dist/language-configuration3.js +2 -0
  187. package/dist/language-configuration30.js +2 -0
  188. package/dist/language-configuration31.js +2 -0
  189. package/dist/language-configuration32.js +2 -0
  190. package/dist/language-configuration33.js +2 -0
  191. package/dist/language-configuration34.js +2 -0
  192. package/dist/language-configuration35.js +2 -0
  193. package/dist/language-configuration36.js +2 -0
  194. package/dist/language-configuration37.js +2 -0
  195. package/dist/language-configuration38.js +2 -0
  196. package/dist/language-configuration39.js +2 -0
  197. package/dist/language-configuration4.js +2 -0
  198. package/dist/language-configuration5.js +2 -0
  199. package/dist/language-configuration6.js +2 -0
  200. package/dist/language-configuration7.js +2 -0
  201. package/dist/language-configuration8.js +2 -0
  202. package/dist/language-configuration9.js +2 -0
  203. package/dist/languageService.js +5 -6
  204. package/dist/languages.d.ts +66 -1
  205. package/dist/languages.js +924 -5
  206. package/dist/latex.js +11 -0
  207. package/dist/layout.contribution.darwin.js +1 -1
  208. package/dist/layout.contribution.linux.js +1 -1
  209. package/dist/layout.contribution.win.js +1 -1
  210. package/dist/less.js +8 -0
  211. package/dist/less.tmLanguage.js +2 -0
  212. package/dist/light_plus.js +2 -0
  213. package/dist/light_plus_experimental.js +2 -0
  214. package/dist/light_vs.js +2 -0
  215. package/dist/log.js +7 -0
  216. package/dist/log.tmLanguage.js +2 -0
  217. package/dist/lua.js +8 -0
  218. package/dist/lua.tmLanguage.js +2 -0
  219. package/dist/make.js +8 -0
  220. package/dist/make.tmLanguage.js +2 -0
  221. package/dist/markdown-basics.js +9 -0
  222. package/dist/markdown-latex-combined.tmLanguage.js +2 -0
  223. package/dist/markdown.js +2 -0
  224. package/dist/markdown.tmLanguage.js +2 -0
  225. package/dist/memento.js +91 -0
  226. package/dist/modelEditor.d.ts +1480 -138
  227. package/dist/modelEditor.js +8699 -326
  228. package/dist/monaco.d.ts +987 -15
  229. package/dist/monaco.js +40 -10
  230. package/dist/monokai-color-theme.js +2 -0
  231. package/dist/notifications.js +84 -64
  232. package/dist/objective-c.js +10 -0
  233. package/dist/objective-c.tmLanguage.js +2 -0
  234. package/dist/objective-c__.tmLanguage.js +2 -0
  235. package/dist/perl.js +10 -0
  236. package/dist/perl.language-configuration.js +2 -0
  237. package/dist/perl.tmLanguage.js +2 -0
  238. package/dist/perl6.language-configuration.js +2 -0
  239. package/dist/perl6.tmLanguage.js +2 -0
  240. package/dist/php.js +10 -0
  241. package/dist/php.tmLanguage.js +2 -0
  242. package/dist/php2.js +2 -0
  243. package/dist/platform.js +105 -0
  244. package/dist/platform.tmLanguage.js +2 -0
  245. package/dist/polyfill.js +52064 -11100
  246. package/dist/powershell.js +8 -0
  247. package/dist/powershell.tmLanguage.js +2 -0
  248. package/dist/preferences.js +2532 -0
  249. package/dist/properties.language-configuration.js +2 -0
  250. package/dist/pug.js +8 -0
  251. package/dist/pug.tmLanguage.js +2 -0
  252. package/dist/python.js +9 -0
  253. package/dist/quietlight-color-theme.js +2 -0
  254. package/dist/r.js +8 -0
  255. package/dist/r.tmLanguage.js +2 -0
  256. package/dist/razor.js +8 -0
  257. package/dist/rollup-vsix-plugin.d.ts +8 -0
  258. package/dist/rollup-vsix-plugin.js +104 -0
  259. package/dist/ruby.js +8 -0
  260. package/dist/ruby.tmLanguage.js +2 -0
  261. package/dist/rust.js +8 -0
  262. package/dist/rust.tmLanguage.js +2 -0
  263. package/dist/sassdoc.tmLanguage.js +2 -0
  264. package/dist/scss.js +9 -0
  265. package/dist/scss.tmLanguage.js +2 -0
  266. package/dist/services.d.ts +12988 -12840
  267. package/dist/services.js +1 -1
  268. package/dist/shaderlab.js +8 -0
  269. package/dist/shaderlab.tmLanguage.js +2 -0
  270. package/dist/shell-unix-bash.tmLanguage.js +2 -0
  271. package/dist/shellscript.js +8 -0
  272. package/dist/snippets.js +6 -11
  273. package/dist/snippetsService.js +7 -10
  274. package/dist/solarized-dark-color-theme.js +2 -0
  275. package/dist/solarized-light-color-theme.js +2 -0
  276. package/dist/sql.js +8 -0
  277. package/dist/sql.tmLanguage.js +2 -0
  278. package/dist/swift.js +9 -0
  279. package/dist/swift.tmLanguage.js +2 -0
  280. package/dist/swift2.js +2 -0
  281. package/dist/tags-language-configuration.js +2 -0
  282. package/dist/textmate.d.ts +0 -264
  283. package/dist/textmate.js +402 -66
  284. package/dist/theme-abyss.js +7 -0
  285. package/dist/theme-defaults.js +15 -0
  286. package/dist/theme-kimbie-dark.js +7 -0
  287. package/dist/theme-monokai-dimmed.js +7 -0
  288. package/dist/theme-monokai.js +7 -0
  289. package/dist/theme-quietlight.js +7 -0
  290. package/dist/theme-red.js +7 -0
  291. package/dist/theme-seti.js +7 -0
  292. package/dist/theme-solarized-dark.js +7 -0
  293. package/dist/theme-solarized-light.js +7 -0
  294. package/dist/theme-tomorrow-night-blue.js +7 -0
  295. package/dist/theme.js +5 -11
  296. package/dist/{contextkeys.js → theme2.js} +165 -143
  297. package/dist/tokenClassificationRegistry.js +46 -2
  298. package/dist/tomorrow-night-blue-color-theme.js +2 -0
  299. package/dist/typescript-basics.js +14 -0
  300. package/dist/typescript.js +2 -0
  301. package/dist/unboundCommands.js +41 -0
  302. package/dist/utils.js +345 -0
  303. package/dist/vb.js +9 -0
  304. package/dist/vb2.js +2 -0
  305. package/dist/vs-seti-icon-theme.js +2 -0
  306. package/dist/vs_minimal-icon-theme.js +2 -0
  307. package/dist/xml.js +10 -0
  308. package/dist/xml.language-configuration.js +2 -0
  309. package/dist/xml.tmLanguage.js +2 -0
  310. package/dist/xsl.language-configuration.js +2 -0
  311. package/dist/xsl.tmLanguage.js +2 -0
  312. package/dist/yaml.js +10 -0
  313. package/dist/yaml.tmLanguage.js +2 -0
  314. package/package.json +50 -33
  315. package/dist/async.js +0 -301
  316. package/dist/cancellation.js +0 -3
  317. package/dist/configurationRegistry.js +0 -441
  318. package/dist/extensionResourceLoader.js +0 -96
  319. package/dist/labels.js +0 -14
  320. package/dist/languageConfiguration.js +0 -919
  321. package/dist/layout.js +0 -47
  322. package/dist/layoutService.js +0 -4
  323. package/dist/missing-services.js +0 -5554
  324. package/dist/resources.js +0 -197
  325. package/dist/services2.js +0 -3467
  326. package/dist/textFileEditorModel.js +0 -2985
  327. package/dist/tokenClassification.d.ts +0 -7
  328. package/dist/tokenClassification.js +0 -277
  329. package/dist/variableResolver.js +0 -1711
  330. package/dist/workbenchThemeService.js +0 -46
  331. package/dist/workspaceContext.js +0 -50
  332. /package/dist/{languageConfiguration.d.ts → preferences.d.ts} +0 -0
@@ -1,919 +0,0 @@
1
- import { o as onServicesInitialized, p as parse, j as getNodeType } from './polyfill.js';
2
- import { bW as ITextMateTokenizationService, bp as IExtensionService } from './missing-services.js';
3
- import { _ as __decorate, a as __param } from './services2.js';
4
- import { g as getParseErrorMessage } from './jsonErrorMessages.js';
5
- import { I as IExtensionResourceLoaderService } from './extensionResourceLoader.js';
6
- import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
7
- import { hash } from 'monaco-editor/esm/vs/base/common/hash.js';
8
- import { localize } from 'monaco-editor/esm/vs/nls.js';
9
- import { isObject } from 'monaco-editor/esm/vs/base/common/types.js';
10
- import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
11
- import { ILanguageConfigurationService } from 'monaco-editor/esm/vs/editor/common/languages/languageConfigurationRegistry.js';
12
- import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
13
- import { Extensions } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
14
- import { IndentAction } from 'monaco-editor/esm/vs/editor/common/languages/languageConfiguration.js';
15
- import { g as getServiceOverride$1 } from './files.js';
16
- function isStringArr(something) {
17
- if (!Array.isArray(something)) {
18
- return false;
19
- }
20
- for (let i = 0, len = something.length; i < len; i++) {
21
- if (typeof something[i] !== 'string') {
22
- return false;
23
- }
24
- }
25
- return true;
26
- }
27
- function isCharacterPair(something) {
28
- return (isStringArr(something)
29
- && something.length === 2);
30
- }
31
- let LanguageConfigurationFileHandler = class LanguageConfigurationFileHandler extends Disposable {
32
- constructor(textMateService, _languageService, _extensionResourceLoaderService, _extensionService, _languageConfigurationService) {
33
- super();
34
- this._languageService = _languageService;
35
- this._extensionResourceLoaderService = _extensionResourceLoaderService;
36
- this._extensionService = _extensionService;
37
- this._languageConfigurationService = _languageConfigurationService;
38
- this._done = ( new Map());
39
- this._register(this._languageService.onDidEncounterLanguage(async (languageIdentifier) => {
40
- this._extensionService.whenInstalledExtensionsRegistered().then(() => {
41
- this._loadConfigurationsForMode(languageIdentifier);
42
- });
43
- }));
44
- this._register(this._languageService.onDidChange(() => {
45
- for (const [languageId] of this._done) {
46
- this._loadConfigurationsForMode(languageId);
47
- }
48
- }));
49
- this._register(textMateService.onDidEncounterLanguage((languageId) => {
50
- this._loadConfigurationsForMode(languageId);
51
- }));
52
- }
53
- async _loadConfigurationsForMode(languageId) {
54
- const configurationFiles = this._languageService.getConfigurationFiles(languageId);
55
- const configurationHash = hash(( configurationFiles.map(uri => ( uri.toString()))));
56
- if (this._done.get(languageId) === configurationHash) {
57
- return;
58
- }
59
- this._done.set(languageId, configurationHash);
60
- const configs = await Promise.all(( configurationFiles.map(configFile => this._readConfigFile(configFile))));
61
- for (const config of configs) {
62
- this._handleConfig(languageId, config);
63
- }
64
- }
65
- async _readConfigFile(configFileLocation) {
66
- try {
67
- const contents = await this._extensionResourceLoaderService.readExtensionResource(configFileLocation);
68
- const errors = [];
69
- let configuration = parse(contents, errors);
70
- if (errors.length) {
71
- console.error(( localize('parseErrors', "Errors parsing {0}: {1}", ( configFileLocation.toString()), ( errors.map(e => (`[${e.offset}, ${e.length}] ${getParseErrorMessage(e.error)}`))).join('\n'))));
72
- }
73
- if (getNodeType(configuration) !== 'object') {
74
- console.error(( localize(
75
- 'formatError',
76
- "{0}: Invalid format, JSON object expected.",
77
- ( configFileLocation.toString())
78
- )));
79
- configuration = {};
80
- }
81
- return configuration;
82
- }
83
- catch (err) {
84
- console.error(err);
85
- return {};
86
- }
87
- }
88
- _extractValidCommentRule(languageId, configuration) {
89
- const source = configuration.comments;
90
- if (typeof source === 'undefined') {
91
- return undefined;
92
- }
93
- if (!isObject(source)) {
94
- console.warn(`[${languageId}]: language configuration: expected \`comments\` to be an object.`);
95
- return undefined;
96
- }
97
- let result = undefined;
98
- if (typeof source.lineComment !== 'undefined') {
99
- if (typeof source.lineComment !== 'string') {
100
- console.warn(`[${languageId}]: language configuration: expected \`comments.lineComment\` to be a string.`);
101
- }
102
- else {
103
- result = result || {};
104
- result.lineComment = source.lineComment;
105
- }
106
- }
107
- if (typeof source.blockComment !== 'undefined') {
108
- if (!isCharacterPair(source.blockComment)) {
109
- console.warn(`[${languageId}]: language configuration: expected \`comments.blockComment\` to be an array of two strings.`);
110
- }
111
- else {
112
- result = result || {};
113
- result.blockComment = source.blockComment;
114
- }
115
- }
116
- return result;
117
- }
118
- _extractValidBrackets(languageId, configuration) {
119
- const source = configuration.brackets;
120
- if (typeof source === 'undefined') {
121
- return undefined;
122
- }
123
- if (!Array.isArray(source)) {
124
- console.warn(`[${languageId}]: language configuration: expected \`brackets\` to be an array.`);
125
- return undefined;
126
- }
127
- let result = undefined;
128
- for (let i = 0, len = source.length; i < len; i++) {
129
- const pair = source[i];
130
- if (!isCharacterPair(pair)) {
131
- console.warn(`[${languageId}]: language configuration: expected \`brackets[${i}]\` to be an array of two strings.`);
132
- continue;
133
- }
134
- result = result || [];
135
- result.push(pair);
136
- }
137
- return result;
138
- }
139
- _extractValidAutoClosingPairs(languageId, configuration) {
140
- const source = configuration.autoClosingPairs;
141
- if (typeof source === 'undefined') {
142
- return undefined;
143
- }
144
- if (!Array.isArray(source)) {
145
- console.warn(`[${languageId}]: language configuration: expected \`autoClosingPairs\` to be an array.`);
146
- return undefined;
147
- }
148
- let result = undefined;
149
- for (let i = 0, len = source.length; i < len; i++) {
150
- const pair = source[i];
151
- if (Array.isArray(pair)) {
152
- if (!isCharacterPair(pair)) {
153
- console.warn(`[${languageId}]: language configuration: expected \`autoClosingPairs[${i}]\` to be an array of two strings or an object.`);
154
- continue;
155
- }
156
- result = result || [];
157
- result.push({ open: pair[0], close: pair[1] });
158
- }
159
- else {
160
- if (!isObject(pair)) {
161
- console.warn(`[${languageId}]: language configuration: expected \`autoClosingPairs[${i}]\` to be an array of two strings or an object.`);
162
- continue;
163
- }
164
- if (typeof pair.open !== 'string') {
165
- console.warn(`[${languageId}]: language configuration: expected \`autoClosingPairs[${i}].open\` to be a string.`);
166
- continue;
167
- }
168
- if (typeof pair.close !== 'string') {
169
- console.warn(`[${languageId}]: language configuration: expected \`autoClosingPairs[${i}].close\` to be a string.`);
170
- continue;
171
- }
172
- if (typeof pair.notIn !== 'undefined') {
173
- if (!isStringArr(pair.notIn)) {
174
- console.warn(`[${languageId}]: language configuration: expected \`autoClosingPairs[${i}].notIn\` to be a string array.`);
175
- continue;
176
- }
177
- }
178
- result = result || [];
179
- result.push({ open: pair.open, close: pair.close, notIn: pair.notIn });
180
- }
181
- }
182
- return result;
183
- }
184
- _extractValidSurroundingPairs(languageId, configuration) {
185
- const source = configuration.surroundingPairs;
186
- if (typeof source === 'undefined') {
187
- return undefined;
188
- }
189
- if (!Array.isArray(source)) {
190
- console.warn(`[${languageId}]: language configuration: expected \`surroundingPairs\` to be an array.`);
191
- return undefined;
192
- }
193
- let result = undefined;
194
- for (let i = 0, len = source.length; i < len; i++) {
195
- const pair = source[i];
196
- if (Array.isArray(pair)) {
197
- if (!isCharacterPair(pair)) {
198
- console.warn(`[${languageId}]: language configuration: expected \`surroundingPairs[${i}]\` to be an array of two strings or an object.`);
199
- continue;
200
- }
201
- result = result || [];
202
- result.push({ open: pair[0], close: pair[1] });
203
- }
204
- else {
205
- if (!isObject(pair)) {
206
- console.warn(`[${languageId}]: language configuration: expected \`surroundingPairs[${i}]\` to be an array of two strings or an object.`);
207
- continue;
208
- }
209
- if (typeof pair.open !== 'string') {
210
- console.warn(`[${languageId}]: language configuration: expected \`surroundingPairs[${i}].open\` to be a string.`);
211
- continue;
212
- }
213
- if (typeof pair.close !== 'string') {
214
- console.warn(`[${languageId}]: language configuration: expected \`surroundingPairs[${i}].close\` to be a string.`);
215
- continue;
216
- }
217
- result = result || [];
218
- result.push({ open: pair.open, close: pair.close });
219
- }
220
- }
221
- return result;
222
- }
223
- _extractValidColorizedBracketPairs(languageId, configuration) {
224
- const source = configuration.colorizedBracketPairs;
225
- if (typeof source === 'undefined') {
226
- return undefined;
227
- }
228
- if (!Array.isArray(source)) {
229
- console.warn(`[${languageId}]: language configuration: expected \`colorizedBracketPairs\` to be an array.`);
230
- return undefined;
231
- }
232
- const result = [];
233
- for (let i = 0, len = source.length; i < len; i++) {
234
- const pair = source[i];
235
- if (!isCharacterPair(pair)) {
236
- console.warn(`[${languageId}]: language configuration: expected \`colorizedBracketPairs[${i}]\` to be an array of two strings.`);
237
- continue;
238
- }
239
- result.push([pair[0], pair[1]]);
240
- }
241
- return result;
242
- }
243
- _extractValidOnEnterRules(languageId, configuration) {
244
- const source = configuration.onEnterRules;
245
- if (typeof source === 'undefined') {
246
- return undefined;
247
- }
248
- if (!Array.isArray(source)) {
249
- console.warn(`[${languageId}]: language configuration: expected \`onEnterRules\` to be an array.`);
250
- return undefined;
251
- }
252
- let result = undefined;
253
- for (let i = 0, len = source.length; i < len; i++) {
254
- const onEnterRule = source[i];
255
- if (!isObject(onEnterRule)) {
256
- console.warn(`[${languageId}]: language configuration: expected \`onEnterRules[${i}]\` to be an object.`);
257
- continue;
258
- }
259
- if (!isObject(onEnterRule.action)) {
260
- console.warn(`[${languageId}]: language configuration: expected \`onEnterRules[${i}].action\` to be an object.`);
261
- continue;
262
- }
263
- let indentAction;
264
- if (onEnterRule.action.indent === 'none') {
265
- indentAction = IndentAction.None;
266
- }
267
- else if (onEnterRule.action.indent === 'indent') {
268
- indentAction = IndentAction.Indent;
269
- }
270
- else if (onEnterRule.action.indent === 'indentOutdent') {
271
- indentAction = IndentAction.IndentOutdent;
272
- }
273
- else if (onEnterRule.action.indent === 'outdent') {
274
- indentAction = IndentAction.Outdent;
275
- }
276
- else {
277
- console.warn(`[${languageId}]: language configuration: expected \`onEnterRules[${i}].action.indent\` to be 'none', 'indent', 'indentOutdent' or 'outdent'.`);
278
- continue;
279
- }
280
- const action = { indentAction };
281
- if (onEnterRule.action.appendText) {
282
- if (typeof onEnterRule.action.appendText === 'string') {
283
- action.appendText = onEnterRule.action.appendText;
284
- }
285
- else {
286
- console.warn(`[${languageId}]: language configuration: expected \`onEnterRules[${i}].action.appendText\` to be undefined or a string.`);
287
- }
288
- }
289
- if (onEnterRule.action.removeText) {
290
- if (typeof onEnterRule.action.removeText === 'number') {
291
- action.removeText = onEnterRule.action.removeText;
292
- }
293
- else {
294
- console.warn(`[${languageId}]: language configuration: expected \`onEnterRules[${i}].action.removeText\` to be undefined or a number.`);
295
- }
296
- }
297
- const beforeText = this._parseRegex(languageId, `onEnterRules[${i}].beforeText`, onEnterRule.beforeText);
298
- if (!beforeText) {
299
- continue;
300
- }
301
- const resultingOnEnterRule = { beforeText, action };
302
- if (onEnterRule.afterText) {
303
- const afterText = this._parseRegex(languageId, `onEnterRules[${i}].afterText`, onEnterRule.afterText);
304
- if (afterText) {
305
- resultingOnEnterRule.afterText = afterText;
306
- }
307
- }
308
- if (onEnterRule.previousLineText) {
309
- const previousLineText = this._parseRegex(languageId, `onEnterRules[${i}].previousLineText`, onEnterRule.previousLineText);
310
- if (previousLineText) {
311
- resultingOnEnterRule.previousLineText = previousLineText;
312
- }
313
- }
314
- result = result || [];
315
- result.push(resultingOnEnterRule);
316
- }
317
- return result;
318
- }
319
- _handleConfig(languageId, configuration) {
320
- const comments = this._extractValidCommentRule(languageId, configuration);
321
- const brackets = this._extractValidBrackets(languageId, configuration);
322
- const autoClosingPairs = this._extractValidAutoClosingPairs(languageId, configuration);
323
- const surroundingPairs = this._extractValidSurroundingPairs(languageId, configuration);
324
- const colorizedBracketPairs = this._extractValidColorizedBracketPairs(languageId, configuration);
325
- const autoCloseBefore = (typeof configuration.autoCloseBefore === 'string' ? configuration.autoCloseBefore : undefined);
326
- const wordPattern = (configuration.wordPattern ? this._parseRegex(languageId, `wordPattern`, configuration.wordPattern) : undefined);
327
- const indentationRules = (configuration.indentationRules ? this._mapIndentationRules(languageId, configuration.indentationRules) : undefined);
328
- let folding = undefined;
329
- if (configuration.folding) {
330
- const rawMarkers = configuration.folding.markers;
331
- const startMarker = (rawMarkers && rawMarkers.start ? this._parseRegex(languageId, `folding.markers.start`, rawMarkers.start) : undefined);
332
- const endMarker = (rawMarkers && rawMarkers.end ? this._parseRegex(languageId, `folding.markers.end`, rawMarkers.end) : undefined);
333
- const markers = (startMarker && endMarker ? { start: startMarker, end: endMarker } : undefined);
334
- folding = {
335
- offSide: configuration.folding.offSide,
336
- markers
337
- };
338
- }
339
- const onEnterRules = this._extractValidOnEnterRules(languageId, configuration);
340
- const richEditConfig = {
341
- comments,
342
- brackets,
343
- wordPattern,
344
- indentationRules,
345
- onEnterRules,
346
- autoClosingPairs,
347
- surroundingPairs,
348
- colorizedBracketPairs,
349
- autoCloseBefore,
350
- folding,
351
- __electricCharacterSupport: undefined,
352
- };
353
- this._languageConfigurationService.register(languageId, richEditConfig, 50);
354
- }
355
- _parseRegex(languageId, confPath, value) {
356
- if (typeof value === 'string') {
357
- try {
358
- return ( new RegExp(value, ''));
359
- }
360
- catch (err) {
361
- console.warn(`[${languageId}]: Invalid regular expression in \`${confPath}\`: `, err);
362
- return undefined;
363
- }
364
- }
365
- if (isObject(value)) {
366
- if (typeof value.pattern !== 'string') {
367
- console.warn(`[${languageId}]: language configuration: expected \`${confPath}.pattern\` to be a string.`);
368
- return undefined;
369
- }
370
- if (typeof value.flags !== 'undefined' && typeof value.flags !== 'string') {
371
- console.warn(`[${languageId}]: language configuration: expected \`${confPath}.flags\` to be a string.`);
372
- return undefined;
373
- }
374
- try {
375
- return ( new RegExp(value.pattern, value.flags));
376
- }
377
- catch (err) {
378
- console.warn(`[${languageId}]: Invalid regular expression in \`${confPath}\`: `, err);
379
- return undefined;
380
- }
381
- }
382
- console.warn(`[${languageId}]: language configuration: expected \`${confPath}\` to be a string or an object.`);
383
- return undefined;
384
- }
385
- _mapIndentationRules(languageId, indentationRules) {
386
- const increaseIndentPattern = this._parseRegex(languageId, `indentationRules.increaseIndentPattern`, indentationRules.increaseIndentPattern);
387
- if (!increaseIndentPattern) {
388
- return undefined;
389
- }
390
- const decreaseIndentPattern = this._parseRegex(languageId, `indentationRules.decreaseIndentPattern`, indentationRules.decreaseIndentPattern);
391
- if (!decreaseIndentPattern) {
392
- return undefined;
393
- }
394
- const result = {
395
- increaseIndentPattern: increaseIndentPattern,
396
- decreaseIndentPattern: decreaseIndentPattern
397
- };
398
- if (indentationRules.indentNextLinePattern) {
399
- result.indentNextLinePattern = this._parseRegex(languageId, `indentationRules.indentNextLinePattern`, indentationRules.indentNextLinePattern);
400
- }
401
- if (indentationRules.unIndentedLinePattern) {
402
- result.unIndentedLinePattern = this._parseRegex(languageId, `indentationRules.unIndentedLinePattern`, indentationRules.unIndentedLinePattern);
403
- }
404
- return result;
405
- }
406
- };
407
- LanguageConfigurationFileHandler = ( __decorate([
408
- ( __param(0, ITextMateTokenizationService)),
409
- ( __param(1, ILanguageService)),
410
- ( __param(2, IExtensionResourceLoaderService)),
411
- ( __param(3, IExtensionService)),
412
- ( __param(4, ILanguageConfigurationService))
413
- ], LanguageConfigurationFileHandler));
414
- const schemaId = 'vscode://schemas/language-configuration';
415
- const schema = {
416
- allowComments: true,
417
- allowTrailingCommas: true,
418
- default: {
419
- comments: {
420
- blockComment: ['/*', '*/'],
421
- lineComment: '//'
422
- },
423
- brackets: [['(', ')'], ['[', ']'], ['{', '}']],
424
- autoClosingPairs: [['(', ')'], ['[', ']'], ['{', '}']],
425
- surroundingPairs: [['(', ')'], ['[', ']'], ['{', '}']]
426
- },
427
- definitions: {
428
- openBracket: {
429
- type: 'string',
430
- description: ( localize('schema.openBracket', 'The opening bracket character or string sequence.'))
431
- },
432
- closeBracket: {
433
- type: 'string',
434
- description: ( localize('schema.closeBracket', 'The closing bracket character or string sequence.'))
435
- },
436
- bracketPair: {
437
- type: 'array',
438
- items: [{
439
- $ref: '#/definitions/openBracket'
440
- }, {
441
- $ref: '#/definitions/closeBracket'
442
- }]
443
- }
444
- },
445
- properties: {
446
- comments: {
447
- default: {
448
- blockComment: ['/*', '*/'],
449
- lineComment: '//'
450
- },
451
- description: ( localize('schema.comments', 'Defines the comment symbols')),
452
- type: 'object',
453
- properties: {
454
- blockComment: {
455
- type: 'array',
456
- description: ( localize('schema.blockComments', 'Defines how block comments are marked.')),
457
- items: [{
458
- type: 'string',
459
- description: ( localize(
460
- 'schema.blockComment.begin',
461
- 'The character sequence that starts a block comment.'
462
- ))
463
- }, {
464
- type: 'string',
465
- description: ( localize(
466
- 'schema.blockComment.end',
467
- 'The character sequence that ends a block comment.'
468
- ))
469
- }]
470
- },
471
- lineComment: {
472
- type: 'string',
473
- description: ( localize('schema.lineComment', 'The character sequence that starts a line comment.'))
474
- }
475
- }
476
- },
477
- brackets: {
478
- default: [['(', ')'], ['[', ']'], ['{', '}']],
479
- description: ( localize(
480
- 'schema.brackets',
481
- 'Defines the bracket symbols that increase or decrease the indentation.'
482
- )),
483
- type: 'array',
484
- items: {
485
- $ref: '#/definitions/bracketPair'
486
- }
487
- },
488
- colorizedBracketPairs: {
489
- default: [['(', ')'], ['[', ']'], ['{', '}']],
490
- description: ( localize(
491
- 'schema.colorizedBracketPairs',
492
- 'Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled.'
493
- )),
494
- type: 'array',
495
- items: {
496
- $ref: '#/definitions/bracketPair'
497
- }
498
- },
499
- autoClosingPairs: {
500
- default: [['(', ')'], ['[', ']'], ['{', '}']],
501
- description: ( localize(
502
- 'schema.autoClosingPairs',
503
- 'Defines the bracket pairs. When a opening bracket is entered, the closing bracket is inserted automatically.'
504
- )),
505
- type: 'array',
506
- items: {
507
- oneOf: [{
508
- $ref: '#/definitions/bracketPair'
509
- }, {
510
- type: 'object',
511
- properties: {
512
- open: {
513
- $ref: '#/definitions/openBracket'
514
- },
515
- close: {
516
- $ref: '#/definitions/closeBracket'
517
- },
518
- notIn: {
519
- type: 'array',
520
- description: ( localize(
521
- 'schema.autoClosingPairs.notIn',
522
- 'Defines a list of scopes where the auto pairs are disabled.'
523
- )),
524
- items: {
525
- enum: ['string', 'comment']
526
- }
527
- }
528
- }
529
- }]
530
- }
531
- },
532
- autoCloseBefore: {
533
- default: ';:.,=}])> \n\t',
534
- description: ( localize(
535
- 'schema.autoCloseBefore',
536
- 'Defines what characters must be after the cursor in order for bracket or quote autoclosing to occur when using the \'languageDefined\' autoclosing setting. This is typically the set of characters which can not start an expression.'
537
- )),
538
- type: 'string',
539
- },
540
- surroundingPairs: {
541
- default: [['(', ')'], ['[', ']'], ['{', '}']],
542
- description: ( localize(
543
- 'schema.surroundingPairs',
544
- 'Defines the bracket pairs that can be used to surround a selected string.'
545
- )),
546
- type: 'array',
547
- items: {
548
- oneOf: [{
549
- $ref: '#/definitions/bracketPair'
550
- }, {
551
- type: 'object',
552
- properties: {
553
- open: {
554
- $ref: '#/definitions/openBracket'
555
- },
556
- close: {
557
- $ref: '#/definitions/closeBracket'
558
- }
559
- }
560
- }]
561
- }
562
- },
563
- wordPattern: {
564
- default: '',
565
- description: ( localize(
566
- 'schema.wordPattern',
567
- 'Defines what is considered to be a word in the programming language.'
568
- )),
569
- type: ['string', 'object'],
570
- properties: {
571
- pattern: {
572
- type: 'string',
573
- description: ( localize('schema.wordPattern.pattern', 'The RegExp pattern used to match words.')),
574
- default: '',
575
- },
576
- flags: {
577
- type: 'string',
578
- description: ( localize('schema.wordPattern.flags', 'The RegExp flags used to match words.')),
579
- default: 'g',
580
- pattern: '^([gimuy]+)$',
581
- patternErrorMessage: ( localize(
582
- 'schema.wordPattern.flags.errorMessage',
583
- 'Must match the pattern `/^([gimuy]+)$/`.'
584
- ))
585
- }
586
- }
587
- },
588
- indentationRules: {
589
- default: {
590
- increaseIndentPattern: '',
591
- decreaseIndentPattern: ''
592
- },
593
- description: ( localize('schema.indentationRules', 'The language\'s indentation settings.')),
594
- type: 'object',
595
- properties: {
596
- increaseIndentPattern: {
597
- type: ['string', 'object'],
598
- description: ( localize(
599
- 'schema.indentationRules.increaseIndentPattern',
600
- 'If a line matches this pattern, then all the lines after it should be indented once (until another rule matches).'
601
- )),
602
- properties: {
603
- pattern: {
604
- type: 'string',
605
- description: ( localize(
606
- 'schema.indentationRules.increaseIndentPattern.pattern',
607
- 'The RegExp pattern for increaseIndentPattern.'
608
- )),
609
- default: '',
610
- },
611
- flags: {
612
- type: 'string',
613
- description: ( localize(
614
- 'schema.indentationRules.increaseIndentPattern.flags',
615
- 'The RegExp flags for increaseIndentPattern.'
616
- )),
617
- default: '',
618
- pattern: '^([gimuy]+)$',
619
- patternErrorMessage: ( localize(
620
- 'schema.indentationRules.increaseIndentPattern.errorMessage',
621
- 'Must match the pattern `/^([gimuy]+)$/`.'
622
- ))
623
- }
624
- }
625
- },
626
- decreaseIndentPattern: {
627
- type: ['string', 'object'],
628
- description: ( localize(
629
- 'schema.indentationRules.decreaseIndentPattern',
630
- 'If a line matches this pattern, then all the lines after it should be unindented once (until another rule matches).'
631
- )),
632
- properties: {
633
- pattern: {
634
- type: 'string',
635
- description: ( localize(
636
- 'schema.indentationRules.decreaseIndentPattern.pattern',
637
- 'The RegExp pattern for decreaseIndentPattern.'
638
- )),
639
- default: '',
640
- },
641
- flags: {
642
- type: 'string',
643
- description: ( localize(
644
- 'schema.indentationRules.decreaseIndentPattern.flags',
645
- 'The RegExp flags for decreaseIndentPattern.'
646
- )),
647
- default: '',
648
- pattern: '^([gimuy]+)$',
649
- patternErrorMessage: ( localize(
650
- 'schema.indentationRules.decreaseIndentPattern.errorMessage',
651
- 'Must match the pattern `/^([gimuy]+)$/`.'
652
- ))
653
- }
654
- }
655
- },
656
- indentNextLinePattern: {
657
- type: ['string', 'object'],
658
- description: ( localize(
659
- 'schema.indentationRules.indentNextLinePattern',
660
- 'If a line matches this pattern, then **only the next line** after it should be indented once.'
661
- )),
662
- properties: {
663
- pattern: {
664
- type: 'string',
665
- description: ( localize(
666
- 'schema.indentationRules.indentNextLinePattern.pattern',
667
- 'The RegExp pattern for indentNextLinePattern.'
668
- )),
669
- default: '',
670
- },
671
- flags: {
672
- type: 'string',
673
- description: ( localize(
674
- 'schema.indentationRules.indentNextLinePattern.flags',
675
- 'The RegExp flags for indentNextLinePattern.'
676
- )),
677
- default: '',
678
- pattern: '^([gimuy]+)$',
679
- patternErrorMessage: ( localize(
680
- 'schema.indentationRules.indentNextLinePattern.errorMessage',
681
- 'Must match the pattern `/^([gimuy]+)$/`.'
682
- ))
683
- }
684
- }
685
- },
686
- unIndentedLinePattern: {
687
- type: ['string', 'object'],
688
- description: ( localize(
689
- 'schema.indentationRules.unIndentedLinePattern',
690
- 'If a line matches this pattern, then its indentation should not be changed and it should not be evaluated against the other rules.'
691
- )),
692
- properties: {
693
- pattern: {
694
- type: 'string',
695
- description: ( localize(
696
- 'schema.indentationRules.unIndentedLinePattern.pattern',
697
- 'The RegExp pattern for unIndentedLinePattern.'
698
- )),
699
- default: '',
700
- },
701
- flags: {
702
- type: 'string',
703
- description: ( localize(
704
- 'schema.indentationRules.unIndentedLinePattern.flags',
705
- 'The RegExp flags for unIndentedLinePattern.'
706
- )),
707
- default: '',
708
- pattern: '^([gimuy]+)$',
709
- patternErrorMessage: ( localize(
710
- 'schema.indentationRules.unIndentedLinePattern.errorMessage',
711
- 'Must match the pattern `/^([gimuy]+)$/`.'
712
- ))
713
- }
714
- }
715
- }
716
- }
717
- },
718
- folding: {
719
- type: 'object',
720
- description: ( localize('schema.folding', 'The language\'s folding settings.')),
721
- properties: {
722
- offSide: {
723
- type: 'boolean',
724
- description: ( localize(
725
- 'schema.folding.offSide',
726
- 'A language adheres to the off-side rule if blocks in that language are expressed by their indentation. If set, empty lines belong to the subsequent block.'
727
- )),
728
- },
729
- markers: {
730
- type: 'object',
731
- description: ( localize(
732
- 'schema.folding.markers',
733
- 'Language specific folding markers such as \'#region\' and \'#endregion\'. The start and end regexes will be tested against the contents of all lines and must be designed efficiently'
734
- )),
735
- properties: {
736
- start: {
737
- type: 'string',
738
- description: ( localize(
739
- 'schema.folding.markers.start',
740
- 'The RegExp pattern for the start marker. The regexp must start with \'^\'.'
741
- ))
742
- },
743
- end: {
744
- type: 'string',
745
- description: ( localize(
746
- 'schema.folding.markers.end',
747
- 'The RegExp pattern for the end marker. The regexp must start with \'^\'.'
748
- ))
749
- },
750
- }
751
- }
752
- }
753
- },
754
- onEnterRules: {
755
- type: 'array',
756
- description: ( localize(
757
- 'schema.onEnterRules',
758
- 'The language\'s rules to be evaluated when pressing Enter.'
759
- )),
760
- items: {
761
- type: 'object',
762
- description: ( localize(
763
- 'schema.onEnterRules',
764
- 'The language\'s rules to be evaluated when pressing Enter.'
765
- )),
766
- required: ['beforeText', 'action'],
767
- properties: {
768
- beforeText: {
769
- type: ['string', 'object'],
770
- description: ( localize(
771
- 'schema.onEnterRules.beforeText',
772
- 'This rule will only execute if the text before the cursor matches this regular expression.'
773
- )),
774
- properties: {
775
- pattern: {
776
- type: 'string',
777
- description: ( localize(
778
- 'schema.onEnterRules.beforeText.pattern',
779
- 'The RegExp pattern for beforeText.'
780
- )),
781
- default: '',
782
- },
783
- flags: {
784
- type: 'string',
785
- description: ( localize('schema.onEnterRules.beforeText.flags', 'The RegExp flags for beforeText.')),
786
- default: '',
787
- pattern: '^([gimuy]+)$',
788
- patternErrorMessage: ( localize(
789
- 'schema.onEnterRules.beforeText.errorMessage',
790
- 'Must match the pattern `/^([gimuy]+)$/`.'
791
- ))
792
- }
793
- }
794
- },
795
- afterText: {
796
- type: ['string', 'object'],
797
- description: ( localize(
798
- 'schema.onEnterRules.afterText',
799
- 'This rule will only execute if the text after the cursor matches this regular expression.'
800
- )),
801
- properties: {
802
- pattern: {
803
- type: 'string',
804
- description: ( localize(
805
- 'schema.onEnterRules.afterText.pattern',
806
- 'The RegExp pattern for afterText.'
807
- )),
808
- default: '',
809
- },
810
- flags: {
811
- type: 'string',
812
- description: ( localize('schema.onEnterRules.afterText.flags', 'The RegExp flags for afterText.')),
813
- default: '',
814
- pattern: '^([gimuy]+)$',
815
- patternErrorMessage: ( localize(
816
- 'schema.onEnterRules.afterText.errorMessage',
817
- 'Must match the pattern `/^([gimuy]+)$/`.'
818
- ))
819
- }
820
- }
821
- },
822
- previousLineText: {
823
- type: ['string', 'object'],
824
- description: ( localize(
825
- 'schema.onEnterRules.previousLineText',
826
- 'This rule will only execute if the text above the line matches this regular expression.'
827
- )),
828
- properties: {
829
- pattern: {
830
- type: 'string',
831
- description: ( localize(
832
- 'schema.onEnterRules.previousLineText.pattern',
833
- 'The RegExp pattern for previousLineText.'
834
- )),
835
- default: '',
836
- },
837
- flags: {
838
- type: 'string',
839
- description: ( localize(
840
- 'schema.onEnterRules.previousLineText.flags',
841
- 'The RegExp flags for previousLineText.'
842
- )),
843
- default: '',
844
- pattern: '^([gimuy]+)$',
845
- patternErrorMessage: ( localize(
846
- 'schema.onEnterRules.previousLineText.errorMessage',
847
- 'Must match the pattern `/^([gimuy]+)$/`.'
848
- ))
849
- }
850
- }
851
- },
852
- action: {
853
- type: ['string', 'object'],
854
- description: ( localize('schema.onEnterRules.action', 'The action to execute.')),
855
- required: ['indent'],
856
- default: { 'indent': 'indent' },
857
- properties: {
858
- indent: {
859
- type: 'string',
860
- description: ( localize(
861
- 'schema.onEnterRules.action.indent',
862
- "Describe what to do with the indentation"
863
- )),
864
- default: 'indent',
865
- enum: ['none', 'indent', 'indentOutdent', 'outdent'],
866
- markdownEnumDescriptions: [
867
- ( localize(
868
- 'schema.onEnterRules.action.indent.none',
869
- "Insert new line and copy the previous line's indentation."
870
- )),
871
- ( localize(
872
- 'schema.onEnterRules.action.indent.indent',
873
- "Insert new line and indent once (relative to the previous line's indentation)."
874
- )),
875
- ( localize(
876
- 'schema.onEnterRules.action.indent.indentOutdent',
877
- "Insert two new lines:\n - the first one indented which will hold the cursor\n - the second one at the same indentation level"
878
- )),
879
- ( localize(
880
- 'schema.onEnterRules.action.indent.outdent',
881
- "Insert new line and outdent once (relative to the previous line's indentation)."
882
- ))
883
- ]
884
- },
885
- appendText: {
886
- type: 'string',
887
- description: ( localize(
888
- 'schema.onEnterRules.action.appendText',
889
- 'Describes text to be appended after the new line and after the indentation.'
890
- )),
891
- default: '',
892
- },
893
- removeText: {
894
- type: 'number',
895
- description: ( localize(
896
- 'schema.onEnterRules.action.removeText',
897
- 'Describes the number of characters to remove from the new line\'s indentation.'
898
- )),
899
- default: 0,
900
- }
901
- }
902
- }
903
- }
904
- }
905
- }
906
- }
907
- };
908
- const schemaRegistry = ( Registry.as(Extensions.JSONContribution));
909
- schemaRegistry.registerSchema(schemaId, schema);
910
- function initialize(instantiationService) {
911
- instantiationService.createInstance(LanguageConfigurationFileHandler);
912
- }
913
- function getServiceOverride() {
914
- onServicesInitialized(initialize);
915
- return {
916
- ...getServiceOverride$1()
917
- };
918
- }
919
- export { getServiceOverride as default };