monaco-editor-core 0.55.0-dev-20251102 → 0.55.0-dev-20251103

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 (70) hide show
  1. package/esm/nls.messages.cs.js +1 -1
  2. package/esm/nls.messages.de.js +1 -1
  3. package/esm/nls.messages.es.js +1 -1
  4. package/esm/nls.messages.fr.js +1 -1
  5. package/esm/nls.messages.it.js +1 -1
  6. package/esm/nls.messages.ja.js +1 -1
  7. package/esm/nls.messages.ko.js +1 -1
  8. package/esm/nls.messages.pl.js +1 -1
  9. package/esm/nls.messages.pt-br.js +1 -1
  10. package/esm/nls.messages.ru.js +1 -1
  11. package/esm/nls.messages.tr.js +1 -1
  12. package/esm/nls.messages.zh-cn.js +1 -1
  13. package/esm/nls.messages.zh-tw.js +1 -1
  14. package/esm/vs/base/browser/dom.js.map +1 -1
  15. package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
  16. package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
  17. package/esm/vs/base/browser/ui/tree/abstractTree.js +2 -0
  18. package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
  19. package/esm/vs/base/browser/ui/tree/asyncDataTree.js +2 -0
  20. package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
  21. package/esm/vs/base/common/arrays.js.map +1 -1
  22. package/esm/vs/base/common/event.js.map +1 -1
  23. package/esm/vs/base/common/glob.js.map +1 -1
  24. package/esm/vs/base/common/lifecycle.js.map +1 -1
  25. package/esm/vs/base/common/network.js.map +1 -1
  26. package/esm/vs/base/common/ternarySearchTree.js.map +1 -1
  27. package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
  28. package/esm/vs/editor/browser/controller/mouseTarget.js.map +1 -1
  29. package/esm/vs/editor/browser/dataTransfer.js.map +1 -1
  30. package/esm/vs/editor/browser/viewParts/viewLines/viewLine.js.map +1 -1
  31. package/esm/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.js.map +1 -1
  32. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  33. package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js.map +1 -1
  34. package/esm/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js.map +1 -1
  35. package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js.map +1 -1
  36. package/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js.map +1 -1
  37. package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
  38. package/esm/vs/editor/common/core/edits/edit.js.map +1 -1
  39. package/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js.map +1 -1
  40. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/ast.js.map +1 -1
  41. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/concat23Trees.js.map +1 -1
  42. package/esm/vs/editor/common/model/tokens/treeSitter/tokenStore.js.map +1 -1
  43. package/esm/vs/editor/common/model/tokens/treeSitter/treeSitterTree.js.map +1 -1
  44. package/esm/vs/editor/common/viewModel/viewModelLines.js.map +1 -1
  45. package/esm/vs/editor/contrib/editorState/browser/editorState.js.map +1 -1
  46. package/esm/vs/editor/contrib/find/browser/findDecorations.js.map +1 -1
  47. package/esm/vs/editor/contrib/find/browser/findModel.js.map +1 -1
  48. package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
  49. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js.map +1 -1
  50. package/esm/vs/editor/contrib/inlineCompletions/browser/model/suggestWidgetAdapter.js.map +1 -1
  51. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/originalEditorInlineDiffView.js.map +1 -1
  52. package/esm/vs/editor/contrib/links/browser/links.js.map +1 -1
  53. package/esm/vs/editor/contrib/rename/browser/renameWidget.js.map +1 -1
  54. package/esm/vs/editor/contrib/snippet/browser/snippetParser.js.map +1 -1
  55. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
  56. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js.map +1 -1
  57. package/esm/vs/editor/standalone/browser/standaloneEditor.js.map +1 -1
  58. package/esm/vs/editor/standalone/common/monarch/monarchCompile.js.map +1 -1
  59. package/esm/vs/platform/configuration/common/configurationRegistry.js.map +1 -1
  60. package/esm/vs/platform/contextkey/common/contextkey.js +0 -4
  61. package/esm/vs/platform/contextkey/common/contextkey.js.map +1 -1
  62. package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
  63. package/esm/vs/platform/observable/common/wrapInHotClass.js.map +1 -1
  64. package/esm/vs/platform/observable/common/wrapInReloadableClass.js +0 -1
  65. package/esm/vs/platform/observable/common/wrapInReloadableClass.js.map +1 -1
  66. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js.map +1 -1
  67. package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
  68. package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
  69. package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
  70. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/standalone/common/monarch/monarchCompile.ts","vs/editor/standalone/common/monarch/monarchCompile.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AAGpD;;;;;;;GAOG;AAEH,SAAS,SAAS,CAAC,QAA6B,EAAE,GAAQ;IACzD,IAAI,CAAC,GAAG,EAAE,CAAC;QACV,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACd,CAAC;IACD,KAAK,MAAM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C,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC;aAC/C,CAAC,CAAC;QACJ,CAAC;aACI,CAAC;YACL,MAAM,aAAa,CAAC,WAAW,CAAC,KAAK,EAAE,0FAA0F,CAAC,CAAC;QACpI,CAAC;IACF,CAAC;IACD,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAE1B,+DAA+D;IAC/D,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;IACrB,OAAO,KAAK,CAAC;AACd,CAAC","file":"monarchCompile.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n * This module only exports 'compile' which compiles a JSON language definition\n * into a typed and checked ILexer definition.\n */\n\nimport { isString } from '../../../../base/common/types.js';\nimport * as monarchCommon from './monarchCommon.js';\nimport { IMonarchLanguage, IMonarchLanguageBracket } from './monarchTypes.js';\n\n/*\n * Type helpers\n *\n * Note: this is just for sanity checks on the JSON description which is\n * helpful for the programmer. No checks are done anymore once the lexer is\n * already 'compiled and checked'.\n *\n */\n\nfunction isArrayOf(elemType: (x: any) => boolean, obj: any): boolean {\n\tif (!obj) {\n\t\treturn false;\n\t}\n\tif (!(Array.isArray(obj))) {\n\t\treturn false;\n\t}\n\tfor (const el of obj) {\n\t\tif (!(elemType(el))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction bool(prop: any, defValue: boolean): boolean {\n\tif (typeof prop === 'boolean') {\n\t\treturn prop;\n\t}\n\treturn defValue;\n}\n\nfunction string(prop: any, defValue: string): string {\n\tif (typeof (prop) === 'string') {\n\t\treturn prop;\n\t}\n\treturn defValue;\n}\n\n\nfunction arrayToHash(array: string[]): { [name: string]: true } {\n\tconst result: any = {};\n\tfor (const e of array) {\n\t\tresult[e] = true;\n\t}\n\treturn result;\n}\n\n\nfunction createKeywordMatcher(arr: string[], caseInsensitive: boolean = false): (str: string) => boolean {\n\tif (caseInsensitive) {\n\t\tarr = arr.map(function (x) { return x.toLowerCase(); });\n\t}\n\tconst hash = arrayToHash(arr);\n\tif (caseInsensitive) {\n\t\treturn function (word) {\n\t\t\treturn hash[word.toLowerCase()] !== undefined && hash.hasOwnProperty(word.toLowerCase());\n\t\t};\n\t} else {\n\t\treturn function (word) {\n\t\t\treturn hash[word] !== undefined && hash.hasOwnProperty(word);\n\t\t};\n\t}\n}\n\n\n// Lexer helpers\n\n/**\n * Compiles a regular expression string, adding the 'i' flag if 'ignoreCase' is set, and the 'u' flag if 'unicode' is set.\n * Also replaces @\\w+ or sequences with the content of the specified attribute\n * @\\w+ replacement can be avoided by escaping `@` signs with another `@` sign.\n * @example /@attr/ will be replaced with the value of lexer[attr]\n * @example /@@text/ will not be replaced and will become /@text/.\n */\nfunction compileRegExp<S extends true | false>(lexer: monarchCommon.ILexerMin, str: string, handleSn: S): S extends true ? RegExp | DynamicRegExp : RegExp;\nfunction compileRegExp(lexer: monarchCommon.ILexerMin, str: string, handleSn: true | false): RegExp | DynamicRegExp {\n\t// @@ must be interpreted as a literal @, so we replace all occurences of @@ with a placeholder character\n\tstr = str.replace(/@@/g, `\\x01`);\n\n\tlet n = 0;\n\tlet hadExpansion: boolean;\n\tdo {\n\t\thadExpansion = false;\n\t\tstr = str.replace(/@(\\w+)/g, function (s, attr?) {\n\t\t\thadExpansion = true;\n\t\t\tlet sub = '';\n\t\t\tif (typeof (lexer[attr]) === 'string') {\n\t\t\t\tsub = lexer[attr];\n\t\t\t} else if (lexer[attr] && lexer[attr] instanceof RegExp) {\n\t\t\t\tsub = lexer[attr].source;\n\t\t\t} else {\n\t\t\t\tif (lexer[attr] === undefined) {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'language definition does not contain attribute \\'' + attr + '\\', used at: ' + str);\n\t\t\t\t} else {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'attribute reference \\'' + attr + '\\' must be a string, used at: ' + str);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn (monarchCommon.empty(sub) ? '' : '(?:' + sub + ')');\n\t\t});\n\t\tn++;\n\t} while (hadExpansion && n < 5);\n\n\t// handle escaped @@\n\tstr = str.replace(/\\x01/g, '@');\n\n\tconst flags = (lexer.ignoreCase ? 'i' : '') + (lexer.unicode ? 'u' : '');\n\n\t// handle $Sn\n\tif (handleSn) {\n\t\tconst match = str.match(/\\$[sS](\\d\\d?)/g);\n\t\tif (match) {\n\t\t\tlet lastState: string | null = null;\n\t\t\tlet lastRegEx: RegExp | null = null;\n\t\t\treturn (state: string) => {\n\t\t\t\tif (lastRegEx && lastState === state) {\n\t\t\t\t\treturn lastRegEx;\n\t\t\t\t}\n\t\t\t\tlastState = state;\n\t\t\t\tlastRegEx = new RegExp(monarchCommon.substituteMatchesRe(lexer, str, state), flags);\n\t\t\t\treturn lastRegEx;\n\t\t\t};\n\t\t}\n\t}\n\n\treturn new RegExp(str, flags);\n}\n\n/**\n * Compiles guard functions for case matches.\n * This compiles 'cases' attributes into efficient match functions.\n *\n */\nfunction selectScrutinee(id: string, matches: string[], state: string, num: number): string | null {\n\tif (num < 0) {\n\t\treturn id;\n\t}\n\tif (num < matches.length) {\n\t\treturn matches[num];\n\t}\n\tif (num >= 100) {\n\t\tnum = num - 100;\n\t\tconst parts = state.split('.');\n\t\tparts.unshift(state);\n\t\tif (num < parts.length) {\n\t\t\treturn parts[num];\n\t\t}\n\t}\n\treturn null;\n}\n\nfunction createGuard(lexer: monarchCommon.ILexerMin, ruleName: string, tkey: string, val: monarchCommon.FuzzyAction): monarchCommon.IBranch {\n\t// get the scrutinee and pattern\n\tlet scrut = -1; // -1: $!, 0-99: $n, 100+n: $Sn\n\tlet oppat = tkey;\n\tlet matches = tkey.match(/^\\$(([sS]?)(\\d\\d?)|#)(.*)$/);\n\tif (matches) {\n\t\tif (matches[3]) { // if digits\n\t\t\tscrut = parseInt(matches[3]);\n\t\t\tif (matches[2]) {\n\t\t\t\tscrut = scrut + 100; // if [sS] present\n\t\t\t}\n\t\t}\n\t\toppat = matches[4];\n\t}\n\t// get operator\n\tlet op = '~';\n\tlet pat = oppat;\n\tif (!oppat || oppat.length === 0) {\n\t\top = '!=';\n\t\tpat = '';\n\t}\n\telse if (/^\\w*$/.test(pat)) { // just a word\n\t\top = '==';\n\t}\n\telse {\n\t\tmatches = oppat.match(/^(@|!@|~|!~|==|!=)(.*)$/);\n\t\tif (matches) {\n\t\t\top = matches[1];\n\t\t\tpat = matches[2];\n\t\t}\n\t}\n\n\t// set the tester function\n\tlet tester: (s: string, id: string, matches: string[], state: string, eos: boolean) => boolean;\n\n\t// special case a regexp that matches just words\n\tif ((op === '~' || op === '!~') && /^(\\w|\\|)*$/.test(pat)) {\n\t\tconst inWords = createKeywordMatcher(pat.split('|'), lexer.ignoreCase);\n\t\ttester = function (s) { return (op === '~' ? inWords(s) : !inWords(s)); };\n\t}\n\telse if (op === '@' || op === '!@') {\n\t\tconst words = lexer[pat];\n\t\tif (!words) {\n\t\t\tthrow monarchCommon.createError(lexer, 'the @ match target \\'' + pat + '\\' is not defined, in rule: ' + ruleName);\n\t\t}\n\t\tif (!(isArrayOf(function (elem) { return (typeof (elem) === 'string'); }, words))) {\n\t\t\tthrow monarchCommon.createError(lexer, 'the @ match target \\'' + pat + '\\' must be an array of strings, in rule: ' + ruleName);\n\t\t}\n\t\tconst inWords = createKeywordMatcher(words, lexer.ignoreCase);\n\t\ttester = function (s) { return (op === '@' ? inWords(s) : !inWords(s)); };\n\t}\n\telse if (op === '~' || op === '!~') {\n\t\tif (pat.indexOf('$') < 0) {\n\t\t\t// precompile regular expression\n\t\t\tconst re = compileRegExp(lexer, '^' + pat + '$', false);\n\t\t\ttester = function (s) { return (op === '~' ? re.test(s) : !re.test(s)); };\n\t\t}\n\t\telse {\n\t\t\ttester = function (s, id, matches, state) {\n\t\t\t\tconst re = compileRegExp(lexer, '^' + monarchCommon.substituteMatches(lexer, pat, id, matches, state) + '$', false);\n\t\t\t\treturn re.test(s);\n\t\t\t};\n\t\t}\n\t}\n\telse { // if (op==='==' || op==='!=') {\n\t\tif (pat.indexOf('$') < 0) {\n\t\t\tconst patx = monarchCommon.fixCase(lexer, pat);\n\t\t\ttester = function (s) { return (op === '==' ? s === patx : s !== patx); };\n\t\t}\n\t\telse {\n\t\t\tconst patx = monarchCommon.fixCase(lexer, pat);\n\t\t\ttester = function (s, id, matches, state, eos) {\n\t\t\t\tconst patexp = monarchCommon.substituteMatches(lexer, patx, id, matches, state);\n\t\t\t\treturn (op === '==' ? s === patexp : s !== patexp);\n\t\t\t};\n\t\t}\n\t}\n\n\t// return the branch object\n\tif (scrut === -1) {\n\t\treturn {\n\t\t\tname: tkey, value: val, test: function (id, matches, state, eos) {\n\t\t\t\treturn tester(id, id, matches, state, eos);\n\t\t\t}\n\t\t};\n\t}\n\telse {\n\t\treturn {\n\t\t\tname: tkey, value: val, test: function (id, matches, state, eos) {\n\t\t\t\tconst scrutinee = selectScrutinee(id, matches, state, scrut);\n\t\t\t\treturn tester(!scrutinee ? '' : scrutinee, id, matches, state, eos);\n\t\t\t}\n\t\t};\n\t}\n}\n\n/**\n * Compiles an action: i.e. optimize regular expressions and case matches\n * and do many sanity checks.\n *\n * This is called only during compilation but if the lexer definition\n * contains user functions as actions (which is usually not allowed), then this\n * may be called during lexing. It is important therefore to compile common cases efficiently\n */\nfunction compileAction(lexer: monarchCommon.ILexerMin, ruleName: string, action: any): monarchCommon.FuzzyAction {\n\tif (!action) {\n\t\treturn { token: '' };\n\t}\n\telse if (typeof (action) === 'string') {\n\t\treturn action; // { token: action };\n\t}\n\telse if (action.token || action.token === '') {\n\t\tif (typeof (action.token) !== 'string') {\n\t\t\tthrow monarchCommon.createError(lexer, 'a \\'token\\' attribute must be of type string, in rule: ' + ruleName);\n\t\t}\n\t\telse {\n\t\t\t// only copy specific typed fields (only happens once during compile Lexer)\n\t\t\tconst newAction: monarchCommon.IAction = { token: action.token };\n\t\t\tif (action.token.indexOf('$') >= 0) {\n\t\t\t\tnewAction.tokenSubst = true;\n\t\t\t}\n\t\t\tif (typeof (action.bracket) === 'string') {\n\t\t\t\tif (action.bracket === '@open') {\n\t\t\t\t\tnewAction.bracket = monarchCommon.MonarchBracket.Open;\n\t\t\t\t} else if (action.bracket === '@close') {\n\t\t\t\t\tnewAction.bracket = monarchCommon.MonarchBracket.Close;\n\t\t\t\t} else {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'a \\'bracket\\' attribute must be either \\'@open\\' or \\'@close\\', in rule: ' + ruleName);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (action.next) {\n\t\t\t\tif (typeof (action.next) !== 'string') {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'the next state must be a string value in rule: ' + ruleName);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tlet next: string = action.next;\n\t\t\t\t\tif (!/^(@pop|@push|@popall)$/.test(next)) {\n\t\t\t\t\t\tif (next[0] === '@') {\n\t\t\t\t\t\t\tnext = next.substr(1); // peel off starting @ sign\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (next.indexOf('$') < 0) { // no dollar substitution, we can check if the state exists\n\t\t\t\t\t\t\tif (!monarchCommon.stateExists(lexer, monarchCommon.substituteMatches(lexer, next, '', [], ''))) {\n\t\t\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'the next state \\'' + action.next + '\\' is not defined in rule: ' + ruleName);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnewAction.next = next;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof (action.goBack) === 'number') {\n\t\t\t\tnewAction.goBack = action.goBack;\n\t\t\t}\n\t\t\tif (typeof (action.switchTo) === 'string') {\n\t\t\t\tnewAction.switchTo = action.switchTo;\n\t\t\t}\n\t\t\tif (typeof (action.log) === 'string') {\n\t\t\t\tnewAction.log = action.log;\n\t\t\t}\n\t\t\tif (typeof (action.nextEmbedded) === 'string') {\n\t\t\t\tnewAction.nextEmbedded = action.nextEmbedded;\n\t\t\t\tlexer.usesEmbedded = true;\n\t\t\t}\n\t\t\treturn newAction;\n\t\t}\n\t}\n\telse if (Array.isArray(action)) {\n\t\tconst results: monarchCommon.FuzzyAction[] = [];\n\t\tfor (let i = 0, len = action.length; i < len; i++) {\n\t\t\tresults[i] = compileAction(lexer, ruleName, action[i]);\n\t\t}\n\t\treturn { group: results };\n\t}\n\telse if (action.cases) {\n\t\t// build an array of test cases\n\t\tconst cases: monarchCommon.IBranch[] = [];\n\n\t\tlet hasEmbeddedEndInCases = false;\n\t\t// for each case, push a test function and result value\n\t\tfor (const tkey in action.cases) {\n\t\t\tif (action.cases.hasOwnProperty(tkey)) {\n\t\t\t\tconst val = compileAction(lexer, ruleName, action.cases[tkey]);\n\n\t\t\t\t// what kind of case\n\t\t\t\tif (tkey === '@default' || tkey === '@' || tkey === '') {\n\t\t\t\t\tcases.push({ test: undefined, value: val, name: tkey });\n\t\t\t\t}\n\t\t\t\telse if (tkey === '@eos') {\n\t\t\t\t\tcases.push({ test: function (id, matches, state, eos) { return eos; }, value: val, name: tkey });\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcases.push(createGuard(lexer, ruleName, tkey, val)); // call separate function to avoid local variable capture\n\t\t\t\t}\n\n\t\t\t\tif (!hasEmbeddedEndInCases) {\n\t\t\t\t\thasEmbeddedEndInCases = !isString(val) && (val.hasEmbeddedEndInCases || ['@pop', '@popall'].includes(val.nextEmbedded || ''));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// create a matching function\n\t\tconst def = lexer.defaultToken;\n\t\treturn {\n\t\t\thasEmbeddedEndInCases,\n\t\t\ttest: function (id, matches, state, eos) {\n\t\t\t\tfor (const _case of cases) {\n\t\t\t\t\tconst didmatch = (!_case.test || _case.test(id, matches, state, eos));\n\t\t\t\t\tif (didmatch) {\n\t\t\t\t\t\treturn _case.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn def;\n\t\t\t}\n\t\t};\n\t}\n\telse {\n\t\tthrow monarchCommon.createError(lexer, 'an action must be a string, an object with a \\'token\\' or \\'cases\\' attribute, or an array of actions; in rule: ' + ruleName);\n\t}\n}\n\ntype DynamicRegExp = (state: string) => RegExp;\n\n/**\n * Helper class for creating matching rules\n */\nclass Rule implements monarchCommon.IRule {\n\tprivate regex: RegExp | DynamicRegExp = new RegExp('');\n\tpublic action: monarchCommon.FuzzyAction = { token: '' };\n\tpublic matchOnlyAtLineStart: boolean = false;\n\tpublic name: string = '';\n\n\tconstructor(name: string) {\n\t\tthis.name = name;\n\t}\n\n\tpublic setRegex(lexer: monarchCommon.ILexerMin, re: string | RegExp): void {\n\t\tlet sregex: string;\n\t\tif (typeof (re) === 'string') {\n\t\t\tsregex = re;\n\t\t}\n\t\telse if (re instanceof RegExp) {\n\t\t\tsregex = (<RegExp>re).source;\n\t\t}\n\t\telse {\n\t\t\tthrow monarchCommon.createError(lexer, 'rules must start with a match string or regular expression: ' + this.name);\n\t\t}\n\n\t\tthis.matchOnlyAtLineStart = (sregex.length > 0 && sregex[0] === '^');\n\t\tthis.name = this.name + ': ' + sregex;\n\t\tthis.regex = compileRegExp(lexer, '^(?:' + (this.matchOnlyAtLineStart ? sregex.substr(1) : sregex) + ')', true);\n\t}\n\n\tpublic setAction(lexer: monarchCommon.ILexerMin, act: monarchCommon.IAction) {\n\t\tthis.action = compileAction(lexer, this.name, act);\n\t}\n\n\tpublic resolveRegex(state: string): RegExp {\n\t\tif (this.regex instanceof RegExp) {\n\t\t\treturn this.regex;\n\t\t} else {\n\t\t\treturn this.regex(state);\n\t\t}\n\t}\n}\n\n/**\n * Compiles a json description function into json where all regular expressions,\n * case matches etc, are compiled and all include rules are expanded.\n * We also compile the bracket definitions, supply defaults, and do many sanity checks.\n * If the 'jsonStrict' parameter is 'false', we allow at certain locations\n * regular expression objects and functions that get called during lexing.\n * (Currently we have no samples that need this so perhaps we should always have\n * jsonStrict to true).\n */\nexport function compile(languageId: string, json: IMonarchLanguage): monarchCommon.ILexer {\n\tif (!json || typeof (json) !== 'object') {\n\t\tthrow new Error('Monarch: expecting a language definition object');\n\t}\n\n\t// Create our lexer\n\tconst lexer: monarchCommon.ILexer = {\n\t\tlanguageId: languageId,\n\t\tincludeLF: bool(json.includeLF, false),\n\t\tnoThrow: false, // raise exceptions during compilation\n\t\tmaxStack: 100,\n\t\tstart: (typeof json.start === 'string' ? json.start : null),\n\t\tignoreCase: bool(json.ignoreCase, false),\n\t\tunicode: bool(json.unicode, false),\n\t\ttokenPostfix: string(json.tokenPostfix, '.' + languageId),\n\t\tdefaultToken: string(json.defaultToken, 'source'),\n\t\tusesEmbedded: false, // becomes true if we find a nextEmbedded action\n\t\tstateNames: {},\n\t\ttokenizer: {},\n\t\tbrackets: []\n\t};\n\n\t// For calling compileAction later on\n\t// eslint-disable-next-line local/code-no-any-casts\n\tconst lexerMin: monarchCommon.ILexerMin = <any>json;\n\tlexerMin.languageId = languageId;\n\tlexerMin.includeLF = lexer.includeLF;\n\tlexerMin.ignoreCase = lexer.ignoreCase;\n\tlexerMin.unicode = lexer.unicode;\n\tlexerMin.noThrow = lexer.noThrow;\n\tlexerMin.usesEmbedded = lexer.usesEmbedded;\n\tlexerMin.stateNames = json.tokenizer;\n\tlexerMin.defaultToken = lexer.defaultToken;\n\n\n\t// Compile an array of rules into newrules where RegExp objects are created.\n\tfunction addRules(state: string, newrules: monarchCommon.IRule[], rules: any[]) {\n\t\tfor (const rule of rules) {\n\n\t\t\tlet include = rule.include;\n\t\t\tif (include) {\n\t\t\t\tif (typeof (include) !== 'string') {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'an \\'include\\' attribute must be a string at: ' + state);\n\t\t\t\t}\n\t\t\t\tif (include[0] === '@') {\n\t\t\t\t\tinclude = include.substr(1); // peel off starting @\n\t\t\t\t}\n\t\t\t\tif (!json.tokenizer[include]) {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'include target \\'' + include + '\\' is not defined at: ' + state);\n\t\t\t\t}\n\t\t\t\taddRules(state + '.' + include, newrules, json.tokenizer[include]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst newrule = new Rule(state);\n\n\t\t\t\t// Set up new rule attributes\n\t\t\t\tif (Array.isArray(rule) && rule.length >= 1 && rule.length <= 3) {\n\t\t\t\t\tnewrule.setRegex(lexerMin, rule[0]);\n\t\t\t\t\tif (rule.length >= 3) {\n\t\t\t\t\t\tif (typeof (rule[1]) === 'string') {\n\t\t\t\t\t\t\tnewrule.setAction(lexerMin, { token: rule[1], next: rule[2] });\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (typeof (rule[1]) === 'object') {\n\t\t\t\t\t\t\tconst rule1 = rule[1];\n\t\t\t\t\t\t\trule1.next = rule[2];\n\t\t\t\t\t\t\tnewrule.setAction(lexerMin, rule1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'a next state as the last element of a rule can only be given if the action is either an object or a string, at: ' + state);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnewrule.setAction(lexerMin, rule[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!rule.regex) {\n\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'a rule must either be an array, or an object with a \\'regex\\' or \\'include\\' field at: ' + state);\n\t\t\t\t\t}\n\t\t\t\t\tif (rule.name) {\n\t\t\t\t\t\tif (typeof rule.name === 'string') {\n\t\t\t\t\t\t\tnewrule.name = rule.name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (rule.matchOnlyAtStart) {\n\t\t\t\t\t\tnewrule.matchOnlyAtLineStart = bool(rule.matchOnlyAtLineStart, false);\n\t\t\t\t\t}\n\t\t\t\t\tnewrule.setRegex(lexerMin, rule.regex);\n\t\t\t\t\tnewrule.setAction(lexerMin, rule.action);\n\t\t\t\t}\n\n\t\t\t\tnewrules.push(newrule);\n\t\t\t}\n\t\t}\n\t}\n\n\t// compile the tokenizer rules\n\tif (!json.tokenizer || typeof (json.tokenizer) !== 'object') {\n\t\tthrow monarchCommon.createError(lexer, 'a language definition must define the \\'tokenizer\\' attribute as an object');\n\t}\n\n\t// eslint-disable-next-line local/code-no-any-casts\n\tlexer.tokenizer = <any>[];\n\tfor (const key in json.tokenizer) {\n\t\tif (json.tokenizer.hasOwnProperty(key)) {\n\t\t\tif (!lexer.start) {\n\t\t\t\tlexer.start = key;\n\t\t\t}\n\n\t\t\tconst rules = json.tokenizer[key];\n\t\t\tlexer.tokenizer[key] = new Array();\n\t\t\taddRules('tokenizer.' + key, lexer.tokenizer[key], rules);\n\t\t}\n\t}\n\tlexer.usesEmbedded = lexerMin.usesEmbedded; // can be set during compileAction\n\n\t// Set simple brackets\n\tif (json.brackets) {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tif (!(Array.isArray(<any>json.brackets))) {\n\t\t\tthrow monarchCommon.createError(lexer, 'the \\'brackets\\' attribute must be defined as an array');\n\t\t}\n\t}\n\telse {\n\t\tjson.brackets = [\n\t\t\t{ open: '{', close: '}', token: 'delimiter.curly' },\n\t\t\t{ open: '[', close: ']', token: 'delimiter.square' },\n\t\t\t{ open: '(', close: ')', token: 'delimiter.parenthesis' },\n\t\t\t{ open: '<', close: '>', token: 'delimiter.angle' }];\n\t}\n\tconst brackets: IMonarchLanguageBracket[] = [];\n\tfor (const el of json.brackets) {\n\t\tlet desc: any = el;\n\t\tif (desc && Array.isArray(desc) && desc.length === 3) {\n\t\t\tdesc = { token: desc[2], open: desc[0], close: desc[1] };\n\t\t}\n\t\tif (desc.open === desc.close) {\n\t\t\tthrow monarchCommon.createError(lexer, 'open and close brackets in a \\'brackets\\' attribute must be different: ' + desc.open +\n\t\t\t\t'\\n hint: use the \\'bracket\\' attribute if matching on equal brackets is required.');\n\t\t}\n\t\tif (typeof desc.open === 'string' && typeof desc.token === 'string' && typeof desc.close === 'string') {\n\t\t\tbrackets.push({\n\t\t\t\ttoken: desc.token + lexer.tokenPostfix,\n\t\t\t\topen: monarchCommon.fixCase(lexer, desc.open),\n\t\t\t\tclose: monarchCommon.fixCase(lexer, desc.close)\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tthrow monarchCommon.createError(lexer, 'every element in the \\'brackets\\' array must be a \\'{open,close,token}\\' object or array');\n\t\t}\n\t}\n\tlexer.brackets = brackets;\n\n\t// Disable throw so the syntax highlighter goes, no matter what\n\tlexer.noThrow = true;\n\treturn lexer;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n * This module only exports 'compile' which compiles a JSON language definition\n * into a typed and checked ILexer definition.\n */\n\nimport { isString } from '../../../../base/common/types.js';\nimport * as monarchCommon from './monarchCommon.js';\nimport { IMonarchLanguage, IMonarchLanguageBracket } from './monarchTypes.js';\n\n/*\n * Type helpers\n *\n * Note: this is just for sanity checks on the JSON description which is\n * helpful for the programmer. No checks are done anymore once the lexer is\n * already 'compiled and checked'.\n *\n */\n\nfunction isArrayOf(elemType: (x: any) => boolean, obj: any): boolean {\n\tif (!obj) {\n\t\treturn false;\n\t}\n\tif (!(Array.isArray(obj))) {\n\t\treturn false;\n\t}\n\tfor (const el of obj) {\n\t\tif (!(elemType(el))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction bool(prop: any, defValue: boolean): boolean {\n\tif (typeof prop === 'boolean') {\n\t\treturn prop;\n\t}\n\treturn defValue;\n}\n\nfunction string(prop: any, defValue: string): string {\n\tif (typeof (prop) === 'string') {\n\t\treturn prop;\n\t}\n\treturn defValue;\n}\n\n\nfunction arrayToHash(array: string[]): { [name: string]: true } {\n\tconst result: any = {};\n\tfor (const e of array) {\n\t\tresult[e] = true;\n\t}\n\treturn result;\n}\n\n\nfunction createKeywordMatcher(arr: string[], caseInsensitive: boolean = false): (str: string) => boolean {\n\tif (caseInsensitive) {\n\t\tarr = arr.map(function (x) { return x.toLowerCase(); });\n\t}\n\tconst hash = arrayToHash(arr);\n\tif (caseInsensitive) {\n\t\treturn function (word) {\n\t\t\treturn hash[word.toLowerCase()] !== undefined && hash.hasOwnProperty(word.toLowerCase());\n\t\t};\n\t} else {\n\t\treturn function (word) {\n\t\t\treturn hash[word] !== undefined && hash.hasOwnProperty(word);\n\t\t};\n\t}\n}\n\n\n// Lexer helpers\n\n/**\n * Compiles a regular expression string, adding the 'i' flag if 'ignoreCase' is set, and the 'u' flag if 'unicode' is set.\n * Also replaces @\\w+ or sequences with the content of the specified attribute\n * @\\w+ replacement can be avoided by escaping `@` signs with another `@` sign.\n * @example /@attr/ will be replaced with the value of lexer[attr]\n * @example /@@text/ will not be replaced and will become /@text/.\n */\nfunction compileRegExp<S extends true | false>(lexer: monarchCommon.ILexerMin, str: string, handleSn: S): S extends true ? RegExp | DynamicRegExp : RegExp;\nfunction compileRegExp(lexer: monarchCommon.ILexerMin, str: string, handleSn: true | false): RegExp | DynamicRegExp {\n\t// @@ must be interpreted as a literal @, so we replace all occurences of @@ with a placeholder character\n\tstr = str.replace(/@@/g, `\\x01`);\n\n\tlet n = 0;\n\tlet hadExpansion: boolean;\n\tdo {\n\t\thadExpansion = false;\n\t\tstr = str.replace(/@(\\w+)/g, function (s, attr?) {\n\t\t\thadExpansion = true;\n\t\t\tlet sub = '';\n\t\t\tif (typeof (lexer[attr]) === 'string') {\n\t\t\t\tsub = lexer[attr];\n\t\t\t} else if (lexer[attr] && lexer[attr] instanceof RegExp) {\n\t\t\t\tsub = lexer[attr].source;\n\t\t\t} else {\n\t\t\t\tif (lexer[attr] === undefined) {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'language definition does not contain attribute \\'' + attr + '\\', used at: ' + str);\n\t\t\t\t} else {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'attribute reference \\'' + attr + '\\' must be a string, used at: ' + str);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn (monarchCommon.empty(sub) ? '' : '(?:' + sub + ')');\n\t\t});\n\t\tn++;\n\t} while (hadExpansion && n < 5);\n\n\t// handle escaped @@\n\tstr = str.replace(/\\x01/g, '@');\n\n\tconst flags = (lexer.ignoreCase ? 'i' : '') + (lexer.unicode ? 'u' : '');\n\n\t// handle $Sn\n\tif (handleSn) {\n\t\tconst match = str.match(/\\$[sS](\\d\\d?)/g);\n\t\tif (match) {\n\t\t\tlet lastState: string | null = null;\n\t\t\tlet lastRegEx: RegExp | null = null;\n\t\t\treturn (state: string) => {\n\t\t\t\tif (lastRegEx && lastState === state) {\n\t\t\t\t\treturn lastRegEx;\n\t\t\t\t}\n\t\t\t\tlastState = state;\n\t\t\t\tlastRegEx = new RegExp(monarchCommon.substituteMatchesRe(lexer, str, state), flags);\n\t\t\t\treturn lastRegEx;\n\t\t\t};\n\t\t}\n\t}\n\n\treturn new RegExp(str, flags);\n}\n\n/**\n * Compiles guard functions for case matches.\n * This compiles 'cases' attributes into efficient match functions.\n *\n */\nfunction selectScrutinee(id: string, matches: string[], state: string, num: number): string | null {\n\tif (num < 0) {\n\t\treturn id;\n\t}\n\tif (num < matches.length) {\n\t\treturn matches[num];\n\t}\n\tif (num >= 100) {\n\t\tnum = num - 100;\n\t\tconst parts = state.split('.');\n\t\tparts.unshift(state);\n\t\tif (num < parts.length) {\n\t\t\treturn parts[num];\n\t\t}\n\t}\n\treturn null;\n}\n\nfunction createGuard(lexer: monarchCommon.ILexerMin, ruleName: string, tkey: string, val: monarchCommon.FuzzyAction): monarchCommon.IBranch {\n\t// get the scrutinee and pattern\n\tlet scrut = -1; // -1: $!, 0-99: $n, 100+n: $Sn\n\tlet oppat = tkey;\n\tlet matches = tkey.match(/^\\$(([sS]?)(\\d\\d?)|#)(.*)$/);\n\tif (matches) {\n\t\tif (matches[3]) { // if digits\n\t\t\tscrut = parseInt(matches[3]);\n\t\t\tif (matches[2]) {\n\t\t\t\tscrut = scrut + 100; // if [sS] present\n\t\t\t}\n\t\t}\n\t\toppat = matches[4];\n\t}\n\t// get operator\n\tlet op = '~';\n\tlet pat = oppat;\n\tif (!oppat || oppat.length === 0) {\n\t\top = '!=';\n\t\tpat = '';\n\t}\n\telse if (/^\\w*$/.test(pat)) { // just a word\n\t\top = '==';\n\t}\n\telse {\n\t\tmatches = oppat.match(/^(@|!@|~|!~|==|!=)(.*)$/);\n\t\tif (matches) {\n\t\t\top = matches[1];\n\t\t\tpat = matches[2];\n\t\t}\n\t}\n\n\t// set the tester function\n\tlet tester: (s: string, id: string, matches: string[], state: string, eos: boolean) => boolean;\n\n\t// special case a regexp that matches just words\n\tif ((op === '~' || op === '!~') && /^(\\w|\\|)*$/.test(pat)) {\n\t\tconst inWords = createKeywordMatcher(pat.split('|'), lexer.ignoreCase);\n\t\ttester = function (s) { return (op === '~' ? inWords(s) : !inWords(s)); };\n\t}\n\telse if (op === '@' || op === '!@') {\n\t\tconst words = lexer[pat];\n\t\tif (!words) {\n\t\t\tthrow monarchCommon.createError(lexer, 'the @ match target \\'' + pat + '\\' is not defined, in rule: ' + ruleName);\n\t\t}\n\t\tif (!(isArrayOf(function (elem) { return (typeof (elem) === 'string'); }, words))) {\n\t\t\tthrow monarchCommon.createError(lexer, 'the @ match target \\'' + pat + '\\' must be an array of strings, in rule: ' + ruleName);\n\t\t}\n\t\tconst inWords = createKeywordMatcher(words, lexer.ignoreCase);\n\t\ttester = function (s) { return (op === '@' ? inWords(s) : !inWords(s)); };\n\t}\n\telse if (op === '~' || op === '!~') {\n\t\tif (pat.indexOf('$') < 0) {\n\t\t\t// precompile regular expression\n\t\t\tconst re = compileRegExp(lexer, '^' + pat + '$', false);\n\t\t\ttester = function (s) { return (op === '~' ? re.test(s) : !re.test(s)); };\n\t\t}\n\t\telse {\n\t\t\ttester = function (s, id, matches, state) {\n\t\t\t\tconst re = compileRegExp(lexer, '^' + monarchCommon.substituteMatches(lexer, pat, id, matches, state) + '$', false);\n\t\t\t\treturn re.test(s);\n\t\t\t};\n\t\t}\n\t}\n\telse { // if (op==='==' || op==='!=') {\n\t\tif (pat.indexOf('$') < 0) {\n\t\t\tconst patx = monarchCommon.fixCase(lexer, pat);\n\t\t\ttester = function (s) { return (op === '==' ? s === patx : s !== patx); };\n\t\t}\n\t\telse {\n\t\t\tconst patx = monarchCommon.fixCase(lexer, pat);\n\t\t\ttester = function (s, id, matches, state, eos) {\n\t\t\t\tconst patexp = monarchCommon.substituteMatches(lexer, patx, id, matches, state);\n\t\t\t\treturn (op === '==' ? s === patexp : s !== patexp);\n\t\t\t};\n\t\t}\n\t}\n\n\t// return the branch object\n\tif (scrut === -1) {\n\t\treturn {\n\t\t\tname: tkey, value: val, test: function (id, matches, state, eos) {\n\t\t\t\treturn tester(id, id, matches, state, eos);\n\t\t\t}\n\t\t};\n\t}\n\telse {\n\t\treturn {\n\t\t\tname: tkey, value: val, test: function (id, matches, state, eos) {\n\t\t\t\tconst scrutinee = selectScrutinee(id, matches, state, scrut);\n\t\t\t\treturn tester(!scrutinee ? '' : scrutinee, id, matches, state, eos);\n\t\t\t}\n\t\t};\n\t}\n}\n\n/**\n * Compiles an action: i.e. optimize regular expressions and case matches\n * and do many sanity checks.\n *\n * This is called only during compilation but if the lexer definition\n * contains user functions as actions (which is usually not allowed), then this\n * may be called during lexing. It is important therefore to compile common cases efficiently\n */\nfunction compileAction(lexer: monarchCommon.ILexerMin, ruleName: string, action: any): monarchCommon.FuzzyAction {\n\tif (!action) {\n\t\treturn { token: '' };\n\t}\n\telse if (typeof (action) === 'string') {\n\t\treturn action; // { token: action };\n\t}\n\telse if (action.token || action.token === '') {\n\t\tif (typeof (action.token) !== 'string') {\n\t\t\tthrow monarchCommon.createError(lexer, 'a \\'token\\' attribute must be of type string, in rule: ' + ruleName);\n\t\t}\n\t\telse {\n\t\t\t// only copy specific typed fields (only happens once during compile Lexer)\n\t\t\tconst newAction: monarchCommon.IAction = { token: action.token };\n\t\t\tif (action.token.indexOf('$') >= 0) {\n\t\t\t\tnewAction.tokenSubst = true;\n\t\t\t}\n\t\t\tif (typeof (action.bracket) === 'string') {\n\t\t\t\tif (action.bracket === '@open') {\n\t\t\t\t\tnewAction.bracket = monarchCommon.MonarchBracket.Open;\n\t\t\t\t} else if (action.bracket === '@close') {\n\t\t\t\t\tnewAction.bracket = monarchCommon.MonarchBracket.Close;\n\t\t\t\t} else {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'a \\'bracket\\' attribute must be either \\'@open\\' or \\'@close\\', in rule: ' + ruleName);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (action.next) {\n\t\t\t\tif (typeof (action.next) !== 'string') {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'the next state must be a string value in rule: ' + ruleName);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tlet next: string = action.next;\n\t\t\t\t\tif (!/^(@pop|@push|@popall)$/.test(next)) {\n\t\t\t\t\t\tif (next[0] === '@') {\n\t\t\t\t\t\t\tnext = next.substr(1); // peel off starting @ sign\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (next.indexOf('$') < 0) { // no dollar substitution, we can check if the state exists\n\t\t\t\t\t\t\tif (!monarchCommon.stateExists(lexer, monarchCommon.substituteMatches(lexer, next, '', [], ''))) {\n\t\t\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'the next state \\'' + action.next + '\\' is not defined in rule: ' + ruleName);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnewAction.next = next;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof (action.goBack) === 'number') {\n\t\t\t\tnewAction.goBack = action.goBack;\n\t\t\t}\n\t\t\tif (typeof (action.switchTo) === 'string') {\n\t\t\t\tnewAction.switchTo = action.switchTo;\n\t\t\t}\n\t\t\tif (typeof (action.log) === 'string') {\n\t\t\t\tnewAction.log = action.log;\n\t\t\t}\n\t\t\tif (typeof (action.nextEmbedded) === 'string') {\n\t\t\t\tnewAction.nextEmbedded = action.nextEmbedded;\n\t\t\t\tlexer.usesEmbedded = true;\n\t\t\t}\n\t\t\treturn newAction;\n\t\t}\n\t}\n\telse if (Array.isArray(action)) {\n\t\tconst results: monarchCommon.FuzzyAction[] = [];\n\t\tfor (let i = 0, len = action.length; i < len; i++) {\n\t\t\tresults[i] = compileAction(lexer, ruleName, action[i]);\n\t\t}\n\t\treturn { group: results };\n\t}\n\telse if (action.cases) {\n\t\t// build an array of test cases\n\t\tconst cases: monarchCommon.IBranch[] = [];\n\n\t\tlet hasEmbeddedEndInCases = false;\n\t\t// for each case, push a test function and result value\n\t\tfor (const tkey in action.cases) {\n\t\t\tif (action.cases.hasOwnProperty(tkey)) {\n\t\t\t\tconst val = compileAction(lexer, ruleName, action.cases[tkey]);\n\n\t\t\t\t// what kind of case\n\t\t\t\tif (tkey === '@default' || tkey === '@' || tkey === '') {\n\t\t\t\t\tcases.push({ test: undefined, value: val, name: tkey });\n\t\t\t\t}\n\t\t\t\telse if (tkey === '@eos') {\n\t\t\t\t\tcases.push({ test: function (id, matches, state, eos) { return eos; }, value: val, name: tkey });\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcases.push(createGuard(lexer, ruleName, tkey, val)); // call separate function to avoid local variable capture\n\t\t\t\t}\n\n\t\t\t\tif (!hasEmbeddedEndInCases) {\n\t\t\t\t\thasEmbeddedEndInCases = !isString(val) && (val.hasEmbeddedEndInCases || ['@pop', '@popall'].includes(val.nextEmbedded || ''));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// create a matching function\n\t\tconst def = lexer.defaultToken;\n\t\treturn {\n\t\t\thasEmbeddedEndInCases,\n\t\t\ttest: function (id, matches, state, eos) {\n\t\t\t\tfor (const _case of cases) {\n\t\t\t\t\tconst didmatch = (!_case.test || _case.test(id, matches, state, eos));\n\t\t\t\t\tif (didmatch) {\n\t\t\t\t\t\treturn _case.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn def;\n\t\t\t}\n\t\t};\n\t}\n\telse {\n\t\tthrow monarchCommon.createError(lexer, 'an action must be a string, an object with a \\'token\\' or \\'cases\\' attribute, or an array of actions; in rule: ' + ruleName);\n\t}\n}\n\ntype DynamicRegExp = (state: string) => RegExp;\n\n/**\n * Helper class for creating matching rules\n */\nclass Rule implements monarchCommon.IRule {\n\tprivate regex: RegExp | DynamicRegExp = new RegExp('');\n\tpublic action: monarchCommon.FuzzyAction = { token: '' };\n\tpublic matchOnlyAtLineStart: boolean = false;\n\tpublic name: string = '';\n\n\tconstructor(name: string) {\n\t\tthis.name = name;\n\t}\n\n\tpublic setRegex(lexer: monarchCommon.ILexerMin, re: string | RegExp): void {\n\t\tlet sregex: string;\n\t\tif (typeof (re) === 'string') {\n\t\t\tsregex = re;\n\t\t}\n\t\telse if (re instanceof RegExp) {\n\t\t\tsregex = (<RegExp>re).source;\n\t\t}\n\t\telse {\n\t\t\tthrow monarchCommon.createError(lexer, 'rules must start with a match string or regular expression: ' + this.name);\n\t\t}\n\n\t\tthis.matchOnlyAtLineStart = (sregex.length > 0 && sregex[0] === '^');\n\t\tthis.name = this.name + ': ' + sregex;\n\t\tthis.regex = compileRegExp(lexer, '^(?:' + (this.matchOnlyAtLineStart ? sregex.substr(1) : sregex) + ')', true);\n\t}\n\n\tpublic setAction(lexer: monarchCommon.ILexerMin, act: monarchCommon.IAction) {\n\t\tthis.action = compileAction(lexer, this.name, act);\n\t}\n\n\tpublic resolveRegex(state: string): RegExp {\n\t\tif (this.regex instanceof RegExp) {\n\t\t\treturn this.regex;\n\t\t} else {\n\t\t\treturn this.regex(state);\n\t\t}\n\t}\n}\n\n/**\n * Compiles a json description function into json where all regular expressions,\n * case matches etc, are compiled and all include rules are expanded.\n * We also compile the bracket definitions, supply defaults, and do many sanity checks.\n * If the 'jsonStrict' parameter is 'false', we allow at certain locations\n * regular expression objects and functions that get called during lexing.\n * (Currently we have no samples that need this so perhaps we should always have\n * jsonStrict to true).\n */\nexport function compile(languageId: string, json: IMonarchLanguage): monarchCommon.ILexer {\n\tif (!json || typeof (json) !== 'object') {\n\t\tthrow new Error('Monarch: expecting a language definition object');\n\t}\n\n\t// Create our lexer\n\tconst lexer: monarchCommon.ILexer = {\n\t\tlanguageId: languageId,\n\t\tincludeLF: bool(json.includeLF, false),\n\t\tnoThrow: false, // raise exceptions during compilation\n\t\tmaxStack: 100,\n\t\tstart: (typeof json.start === 'string' ? json.start : null),\n\t\tignoreCase: bool(json.ignoreCase, false),\n\t\tunicode: bool(json.unicode, false),\n\t\ttokenPostfix: string(json.tokenPostfix, '.' + languageId),\n\t\tdefaultToken: string(json.defaultToken, 'source'),\n\t\tusesEmbedded: false, // becomes true if we find a nextEmbedded action\n\t\tstateNames: {},\n\t\ttokenizer: {},\n\t\tbrackets: []\n\t};\n\n\t// For calling compileAction later on\n\t// eslint-disable-next-line local/code-no-any-casts\n\tconst lexerMin: monarchCommon.ILexerMin = <any>json;\n\tlexerMin.languageId = languageId;\n\tlexerMin.includeLF = lexer.includeLF;\n\tlexerMin.ignoreCase = lexer.ignoreCase;\n\tlexerMin.unicode = lexer.unicode;\n\tlexerMin.noThrow = lexer.noThrow;\n\tlexerMin.usesEmbedded = lexer.usesEmbedded;\n\tlexerMin.stateNames = json.tokenizer;\n\tlexerMin.defaultToken = lexer.defaultToken;\n\n\n\t// Compile an array of rules into newrules where RegExp objects are created.\n\tfunction addRules(state: string, newrules: monarchCommon.IRule[], rules: any[]) {\n\t\tfor (const rule of rules) {\n\n\t\t\tlet include = rule.include;\n\t\t\tif (include) {\n\t\t\t\tif (typeof (include) !== 'string') {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'an \\'include\\' attribute must be a string at: ' + state);\n\t\t\t\t}\n\t\t\t\tif (include[0] === '@') {\n\t\t\t\t\tinclude = include.substr(1); // peel off starting @\n\t\t\t\t}\n\t\t\t\tif (!json.tokenizer[include]) {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'include target \\'' + include + '\\' is not defined at: ' + state);\n\t\t\t\t}\n\t\t\t\taddRules(state + '.' + include, newrules, json.tokenizer[include]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst newrule = new Rule(state);\n\n\t\t\t\t// Set up new rule attributes\n\t\t\t\tif (Array.isArray(rule) && rule.length >= 1 && rule.length <= 3) {\n\t\t\t\t\tnewrule.setRegex(lexerMin, rule[0]);\n\t\t\t\t\tif (rule.length >= 3) {\n\t\t\t\t\t\tif (typeof (rule[1]) === 'string') {\n\t\t\t\t\t\t\tnewrule.setAction(lexerMin, { token: rule[1], next: rule[2] });\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (typeof (rule[1]) === 'object') {\n\t\t\t\t\t\t\tconst rule1 = rule[1];\n\t\t\t\t\t\t\trule1.next = rule[2];\n\t\t\t\t\t\t\tnewrule.setAction(lexerMin, rule1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'a next state as the last element of a rule can only be given if the action is either an object or a string, at: ' + state);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnewrule.setAction(lexerMin, rule[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!rule.regex) {\n\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'a rule must either be an array, or an object with a \\'regex\\' or \\'include\\' field at: ' + state);\n\t\t\t\t\t}\n\t\t\t\t\tif (rule.name) {\n\t\t\t\t\t\tif (typeof rule.name === 'string') {\n\t\t\t\t\t\t\tnewrule.name = rule.name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (rule.matchOnlyAtStart) {\n\t\t\t\t\t\tnewrule.matchOnlyAtLineStart = bool(rule.matchOnlyAtLineStart, false);\n\t\t\t\t\t}\n\t\t\t\t\tnewrule.setRegex(lexerMin, rule.regex);\n\t\t\t\t\tnewrule.setAction(lexerMin, rule.action);\n\t\t\t\t}\n\n\t\t\t\tnewrules.push(newrule);\n\t\t\t}\n\t\t}\n\t}\n\n\t// compile the tokenizer rules\n\tif (!json.tokenizer || typeof (json.tokenizer) !== 'object') {\n\t\tthrow monarchCommon.createError(lexer, 'a language definition must define the \\'tokenizer\\' attribute as an object');\n\t}\n\n\t// eslint-disable-next-line local/code-no-any-casts\n\tlexer.tokenizer = <any>[];\n\tfor (const key in json.tokenizer) {\n\t\tif (json.tokenizer.hasOwnProperty(key)) {\n\t\t\tif (!lexer.start) {\n\t\t\t\tlexer.start = key;\n\t\t\t}\n\n\t\t\tconst rules = json.tokenizer[key];\n\t\t\tlexer.tokenizer[key] = new Array();\n\t\t\taddRules('tokenizer.' + key, lexer.tokenizer[key], rules);\n\t\t}\n\t}\n\tlexer.usesEmbedded = lexerMin.usesEmbedded; // can be set during compileAction\n\n\t// Set simple brackets\n\tif (json.brackets) {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tif (!(Array.isArray(<any>json.brackets))) {\n\t\t\tthrow monarchCommon.createError(lexer, 'the \\'brackets\\' attribute must be defined as an array');\n\t\t}\n\t}\n\telse {\n\t\tjson.brackets = [\n\t\t\t{ open: '{', close: '}', token: 'delimiter.curly' },\n\t\t\t{ open: '[', close: ']', token: 'delimiter.square' },\n\t\t\t{ open: '(', close: ')', token: 'delimiter.parenthesis' },\n\t\t\t{ open: '<', close: '>', token: 'delimiter.angle' }];\n\t}\n\tconst brackets: IMonarchLanguageBracket[] = [];\n\tfor (const el of json.brackets) {\n\t\tlet desc: any = el;\n\t\tif (desc && Array.isArray(desc) && desc.length === 3) {\n\t\t\tdesc = { token: desc[2], open: desc[0], close: desc[1] };\n\t\t}\n\t\tif (desc.open === desc.close) {\n\t\t\tthrow monarchCommon.createError(lexer, 'open and close brackets in a \\'brackets\\' attribute must be different: ' + desc.open +\n\t\t\t\t'\\n hint: use the \\'bracket\\' attribute if matching on equal brackets is required.');\n\t\t}\n\t\tif (typeof desc.open === 'string' && typeof desc.token === 'string' && typeof desc.close === 'string') {\n\t\t\tbrackets.push({\n\t\t\t\ttoken: desc.token + lexer.tokenPostfix,\n\t\t\t\topen: monarchCommon.fixCase(lexer, desc.open),\n\t\t\t\tclose: monarchCommon.fixCase(lexer, desc.close)\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tthrow monarchCommon.createError(lexer, 'every element in the \\'brackets\\' array must be a \\'{open,close,token}\\' object or array');\n\t\t}\n\t}\n\tlexer.brackets = brackets;\n\n\t// Disable throw so the syntax highlighter goes, no matter what\n\tlexer.noThrow = true;\n\treturn lexer;\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/standalone/common/monarch/monarchCompile.ts","vs/editor/standalone/common/monarch/monarchCompile.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAC;AAGpD;;;;;;;GAOG;AAEH,SAAS,SAAS,CAAC,QAA6B,EAAE,GAAQ;IACzD,IAAI,CAAC,GAAG,EAAE,CAAC;QACV,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACd,CAAC;IACD,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YACrB,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,IAAI,CAAC,IAAS,EAAE,QAAiB;IACzC,IAAI,OAAO,IAAI,KA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,OAAO,GAAG,IAAI,CAAC;IACrB,OAAO,KAAK,CAAC;AACd,CAAC","file":"monarchCompile.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n * This module only exports 'compile' which compiles a JSON language definition\n * into a typed and checked ILexer definition.\n */\n\nimport { isString } from '../../../../base/common/types.js';\nimport * as monarchCommon from './monarchCommon.js';\nimport { IMonarchLanguage, IMonarchLanguageBracket } from './monarchTypes.js';\n\n/*\n * Type helpers\n *\n * Note: this is just for sanity checks on the JSON description which is\n * helpful for the programmer. No checks are done anymore once the lexer is\n * already 'compiled and checked'.\n *\n */\n\nfunction isArrayOf(elemType: (x: any) => boolean, obj: any): boolean {\n\tif (!obj) {\n\t\treturn false;\n\t}\n\tif (!(Array.isArray(obj))) {\n\t\treturn false;\n\t}\n\tfor (const el of obj) {\n\t\tif (!(elemType(el))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction bool(prop: any, defValue: boolean): boolean {\n\tif (typeof prop === 'boolean') {\n\t\treturn prop;\n\t}\n\treturn defValue;\n}\n\nfunction string(prop: any, defValue: string): string {\n\tif (typeof (prop) === 'string') {\n\t\treturn prop;\n\t}\n\treturn defValue;\n}\n\n\nfunction arrayToHash(array: string[]): { [name: string]: true } {\n\tconst result: any = {};\n\tfor (const e of array) {\n\t\tresult[e] = true;\n\t}\n\treturn result;\n}\n\n\nfunction createKeywordMatcher(arr: string[], caseInsensitive: boolean = false): (str: string) => boolean {\n\tif (caseInsensitive) {\n\t\tarr = arr.map(function (x) { return x.toLowerCase(); });\n\t}\n\tconst hash = arrayToHash(arr);\n\tif (caseInsensitive) {\n\t\treturn function (word) {\n\t\t\treturn hash[word.toLowerCase()] !== undefined && hash.hasOwnProperty(word.toLowerCase());\n\t\t};\n\t} else {\n\t\treturn function (word) {\n\t\t\treturn hash[word] !== undefined && hash.hasOwnProperty(word);\n\t\t};\n\t}\n}\n\n\n// Lexer helpers\n\n/**\n * Compiles a regular expression string, adding the 'i' flag if 'ignoreCase' is set, and the 'u' flag if 'unicode' is set.\n * Also replaces @\\w+ or sequences with the content of the specified attribute\n * @\\w+ replacement can be avoided by escaping `@` signs with another `@` sign.\n * @example /@attr/ will be replaced with the value of lexer[attr]\n * @example /@@text/ will not be replaced and will become /@text/.\n */\nfunction compileRegExp<S extends true | false>(lexer: monarchCommon.ILexerMin, str: string, handleSn: S): S extends true ? RegExp | DynamicRegExp : RegExp;\nfunction compileRegExp(lexer: monarchCommon.ILexerMin, str: string, handleSn: true | false): RegExp | DynamicRegExp {\n\t// @@ must be interpreted as a literal @, so we replace all occurences of @@ with a placeholder character\n\tstr = str.replace(/@@/g, `\\x01`);\n\n\tlet n = 0;\n\tlet hadExpansion: boolean;\n\tdo {\n\t\thadExpansion = false;\n\t\tstr = str.replace(/@(\\w+)/g, function (s, attr?) {\n\t\t\thadExpansion = true;\n\t\t\tlet sub = '';\n\t\t\tif (typeof (lexer[attr]) === 'string') {\n\t\t\t\tsub = lexer[attr];\n\t\t\t} else if (lexer[attr] && lexer[attr] instanceof RegExp) {\n\t\t\t\tsub = lexer[attr].source;\n\t\t\t} else {\n\t\t\t\tif (lexer[attr] === undefined) {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'language definition does not contain attribute \\'' + attr + '\\', used at: ' + str);\n\t\t\t\t} else {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'attribute reference \\'' + attr + '\\' must be a string, used at: ' + str);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn (monarchCommon.empty(sub) ? '' : '(?:' + sub + ')');\n\t\t});\n\t\tn++;\n\t} while (hadExpansion && n < 5);\n\n\t// handle escaped @@\n\tstr = str.replace(/\\x01/g, '@');\n\n\tconst flags = (lexer.ignoreCase ? 'i' : '') + (lexer.unicode ? 'u' : '');\n\n\t// handle $Sn\n\tif (handleSn) {\n\t\tconst match = str.match(/\\$[sS](\\d\\d?)/g);\n\t\tif (match) {\n\t\t\tlet lastState: string | null = null;\n\t\t\tlet lastRegEx: RegExp | null = null;\n\t\t\treturn (state: string) => {\n\t\t\t\tif (lastRegEx && lastState === state) {\n\t\t\t\t\treturn lastRegEx;\n\t\t\t\t}\n\t\t\t\tlastState = state;\n\t\t\t\tlastRegEx = new RegExp(monarchCommon.substituteMatchesRe(lexer, str, state), flags);\n\t\t\t\treturn lastRegEx;\n\t\t\t};\n\t\t}\n\t}\n\n\treturn new RegExp(str, flags);\n}\n\n/**\n * Compiles guard functions for case matches.\n * This compiles 'cases' attributes into efficient match functions.\n *\n */\nfunction selectScrutinee(id: string, matches: string[], state: string, num: number): string | null {\n\tif (num < 0) {\n\t\treturn id;\n\t}\n\tif (num < matches.length) {\n\t\treturn matches[num];\n\t}\n\tif (num >= 100) {\n\t\tnum = num - 100;\n\t\tconst parts = state.split('.');\n\t\tparts.unshift(state);\n\t\tif (num < parts.length) {\n\t\t\treturn parts[num];\n\t\t}\n\t}\n\treturn null;\n}\n\nfunction createGuard(lexer: monarchCommon.ILexerMin, ruleName: string, tkey: string, val: monarchCommon.FuzzyAction): monarchCommon.IBranch {\n\t// get the scrutinee and pattern\n\tlet scrut = -1; // -1: $!, 0-99: $n, 100+n: $Sn\n\tlet oppat = tkey;\n\tlet matches = tkey.match(/^\\$(([sS]?)(\\d\\d?)|#)(.*)$/);\n\tif (matches) {\n\t\tif (matches[3]) { // if digits\n\t\t\tscrut = parseInt(matches[3]);\n\t\t\tif (matches[2]) {\n\t\t\t\tscrut = scrut + 100; // if [sS] present\n\t\t\t}\n\t\t}\n\t\toppat = matches[4];\n\t}\n\t// get operator\n\tlet op = '~';\n\tlet pat = oppat;\n\tif (!oppat || oppat.length === 0) {\n\t\top = '!=';\n\t\tpat = '';\n\t}\n\telse if (/^\\w*$/.test(pat)) { // just a word\n\t\top = '==';\n\t}\n\telse {\n\t\tmatches = oppat.match(/^(@|!@|~|!~|==|!=)(.*)$/);\n\t\tif (matches) {\n\t\t\top = matches[1];\n\t\t\tpat = matches[2];\n\t\t}\n\t}\n\n\t// set the tester function\n\tlet tester: (s: string, id: string, matches: string[], state: string, eos: boolean) => boolean;\n\n\t// special case a regexp that matches just words\n\tif ((op === '~' || op === '!~') && /^(\\w|\\|)*$/.test(pat)) {\n\t\tconst inWords = createKeywordMatcher(pat.split('|'), lexer.ignoreCase);\n\t\ttester = function (s) { return (op === '~' ? inWords(s) : !inWords(s)); };\n\t}\n\telse if (op === '@' || op === '!@') {\n\t\tconst words = lexer[pat];\n\t\tif (!words) {\n\t\t\tthrow monarchCommon.createError(lexer, 'the @ match target \\'' + pat + '\\' is not defined, in rule: ' + ruleName);\n\t\t}\n\t\tif (!(isArrayOf(function (elem) { return (typeof (elem) === 'string'); }, words))) {\n\t\t\tthrow monarchCommon.createError(lexer, 'the @ match target \\'' + pat + '\\' must be an array of strings, in rule: ' + ruleName);\n\t\t}\n\t\tconst inWords = createKeywordMatcher(words, lexer.ignoreCase);\n\t\ttester = function (s) { return (op === '@' ? inWords(s) : !inWords(s)); };\n\t}\n\telse if (op === '~' || op === '!~') {\n\t\tif (pat.indexOf('$') < 0) {\n\t\t\t// precompile regular expression\n\t\t\tconst re = compileRegExp(lexer, '^' + pat + '$', false);\n\t\t\ttester = function (s) { return (op === '~' ? re.test(s) : !re.test(s)); };\n\t\t}\n\t\telse {\n\t\t\ttester = function (s, id, matches, state) {\n\t\t\t\tconst re = compileRegExp(lexer, '^' + monarchCommon.substituteMatches(lexer, pat, id, matches, state) + '$', false);\n\t\t\t\treturn re.test(s);\n\t\t\t};\n\t\t}\n\t}\n\telse { // if (op==='==' || op==='!=') {\n\t\tif (pat.indexOf('$') < 0) {\n\t\t\tconst patx = monarchCommon.fixCase(lexer, pat);\n\t\t\ttester = function (s) { return (op === '==' ? s === patx : s !== patx); };\n\t\t}\n\t\telse {\n\t\t\tconst patx = monarchCommon.fixCase(lexer, pat);\n\t\t\ttester = function (s, id, matches, state, eos) {\n\t\t\t\tconst patexp = monarchCommon.substituteMatches(lexer, patx, id, matches, state);\n\t\t\t\treturn (op === '==' ? s === patexp : s !== patexp);\n\t\t\t};\n\t\t}\n\t}\n\n\t// return the branch object\n\tif (scrut === -1) {\n\t\treturn {\n\t\t\tname: tkey, value: val, test: function (id, matches, state, eos) {\n\t\t\t\treturn tester(id, id, matches, state, eos);\n\t\t\t}\n\t\t};\n\t}\n\telse {\n\t\treturn {\n\t\t\tname: tkey, value: val, test: function (id, matches, state, eos) {\n\t\t\t\tconst scrutinee = selectScrutinee(id, matches, state, scrut);\n\t\t\t\treturn tester(!scrutinee ? '' : scrutinee, id, matches, state, eos);\n\t\t\t}\n\t\t};\n\t}\n}\n\n/**\n * Compiles an action: i.e. optimize regular expressions and case matches\n * and do many sanity checks.\n *\n * This is called only during compilation but if the lexer definition\n * contains user functions as actions (which is usually not allowed), then this\n * may be called during lexing. It is important therefore to compile common cases efficiently\n */\nfunction compileAction(lexer: monarchCommon.ILexerMin, ruleName: string, action: any): monarchCommon.FuzzyAction {\n\tif (!action) {\n\t\treturn { token: '' };\n\t}\n\telse if (typeof (action) === 'string') {\n\t\treturn action; // { token: action };\n\t}\n\telse if (action.token || action.token === '') {\n\t\tif (typeof (action.token) !== 'string') {\n\t\t\tthrow monarchCommon.createError(lexer, 'a \\'token\\' attribute must be of type string, in rule: ' + ruleName);\n\t\t}\n\t\telse {\n\t\t\t// only copy specific typed fields (only happens once during compile Lexer)\n\t\t\tconst newAction: monarchCommon.IAction = { token: action.token };\n\t\t\tif (action.token.indexOf('$') >= 0) {\n\t\t\t\tnewAction.tokenSubst = true;\n\t\t\t}\n\t\t\tif (typeof (action.bracket) === 'string') {\n\t\t\t\tif (action.bracket === '@open') {\n\t\t\t\t\tnewAction.bracket = monarchCommon.MonarchBracket.Open;\n\t\t\t\t} else if (action.bracket === '@close') {\n\t\t\t\t\tnewAction.bracket = monarchCommon.MonarchBracket.Close;\n\t\t\t\t} else {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'a \\'bracket\\' attribute must be either \\'@open\\' or \\'@close\\', in rule: ' + ruleName);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (action.next) {\n\t\t\t\tif (typeof (action.next) !== 'string') {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'the next state must be a string value in rule: ' + ruleName);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tlet next: string = action.next;\n\t\t\t\t\tif (!/^(@pop|@push|@popall)$/.test(next)) {\n\t\t\t\t\t\tif (next[0] === '@') {\n\t\t\t\t\t\t\tnext = next.substr(1); // peel off starting @ sign\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (next.indexOf('$') < 0) { // no dollar substitution, we can check if the state exists\n\t\t\t\t\t\t\tif (!monarchCommon.stateExists(lexer, monarchCommon.substituteMatches(lexer, next, '', [], ''))) {\n\t\t\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'the next state \\'' + action.next + '\\' is not defined in rule: ' + ruleName);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnewAction.next = next;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof (action.goBack) === 'number') {\n\t\t\t\tnewAction.goBack = action.goBack;\n\t\t\t}\n\t\t\tif (typeof (action.switchTo) === 'string') {\n\t\t\t\tnewAction.switchTo = action.switchTo;\n\t\t\t}\n\t\t\tif (typeof (action.log) === 'string') {\n\t\t\t\tnewAction.log = action.log;\n\t\t\t}\n\t\t\tif (typeof (action.nextEmbedded) === 'string') {\n\t\t\t\tnewAction.nextEmbedded = action.nextEmbedded;\n\t\t\t\tlexer.usesEmbedded = true;\n\t\t\t}\n\t\t\treturn newAction;\n\t\t}\n\t}\n\telse if (Array.isArray(action)) {\n\t\tconst results: monarchCommon.FuzzyAction[] = [];\n\t\tfor (let i = 0, len = action.length; i < len; i++) {\n\t\t\tresults[i] = compileAction(lexer, ruleName, action[i]);\n\t\t}\n\t\treturn { group: results };\n\t}\n\telse if (action.cases) {\n\t\t// build an array of test cases\n\t\tconst cases: monarchCommon.IBranch[] = [];\n\n\t\tlet hasEmbeddedEndInCases = false;\n\t\t// for each case, push a test function and result value\n\t\tfor (const tkey in action.cases) {\n\t\t\tif (action.cases.hasOwnProperty(tkey)) {\n\t\t\t\tconst val = compileAction(lexer, ruleName, action.cases[tkey]);\n\n\t\t\t\t// what kind of case\n\t\t\t\tif (tkey === '@default' || tkey === '@' || tkey === '') {\n\t\t\t\t\tcases.push({ test: undefined, value: val, name: tkey });\n\t\t\t\t}\n\t\t\t\telse if (tkey === '@eos') {\n\t\t\t\t\tcases.push({ test: function (id, matches, state, eos) { return eos; }, value: val, name: tkey });\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcases.push(createGuard(lexer, ruleName, tkey, val)); // call separate function to avoid local variable capture\n\t\t\t\t}\n\n\t\t\t\tif (!hasEmbeddedEndInCases) {\n\t\t\t\t\thasEmbeddedEndInCases = !isString(val) && (val.hasEmbeddedEndInCases || ['@pop', '@popall'].includes(val.nextEmbedded || ''));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// create a matching function\n\t\tconst def = lexer.defaultToken;\n\t\treturn {\n\t\t\thasEmbeddedEndInCases,\n\t\t\ttest: function (id, matches, state, eos) {\n\t\t\t\tfor (const _case of cases) {\n\t\t\t\t\tconst didmatch = (!_case.test || _case.test(id, matches, state, eos));\n\t\t\t\t\tif (didmatch) {\n\t\t\t\t\t\treturn _case.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn def;\n\t\t\t}\n\t\t};\n\t}\n\telse {\n\t\tthrow monarchCommon.createError(lexer, 'an action must be a string, an object with a \\'token\\' or \\'cases\\' attribute, or an array of actions; in rule: ' + ruleName);\n\t}\n}\n\ntype DynamicRegExp = (state: string) => RegExp;\n\n/**\n * Helper class for creating matching rules\n */\nclass Rule implements monarchCommon.IRule {\n\tprivate regex: RegExp | DynamicRegExp = new RegExp('');\n\tpublic action: monarchCommon.FuzzyAction = { token: '' };\n\tpublic matchOnlyAtLineStart: boolean = false;\n\tpublic name: string = '';\n\n\tconstructor(name: string) {\n\t\tthis.name = name;\n\t}\n\n\tpublic setRegex(lexer: monarchCommon.ILexerMin, re: string | RegExp): void {\n\t\tlet sregex: string;\n\t\tif (typeof (re) === 'string') {\n\t\t\tsregex = re;\n\t\t}\n\t\telse if (re instanceof RegExp) {\n\t\t\tsregex = re.source;\n\t\t}\n\t\telse {\n\t\t\tthrow monarchCommon.createError(lexer, 'rules must start with a match string or regular expression: ' + this.name);\n\t\t}\n\n\t\tthis.matchOnlyAtLineStart = (sregex.length > 0 && sregex[0] === '^');\n\t\tthis.name = this.name + ': ' + sregex;\n\t\tthis.regex = compileRegExp(lexer, '^(?:' + (this.matchOnlyAtLineStart ? sregex.substr(1) : sregex) + ')', true);\n\t}\n\n\tpublic setAction(lexer: monarchCommon.ILexerMin, act: monarchCommon.IAction) {\n\t\tthis.action = compileAction(lexer, this.name, act);\n\t}\n\n\tpublic resolveRegex(state: string): RegExp {\n\t\tif (this.regex instanceof RegExp) {\n\t\t\treturn this.regex;\n\t\t} else {\n\t\t\treturn this.regex(state);\n\t\t}\n\t}\n}\n\n/**\n * Compiles a json description function into json where all regular expressions,\n * case matches etc, are compiled and all include rules are expanded.\n * We also compile the bracket definitions, supply defaults, and do many sanity checks.\n * If the 'jsonStrict' parameter is 'false', we allow at certain locations\n * regular expression objects and functions that get called during lexing.\n * (Currently we have no samples that need this so perhaps we should always have\n * jsonStrict to true).\n */\nexport function compile(languageId: string, json: IMonarchLanguage): monarchCommon.ILexer {\n\tif (!json || typeof (json) !== 'object') {\n\t\tthrow new Error('Monarch: expecting a language definition object');\n\t}\n\n\t// Create our lexer\n\tconst lexer: monarchCommon.ILexer = {\n\t\tlanguageId: languageId,\n\t\tincludeLF: bool(json.includeLF, false),\n\t\tnoThrow: false, // raise exceptions during compilation\n\t\tmaxStack: 100,\n\t\tstart: (typeof json.start === 'string' ? json.start : null),\n\t\tignoreCase: bool(json.ignoreCase, false),\n\t\tunicode: bool(json.unicode, false),\n\t\ttokenPostfix: string(json.tokenPostfix, '.' + languageId),\n\t\tdefaultToken: string(json.defaultToken, 'source'),\n\t\tusesEmbedded: false, // becomes true if we find a nextEmbedded action\n\t\tstateNames: {},\n\t\ttokenizer: {},\n\t\tbrackets: []\n\t};\n\n\t// For calling compileAction later on\n\t// eslint-disable-next-line local/code-no-any-casts\n\tconst lexerMin: monarchCommon.ILexerMin = <any>json;\n\tlexerMin.languageId = languageId;\n\tlexerMin.includeLF = lexer.includeLF;\n\tlexerMin.ignoreCase = lexer.ignoreCase;\n\tlexerMin.unicode = lexer.unicode;\n\tlexerMin.noThrow = lexer.noThrow;\n\tlexerMin.usesEmbedded = lexer.usesEmbedded;\n\tlexerMin.stateNames = json.tokenizer;\n\tlexerMin.defaultToken = lexer.defaultToken;\n\n\n\t// Compile an array of rules into newrules where RegExp objects are created.\n\tfunction addRules(state: string, newrules: monarchCommon.IRule[], rules: any[]) {\n\t\tfor (const rule of rules) {\n\n\t\t\tlet include = rule.include;\n\t\t\tif (include) {\n\t\t\t\tif (typeof (include) !== 'string') {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'an \\'include\\' attribute must be a string at: ' + state);\n\t\t\t\t}\n\t\t\t\tif (include[0] === '@') {\n\t\t\t\t\tinclude = include.substr(1); // peel off starting @\n\t\t\t\t}\n\t\t\t\tif (!json.tokenizer[include]) {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'include target \\'' + include + '\\' is not defined at: ' + state);\n\t\t\t\t}\n\t\t\t\taddRules(state + '.' + include, newrules, json.tokenizer[include]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst newrule = new Rule(state);\n\n\t\t\t\t// Set up new rule attributes\n\t\t\t\tif (Array.isArray(rule) && rule.length >= 1 && rule.length <= 3) {\n\t\t\t\t\tnewrule.setRegex(lexerMin, rule[0]);\n\t\t\t\t\tif (rule.length >= 3) {\n\t\t\t\t\t\tif (typeof (rule[1]) === 'string') {\n\t\t\t\t\t\t\tnewrule.setAction(lexerMin, { token: rule[1], next: rule[2] });\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (typeof (rule[1]) === 'object') {\n\t\t\t\t\t\t\tconst rule1 = rule[1];\n\t\t\t\t\t\t\trule1.next = rule[2];\n\t\t\t\t\t\t\tnewrule.setAction(lexerMin, rule1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'a next state as the last element of a rule can only be given if the action is either an object or a string, at: ' + state);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnewrule.setAction(lexerMin, rule[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!rule.regex) {\n\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'a rule must either be an array, or an object with a \\'regex\\' or \\'include\\' field at: ' + state);\n\t\t\t\t\t}\n\t\t\t\t\tif (rule.name) {\n\t\t\t\t\t\tif (typeof rule.name === 'string') {\n\t\t\t\t\t\t\tnewrule.name = rule.name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (rule.matchOnlyAtStart) {\n\t\t\t\t\t\tnewrule.matchOnlyAtLineStart = bool(rule.matchOnlyAtLineStart, false);\n\t\t\t\t\t}\n\t\t\t\t\tnewrule.setRegex(lexerMin, rule.regex);\n\t\t\t\t\tnewrule.setAction(lexerMin, rule.action);\n\t\t\t\t}\n\n\t\t\t\tnewrules.push(newrule);\n\t\t\t}\n\t\t}\n\t}\n\n\t// compile the tokenizer rules\n\tif (!json.tokenizer || typeof (json.tokenizer) !== 'object') {\n\t\tthrow monarchCommon.createError(lexer, 'a language definition must define the \\'tokenizer\\' attribute as an object');\n\t}\n\n\t// eslint-disable-next-line local/code-no-any-casts\n\tlexer.tokenizer = <any>[];\n\tfor (const key in json.tokenizer) {\n\t\tif (json.tokenizer.hasOwnProperty(key)) {\n\t\t\tif (!lexer.start) {\n\t\t\t\tlexer.start = key;\n\t\t\t}\n\n\t\t\tconst rules = json.tokenizer[key];\n\t\t\tlexer.tokenizer[key] = new Array();\n\t\t\taddRules('tokenizer.' + key, lexer.tokenizer[key], rules);\n\t\t}\n\t}\n\tlexer.usesEmbedded = lexerMin.usesEmbedded; // can be set during compileAction\n\n\t// Set simple brackets\n\tif (json.brackets) {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tif (!(Array.isArray(<any>json.brackets))) {\n\t\t\tthrow monarchCommon.createError(lexer, 'the \\'brackets\\' attribute must be defined as an array');\n\t\t}\n\t}\n\telse {\n\t\tjson.brackets = [\n\t\t\t{ open: '{', close: '}', token: 'delimiter.curly' },\n\t\t\t{ open: '[', close: ']', token: 'delimiter.square' },\n\t\t\t{ open: '(', close: ')', token: 'delimiter.parenthesis' },\n\t\t\t{ open: '<', close: '>', token: 'delimiter.angle' }];\n\t}\n\tconst brackets: IMonarchLanguageBracket[] = [];\n\tfor (const el of json.brackets) {\n\t\tlet desc: any = el;\n\t\tif (desc && Array.isArray(desc) && desc.length === 3) {\n\t\t\tdesc = { token: desc[2], open: desc[0], close: desc[1] };\n\t\t}\n\t\tif (desc.open === desc.close) {\n\t\t\tthrow monarchCommon.createError(lexer, 'open and close brackets in a \\'brackets\\' attribute must be different: ' + desc.open +\n\t\t\t\t'\\n hint: use the \\'bracket\\' attribute if matching on equal brackets is required.');\n\t\t}\n\t\tif (typeof desc.open === 'string' && typeof desc.token === 'string' && typeof desc.close === 'string') {\n\t\t\tbrackets.push({\n\t\t\t\ttoken: desc.token + lexer.tokenPostfix,\n\t\t\t\topen: monarchCommon.fixCase(lexer, desc.open),\n\t\t\t\tclose: monarchCommon.fixCase(lexer, desc.close)\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tthrow monarchCommon.createError(lexer, 'every element in the \\'brackets\\' array must be a \\'{open,close,token}\\' object or array');\n\t\t}\n\t}\n\tlexer.brackets = brackets;\n\n\t// Disable throw so the syntax highlighter goes, no matter what\n\tlexer.noThrow = true;\n\treturn lexer;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/*\n * This module only exports 'compile' which compiles a JSON language definition\n * into a typed and checked ILexer definition.\n */\n\nimport { isString } from '../../../../base/common/types.js';\nimport * as monarchCommon from './monarchCommon.js';\nimport { IMonarchLanguage, IMonarchLanguageBracket } from './monarchTypes.js';\n\n/*\n * Type helpers\n *\n * Note: this is just for sanity checks on the JSON description which is\n * helpful for the programmer. No checks are done anymore once the lexer is\n * already 'compiled and checked'.\n *\n */\n\nfunction isArrayOf(elemType: (x: any) => boolean, obj: any): boolean {\n\tif (!obj) {\n\t\treturn false;\n\t}\n\tif (!(Array.isArray(obj))) {\n\t\treturn false;\n\t}\n\tfor (const el of obj) {\n\t\tif (!(elemType(el))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction bool(prop: any, defValue: boolean): boolean {\n\tif (typeof prop === 'boolean') {\n\t\treturn prop;\n\t}\n\treturn defValue;\n}\n\nfunction string(prop: any, defValue: string): string {\n\tif (typeof (prop) === 'string') {\n\t\treturn prop;\n\t}\n\treturn defValue;\n}\n\n\nfunction arrayToHash(array: string[]): { [name: string]: true } {\n\tconst result: any = {};\n\tfor (const e of array) {\n\t\tresult[e] = true;\n\t}\n\treturn result;\n}\n\n\nfunction createKeywordMatcher(arr: string[], caseInsensitive: boolean = false): (str: string) => boolean {\n\tif (caseInsensitive) {\n\t\tarr = arr.map(function (x) { return x.toLowerCase(); });\n\t}\n\tconst hash = arrayToHash(arr);\n\tif (caseInsensitive) {\n\t\treturn function (word) {\n\t\t\treturn hash[word.toLowerCase()] !== undefined && hash.hasOwnProperty(word.toLowerCase());\n\t\t};\n\t} else {\n\t\treturn function (word) {\n\t\t\treturn hash[word] !== undefined && hash.hasOwnProperty(word);\n\t\t};\n\t}\n}\n\n\n// Lexer helpers\n\n/**\n * Compiles a regular expression string, adding the 'i' flag if 'ignoreCase' is set, and the 'u' flag if 'unicode' is set.\n * Also replaces @\\w+ or sequences with the content of the specified attribute\n * @\\w+ replacement can be avoided by escaping `@` signs with another `@` sign.\n * @example /@attr/ will be replaced with the value of lexer[attr]\n * @example /@@text/ will not be replaced and will become /@text/.\n */\nfunction compileRegExp<S extends true | false>(lexer: monarchCommon.ILexerMin, str: string, handleSn: S): S extends true ? RegExp | DynamicRegExp : RegExp;\nfunction compileRegExp(lexer: monarchCommon.ILexerMin, str: string, handleSn: true | false): RegExp | DynamicRegExp {\n\t// @@ must be interpreted as a literal @, so we replace all occurences of @@ with a placeholder character\n\tstr = str.replace(/@@/g, `\\x01`);\n\n\tlet n = 0;\n\tlet hadExpansion: boolean;\n\tdo {\n\t\thadExpansion = false;\n\t\tstr = str.replace(/@(\\w+)/g, function (s, attr?) {\n\t\t\thadExpansion = true;\n\t\t\tlet sub = '';\n\t\t\tif (typeof (lexer[attr]) === 'string') {\n\t\t\t\tsub = lexer[attr];\n\t\t\t} else if (lexer[attr] && lexer[attr] instanceof RegExp) {\n\t\t\t\tsub = lexer[attr].source;\n\t\t\t} else {\n\t\t\t\tif (lexer[attr] === undefined) {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'language definition does not contain attribute \\'' + attr + '\\', used at: ' + str);\n\t\t\t\t} else {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'attribute reference \\'' + attr + '\\' must be a string, used at: ' + str);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn (monarchCommon.empty(sub) ? '' : '(?:' + sub + ')');\n\t\t});\n\t\tn++;\n\t} while (hadExpansion && n < 5);\n\n\t// handle escaped @@\n\tstr = str.replace(/\\x01/g, '@');\n\n\tconst flags = (lexer.ignoreCase ? 'i' : '') + (lexer.unicode ? 'u' : '');\n\n\t// handle $Sn\n\tif (handleSn) {\n\t\tconst match = str.match(/\\$[sS](\\d\\d?)/g);\n\t\tif (match) {\n\t\t\tlet lastState: string | null = null;\n\t\t\tlet lastRegEx: RegExp | null = null;\n\t\t\treturn (state: string) => {\n\t\t\t\tif (lastRegEx && lastState === state) {\n\t\t\t\t\treturn lastRegEx;\n\t\t\t\t}\n\t\t\t\tlastState = state;\n\t\t\t\tlastRegEx = new RegExp(monarchCommon.substituteMatchesRe(lexer, str, state), flags);\n\t\t\t\treturn lastRegEx;\n\t\t\t};\n\t\t}\n\t}\n\n\treturn new RegExp(str, flags);\n}\n\n/**\n * Compiles guard functions for case matches.\n * This compiles 'cases' attributes into efficient match functions.\n *\n */\nfunction selectScrutinee(id: string, matches: string[], state: string, num: number): string | null {\n\tif (num < 0) {\n\t\treturn id;\n\t}\n\tif (num < matches.length) {\n\t\treturn matches[num];\n\t}\n\tif (num >= 100) {\n\t\tnum = num - 100;\n\t\tconst parts = state.split('.');\n\t\tparts.unshift(state);\n\t\tif (num < parts.length) {\n\t\t\treturn parts[num];\n\t\t}\n\t}\n\treturn null;\n}\n\nfunction createGuard(lexer: monarchCommon.ILexerMin, ruleName: string, tkey: string, val: monarchCommon.FuzzyAction): monarchCommon.IBranch {\n\t// get the scrutinee and pattern\n\tlet scrut = -1; // -1: $!, 0-99: $n, 100+n: $Sn\n\tlet oppat = tkey;\n\tlet matches = tkey.match(/^\\$(([sS]?)(\\d\\d?)|#)(.*)$/);\n\tif (matches) {\n\t\tif (matches[3]) { // if digits\n\t\t\tscrut = parseInt(matches[3]);\n\t\t\tif (matches[2]) {\n\t\t\t\tscrut = scrut + 100; // if [sS] present\n\t\t\t}\n\t\t}\n\t\toppat = matches[4];\n\t}\n\t// get operator\n\tlet op = '~';\n\tlet pat = oppat;\n\tif (!oppat || oppat.length === 0) {\n\t\top = '!=';\n\t\tpat = '';\n\t}\n\telse if (/^\\w*$/.test(pat)) { // just a word\n\t\top = '==';\n\t}\n\telse {\n\t\tmatches = oppat.match(/^(@|!@|~|!~|==|!=)(.*)$/);\n\t\tif (matches) {\n\t\t\top = matches[1];\n\t\t\tpat = matches[2];\n\t\t}\n\t}\n\n\t// set the tester function\n\tlet tester: (s: string, id: string, matches: string[], state: string, eos: boolean) => boolean;\n\n\t// special case a regexp that matches just words\n\tif ((op === '~' || op === '!~') && /^(\\w|\\|)*$/.test(pat)) {\n\t\tconst inWords = createKeywordMatcher(pat.split('|'), lexer.ignoreCase);\n\t\ttester = function (s) { return (op === '~' ? inWords(s) : !inWords(s)); };\n\t}\n\telse if (op === '@' || op === '!@') {\n\t\tconst words = lexer[pat];\n\t\tif (!words) {\n\t\t\tthrow monarchCommon.createError(lexer, 'the @ match target \\'' + pat + '\\' is not defined, in rule: ' + ruleName);\n\t\t}\n\t\tif (!(isArrayOf(function (elem) { return (typeof (elem) === 'string'); }, words))) {\n\t\t\tthrow monarchCommon.createError(lexer, 'the @ match target \\'' + pat + '\\' must be an array of strings, in rule: ' + ruleName);\n\t\t}\n\t\tconst inWords = createKeywordMatcher(words, lexer.ignoreCase);\n\t\ttester = function (s) { return (op === '@' ? inWords(s) : !inWords(s)); };\n\t}\n\telse if (op === '~' || op === '!~') {\n\t\tif (pat.indexOf('$') < 0) {\n\t\t\t// precompile regular expression\n\t\t\tconst re = compileRegExp(lexer, '^' + pat + '$', false);\n\t\t\ttester = function (s) { return (op === '~' ? re.test(s) : !re.test(s)); };\n\t\t}\n\t\telse {\n\t\t\ttester = function (s, id, matches, state) {\n\t\t\t\tconst re = compileRegExp(lexer, '^' + monarchCommon.substituteMatches(lexer, pat, id, matches, state) + '$', false);\n\t\t\t\treturn re.test(s);\n\t\t\t};\n\t\t}\n\t}\n\telse { // if (op==='==' || op==='!=') {\n\t\tif (pat.indexOf('$') < 0) {\n\t\t\tconst patx = monarchCommon.fixCase(lexer, pat);\n\t\t\ttester = function (s) { return (op === '==' ? s === patx : s !== patx); };\n\t\t}\n\t\telse {\n\t\t\tconst patx = monarchCommon.fixCase(lexer, pat);\n\t\t\ttester = function (s, id, matches, state, eos) {\n\t\t\t\tconst patexp = monarchCommon.substituteMatches(lexer, patx, id, matches, state);\n\t\t\t\treturn (op === '==' ? s === patexp : s !== patexp);\n\t\t\t};\n\t\t}\n\t}\n\n\t// return the branch object\n\tif (scrut === -1) {\n\t\treturn {\n\t\t\tname: tkey, value: val, test: function (id, matches, state, eos) {\n\t\t\t\treturn tester(id, id, matches, state, eos);\n\t\t\t}\n\t\t};\n\t}\n\telse {\n\t\treturn {\n\t\t\tname: tkey, value: val, test: function (id, matches, state, eos) {\n\t\t\t\tconst scrutinee = selectScrutinee(id, matches, state, scrut);\n\t\t\t\treturn tester(!scrutinee ? '' : scrutinee, id, matches, state, eos);\n\t\t\t}\n\t\t};\n\t}\n}\n\n/**\n * Compiles an action: i.e. optimize regular expressions and case matches\n * and do many sanity checks.\n *\n * This is called only during compilation but if the lexer definition\n * contains user functions as actions (which is usually not allowed), then this\n * may be called during lexing. It is important therefore to compile common cases efficiently\n */\nfunction compileAction(lexer: monarchCommon.ILexerMin, ruleName: string, action: any): monarchCommon.FuzzyAction {\n\tif (!action) {\n\t\treturn { token: '' };\n\t}\n\telse if (typeof (action) === 'string') {\n\t\treturn action; // { token: action };\n\t}\n\telse if (action.token || action.token === '') {\n\t\tif (typeof (action.token) !== 'string') {\n\t\t\tthrow monarchCommon.createError(lexer, 'a \\'token\\' attribute must be of type string, in rule: ' + ruleName);\n\t\t}\n\t\telse {\n\t\t\t// only copy specific typed fields (only happens once during compile Lexer)\n\t\t\tconst newAction: monarchCommon.IAction = { token: action.token };\n\t\t\tif (action.token.indexOf('$') >= 0) {\n\t\t\t\tnewAction.tokenSubst = true;\n\t\t\t}\n\t\t\tif (typeof (action.bracket) === 'string') {\n\t\t\t\tif (action.bracket === '@open') {\n\t\t\t\t\tnewAction.bracket = monarchCommon.MonarchBracket.Open;\n\t\t\t\t} else if (action.bracket === '@close') {\n\t\t\t\t\tnewAction.bracket = monarchCommon.MonarchBracket.Close;\n\t\t\t\t} else {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'a \\'bracket\\' attribute must be either \\'@open\\' or \\'@close\\', in rule: ' + ruleName);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (action.next) {\n\t\t\t\tif (typeof (action.next) !== 'string') {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'the next state must be a string value in rule: ' + ruleName);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tlet next: string = action.next;\n\t\t\t\t\tif (!/^(@pop|@push|@popall)$/.test(next)) {\n\t\t\t\t\t\tif (next[0] === '@') {\n\t\t\t\t\t\t\tnext = next.substr(1); // peel off starting @ sign\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (next.indexOf('$') < 0) { // no dollar substitution, we can check if the state exists\n\t\t\t\t\t\t\tif (!monarchCommon.stateExists(lexer, monarchCommon.substituteMatches(lexer, next, '', [], ''))) {\n\t\t\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'the next state \\'' + action.next + '\\' is not defined in rule: ' + ruleName);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnewAction.next = next;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof (action.goBack) === 'number') {\n\t\t\t\tnewAction.goBack = action.goBack;\n\t\t\t}\n\t\t\tif (typeof (action.switchTo) === 'string') {\n\t\t\t\tnewAction.switchTo = action.switchTo;\n\t\t\t}\n\t\t\tif (typeof (action.log) === 'string') {\n\t\t\t\tnewAction.log = action.log;\n\t\t\t}\n\t\t\tif (typeof (action.nextEmbedded) === 'string') {\n\t\t\t\tnewAction.nextEmbedded = action.nextEmbedded;\n\t\t\t\tlexer.usesEmbedded = true;\n\t\t\t}\n\t\t\treturn newAction;\n\t\t}\n\t}\n\telse if (Array.isArray(action)) {\n\t\tconst results: monarchCommon.FuzzyAction[] = [];\n\t\tfor (let i = 0, len = action.length; i < len; i++) {\n\t\t\tresults[i] = compileAction(lexer, ruleName, action[i]);\n\t\t}\n\t\treturn { group: results };\n\t}\n\telse if (action.cases) {\n\t\t// build an array of test cases\n\t\tconst cases: monarchCommon.IBranch[] = [];\n\n\t\tlet hasEmbeddedEndInCases = false;\n\t\t// for each case, push a test function and result value\n\t\tfor (const tkey in action.cases) {\n\t\t\tif (action.cases.hasOwnProperty(tkey)) {\n\t\t\t\tconst val = compileAction(lexer, ruleName, action.cases[tkey]);\n\n\t\t\t\t// what kind of case\n\t\t\t\tif (tkey === '@default' || tkey === '@' || tkey === '') {\n\t\t\t\t\tcases.push({ test: undefined, value: val, name: tkey });\n\t\t\t\t}\n\t\t\t\telse if (tkey === '@eos') {\n\t\t\t\t\tcases.push({ test: function (id, matches, state, eos) { return eos; }, value: val, name: tkey });\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcases.push(createGuard(lexer, ruleName, tkey, val)); // call separate function to avoid local variable capture\n\t\t\t\t}\n\n\t\t\t\tif (!hasEmbeddedEndInCases) {\n\t\t\t\t\thasEmbeddedEndInCases = !isString(val) && (val.hasEmbeddedEndInCases || ['@pop', '@popall'].includes(val.nextEmbedded || ''));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// create a matching function\n\t\tconst def = lexer.defaultToken;\n\t\treturn {\n\t\t\thasEmbeddedEndInCases,\n\t\t\ttest: function (id, matches, state, eos) {\n\t\t\t\tfor (const _case of cases) {\n\t\t\t\t\tconst didmatch = (!_case.test || _case.test(id, matches, state, eos));\n\t\t\t\t\tif (didmatch) {\n\t\t\t\t\t\treturn _case.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn def;\n\t\t\t}\n\t\t};\n\t}\n\telse {\n\t\tthrow monarchCommon.createError(lexer, 'an action must be a string, an object with a \\'token\\' or \\'cases\\' attribute, or an array of actions; in rule: ' + ruleName);\n\t}\n}\n\ntype DynamicRegExp = (state: string) => RegExp;\n\n/**\n * Helper class for creating matching rules\n */\nclass Rule implements monarchCommon.IRule {\n\tprivate regex: RegExp | DynamicRegExp = new RegExp('');\n\tpublic action: monarchCommon.FuzzyAction = { token: '' };\n\tpublic matchOnlyAtLineStart: boolean = false;\n\tpublic name: string = '';\n\n\tconstructor(name: string) {\n\t\tthis.name = name;\n\t}\n\n\tpublic setRegex(lexer: monarchCommon.ILexerMin, re: string | RegExp): void {\n\t\tlet sregex: string;\n\t\tif (typeof (re) === 'string') {\n\t\t\tsregex = re;\n\t\t}\n\t\telse if (re instanceof RegExp) {\n\t\t\tsregex = re.source;\n\t\t}\n\t\telse {\n\t\t\tthrow monarchCommon.createError(lexer, 'rules must start with a match string or regular expression: ' + this.name);\n\t\t}\n\n\t\tthis.matchOnlyAtLineStart = (sregex.length > 0 && sregex[0] === '^');\n\t\tthis.name = this.name + ': ' + sregex;\n\t\tthis.regex = compileRegExp(lexer, '^(?:' + (this.matchOnlyAtLineStart ? sregex.substr(1) : sregex) + ')', true);\n\t}\n\n\tpublic setAction(lexer: monarchCommon.ILexerMin, act: monarchCommon.IAction) {\n\t\tthis.action = compileAction(lexer, this.name, act);\n\t}\n\n\tpublic resolveRegex(state: string): RegExp {\n\t\tif (this.regex instanceof RegExp) {\n\t\t\treturn this.regex;\n\t\t} else {\n\t\t\treturn this.regex(state);\n\t\t}\n\t}\n}\n\n/**\n * Compiles a json description function into json where all regular expressions,\n * case matches etc, are compiled and all include rules are expanded.\n * We also compile the bracket definitions, supply defaults, and do many sanity checks.\n * If the 'jsonStrict' parameter is 'false', we allow at certain locations\n * regular expression objects and functions that get called during lexing.\n * (Currently we have no samples that need this so perhaps we should always have\n * jsonStrict to true).\n */\nexport function compile(languageId: string, json: IMonarchLanguage): monarchCommon.ILexer {\n\tif (!json || typeof (json) !== 'object') {\n\t\tthrow new Error('Monarch: expecting a language definition object');\n\t}\n\n\t// Create our lexer\n\tconst lexer: monarchCommon.ILexer = {\n\t\tlanguageId: languageId,\n\t\tincludeLF: bool(json.includeLF, false),\n\t\tnoThrow: false, // raise exceptions during compilation\n\t\tmaxStack: 100,\n\t\tstart: (typeof json.start === 'string' ? json.start : null),\n\t\tignoreCase: bool(json.ignoreCase, false),\n\t\tunicode: bool(json.unicode, false),\n\t\ttokenPostfix: string(json.tokenPostfix, '.' + languageId),\n\t\tdefaultToken: string(json.defaultToken, 'source'),\n\t\tusesEmbedded: false, // becomes true if we find a nextEmbedded action\n\t\tstateNames: {},\n\t\ttokenizer: {},\n\t\tbrackets: []\n\t};\n\n\t// For calling compileAction later on\n\t// eslint-disable-next-line local/code-no-any-casts\n\tconst lexerMin: monarchCommon.ILexerMin = <any>json;\n\tlexerMin.languageId = languageId;\n\tlexerMin.includeLF = lexer.includeLF;\n\tlexerMin.ignoreCase = lexer.ignoreCase;\n\tlexerMin.unicode = lexer.unicode;\n\tlexerMin.noThrow = lexer.noThrow;\n\tlexerMin.usesEmbedded = lexer.usesEmbedded;\n\tlexerMin.stateNames = json.tokenizer;\n\tlexerMin.defaultToken = lexer.defaultToken;\n\n\n\t// Compile an array of rules into newrules where RegExp objects are created.\n\tfunction addRules(state: string, newrules: monarchCommon.IRule[], rules: any[]) {\n\t\tfor (const rule of rules) {\n\n\t\t\tlet include = rule.include;\n\t\t\tif (include) {\n\t\t\t\tif (typeof (include) !== 'string') {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'an \\'include\\' attribute must be a string at: ' + state);\n\t\t\t\t}\n\t\t\t\tif (include[0] === '@') {\n\t\t\t\t\tinclude = include.substr(1); // peel off starting @\n\t\t\t\t}\n\t\t\t\tif (!json.tokenizer[include]) {\n\t\t\t\t\tthrow monarchCommon.createError(lexer, 'include target \\'' + include + '\\' is not defined at: ' + state);\n\t\t\t\t}\n\t\t\t\taddRules(state + '.' + include, newrules, json.tokenizer[include]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst newrule = new Rule(state);\n\n\t\t\t\t// Set up new rule attributes\n\t\t\t\tif (Array.isArray(rule) && rule.length >= 1 && rule.length <= 3) {\n\t\t\t\t\tnewrule.setRegex(lexerMin, rule[0]);\n\t\t\t\t\tif (rule.length >= 3) {\n\t\t\t\t\t\tif (typeof (rule[1]) === 'string') {\n\t\t\t\t\t\t\tnewrule.setAction(lexerMin, { token: rule[1], next: rule[2] });\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (typeof (rule[1]) === 'object') {\n\t\t\t\t\t\t\tconst rule1 = rule[1];\n\t\t\t\t\t\t\trule1.next = rule[2];\n\t\t\t\t\t\t\tnewrule.setAction(lexerMin, rule1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'a next state as the last element of a rule can only be given if the action is either an object or a string, at: ' + state);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnewrule.setAction(lexerMin, rule[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!rule.regex) {\n\t\t\t\t\t\tthrow monarchCommon.createError(lexer, 'a rule must either be an array, or an object with a \\'regex\\' or \\'include\\' field at: ' + state);\n\t\t\t\t\t}\n\t\t\t\t\tif (rule.name) {\n\t\t\t\t\t\tif (typeof rule.name === 'string') {\n\t\t\t\t\t\t\tnewrule.name = rule.name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (rule.matchOnlyAtStart) {\n\t\t\t\t\t\tnewrule.matchOnlyAtLineStart = bool(rule.matchOnlyAtLineStart, false);\n\t\t\t\t\t}\n\t\t\t\t\tnewrule.setRegex(lexerMin, rule.regex);\n\t\t\t\t\tnewrule.setAction(lexerMin, rule.action);\n\t\t\t\t}\n\n\t\t\t\tnewrules.push(newrule);\n\t\t\t}\n\t\t}\n\t}\n\n\t// compile the tokenizer rules\n\tif (!json.tokenizer || typeof (json.tokenizer) !== 'object') {\n\t\tthrow monarchCommon.createError(lexer, 'a language definition must define the \\'tokenizer\\' attribute as an object');\n\t}\n\n\t// eslint-disable-next-line local/code-no-any-casts\n\tlexer.tokenizer = <any>[];\n\tfor (const key in json.tokenizer) {\n\t\tif (json.tokenizer.hasOwnProperty(key)) {\n\t\t\tif (!lexer.start) {\n\t\t\t\tlexer.start = key;\n\t\t\t}\n\n\t\t\tconst rules = json.tokenizer[key];\n\t\t\tlexer.tokenizer[key] = new Array();\n\t\t\taddRules('tokenizer.' + key, lexer.tokenizer[key], rules);\n\t\t}\n\t}\n\tlexer.usesEmbedded = lexerMin.usesEmbedded; // can be set during compileAction\n\n\t// Set simple brackets\n\tif (json.brackets) {\n\t\t// eslint-disable-next-line local/code-no-any-casts\n\t\tif (!(Array.isArray(<any>json.brackets))) {\n\t\t\tthrow monarchCommon.createError(lexer, 'the \\'brackets\\' attribute must be defined as an array');\n\t\t}\n\t}\n\telse {\n\t\tjson.brackets = [\n\t\t\t{ open: '{', close: '}', token: 'delimiter.curly' },\n\t\t\t{ open: '[', close: ']', token: 'delimiter.square' },\n\t\t\t{ open: '(', close: ')', token: 'delimiter.parenthesis' },\n\t\t\t{ open: '<', close: '>', token: 'delimiter.angle' }];\n\t}\n\tconst brackets: IMonarchLanguageBracket[] = [];\n\tfor (const el of json.brackets) {\n\t\tlet desc: any = el;\n\t\tif (desc && Array.isArray(desc) && desc.length === 3) {\n\t\t\tdesc = { token: desc[2], open: desc[0], close: desc[1] };\n\t\t}\n\t\tif (desc.open === desc.close) {\n\t\t\tthrow monarchCommon.createError(lexer, 'open and close brackets in a \\'brackets\\' attribute must be different: ' + desc.open +\n\t\t\t\t'\\n hint: use the \\'bracket\\' attribute if matching on equal brackets is required.');\n\t\t}\n\t\tif (typeof desc.open === 'string' && typeof desc.token === 'string' && typeof desc.close === 'string') {\n\t\t\tbrackets.push({\n\t\t\t\ttoken: desc.token + lexer.tokenPostfix,\n\t\t\t\topen: monarchCommon.fixCase(lexer, desc.open),\n\t\t\t\tclose: monarchCommon.fixCase(lexer, desc.close)\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tthrow monarchCommon.createError(lexer, 'every element in the \\'brackets\\' array must be a \\'{open,close,token}\\' object or array');\n\t\t}\n\t}\n\tlexer.brackets = brackets;\n\n\t// Disable throw so the syntax highlighter goes, no matter what\n\tlexer.noThrow = true;\n\treturn lexer;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/platform/configuration/common/configurationRegistry.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AACvD,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,UAAU,IAAI,cAAc,EAA6B,MAAM,sDAAsD,CAAC;AAC/H,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,aAAa,EAAE,kCAAkC;CACjD,CAAC;AA8JF,MAAM,CAAC,MAAM,WAAW,GAAwI,EAAE,UAAU,EAAE,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,CAAC;AAC1M,MAAM,CAAC,MAAM,mBAAmB,GAAwI,EAAE,UAAU,EAAE,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,CAAC;AAClN,MAAM,CAAC,MAAM,0BAA0B,GAAwI,EAAE,UAAU,EAAE,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,CAAC;AACzN,MAAM,CAAC,MAAM,eAAe,GAAwI,EAAE,UAAU,EAAE,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,CAAC;AAC9M,MAAM,CAAC,MAAM,0BAA0B,GAAwI,EAAE,UAAU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AqB,CAAC,CAAC;AAE9D,MAAM,UAAU,gBAAgB,CAAC,QAAgB,EAAE,MAA8C;IAChG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;QACtB,OAAO,GAAG,CAAC,QAAQ,CAAC,IAAuB,EAAE,mCAAmC,CAAC,CAAC;IACnF,CAAC;IACD,IAAI,uBAAuB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5C,OAAO,GAAG,CAAC,QAAQ,CAAC,IAAiC,EAAE,kKAAkK,EAAE,QAAQ,CAAC,CAAC;IACtO,CAAC;IACD,IAAI,qBAAqB,CAAC,0BAA0B,EAAE,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE,CAAC;QAChF,OAAO,GAAG,CAAC,QAAQ,CAAC,IAA2B,EAAE,6DAA6D,EAAE,QAAQ,CAAC,CAAC;IAC3H,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,IAAI,qBAAqB,CAAC,uBAAuB,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACnH,OAAO,GAAG,CAAC,QAAQ,CAAC,IAAyB,EAAE,kFAAkF,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,qBAAqB,CAAC,uBAAuB,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IAC7O,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC","file":"configurationRegistry.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { distinct } from '../../../base/common/arrays.js';\nimport { IStringDictionary } from '../../../base/common/collections.js';\nimport { Emitter } from '../../../base/common/event.js';\nimport { IJSONSchema } from '../../../base/common/jsonSchema.js';\nimport * as types from '../../../base/common/types.js';\nimport * as nls from '../../../nls.js';\nimport { getLanguageTagSettingPlainKey } from './configuration.js';\nimport { Extensions as JSONExtensions, IJSONContributionRegistry } from '../../jsonschemas/common/jsonContributionRegistry.js';\nimport { Registry } from '../../registry/common/platform.js';\nimport { IPolicy, PolicyName } from '../../../base/common/policy.js';\nimport { Disposable } from '../../../base/common/lifecycle.js';\n\nexport const Extensions = {\n\tConfiguration: 'base.contributions.configuration'\n};\n\nexport interface IConfigurationRegistry {\n\n\t/**\n\t * Register a configuration to the registry.\n\t */\n\tregisterConfiguration(configuration: IConfigurationNode): IConfigurationNode;\n\n\t/**\n\t * Register multiple default configurations to the registry.\n\t */\n\tregisterDefaultConfigurations(defaultConfigurations: IConfigurationDefaults[]): void;\n\n\t/**\n\t * Returns all configurations settings of all configuration nodes contributed to this registry.\n\t */\n\tgetConfigurationProperties(): IStringDictionary<IRegisteredConfigurationPropertySchema>;\n\n\t/**\n\t * Returns all excluded configurations settings of all configuration nodes contributed to this registry.\n\t */\n\tgetExcludedConfigurationProperties(): IStringDictionary<IRegisteredConfigurationPropertySchema>;\n\n\t/**\n\t * Register the identifiers for editor configurations\n\t */\n\tregisterOverrideIdentifiers(identifiers: string[]): void;\n}\n\nexport const enum ConfigurationScope {\n\t/**\n\t * Application specific configuration, which can be configured only in default profile user settings.\n\t */\n\tAPPLICATION = 1,\n\t/**\n\t * Machine specific configuration, which can be configured only in local and remote user settings.\n\t */\n\tMACHINE,\n\t/**\n\t * An application machine specific configuration, which can be configured only in default profile user settings and remote user settings.\n\t */\n\tAPPLICATION_MACHINE,\n\t/**\n\t * Window specific configuration, which can be configured in the user or workspace settings.\n\t */\n\tWINDOW,\n\t/**\n\t * Resource specific configuration, which can be configured in the user, workspace or folder settings.\n\t */\n\tRESOURCE,\n\t/**\n\t * Resource specific configuration that can be configured in language specific settings\n\t */\n\tLANGUAGE_OVERRIDABLE,\n\t/**\n\t * Machine specific configuration that can also be configured in workspace or folder settings.\n\t */\n\tMACHINE_OVERRIDABLE,\n}\n\n\nexport interface IConfigurationPropertySchema extends IJSONSchema {\n\n\tscope?: ConfigurationScope;\n\n\t/**\n\t * When restricted, value of this configuration will be read only from trusted sources.\n\t * For eg., If the workspace is not trusted, then the value of this configuration is not read from workspace settings file.\n\t */\n\trestricted?: boolean;\n\n\t/**\n\t * When `false` this property is excluded from the registry. Default is to include.\n\t */\n\tincluded?: boolean;\n\n\t/**\n\t * List of tags associated to the property.\n\t * - A tag can be used for filtering\n\t * - Use `experimental` tag for marking the setting as experimental.\n\t */\n\ttags?: string[];\n\n\t/**\n\t * Disallow extensions to contribute configuration default value for this setting.\n\t */\n\tdisallowConfigurationDefault?: boolean;\n\n\t/**\n\t * When specified, this setting's value can always be overwritten by\n\t * a system-wide policy.\n\t */\n\tpolicy?: IPolicy;\n\n\t/**\n\t * When specified, this setting's default value can always be overwritten by\n\t * an experiment.\n\t */\n\texperiment?: {\n\t\t/**\n\t\t * The mode of the experiment.\n\t\t * - `startup`: The setting value is updated to the experiment value only on startup.\n\t\t * - `auto`: The setting value is updated to the experiment value automatically (whenever the experiment value changes).\n\t\t */\n\t\tmode: 'startup' | 'auto';\n\n\t\t/**\n\t\t * The name of the experiment. By default, this is `config.${settingId}`\n\t\t */\n\t\tname?: string;\n\t};\n}\n\nexport interface IExtensionInfo {\n}\n\nexport interface IConfigurationNode {\n\tid?: string;\n\torder?: number;\n\ttype?: string | string[];\n\ttitle?: string;\n\tproperties?: IStringDictionary<IConfigurationPropertySchema>;\n\tallOf?: IConfigurationNode[];\n\tscope?: ConfigurationScope;\n\textensionInfo?: IExtensionInfo;\n\trestrictedProperties?: string[];\n}\n\nexport type ConfigurationDefaultValueSource = IExtensionInfo | Map<string, IExtensionInfo>;\n\nexport interface IConfigurationDefaults {\n\toverrides: IStringDictionary<any>;\n\tsource?: IExtensionInfo;\n}\n\nexport type IRegisteredConfigurationPropertySchema = IConfigurationPropertySchema & {\n\tsection?: {\n\t\tid?: string;\n\t\ttitle?: string;\n\t\torder?: number;\n\t\textensionInfo?: IExtensionInfo;\n\t};\n\tdefaultDefaultValue?: any;\n\tsource?: IExtensionInfo; // Source of the Property\n\tdefaultValueSource?: ConfigurationDefaultValueSource; // Source of the Default Value\n};\n\nexport interface IConfigurationDefaultOverride {\n\treadonly value: any;\n\treadonly source?: IExtensionInfo; // Source of the default override\n}\n\nexport interface IConfigurationDefaultOverrideValue {\n\treadonly value: any;\n\treadonly source?: ConfigurationDefaultValueSource;\n}\n\nexport const allSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const applicationSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const applicationMachineSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const machineSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const machineOverridableSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const windowSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const resourceSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\n\nexport const resourceLanguageSettingsSchemaId = 'vscode://schemas/settings/resourceLanguage';\n\nconst contributionRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);\n\nclass ConfigurationRegistry extends Disposable implements IConfigurationRegistry {\n\n\tprivate readonly registeredConfigurationDefaults: IConfigurationDefaults[] = [];\n\tprivate readonly configurationDefaultsOverrides: Map<string, { configurationDefaultOverrides: IConfigurationDefaultOverride[]; configurationDefaultOverrideValue?: IConfigurationDefaultOverrideValue }>;\n\tprivate readonly defaultLanguageConfigurationOverridesNode: IConfigurationNode;\n\tprivate readonly configurationContributors: IConfigurationNode[];\n\tprivate readonly configurationProperties: IStringDictionary<IRegisteredConfigurationPropertySchema>;\n\tprivate readonly policyConfigurations: Map<PolicyName, string>;\n\tprivate readonly excludedConfigurationProperties: IStringDictionary<IRegisteredConfigurationPropertySchema>;\n\tprivate readonly resourceLanguageSettingsSchema: IJSONSchema;\n\tprivate readonly overrideIdentifiers = new Set<string>();\n\n\tprivate readonly _onDidSchemaChange = this._register(new Emitter<void>());\n\n\tprivate readonly _onDidUpdateConfiguration = this._register(new Emitter<{ properties: ReadonlySet<string>; defaultsOverrides?: boolean }>());\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.configurationDefaultsOverrides = new Map();\n\t\tthis.defaultLanguageConfigurationOverridesNode = {\n\t\t\tid: 'defaultOverrides',\n\t\t\ttitle: nls.localize('defaultLanguageConfigurationOverrides.title', \"Default Language Configuration Overrides\"),\n\t\t\tproperties: {}\n\t\t};\n\t\tthis.configurationContributors = [this.defaultLanguageConfigurationOverridesNode];\n\t\tthis.resourceLanguageSettingsSchema = {\n\t\t\tproperties: {},\n\t\t\tpatternProperties: {},\n\t\t\tadditionalProperties: true,\n\t\t\tallowTrailingCommas: true,\n\t\t\tallowComments: true\n\t\t};\n\t\tthis.configurationProperties = {};\n\t\tthis.policyConfigurations = new Map<PolicyName, string>();\n\t\tthis.excludedConfigurationProperties = {};\n\n\t\tcontributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema);\n\t\tthis.registerOverridePropertyPatternKey();\n\t}\n\n\tpublic registerConfiguration(configuration: IConfigurationNode, validate: boolean = true): IConfigurationNode {\n\t\tthis.registerConfigurations([configuration], validate);\n\t\treturn configuration;\n\t}\n\n\tpublic registerConfigurations(configurations: IConfigurationNode[], validate: boolean = true): void {\n\t\tconst properties = new Set<string>();\n\t\tthis.doRegisterConfigurations(configurations, validate, properties);\n\n\t\tcontributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema);\n\t\tthis._onDidSchemaChange.fire();\n\t\tthis._onDidUpdateConfiguration.fire({ properties });\n\t}\n\n\tpublic registerDefaultConfigurations(configurationDefaults: IConfigurationDefaults[]): void {\n\t\tconst properties = new Set<string>();\n\t\tthis.doRegisterDefaultConfigurations(configurationDefaults, properties);\n\t\tthis._onDidSchemaChange.fire();\n\t\tthis._onDidUpdateConfiguration.fire({ properties, defaultsOverrides: true });\n\t}\n\n\tprivate doRegisterDefaultConfigurations(configurationDefaults: IConfigurationDefaults[], bucket: Set<string>) {\n\n\t\tthis.registeredConfigurationDefaults.push(...configurationDefaults);\n\n\t\tconst overrideIdentifiers: string[] = [];\n\n\t\tfor (const { overrides, source } of configurationDefaults) {\n\t\t\tfor (const key in overrides) {\n\t\t\t\tbucket.add(key);\n\n\t\t\t\tconst configurationDefaultOverridesForKey = this.configurationDefaultsOverrides.get(key)\n\t\t\t\t\t?? this.configurationDefaultsOverrides.set(key, { configurationDefaultOverrides: [] }).get(key)!;\n\n\t\t\t\tconst value = overrides[key];\n\t\t\t\tconfigurationDefaultOverridesForKey.configurationDefaultOverrides.push({ value, source });\n\n\t\t\t\t// Configuration defaults for Override Identifiers\n\t\t\t\tif (OVERRIDE_PROPERTY_REGEX.test(key)) {\n\t\t\t\t\tconst newDefaultOverride = this.mergeDefaultConfigurationsForOverrideIdentifier(key, value, source, configurationDefaultOverridesForKey.configurationDefaultOverrideValue);\n\t\t\t\t\tif (!newDefaultOverride) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconfigurationDefaultOverridesForKey.configurationDefaultOverrideValue = newDefaultOverride;\n\t\t\t\t\tthis.updateDefaultOverrideProperty(key, newDefaultOverride, source);\n\t\t\t\t\toverrideIdentifiers.push(...overrideIdentifiersFromKey(key));\n\t\t\t\t}\n\n\t\t\t\t// Configuration defaults for Configuration Properties\n\t\t\t\telse {\n\t\t\t\t\tconst newDefaultOverride = this.mergeDefaultConfigurationsForConfigurationProperty(key, value, source, configurationDefaultOverridesForKey.configurationDefaultOverrideValue);\n\t\t\t\t\tif (!newDefaultOverride) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconfigurationDefaultOverridesForKey.configurationDefaultOverrideValue = newDefaultOverride;\n\t\t\t\t\tconst property = this.configurationProperties[key];\n\t\t\t\t\tif (property) {\n\t\t\t\t\t\tthis.updatePropertyDefaultValue(key, property);\n\t\t\t\t\t\tthis.updateSchema(key, property);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tthis.doRegisterOverrideIdentifiers(overrideIdentifiers);\n\t}\n\n\tprivate updateDefaultOverrideProperty(key: string, newDefaultOverride: IConfigurationDefaultOverrideValue, source: IExtensionInfo | undefined): void {\n\t\tconst property: IRegisteredConfigurationPropertySchema = {\n\t\t\tsection: {\n\t\t\t\tid: this.defaultLanguageConfigurationOverridesNode.id,\n\t\t\t\ttitle: this.defaultLanguageConfigurationOverridesNode.title,\n\t\t\t\torder: this.defaultLanguageConfigurationOverridesNode.order,\n\t\t\t\textensionInfo: this.defaultLanguageConfigurationOverridesNode.extensionInfo\n\t\t\t},\n\t\t\ttype: 'object',\n\t\t\tdefault: newDefaultOverride.value,\n\t\t\tdescription: nls.localize('defaultLanguageConfiguration.description', \"Configure settings to be overridden for {0}.\", getLanguageTagSettingPlainKey(key)),\n\t\t\t$ref: resourceLanguageSettingsSchemaId,\n\t\t\tdefaultDefaultValue: newDefaultOverride.value,\n\t\t\tsource,\n\t\t\tdefaultValueSource: source\n\t\t};\n\t\tthis.configurationProperties[key] = property;\n\t\tthis.defaultLanguageConfigurationOverridesNode.properties![key] = property;\n\t}\n\n\tprivate mergeDefaultConfigurationsForOverrideIdentifier(overrideIdentifier: string, configurationValueObject: IStringDictionary<any>, valueSource: IExtensionInfo | undefined, existingDefaultOverride: IConfigurationDefaultOverrideValue | undefined): IConfigurationDefaultOverrideValue | undefined {\n\t\tconst defaultValue = existingDefaultOverride?.value || {};\n\t\tconst source = existingDefaultOverride?.source ?? new Map<string, IExtensionInfo>();\n\n\t\t// This should not happen\n\t\tif (!(source instanceof Map)) {\n\t\t\tconsole.error('objectConfigurationSources is not a Map');\n\t\t\treturn undefined;\n\t\t}\n\n\t\tfor (const propertyKey of Object.keys(configurationValueObject)) {\n\t\t\tconst propertyDefaultValue = configurationValueObject[propertyKey];\n\n\t\t\tconst isObjectSetting = types.isObject(propertyDefaultValue) &&\n\t\t\t\t(types.isUndefined(defaultValue[propertyKey]) || types.isObject(defaultValue[propertyKey]));\n\n\t\t\t// If the default value is an object, merge the objects and store the source of each keys\n\t\t\tif (isObjectSetting) {\n\t\t\t\tdefaultValue[propertyKey] = { ...(defaultValue[propertyKey] ?? {}), ...propertyDefaultValue };\n\t\t\t\t// Track the source of each value in the object\n\t\t\t\tif (valueSource) {\n\t\t\t\t\tfor (const objectKey in propertyDefaultValue) {\n\t\t\t\t\t\tsource.set(`${propertyKey}.${objectKey}`, valueSource);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Primitive values are overridden\n\t\t\telse {\n\t\t\t\tdefaultValue[propertyKey] = propertyDefaultValue;\n\t\t\t\tif (valueSource) {\n\t\t\t\t\tsource.set(propertyKey, valueSource);\n\t\t\t\t} else {\n\t\t\t\t\tsource.delete(propertyKey);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { value: defaultValue, source };\n\t}\n\n\tprivate mergeDefaultConfigurationsForConfigurationProperty(propertyKey: string, value: any, valuesSource: IExtensionInfo | undefined, existingDefaultOverride: IConfigurationDefaultOverrideValue | undefined): IConfigurationDefaultOverrideValue | undefined {\n\t\tconst property = this.configurationProperties[propertyKey];\n\t\tconst existingDefaultValue = existingDefaultOverride?.value ?? property?.defaultDefaultValue;\n\t\tlet source: ConfigurationDefaultValueSource | undefined = valuesSource;\n\n\t\tconst isObjectSetting = types.isObject(value) &&\n\t\t\t(\n\t\t\t\tproperty !== undefined && property.type === 'object' ||\n\t\t\t\tproperty === undefined && (types.isUndefined(existingDefaultValue) || types.isObject(existingDefaultValue))\n\t\t\t);\n\n\t\t// If the default value is an object, merge the objects and store the source of each keys\n\t\tif (isObjectSetting) {\n\t\t\tsource = existingDefaultOverride?.source ?? new Map<string, IExtensionInfo>();\n\n\t\t\t// This should not happen\n\t\t\tif (!(source instanceof Map)) {\n\t\t\t\tconsole.error('defaultValueSource is not a Map');\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tfor (const objectKey in value) {\n\t\t\t\tif (valuesSource) {\n\t\t\t\t\tsource.set(`${propertyKey}.${objectKey}`, valuesSource);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalue = { ...(types.isObject(existingDefaultValue) ? existingDefaultValue : {}), ...value };\n\t\t}\n\n\t\treturn { value, source };\n\t}\n\n\tpublic registerOverrideIdentifiers(overrideIdentifiers: string[]): void {\n\t\tthis.doRegisterOverrideIdentifiers(overrideIdentifiers);\n\t\tthis._onDidSchemaChange.fire();\n\t}\n\n\tprivate doRegisterOverrideIdentifiers(overrideIdentifiers: string[]) {\n\t\tfor (const overrideIdentifier of overrideIdentifiers) {\n\t\t\tthis.overrideIdentifiers.add(overrideIdentifier);\n\t\t}\n\t\tthis.updateOverridePropertyPatternKey();\n\t}\n\n\tprivate doRegisterConfigurations(configurations: IConfigurationNode[], validate: boolean, bucket: Set<string>): void {\n\n\t\tconfigurations.forEach(configuration => {\n\n\t\t\tthis.validateAndRegisterProperties(configuration, validate, configuration.extensionInfo, configuration.restrictedProperties, undefined, bucket);\n\n\t\t\tthis.configurationContributors.push(configuration);\n\t\t\tthis.registerJSONConfiguration(configuration);\n\t\t});\n\t}\n\n\tprivate validateAndRegisterProperties(configuration: IConfigurationNode, validate: boolean = true, extensionInfo: IExtensionInfo | undefined, restrictedProperties: string[] | undefined, scope: ConfigurationScope = ConfigurationScope.WINDOW, bucket: Set<string>): void {\n\t\tscope = types.isUndefinedOrNull(configuration.scope) ? scope : configuration.scope;\n\t\tconst properties = configuration.properties;\n\t\tif (properties) {\n\t\t\tfor (const key in properties) {\n\t\t\t\tconst property: IRegisteredConfigurationPropertySchema = properties[key];\n\t\t\t\tproperty.section = {\n\t\t\t\t\tid: configuration.id,\n\t\t\t\t\ttitle: configuration.title,\n\t\t\t\t\torder: configuration.order,\n\t\t\t\t\textensionInfo: configuration.extensionInfo\n\t\t\t\t};\n\t\t\t\tif (validate && validateProperty(key, property)) {\n\t\t\t\t\tdelete properties[key];\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tproperty.source = extensionInfo;\n\n\t\t\t\t// update default value\n\t\t\t\tproperty.defaultDefaultValue = properties[key].default;\n\t\t\t\tthis.updatePropertyDefaultValue(key, property);\n\n\t\t\t\t// update scope\n\t\t\t\tif (OVERRIDE_PROPERTY_REGEX.test(key)) {\n\t\t\t\t\tproperty.scope = undefined; // No scope for overridable properties `[${identifier}]`\n\t\t\t\t} else {\n\t\t\t\t\tproperty.scope = types.isUndefinedOrNull(property.scope) ? scope : property.scope;\n\t\t\t\t\tproperty.restricted = types.isUndefinedOrNull(property.restricted) ? !!restrictedProperties?.includes(key) : property.restricted;\n\t\t\t\t}\n\n\t\t\t\tif (property.experiment) {\n\t\t\t\t\tif (!property.tags?.some(tag => tag.toLowerCase() === 'onexp')) {\n\t\t\t\t\t\tproperty.tags = property.tags ?? [];\n\t\t\t\t\t\tproperty.tags.push('onExP');\n\t\t\t\t\t}\n\t\t\t\t} else if (property.tags?.some(tag => tag.toLowerCase() === 'onexp')) {\n\t\t\t\t\tconsole.error(`Invalid tag 'onExP' found for property '${key}'. Please use 'experiment' property instead.`);\n\t\t\t\t\tproperty.experiment = { mode: 'startup' };\n\t\t\t\t}\n\n\t\t\t\tconst excluded = properties[key].hasOwnProperty('included') && !properties[key].included;\n\t\t\t\tconst policyName = properties[key].policy?.name;\n\n\t\t\t\tif (excluded) {\n\t\t\t\t\tthis.excludedConfigurationProperties[key] = properties[key];\n\t\t\t\t\tif (policyName) {\n\t\t\t\t\t\tthis.policyConfigurations.set(policyName, key);\n\t\t\t\t\t\tbucket.add(key);\n\t\t\t\t\t}\n\t\t\t\t\tdelete properties[key];\n\t\t\t\t} else {\n\t\t\t\t\tbucket.add(key);\n\t\t\t\t\tif (policyName) {\n\t\t\t\t\t\tthis.policyConfigurations.set(policyName, key);\n\t\t\t\t\t}\n\t\t\t\t\tthis.configurationProperties[key] = properties[key];\n\t\t\t\t\tif (!properties[key].deprecationMessage && properties[key].markdownDeprecationMessage) {\n\t\t\t\t\t\t// If not set, default deprecationMessage to the markdown source\n\t\t\t\t\t\tproperties[key].deprecationMessage = properties[key].markdownDeprecationMessage;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t}\n\t\t}\n\t\tconst subNodes = configuration.allOf;\n\t\tif (subNodes) {\n\t\t\tfor (const node of subNodes) {\n\t\t\t\tthis.validateAndRegisterProperties(node, validate, extensionInfo, restrictedProperties, scope, bucket);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetConfigurationProperties(): IStringDictionary<IRegisteredConfigurationPropertySchema> {\n\t\treturn this.configurationProperties;\n\t}\n\n\tgetPolicyConfigurations(): Map<PolicyName, string> {\n\t\treturn this.policyConfigurations;\n\t}\n\n\tgetExcludedConfigurationProperties(): IStringDictionary<IRegisteredConfigurationPropertySchema> {\n\t\treturn this.excludedConfigurationProperties;\n\t}\n\n\tprivate registerJSONConfiguration(configuration: IConfigurationNode) {\n\t\tconst register = (configuration: IConfigurationNode) => {\n\t\t\tconst properties = configuration.properties;\n\t\t\tif (properties) {\n\t\t\t\tfor (const key in properties) {\n\t\t\t\t\tthis.updateSchema(key, properties[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst subNodes = configuration.allOf;\n\t\t\tsubNodes?.forEach(register);\n\t\t};\n\t\tregister(configuration);\n\t}\n\n\tprivate updateSchema(key: string, property: IConfigurationPropertySchema): void {\n\t\tallSettings.properties[key] = property;\n\t\tswitch (property.scope) {\n\t\t\tcase ConfigurationScope.APPLICATION:\n\t\t\t\tapplicationSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.MACHINE:\n\t\t\t\tmachineSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.APPLICATION_MACHINE:\n\t\t\t\tapplicationMachineSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.MACHINE_OVERRIDABLE:\n\t\t\t\tmachineOverridableSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.WINDOW:\n\t\t\t\twindowSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.RESOURCE:\n\t\t\t\tresourceSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.LANGUAGE_OVERRIDABLE:\n\t\t\t\tresourceSettings.properties[key] = property;\n\t\t\t\tthis.resourceLanguageSettingsSchema.properties![key] = property;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tprivate updateOverridePropertyPatternKey(): void {\n\t\tfor (const overrideIdentifier of this.overrideIdentifiers.values()) {\n\t\t\tconst overrideIdentifierProperty = `[${overrideIdentifier}]`;\n\t\t\tconst resourceLanguagePropertiesSchema: IJSONSchema = {\n\t\t\t\ttype: 'object',\n\t\t\t\tdescription: nls.localize('overrideSettings.defaultDescription', \"Configure editor settings to be overridden for a language.\"),\n\t\t\t\terrorMessage: nls.localize('overrideSettings.errorMessage', \"This setting does not support per-language configuration.\"),\n\t\t\t\t$ref: resourceLanguageSettingsSchemaId,\n\t\t\t};\n\t\t\tthis.updatePropertyDefaultValue(overrideIdentifierProperty, resourceLanguagePropertiesSchema);\n\t\t\tallSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\tapplicationSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\tapplicationMachineSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\tmachineSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\tmachineOverridableSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\twindowSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\tresourceSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t}\n\t}\n\n\tprivate registerOverridePropertyPatternKey(): void {\n\t\tconst resourceLanguagePropertiesSchema: IJSONSchema = {\n\t\t\ttype: 'object',\n\t\t\tdescription: nls.localize('overrideSettings.defaultDescription', \"Configure editor settings to be overridden for a language.\"),\n\t\t\terrorMessage: nls.localize('overrideSettings.errorMessage', \"This setting does not support per-language configuration.\"),\n\t\t\t$ref: resourceLanguageSettingsSchemaId,\n\t\t};\n\t\tallSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tapplicationSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tapplicationMachineSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tmachineSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tmachineOverridableSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\twindowSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tresourceSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tthis._onDidSchemaChange.fire();\n\t}\n\n\tprivate updatePropertyDefaultValue(key: string, property: IRegisteredConfigurationPropertySchema): void {\n\t\tconst configurationdefaultOverride = this.configurationDefaultsOverrides.get(key)?.configurationDefaultOverrideValue;\n\t\tlet defaultValue = undefined;\n\t\tlet defaultSource = undefined;\n\t\tif (configurationdefaultOverride\n\t\t\t&& (!property.disallowConfigurationDefault || !configurationdefaultOverride.source) // Prevent overriding the default value if the property is disallowed to be overridden by configuration defaults from extensions\n\t\t) {\n\t\t\tdefaultValue = configurationdefaultOverride.value;\n\t\t\tdefaultSource = configurationdefaultOverride.source;\n\t\t}\n\t\tif (types.isUndefined(defaultValue)) {\n\t\t\tdefaultValue = property.defaultDefaultValue;\n\t\t\tdefaultSource = undefined;\n\t\t}\n\t\tif (types.isUndefined(defaultValue)) {\n\t\t\tdefaultValue = getDefaultValue(property.type);\n\t\t}\n\t\tproperty.default = defaultValue;\n\t\tproperty.defaultValueSource = defaultSource;\n\t}\n}\n\nconst OVERRIDE_IDENTIFIER_PATTERN = `\\\\[([^\\\\]]+)\\\\]`;\nconst OVERRIDE_IDENTIFIER_REGEX = new RegExp(OVERRIDE_IDENTIFIER_PATTERN, 'g');\nexport const OVERRIDE_PROPERTY_PATTERN = `^(${OVERRIDE_IDENTIFIER_PATTERN})+$`;\nexport const OVERRIDE_PROPERTY_REGEX = new RegExp(OVERRIDE_PROPERTY_PATTERN);\n\nexport function overrideIdentifiersFromKey(key: string): string[] {\n\tconst identifiers: string[] = [];\n\tif (OVERRIDE_PROPERTY_REGEX.test(key)) {\n\t\tlet matches = OVERRIDE_IDENTIFIER_REGEX.exec(key);\n\t\twhile (matches?.length) {\n\t\t\tconst identifier = matches[1].trim();\n\t\t\tif (identifier) {\n\t\t\t\tidentifiers.push(identifier);\n\t\t\t}\n\t\t\tmatches = OVERRIDE_IDENTIFIER_REGEX.exec(key);\n\t\t}\n\t}\n\treturn distinct(identifiers);\n}\n\nexport function getDefaultValue(type: string | string[] | undefined) {\n\tconst t = Array.isArray(type) ? (<string[]>type)[0] : <string>type;\n\tswitch (t) {\n\t\tcase 'boolean':\n\t\t\treturn false;\n\t\tcase 'integer':\n\t\tcase 'number':\n\t\t\treturn 0;\n\t\tcase 'string':\n\t\t\treturn '';\n\t\tcase 'array':\n\t\t\treturn [];\n\t\tcase 'object':\n\t\t\treturn {};\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\nconst configurationRegistry = new ConfigurationRegistry();\nRegistry.add(Extensions.Configuration, configurationRegistry);\n\nexport function validateProperty(property: string, schema: IRegisteredConfigurationPropertySchema): string | null {\n\tif (!property.trim()) {\n\t\treturn nls.localize('config.property.empty', \"Cannot register an empty property\");\n\t}\n\tif (OVERRIDE_PROPERTY_REGEX.test(property)) {\n\t\treturn nls.localize('config.property.languageDefault', \"Cannot register '{0}'. This matches property pattern '\\\\\\\\[.*\\\\\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.\", property);\n\t}\n\tif (configurationRegistry.getConfigurationProperties()[property] !== undefined) {\n\t\treturn nls.localize('config.property.duplicate', \"Cannot register '{0}'. This property is already registered.\", property);\n\t}\n\tif (schema.policy?.name && configurationRegistry.getPolicyConfigurations().get(schema.policy?.name) !== undefined) {\n\t\treturn nls.localize('config.policy.duplicate', \"Cannot register '{0}'. The associated policy {1} is already registered with {2}.\", property, schema.policy?.name, configurationRegistry.getPolicyConfigurations().get(schema.policy?.name));\n\t}\n\treturn null;\n}\n"]}
1
+ {"version":3,"sources":["vs/platform/configuration/common/configurationRegistry.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AACvD,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,UAAU,IAAI,cAAc,EAA6B,MAAM,sDAA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,IAAI,IAAI,qBAAqB,CAAC,uBAAuB,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACnH,OAAO,GAAG,CAAC,QAAQ,CAAC,IAAyB,EAAE,kFAAkF,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,qBAAqB,CAAC,uBAAuB,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IAC7O,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC","file":"configurationRegistry.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { distinct } from '../../../base/common/arrays.js';\nimport { IStringDictionary } from '../../../base/common/collections.js';\nimport { Emitter } from '../../../base/common/event.js';\nimport { IJSONSchema } from '../../../base/common/jsonSchema.js';\nimport * as types from '../../../base/common/types.js';\nimport * as nls from '../../../nls.js';\nimport { getLanguageTagSettingPlainKey } from './configuration.js';\nimport { Extensions as JSONExtensions, IJSONContributionRegistry } from '../../jsonschemas/common/jsonContributionRegistry.js';\nimport { Registry } from '../../registry/common/platform.js';\nimport { IPolicy, PolicyName } from '../../../base/common/policy.js';\nimport { Disposable } from '../../../base/common/lifecycle.js';\n\nexport const Extensions = {\n\tConfiguration: 'base.contributions.configuration'\n};\n\nexport interface IConfigurationRegistry {\n\n\t/**\n\t * Register a configuration to the registry.\n\t */\n\tregisterConfiguration(configuration: IConfigurationNode): IConfigurationNode;\n\n\t/**\n\t * Register multiple default configurations to the registry.\n\t */\n\tregisterDefaultConfigurations(defaultConfigurations: IConfigurationDefaults[]): void;\n\n\t/**\n\t * Returns all configurations settings of all configuration nodes contributed to this registry.\n\t */\n\tgetConfigurationProperties(): IStringDictionary<IRegisteredConfigurationPropertySchema>;\n\n\t/**\n\t * Returns all excluded configurations settings of all configuration nodes contributed to this registry.\n\t */\n\tgetExcludedConfigurationProperties(): IStringDictionary<IRegisteredConfigurationPropertySchema>;\n\n\t/**\n\t * Register the identifiers for editor configurations\n\t */\n\tregisterOverrideIdentifiers(identifiers: string[]): void;\n}\n\nexport const enum ConfigurationScope {\n\t/**\n\t * Application specific configuration, which can be configured only in default profile user settings.\n\t */\n\tAPPLICATION = 1,\n\t/**\n\t * Machine specific configuration, which can be configured only in local and remote user settings.\n\t */\n\tMACHINE,\n\t/**\n\t * An application machine specific configuration, which can be configured only in default profile user settings and remote user settings.\n\t */\n\tAPPLICATION_MACHINE,\n\t/**\n\t * Window specific configuration, which can be configured in the user or workspace settings.\n\t */\n\tWINDOW,\n\t/**\n\t * Resource specific configuration, which can be configured in the user, workspace or folder settings.\n\t */\n\tRESOURCE,\n\t/**\n\t * Resource specific configuration that can be configured in language specific settings\n\t */\n\tLANGUAGE_OVERRIDABLE,\n\t/**\n\t * Machine specific configuration that can also be configured in workspace or folder settings.\n\t */\n\tMACHINE_OVERRIDABLE,\n}\n\n\nexport interface IConfigurationPropertySchema extends IJSONSchema {\n\n\tscope?: ConfigurationScope;\n\n\t/**\n\t * When restricted, value of this configuration will be read only from trusted sources.\n\t * For eg., If the workspace is not trusted, then the value of this configuration is not read from workspace settings file.\n\t */\n\trestricted?: boolean;\n\n\t/**\n\t * When `false` this property is excluded from the registry. Default is to include.\n\t */\n\tincluded?: boolean;\n\n\t/**\n\t * List of tags associated to the property.\n\t * - A tag can be used for filtering\n\t * - Use `experimental` tag for marking the setting as experimental.\n\t */\n\ttags?: string[];\n\n\t/**\n\t * Disallow extensions to contribute configuration default value for this setting.\n\t */\n\tdisallowConfigurationDefault?: boolean;\n\n\t/**\n\t * When specified, this setting's value can always be overwritten by\n\t * a system-wide policy.\n\t */\n\tpolicy?: IPolicy;\n\n\t/**\n\t * When specified, this setting's default value can always be overwritten by\n\t * an experiment.\n\t */\n\texperiment?: {\n\t\t/**\n\t\t * The mode of the experiment.\n\t\t * - `startup`: The setting value is updated to the experiment value only on startup.\n\t\t * - `auto`: The setting value is updated to the experiment value automatically (whenever the experiment value changes).\n\t\t */\n\t\tmode: 'startup' | 'auto';\n\n\t\t/**\n\t\t * The name of the experiment. By default, this is `config.${settingId}`\n\t\t */\n\t\tname?: string;\n\t};\n}\n\nexport interface IExtensionInfo {\n}\n\nexport interface IConfigurationNode {\n\tid?: string;\n\torder?: number;\n\ttype?: string | string[];\n\ttitle?: string;\n\tproperties?: IStringDictionary<IConfigurationPropertySchema>;\n\tallOf?: IConfigurationNode[];\n\tscope?: ConfigurationScope;\n\textensionInfo?: IExtensionInfo;\n\trestrictedProperties?: string[];\n}\n\nexport type ConfigurationDefaultValueSource = IExtensionInfo | Map<string, IExtensionInfo>;\n\nexport interface IConfigurationDefaults {\n\toverrides: IStringDictionary<any>;\n\tsource?: IExtensionInfo;\n}\n\nexport type IRegisteredConfigurationPropertySchema = IConfigurationPropertySchema & {\n\tsection?: {\n\t\tid?: string;\n\t\ttitle?: string;\n\t\torder?: number;\n\t\textensionInfo?: IExtensionInfo;\n\t};\n\tdefaultDefaultValue?: any;\n\tsource?: IExtensionInfo; // Source of the Property\n\tdefaultValueSource?: ConfigurationDefaultValueSource; // Source of the Default Value\n};\n\nexport interface IConfigurationDefaultOverride {\n\treadonly value: any;\n\treadonly source?: IExtensionInfo; // Source of the default override\n}\n\nexport interface IConfigurationDefaultOverrideValue {\n\treadonly value: any;\n\treadonly source?: ConfigurationDefaultValueSource;\n}\n\nexport const allSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const applicationSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const applicationMachineSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const machineSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const machineOverridableSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const windowSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\nexport const resourceSettings: { properties: IStringDictionary<IConfigurationPropertySchema>; patternProperties: IStringDictionary<IConfigurationPropertySchema> } = { properties: {}, patternProperties: {} };\n\nexport const resourceLanguageSettingsSchemaId = 'vscode://schemas/settings/resourceLanguage';\n\nconst contributionRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);\n\nclass ConfigurationRegistry extends Disposable implements IConfigurationRegistry {\n\n\tprivate readonly registeredConfigurationDefaults: IConfigurationDefaults[] = [];\n\tprivate readonly configurationDefaultsOverrides: Map<string, { configurationDefaultOverrides: IConfigurationDefaultOverride[]; configurationDefaultOverrideValue?: IConfigurationDefaultOverrideValue }>;\n\tprivate readonly defaultLanguageConfigurationOverridesNode: IConfigurationNode;\n\tprivate readonly configurationContributors: IConfigurationNode[];\n\tprivate readonly configurationProperties: IStringDictionary<IRegisteredConfigurationPropertySchema>;\n\tprivate readonly policyConfigurations: Map<PolicyName, string>;\n\tprivate readonly excludedConfigurationProperties: IStringDictionary<IRegisteredConfigurationPropertySchema>;\n\tprivate readonly resourceLanguageSettingsSchema: IJSONSchema;\n\tprivate readonly overrideIdentifiers = new Set<string>();\n\n\tprivate readonly _onDidSchemaChange = this._register(new Emitter<void>());\n\n\tprivate readonly _onDidUpdateConfiguration = this._register(new Emitter<{ properties: ReadonlySet<string>; defaultsOverrides?: boolean }>());\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.configurationDefaultsOverrides = new Map();\n\t\tthis.defaultLanguageConfigurationOverridesNode = {\n\t\t\tid: 'defaultOverrides',\n\t\t\ttitle: nls.localize('defaultLanguageConfigurationOverrides.title', \"Default Language Configuration Overrides\"),\n\t\t\tproperties: {}\n\t\t};\n\t\tthis.configurationContributors = [this.defaultLanguageConfigurationOverridesNode];\n\t\tthis.resourceLanguageSettingsSchema = {\n\t\t\tproperties: {},\n\t\t\tpatternProperties: {},\n\t\t\tadditionalProperties: true,\n\t\t\tallowTrailingCommas: true,\n\t\t\tallowComments: true\n\t\t};\n\t\tthis.configurationProperties = {};\n\t\tthis.policyConfigurations = new Map<PolicyName, string>();\n\t\tthis.excludedConfigurationProperties = {};\n\n\t\tcontributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema);\n\t\tthis.registerOverridePropertyPatternKey();\n\t}\n\n\tpublic registerConfiguration(configuration: IConfigurationNode, validate: boolean = true): IConfigurationNode {\n\t\tthis.registerConfigurations([configuration], validate);\n\t\treturn configuration;\n\t}\n\n\tpublic registerConfigurations(configurations: IConfigurationNode[], validate: boolean = true): void {\n\t\tconst properties = new Set<string>();\n\t\tthis.doRegisterConfigurations(configurations, validate, properties);\n\n\t\tcontributionRegistry.registerSchema(resourceLanguageSettingsSchemaId, this.resourceLanguageSettingsSchema);\n\t\tthis._onDidSchemaChange.fire();\n\t\tthis._onDidUpdateConfiguration.fire({ properties });\n\t}\n\n\tpublic registerDefaultConfigurations(configurationDefaults: IConfigurationDefaults[]): void {\n\t\tconst properties = new Set<string>();\n\t\tthis.doRegisterDefaultConfigurations(configurationDefaults, properties);\n\t\tthis._onDidSchemaChange.fire();\n\t\tthis._onDidUpdateConfiguration.fire({ properties, defaultsOverrides: true });\n\t}\n\n\tprivate doRegisterDefaultConfigurations(configurationDefaults: IConfigurationDefaults[], bucket: Set<string>) {\n\n\t\tthis.registeredConfigurationDefaults.push(...configurationDefaults);\n\n\t\tconst overrideIdentifiers: string[] = [];\n\n\t\tfor (const { overrides, source } of configurationDefaults) {\n\t\t\tfor (const key in overrides) {\n\t\t\t\tbucket.add(key);\n\n\t\t\t\tconst configurationDefaultOverridesForKey = this.configurationDefaultsOverrides.get(key)\n\t\t\t\t\t?? this.configurationDefaultsOverrides.set(key, { configurationDefaultOverrides: [] }).get(key)!;\n\n\t\t\t\tconst value = overrides[key];\n\t\t\t\tconfigurationDefaultOverridesForKey.configurationDefaultOverrides.push({ value, source });\n\n\t\t\t\t// Configuration defaults for Override Identifiers\n\t\t\t\tif (OVERRIDE_PROPERTY_REGEX.test(key)) {\n\t\t\t\t\tconst newDefaultOverride = this.mergeDefaultConfigurationsForOverrideIdentifier(key, value, source, configurationDefaultOverridesForKey.configurationDefaultOverrideValue);\n\t\t\t\t\tif (!newDefaultOverride) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconfigurationDefaultOverridesForKey.configurationDefaultOverrideValue = newDefaultOverride;\n\t\t\t\t\tthis.updateDefaultOverrideProperty(key, newDefaultOverride, source);\n\t\t\t\t\toverrideIdentifiers.push(...overrideIdentifiersFromKey(key));\n\t\t\t\t}\n\n\t\t\t\t// Configuration defaults for Configuration Properties\n\t\t\t\telse {\n\t\t\t\t\tconst newDefaultOverride = this.mergeDefaultConfigurationsForConfigurationProperty(key, value, source, configurationDefaultOverridesForKey.configurationDefaultOverrideValue);\n\t\t\t\t\tif (!newDefaultOverride) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconfigurationDefaultOverridesForKey.configurationDefaultOverrideValue = newDefaultOverride;\n\t\t\t\t\tconst property = this.configurationProperties[key];\n\t\t\t\t\tif (property) {\n\t\t\t\t\t\tthis.updatePropertyDefaultValue(key, property);\n\t\t\t\t\t\tthis.updateSchema(key, property);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tthis.doRegisterOverrideIdentifiers(overrideIdentifiers);\n\t}\n\n\tprivate updateDefaultOverrideProperty(key: string, newDefaultOverride: IConfigurationDefaultOverrideValue, source: IExtensionInfo | undefined): void {\n\t\tconst property: IRegisteredConfigurationPropertySchema = {\n\t\t\tsection: {\n\t\t\t\tid: this.defaultLanguageConfigurationOverridesNode.id,\n\t\t\t\ttitle: this.defaultLanguageConfigurationOverridesNode.title,\n\t\t\t\torder: this.defaultLanguageConfigurationOverridesNode.order,\n\t\t\t\textensionInfo: this.defaultLanguageConfigurationOverridesNode.extensionInfo\n\t\t\t},\n\t\t\ttype: 'object',\n\t\t\tdefault: newDefaultOverride.value,\n\t\t\tdescription: nls.localize('defaultLanguageConfiguration.description', \"Configure settings to be overridden for {0}.\", getLanguageTagSettingPlainKey(key)),\n\t\t\t$ref: resourceLanguageSettingsSchemaId,\n\t\t\tdefaultDefaultValue: newDefaultOverride.value,\n\t\t\tsource,\n\t\t\tdefaultValueSource: source\n\t\t};\n\t\tthis.configurationProperties[key] = property;\n\t\tthis.defaultLanguageConfigurationOverridesNode.properties![key] = property;\n\t}\n\n\tprivate mergeDefaultConfigurationsForOverrideIdentifier(overrideIdentifier: string, configurationValueObject: IStringDictionary<any>, valueSource: IExtensionInfo | undefined, existingDefaultOverride: IConfigurationDefaultOverrideValue | undefined): IConfigurationDefaultOverrideValue | undefined {\n\t\tconst defaultValue = existingDefaultOverride?.value || {};\n\t\tconst source = existingDefaultOverride?.source ?? new Map<string, IExtensionInfo>();\n\n\t\t// This should not happen\n\t\tif (!(source instanceof Map)) {\n\t\t\tconsole.error('objectConfigurationSources is not a Map');\n\t\t\treturn undefined;\n\t\t}\n\n\t\tfor (const propertyKey of Object.keys(configurationValueObject)) {\n\t\t\tconst propertyDefaultValue = configurationValueObject[propertyKey];\n\n\t\t\tconst isObjectSetting = types.isObject(propertyDefaultValue) &&\n\t\t\t\t(types.isUndefined(defaultValue[propertyKey]) || types.isObject(defaultValue[propertyKey]));\n\n\t\t\t// If the default value is an object, merge the objects and store the source of each keys\n\t\t\tif (isObjectSetting) {\n\t\t\t\tdefaultValue[propertyKey] = { ...(defaultValue[propertyKey] ?? {}), ...propertyDefaultValue };\n\t\t\t\t// Track the source of each value in the object\n\t\t\t\tif (valueSource) {\n\t\t\t\t\tfor (const objectKey in propertyDefaultValue) {\n\t\t\t\t\t\tsource.set(`${propertyKey}.${objectKey}`, valueSource);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Primitive values are overridden\n\t\t\telse {\n\t\t\t\tdefaultValue[propertyKey] = propertyDefaultValue;\n\t\t\t\tif (valueSource) {\n\t\t\t\t\tsource.set(propertyKey, valueSource);\n\t\t\t\t} else {\n\t\t\t\t\tsource.delete(propertyKey);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { value: defaultValue, source };\n\t}\n\n\tprivate mergeDefaultConfigurationsForConfigurationProperty(propertyKey: string, value: any, valuesSource: IExtensionInfo | undefined, existingDefaultOverride: IConfigurationDefaultOverrideValue | undefined): IConfigurationDefaultOverrideValue | undefined {\n\t\tconst property = this.configurationProperties[propertyKey];\n\t\tconst existingDefaultValue = existingDefaultOverride?.value ?? property?.defaultDefaultValue;\n\t\tlet source: ConfigurationDefaultValueSource | undefined = valuesSource;\n\n\t\tconst isObjectSetting = types.isObject(value) &&\n\t\t\t(\n\t\t\t\tproperty !== undefined && property.type === 'object' ||\n\t\t\t\tproperty === undefined && (types.isUndefined(existingDefaultValue) || types.isObject(existingDefaultValue))\n\t\t\t);\n\n\t\t// If the default value is an object, merge the objects and store the source of each keys\n\t\tif (isObjectSetting) {\n\t\t\tsource = existingDefaultOverride?.source ?? new Map<string, IExtensionInfo>();\n\n\t\t\t// This should not happen\n\t\t\tif (!(source instanceof Map)) {\n\t\t\t\tconsole.error('defaultValueSource is not a Map');\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tfor (const objectKey in value) {\n\t\t\t\tif (valuesSource) {\n\t\t\t\t\tsource.set(`${propertyKey}.${objectKey}`, valuesSource);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalue = { ...(types.isObject(existingDefaultValue) ? existingDefaultValue : {}), ...value };\n\t\t}\n\n\t\treturn { value, source };\n\t}\n\n\tpublic registerOverrideIdentifiers(overrideIdentifiers: string[]): void {\n\t\tthis.doRegisterOverrideIdentifiers(overrideIdentifiers);\n\t\tthis._onDidSchemaChange.fire();\n\t}\n\n\tprivate doRegisterOverrideIdentifiers(overrideIdentifiers: string[]) {\n\t\tfor (const overrideIdentifier of overrideIdentifiers) {\n\t\t\tthis.overrideIdentifiers.add(overrideIdentifier);\n\t\t}\n\t\tthis.updateOverridePropertyPatternKey();\n\t}\n\n\tprivate doRegisterConfigurations(configurations: IConfigurationNode[], validate: boolean, bucket: Set<string>): void {\n\n\t\tconfigurations.forEach(configuration => {\n\n\t\t\tthis.validateAndRegisterProperties(configuration, validate, configuration.extensionInfo, configuration.restrictedProperties, undefined, bucket);\n\n\t\t\tthis.configurationContributors.push(configuration);\n\t\t\tthis.registerJSONConfiguration(configuration);\n\t\t});\n\t}\n\n\tprivate validateAndRegisterProperties(configuration: IConfigurationNode, validate: boolean = true, extensionInfo: IExtensionInfo | undefined, restrictedProperties: string[] | undefined, scope: ConfigurationScope = ConfigurationScope.WINDOW, bucket: Set<string>): void {\n\t\tscope = types.isUndefinedOrNull(configuration.scope) ? scope : configuration.scope;\n\t\tconst properties = configuration.properties;\n\t\tif (properties) {\n\t\t\tfor (const key in properties) {\n\t\t\t\tconst property: IRegisteredConfigurationPropertySchema = properties[key];\n\t\t\t\tproperty.section = {\n\t\t\t\t\tid: configuration.id,\n\t\t\t\t\ttitle: configuration.title,\n\t\t\t\t\torder: configuration.order,\n\t\t\t\t\textensionInfo: configuration.extensionInfo\n\t\t\t\t};\n\t\t\t\tif (validate && validateProperty(key, property)) {\n\t\t\t\t\tdelete properties[key];\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tproperty.source = extensionInfo;\n\n\t\t\t\t// update default value\n\t\t\t\tproperty.defaultDefaultValue = properties[key].default;\n\t\t\t\tthis.updatePropertyDefaultValue(key, property);\n\n\t\t\t\t// update scope\n\t\t\t\tif (OVERRIDE_PROPERTY_REGEX.test(key)) {\n\t\t\t\t\tproperty.scope = undefined; // No scope for overridable properties `[${identifier}]`\n\t\t\t\t} else {\n\t\t\t\t\tproperty.scope = types.isUndefinedOrNull(property.scope) ? scope : property.scope;\n\t\t\t\t\tproperty.restricted = types.isUndefinedOrNull(property.restricted) ? !!restrictedProperties?.includes(key) : property.restricted;\n\t\t\t\t}\n\n\t\t\t\tif (property.experiment) {\n\t\t\t\t\tif (!property.tags?.some(tag => tag.toLowerCase() === 'onexp')) {\n\t\t\t\t\t\tproperty.tags = property.tags ?? [];\n\t\t\t\t\t\tproperty.tags.push('onExP');\n\t\t\t\t\t}\n\t\t\t\t} else if (property.tags?.some(tag => tag.toLowerCase() === 'onexp')) {\n\t\t\t\t\tconsole.error(`Invalid tag 'onExP' found for property '${key}'. Please use 'experiment' property instead.`);\n\t\t\t\t\tproperty.experiment = { mode: 'startup' };\n\t\t\t\t}\n\n\t\t\t\tconst excluded = properties[key].hasOwnProperty('included') && !properties[key].included;\n\t\t\t\tconst policyName = properties[key].policy?.name;\n\n\t\t\t\tif (excluded) {\n\t\t\t\t\tthis.excludedConfigurationProperties[key] = properties[key];\n\t\t\t\t\tif (policyName) {\n\t\t\t\t\t\tthis.policyConfigurations.set(policyName, key);\n\t\t\t\t\t\tbucket.add(key);\n\t\t\t\t\t}\n\t\t\t\t\tdelete properties[key];\n\t\t\t\t} else {\n\t\t\t\t\tbucket.add(key);\n\t\t\t\t\tif (policyName) {\n\t\t\t\t\t\tthis.policyConfigurations.set(policyName, key);\n\t\t\t\t\t}\n\t\t\t\t\tthis.configurationProperties[key] = properties[key];\n\t\t\t\t\tif (!properties[key].deprecationMessage && properties[key].markdownDeprecationMessage) {\n\t\t\t\t\t\t// If not set, default deprecationMessage to the markdown source\n\t\t\t\t\t\tproperties[key].deprecationMessage = properties[key].markdownDeprecationMessage;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t}\n\t\t}\n\t\tconst subNodes = configuration.allOf;\n\t\tif (subNodes) {\n\t\t\tfor (const node of subNodes) {\n\t\t\t\tthis.validateAndRegisterProperties(node, validate, extensionInfo, restrictedProperties, scope, bucket);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetConfigurationProperties(): IStringDictionary<IRegisteredConfigurationPropertySchema> {\n\t\treturn this.configurationProperties;\n\t}\n\n\tgetPolicyConfigurations(): Map<PolicyName, string> {\n\t\treturn this.policyConfigurations;\n\t}\n\n\tgetExcludedConfigurationProperties(): IStringDictionary<IRegisteredConfigurationPropertySchema> {\n\t\treturn this.excludedConfigurationProperties;\n\t}\n\n\tprivate registerJSONConfiguration(configuration: IConfigurationNode) {\n\t\tconst register = (configuration: IConfigurationNode) => {\n\t\t\tconst properties = configuration.properties;\n\t\t\tif (properties) {\n\t\t\t\tfor (const key in properties) {\n\t\t\t\t\tthis.updateSchema(key, properties[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst subNodes = configuration.allOf;\n\t\t\tsubNodes?.forEach(register);\n\t\t};\n\t\tregister(configuration);\n\t}\n\n\tprivate updateSchema(key: string, property: IConfigurationPropertySchema): void {\n\t\tallSettings.properties[key] = property;\n\t\tswitch (property.scope) {\n\t\t\tcase ConfigurationScope.APPLICATION:\n\t\t\t\tapplicationSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.MACHINE:\n\t\t\t\tmachineSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.APPLICATION_MACHINE:\n\t\t\t\tapplicationMachineSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.MACHINE_OVERRIDABLE:\n\t\t\t\tmachineOverridableSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.WINDOW:\n\t\t\t\twindowSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.RESOURCE:\n\t\t\t\tresourceSettings.properties[key] = property;\n\t\t\t\tbreak;\n\t\t\tcase ConfigurationScope.LANGUAGE_OVERRIDABLE:\n\t\t\t\tresourceSettings.properties[key] = property;\n\t\t\t\tthis.resourceLanguageSettingsSchema.properties![key] = property;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tprivate updateOverridePropertyPatternKey(): void {\n\t\tfor (const overrideIdentifier of this.overrideIdentifiers.values()) {\n\t\t\tconst overrideIdentifierProperty = `[${overrideIdentifier}]`;\n\t\t\tconst resourceLanguagePropertiesSchema: IJSONSchema = {\n\t\t\t\ttype: 'object',\n\t\t\t\tdescription: nls.localize('overrideSettings.defaultDescription', \"Configure editor settings to be overridden for a language.\"),\n\t\t\t\terrorMessage: nls.localize('overrideSettings.errorMessage', \"This setting does not support per-language configuration.\"),\n\t\t\t\t$ref: resourceLanguageSettingsSchemaId,\n\t\t\t};\n\t\t\tthis.updatePropertyDefaultValue(overrideIdentifierProperty, resourceLanguagePropertiesSchema);\n\t\t\tallSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\tapplicationSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\tapplicationMachineSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\tmachineSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\tmachineOverridableSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\twindowSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t\tresourceSettings.properties[overrideIdentifierProperty] = resourceLanguagePropertiesSchema;\n\t\t}\n\t}\n\n\tprivate registerOverridePropertyPatternKey(): void {\n\t\tconst resourceLanguagePropertiesSchema: IJSONSchema = {\n\t\t\ttype: 'object',\n\t\t\tdescription: nls.localize('overrideSettings.defaultDescription', \"Configure editor settings to be overridden for a language.\"),\n\t\t\terrorMessage: nls.localize('overrideSettings.errorMessage', \"This setting does not support per-language configuration.\"),\n\t\t\t$ref: resourceLanguageSettingsSchemaId,\n\t\t};\n\t\tallSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tapplicationSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tapplicationMachineSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tmachineSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tmachineOverridableSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\twindowSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tresourceSettings.patternProperties[OVERRIDE_PROPERTY_PATTERN] = resourceLanguagePropertiesSchema;\n\t\tthis._onDidSchemaChange.fire();\n\t}\n\n\tprivate updatePropertyDefaultValue(key: string, property: IRegisteredConfigurationPropertySchema): void {\n\t\tconst configurationdefaultOverride = this.configurationDefaultsOverrides.get(key)?.configurationDefaultOverrideValue;\n\t\tlet defaultValue = undefined;\n\t\tlet defaultSource = undefined;\n\t\tif (configurationdefaultOverride\n\t\t\t&& (!property.disallowConfigurationDefault || !configurationdefaultOverride.source) // Prevent overriding the default value if the property is disallowed to be overridden by configuration defaults from extensions\n\t\t) {\n\t\t\tdefaultValue = configurationdefaultOverride.value;\n\t\t\tdefaultSource = configurationdefaultOverride.source;\n\t\t}\n\t\tif (types.isUndefined(defaultValue)) {\n\t\t\tdefaultValue = property.defaultDefaultValue;\n\t\t\tdefaultSource = undefined;\n\t\t}\n\t\tif (types.isUndefined(defaultValue)) {\n\t\t\tdefaultValue = getDefaultValue(property.type);\n\t\t}\n\t\tproperty.default = defaultValue;\n\t\tproperty.defaultValueSource = defaultSource;\n\t}\n}\n\nconst OVERRIDE_IDENTIFIER_PATTERN = `\\\\[([^\\\\]]+)\\\\]`;\nconst OVERRIDE_IDENTIFIER_REGEX = new RegExp(OVERRIDE_IDENTIFIER_PATTERN, 'g');\nexport const OVERRIDE_PROPERTY_PATTERN = `^(${OVERRIDE_IDENTIFIER_PATTERN})+$`;\nexport const OVERRIDE_PROPERTY_REGEX = new RegExp(OVERRIDE_PROPERTY_PATTERN);\n\nexport function overrideIdentifiersFromKey(key: string): string[] {\n\tconst identifiers: string[] = [];\n\tif (OVERRIDE_PROPERTY_REGEX.test(key)) {\n\t\tlet matches = OVERRIDE_IDENTIFIER_REGEX.exec(key);\n\t\twhile (matches?.length) {\n\t\t\tconst identifier = matches[1].trim();\n\t\t\tif (identifier) {\n\t\t\t\tidentifiers.push(identifier);\n\t\t\t}\n\t\t\tmatches = OVERRIDE_IDENTIFIER_REGEX.exec(key);\n\t\t}\n\t}\n\treturn distinct(identifiers);\n}\n\nexport function getDefaultValue(type: string | string[] | undefined) {\n\tconst t = Array.isArray(type) ? type[0] : <string>type;\n\tswitch (t) {\n\t\tcase 'boolean':\n\t\t\treturn false;\n\t\tcase 'integer':\n\t\tcase 'number':\n\t\t\treturn 0;\n\t\tcase 'string':\n\t\t\treturn '';\n\t\tcase 'array':\n\t\t\treturn [];\n\t\tcase 'object':\n\t\t\treturn {};\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\nconst configurationRegistry = new ConfigurationRegistry();\nRegistry.add(Extensions.Configuration, configurationRegistry);\n\nexport function validateProperty(property: string, schema: IRegisteredConfigurationPropertySchema): string | null {\n\tif (!property.trim()) {\n\t\treturn nls.localize('config.property.empty', \"Cannot register an empty property\");\n\t}\n\tif (OVERRIDE_PROPERTY_REGEX.test(property)) {\n\t\treturn nls.localize('config.property.languageDefault', \"Cannot register '{0}'. This matches property pattern '\\\\\\\\[.*\\\\\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.\", property);\n\t}\n\tif (configurationRegistry.getConfigurationProperties()[property] !== undefined) {\n\t\treturn nls.localize('config.property.duplicate', \"Cannot register '{0}'. This property is already registered.\", property);\n\t}\n\tif (schema.policy?.name && configurationRegistry.getPolicyConfigurations().get(schema.policy?.name) !== undefined) {\n\t\treturn nls.localize('config.policy.duplicate', \"Cannot register '{0}'. The associated policy {1} is already registered with {2}.\", property, schema.policy?.name, configurationRegistry.getPolicyConfigurations().get(schema.policy?.name));\n\t}\n\treturn null;\n}\n"]}
@@ -842,7 +842,6 @@ export class ContextKeyGreaterExpr {
842
842
  if (typeof this.value === 'string') {
843
843
  return false;
844
844
  }
845
- // eslint-disable-next-line local/code-no-any-casts
846
845
  return (parseFloat(context.getValue(this.key)) > this.value);
847
846
  }
848
847
  serialize() {
@@ -887,7 +886,6 @@ export class ContextKeyGreaterEqualsExpr {
887
886
  if (typeof this.value === 'string') {
888
887
  return false;
889
888
  }
890
- // eslint-disable-next-line local/code-no-any-casts
891
889
  return (parseFloat(context.getValue(this.key)) >= this.value);
892
890
  }
893
891
  serialize() {
@@ -932,7 +930,6 @@ export class ContextKeySmallerExpr {
932
930
  if (typeof this.value === 'string') {
933
931
  return false;
934
932
  }
935
- // eslint-disable-next-line local/code-no-any-casts
936
933
  return (parseFloat(context.getValue(this.key)) < this.value);
937
934
  }
938
935
  serialize() {
@@ -977,7 +974,6 @@ export class ContextKeySmallerEqualsExpr {
977
974
  if (typeof this.value === 'string') {
978
975
  return false;
979
976
  }
980
- // eslint-disable-next-line local/code-no-any-casts
981
977
  return (parseFloat(context.getValue(this.key)) <= this.value);
982
978
  }
983
979
  serialize() {