diff --git a/ADOPTING.md b/ADOPTING.md new file mode 100644 index 0000000000000..32ec973c4c8ed --- /dev/null +++ b/ADOPTING.md @@ -0,0 +1,83 @@ +## Browser-Only + +### Static Extension Support + +Currently, Theia Browser-Only supports the static configuration of extensions. This means only the extensions that are statically configured at build time will be available in the browser. Theia Browser-Only does not support dynamic extension loading at runtime. + +When it comes to extension support, there are some restrictions to consider: +1. The extensions must be compatible to run in a browser environment. This means that ideally, the extension is already a web extension according to the [VS Code Web Extension API](https://code.visualstudio.com/api/extension-guides/web-extensions). +2. The extensions must not rely on Node.js APIs or other APIs that are not available in the browser. + +There are two ways to retrieve extensions: +1. VSIX packages: Copy the `.vsix` files to the directory specified in the `package.json` file by the `theiaPluginsDir` property. (e.g. `"theiaPluginsDir": "plugins"`) +2. Open VSX Link: Specify a list of `id:link` mappings in the `package.json` file by the `theiaPlugins` property (e.g. `"theiaPlugins": { "vscodevim.vim": "https://open-vsx.org/api/vscodevim/vim/1.29.0/file/vscodevim.vim-1.29.0.vsix" }`). Extensions can be found on the [Open VSX Registry](https://open-vsx.org/) by searching for the extension and copying the link linked to the Download button. +When using the Theia CLI command `theia download:plugins`, the Theia CLI will download the `.vsix` files from the specified links and install them in the directory specified by the `theiaPluginsDir` property. + +After the extensions are downloaded, they need to be unpacked and placed in the **`lib/frontend/hostedPlugin`** directory so that they can be used by Theia Browser-Only. + +To achieve this, the `.vsix` files must be extracted, and their contents copied into the correct directory structure. This process involves: +1. Unpacking the `.vsix` files. +2. Copying the extracted contents into the **`lib/frontend/hostedPlugin`** directory. Make sure to copy the `extension` folder from the VSIX file and name it according to the extension's id (typically the publisher name and the extension name separated by a dot). + +This process can be automated using a script. For an example implementation, you can refer to the [prepare-plugins.js script](examples/browser-only/prepare-plugins.js), which demonstrates how to extract and place the `.vsix` files in the appropriate location. + +As Theia need to know which extensions are available, the `pluginMetadata` inside the `PluginLocalOptions` needs to be updated with the metadata of the extensions. This can be achieved by specifying the metadata and binding it to `PluginLocalOptions` (see this [example initialization](examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts)). + +As of now, the metadata is required to be specified manually. In the future, it is planned to automate this process. +An example of the format of meta can be found [here](examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts). In the following section we will give tips on how to generate this metadata such that it adheres to the `DeployedPlugin` interface (see [`plugin-protocol.ts`](packages/plugin-ext/src/common/plugin-protocol.ts)). + +#### Creating the static metadata +Most of the information to create the model in metadata can be found in the `package.json` file of the extension. + +The general structure of each entry should be as follows: +```typescript +{ + "metadata": { + ... + }, + "type": 0, // should always be set to 0 + "contributes": { + ... + }, + }, +``` + +The `metadata` object should contain the following fields: +```typescript +metadata: { + 'host': 'main', // Should always be set to 'main' + 'model': { + 'packagePath': '/home/user/theia/examples/browser-only/plugins/theia.helloworld-web-sample/extension', // Deprecated + 'packageUri': 'file:///home/user/theia/examples/browser-only/plugins/theia.helloworld-web-sample/extension', // The absolute path to the extension's location inside the 'theiaPluginsDir' directory; prefixed with 'file://' protocol + 'id': 'theia.helloworld-web-sample', // the extension's id; typically the publisher name and the extension name separated by a dot + 'name': 'helloworld-web-sample', // the extension's name as specified in the 'package.json' file + 'publisher': 'theia', // the extension's publisher as specified in the 'package.json' file + 'version': '0.0.1', // the extension's version as specified in the 'package.json' file + 'displayName': 'theia.helloworld-web-sample', // the extension's display name as specified in the 'package.json' file + 'description': '', // the extension's description as specified in the 'package.json' file + 'engine': { + 'type': 'vscode', // incase of vscode web extension; if Theia plugin, set to 'theiaPlugin' + 'version': '^1.74.0' // the version of the engine the extension is compatible with; specified in the 'engines' field of the 'package.json' file + }, + 'entryPoint': { + 'frontend': 'dist/web/extension.js' // specified by the 'browser' field in the 'package.json' file for VScode web extensions or 'frontend' field for Theia plugins + } + iconUrl: 'hostedPlugin/theia_helloworld_web_sample/media%2Ficon.png', // optional: the path to the extension's icon; prefixed with 'hostedPlugin' and URL encoded + l10n: undefined, + readmeUrl: 'hostedPlugin/theia_helloworld_web_sample/.%2FREADME.md', // optional: the path to the extension's README file; prefixed with 'hostedPlugin' and URL encoded + licenseUrl: 'hostedPlugin/theia_helloworld_web_sample/.%2FLICENSE', // optional: the path to the extension's LICENSE file; prefixed with 'hostedPlugin' and URL encoded + }, + 'lifecycle': { + 'startMethod': 'activate', // the method to call when the extension is activated; typically 'activate' for VS Code extensions and 'start' for Theia plugins + 'stopMethod': 'deactivate', // the method to call when the extension is deactivated; typically 'deactivate' for VS Code extensions and 'stop' for Theia plugins + 'frontendModuleName': 'theia_helloworld_web_sample', // the id specified above but with underscores instead of dots and dashes similar to iconUrl, readmeUrl, and licenseUrl + 'frontendInitPath': 'plugin-vscode-init-fe.js', // the path to the frontend initialization script; only required for VS Code extensions + }, + 'outOfSync': false, // should always be set to false + 'isUnderDevelopment': false // should always be set to false +}, +``` + +For the `contributes` object, one can copy the `contributes` object from the `package.json` file of the extension. This object contains the contributions the extension makes to the Theia application. This includes 'activationEvents', 'commands', 'configuration', 'debuggers' etc. Details on the structure of the `contributes` object can be found in the [plugin-protocol file under PluginContribution](packages/plugin-ext/src/common/plugin-protocol.ts). + +Once this static metadata is complete, one can build and start the Theia Browser-Only application. The extensions should now be available in the browser. To verify that the extensions are correctly packaged with the Theia Browser-Only application, one can check the `lib/frontend/hostedPlugin` directory. The extensions should be present in this directory with the correct `frontendModuleName`. diff --git a/examples/api-samples/.eslintrc.js b/examples/api-samples/.eslintrc.js index 13089943582b6..8e04303b17de1 100644 --- a/examples/api-samples/.eslintrc.js +++ b/examples/api-samples/.eslintrc.js @@ -3,6 +3,9 @@ module.exports = { extends: [ '../../configs/build.eslintrc.json' ], + ignorePatterns: [ + "./src/browser-only/plugin-sample/example-static-plugin-metadata.ts" // Ignoring this file as it only contains static metadata + ], parserOptions: { tsconfigRootDir: __dirname, project: 'tsconfig.json' diff --git a/examples/api-samples/src/browser-only/api-samples-frontend-only-module.ts b/examples/api-samples/src/browser-only/api-samples-frontend-only-module.ts index 6de6d07280007..a7341f7bc2738 100644 --- a/examples/api-samples/src/browser-only/api-samples-frontend-only-module.ts +++ b/examples/api-samples/src/browser-only/api-samples-frontend-only-module.ts @@ -16,6 +16,7 @@ import { ContainerModule, interfaces } from '@theia/core/shared/inversify'; import { bindOPFSInitialization } from './filesystem/example-filesystem-initialization'; +import { bindPluginInitialization } from './plugin-sample/example-plugin-initialization'; export default new ContainerModule(( bind: interfaces.Bind, @@ -24,4 +25,5 @@ export default new ContainerModule(( rebind: interfaces.Rebind, ) => { bindOPFSInitialization(bind, rebind); + bindPluginInitialization(bind, rebind); }); diff --git a/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts b/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts new file mode 100644 index 0000000000000..7b67bd5b0fb8c --- /dev/null +++ b/examples/api-samples/src/browser-only/plugin-sample/example-plugin-initialization.ts @@ -0,0 +1,26 @@ +// ***************************************************************************** +// Copyright (C) 2023 EclipseSource and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// **************************************************************************** + +import { interfaces } from '@theia/core/shared/inversify'; +import { PluginLocalOptions } from '@theia/plugin-ext/lib/hosted/browser-only/frontend-hosted-plugin-server'; +import { staticMetadata } from './example-static-plugin-metadata'; + +export const bindPluginInitialization = (bind: interfaces.Bind, rebind: interfaces.Rebind): void => { + const pluginLocalOptions = { + pluginMetadata: staticMetadata, + }; + bind(PluginLocalOptions).toConstantValue(pluginLocalOptions); +}; diff --git a/examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts b/examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts new file mode 100644 index 0000000000000..62242fd4a227c --- /dev/null +++ b/examples/api-samples/src/browser-only/plugin-sample/example-static-plugin-metadata.ts @@ -0,0 +1,13797 @@ +// ***************************************************************************** +// Copyright (C) 2023 EclipseSource and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// **************************************************************************** + +export const staticMetadata: any[] = [ + { + metadata: { + host: 'main', + model: { + packagePath: '/home/user/theia/examples/browser-only/plugins/vscode.typescript-language-features/extension', + packageUri: 'file:///home/user/theia/examples/browser-only/plugins/vscode.typescript-language-features', + id: 'vscode.typescript-language-features', + name: 'typescript-language-features', + publisher: 'vscode', + version: '1.95.3', + displayName: 'TypeScript and JavaScript Language Features (built-in)', + description: 'Provides rich language support for JavaScript and TypeScript.', + engine: { + type: 'vscode', + version: '^1.30.0', + }, + entryPoint: { + frontend: './dist/browser/extension.js', + }, + iconUrl: 'hostedPlugin/vscode_typescript_language_features/media%2Ficon.png', + l10n: undefined, + readmeUrl: 'hostedPlugin/vscode_typescript_language_features/.%2FREADME.md', + licenseUrl: 'hostedPlugin/vscode_typescript_language_features/.%2FLICENSE', + }, + lifecycle: { + startMethod: 'activate', + stopMethod: 'deactivate', + frontendModuleName: 'vscode_typescript_language_features', + frontendInitPath: 'plugin-vscode-init-fe.js', + }, + outOfSync: false, + isUnderDevelopment: false, + }, + type: 0, + contributes: { + activationEvents: [ + 'onLanguage:javascript', + 'onLanguage:javascriptreact', + 'onLanguage:typescript', + 'onLanguage:typescriptreact', + 'onLanguage:jsx-tags', + 'onCommand:typescript.tsserverRequest', + 'onCommand:_typescript.configurePlugin', + 'onCommand:_typescript.learnMoreAboutRefactorings', + 'onCommand:typescript.fileReferences', + 'onTaskType:typescript', + 'onLanguage:jsonc', + 'onWalkthrough:nodejsWelcome', + 'onCommand:typescript.reloadProjects', + 'onCommand:javascript.reloadProjects', + 'onCommand:typescript.selectTypeScriptVersion', + 'onCommand:typescript.goToProjectConfig', + 'onCommand:javascript.goToProjectConfig', + 'onCommand:typescript.openTsServerLog', + 'onCommand:typescript.restartTsServer', + 'onCommand:typescript.findAllFileReferences', + 'onCommand:typescript.goToSourceDefinition', + 'onCommand:typescript.sortImports', + 'onCommand:javascript.sortImports', + 'onCommand:typescript.removeUnusedImports', + 'onCommand:javascript.removeUnusedImports', + ], + configuration: [ + { + type: 'object', + title: 'TypeScript', + order: 20, + properties: { + 'typescript.tsdk': { + type: 'string', + markdownDescription: 'Specifies the folder path to the tsserver and `lib*.d.ts` files under a TypeScript install to use for IntelliSense, for example: `./node_modules/typescript/lib`.\n\n- When specified as a user setting, the TypeScript version from `typescript.tsdk` automatically replaces the built-in TypeScript version.\n- When specified as a workspace setting, `typescript.tsdk` allows you to switch to use that workspace version of TypeScript for IntelliSense with the `TypeScript: Select TypeScript version` command.\n\nSee the [TypeScript documentation](https://code.visualstudio.com/docs/typescript/typescript-compiling#_using-newer-typescript-versions) for more detail about managing TypeScript versions.', + scope: 'window', + }, + 'typescript.disableAutomaticTypeAcquisition': { + type: 'boolean', + default: false, + markdownDescription: 'Disables [automatic type acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition). Automatic type acquisition fetches `@types` packages from npm to improve IntelliSense for external libraries.', + scope: 'window', + tags: [ + 'usesOnlineServices', + ], + }, + 'typescript.enablePromptUseWorkspaceTsdk': { + type: 'boolean', + default: false, + description: 'Enables prompting of users to use the TypeScript version configured in the workspace for Intellisense.', + scope: 'window', + }, + 'typescript.npm': { + type: 'string', + markdownDescription: 'Specifies the path to the npm executable used for [Automatic Type Acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition).', + scope: 'machine', + }, + 'typescript.check.npmIsInstalled': { + type: 'boolean', + default: true, + markdownDescription: 'Check if npm is installed for [Automatic Type Acquisition](https://code.visualstudio.com/docs/nodejs/working-with-javascript#_typings-and-automatic-type-acquisition).', + scope: 'window', + }, + 'javascript.referencesCodeLens.enabled': { + type: 'boolean', + default: false, + description: 'Enable/disable references CodeLens in JavaScript files.', + scope: 'window', + }, + 'javascript.referencesCodeLens.showOnAllFunctions': { + type: 'boolean', + default: false, + description: 'Enable/disable references CodeLens on all functions in JavaScript files.', + scope: 'window', + }, + 'typescript.referencesCodeLens.enabled': { + type: 'boolean', + default: false, + description: 'Enable/disable references CodeLens in TypeScript files.', + scope: 'window', + }, + 'typescript.referencesCodeLens.showOnAllFunctions': { + type: 'boolean', + default: false, + description: 'Enable/disable references CodeLens on all functions in TypeScript files.', + scope: 'window', + }, + 'typescript.implementationsCodeLens.enabled': { + type: 'boolean', + default: false, + description: 'Enable/disable implementations CodeLens. This CodeLens shows the implementers of an interface.', + scope: 'window', + }, + 'typescript.tsserver.enableTracing': { + type: 'boolean', + default: false, + description: 'Enables tracing TS server performance to a directory. These trace files can be used to diagnose TS Server performance issues. The log may contain file paths, source code, and other potentially sensitive information from your project.', + scope: 'window', + }, + 'typescript.tsserver.log': { + type: 'string', + enum: [ + 'off', + 'terse', + 'normal', + 'verbose', + ], + default: 'off', + description: 'Enables logging of the TS server to a file. This log can be used to diagnose TS Server issues. The log may contain file paths, source code, and other potentially sensitive information from your project.', + scope: 'window', + }, + 'typescript.tsserver.pluginPaths': { + type: 'array', + items: { + type: 'string', + description: 'Either an absolute or relative path. Relative path will be resolved against workspace folder(s).', + }, + default: [ + ], + description: 'Additional paths to discover TypeScript Language Service plugins.', + scope: 'machine', + }, + 'typescript.tsserver.trace': { + type: 'string', + enum: [ + 'off', + 'messages', + 'verbose', + ], + default: 'off', + description: 'Enables tracing of messages sent to the TS server. This trace can be used to diagnose TS Server issues. The trace may contain file paths, source code, and other potentially sensitive information from your project.', + scope: 'window', + }, + 'javascript.suggest.completeFunctionCalls': { + type: 'boolean', + default: false, + description: 'Complete functions with their parameter signature.', + scope: 'resource', + }, + 'typescript.suggest.completeFunctionCalls': { + type: 'boolean', + default: false, + description: 'Complete functions with their parameter signature.', + scope: 'resource', + }, + 'javascript.suggest.includeAutomaticOptionalChainCompletions': { + type: 'boolean', + default: true, + description: 'Enable/disable showing completions on potentially undefined values that insert an optional chain call. Requires strict null checks to be enabled.', + scope: 'resource', + }, + 'typescript.suggest.includeAutomaticOptionalChainCompletions': { + type: 'boolean', + default: true, + description: 'Enable/disable showing completions on potentially undefined values that insert an optional chain call. Requires strict null checks to be enabled.', + scope: 'resource', + }, + 'typescript.inlayHints.parameterNames.enabled': { + type: 'string', + enum: [ + 'none', + 'literals', + 'all', + ], + enumDescriptions: [ + 'Disable parameter name hints.', + 'Enable parameter name hints only for literal arguments.', + 'Enable parameter name hints for literal and non-literal arguments.', + ], + default: 'none', + markdownDescription: "Enable/disable inlay hints for parameter names:\n```typescript\n\nparseInt(/* str: */ '123', /* radix: */ 8)\n \n```", + scope: 'resource', + }, + 'typescript.inlayHints.parameterNames.suppressWhenArgumentMatchesName': { + type: 'boolean', + default: true, + markdownDescription: 'Suppress parameter name hints on arguments whose text is identical to the parameter name.', + scope: 'resource', + }, + 'typescript.inlayHints.parameterTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: "Enable/disable inlay hints for implicit parameter types:\n```typescript\n\nel.addEventListener('click', e /* :MouseEvent */ => ...)\n \n```", + scope: 'resource', + }, + 'typescript.inlayHints.variableTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit variable types:\n```typescript\n\nconst foo /* :number */ = Date.now();\n \n```', + scope: 'resource', + }, + 'typescript.inlayHints.variableTypes.suppressWhenTypeMatchesName': { + type: 'boolean', + default: true, + markdownDescription: 'Suppress type hints on variables whose name is identical to the type name. Requires using TypeScript 4.8+ in the workspace.', + scope: 'resource', + }, + 'typescript.inlayHints.propertyDeclarationTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit types on property declarations:\n```typescript\n\nclass Foo {\n\tprop /* :number */ = Date.now();\n}\n \n```', + scope: 'resource', + }, + 'typescript.inlayHints.functionLikeReturnTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit return types on function signatures:\n```typescript\n\nfunction foo() /* :number */ {\n\treturn Date.now();\n} \n \n```', + scope: 'resource', + }, + 'typescript.inlayHints.enumMemberValues.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for member values in enum declarations:\n```typescript\n\nenum MyValue {\n\tA /* = 0 */;\n\tB /* = 1 */;\n}\n \n```', + scope: 'resource', + }, + 'javascript.inlayHints.parameterNames.enabled': { + type: 'string', + enum: [ + 'none', + 'literals', + 'all', + ], + enumDescriptions: [ + 'Disable parameter name hints.', + 'Enable parameter name hints only for literal arguments.', + 'Enable parameter name hints for literal and non-literal arguments.', + ], + default: 'none', + markdownDescription: "Enable/disable inlay hints for parameter names:\n```typescript\n\nparseInt(/* str: */ '123', /* radix: */ 8)\n \n```", + scope: 'resource', + }, + 'javascript.inlayHints.parameterNames.suppressWhenArgumentMatchesName': { + type: 'boolean', + default: true, + markdownDescription: 'Suppress parameter name hints on arguments whose text is identical to the parameter name.', + scope: 'resource', + }, + 'javascript.inlayHints.parameterTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: "Enable/disable inlay hints for implicit parameter types:\n```typescript\n\nel.addEventListener('click', e /* :MouseEvent */ => ...)\n \n```", + scope: 'resource', + }, + 'javascript.inlayHints.variableTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit variable types:\n```typescript\n\nconst foo /* :number */ = Date.now();\n \n```', + scope: 'resource', + }, + 'javascript.inlayHints.variableTypes.suppressWhenTypeMatchesName': { + type: 'boolean', + default: true, + markdownDescription: 'Suppress type hints on variables whose name is identical to the type name. Requires using TypeScript 4.8+ in the workspace.', + scope: 'resource', + }, + 'javascript.inlayHints.propertyDeclarationTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit types on property declarations:\n```typescript\n\nclass Foo {\n\tprop /* :number */ = Date.now();\n}\n \n```', + scope: 'resource', + }, + 'javascript.inlayHints.functionLikeReturnTypes.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for implicit return types on function signatures:\n```typescript\n\nfunction foo() /* :number */ {\n\treturn Date.now();\n} \n \n```', + scope: 'resource', + }, + 'javascript.inlayHints.enumMemberValues.enabled': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable inlay hints for member values in enum declarations:\n```typescript\n\nenum MyValue {\n\tA /* = 0 */;\n\tB /* = 1 */;\n}\n \n```', + scope: 'resource', + }, + 'javascript.suggest.includeCompletionsForImportStatements': { + type: 'boolean', + default: true, + description: 'Enable/disable auto-import-style completions on partially-typed import statements.', + scope: 'resource', + }, + 'typescript.suggest.includeCompletionsForImportStatements': { + type: 'boolean', + default: true, + description: 'Enable/disable auto-import-style completions on partially-typed import statements.', + scope: 'resource', + }, + 'typescript.reportStyleChecksAsWarnings': { + type: 'boolean', + default: true, + description: 'Report style checks as warnings.', + scope: 'window', + }, + 'typescript.validate.enable': { + type: 'boolean', + default: true, + description: 'Enable/disable TypeScript validation.', + scope: 'window', + }, + 'typescript.format.enable': { + type: 'boolean', + default: true, + description: 'Enable/disable default TypeScript formatter.', + scope: 'window', + }, + 'typescript.format.insertSpaceAfterCommaDelimiter': { + type: 'boolean', + default: true, + description: 'Defines space handling after a comma delimiter.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterConstructor': { + type: 'boolean', + default: false, + description: 'Defines space handling after the constructor keyword.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterSemicolonInForStatements': { + type: 'boolean', + default: true, + description: 'Defines space handling after a semicolon in a for statement.', + scope: 'resource', + }, + 'typescript.format.insertSpaceBeforeAndAfterBinaryOperators': { + type: 'boolean', + default: true, + description: 'Defines space handling after a binary operator.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterKeywordsInControlFlowStatements': { + type: 'boolean', + default: true, + description: 'Defines space handling after keywords in a control flow statement.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions': { + type: 'boolean', + default: true, + description: 'Defines space handling after function keyword for anonymous functions.', + scope: 'resource', + }, + 'typescript.format.insertSpaceBeforeFunctionParenthesis': { + type: 'boolean', + default: false, + description: 'Defines space handling before function argument parentheses.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing non-empty parenthesis.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing non-empty brackets.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces': { + type: 'boolean', + default: true, + description: 'Defines space handling after opening and before closing non-empty braces.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces': { + type: 'boolean', + default: true, + description: 'Defines space handling after opening and before closing empty braces.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing template string braces.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing JSX expression braces.', + scope: 'resource', + }, + 'typescript.format.insertSpaceAfterTypeAssertion': { + type: 'boolean', + default: false, + description: 'Defines space handling after type assertions in TypeScript.', + scope: 'resource', + }, + 'typescript.format.placeOpenBraceOnNewLineForFunctions': { + type: 'boolean', + default: false, + description: 'Defines whether an open brace is put onto a new line for functions or not.', + scope: 'resource', + }, + 'typescript.format.placeOpenBraceOnNewLineForControlBlocks': { + type: 'boolean', + default: false, + description: 'Defines whether an open brace is put onto a new line for control blocks or not.', + scope: 'resource', + }, + 'typescript.format.semicolons': { + type: 'string', + default: 'ignore', + description: 'Defines handling of optional semicolons.', + scope: 'resource', + enum: [ + 'ignore', + 'insert', + 'remove', + ], + enumDescriptions: [ + "Don't insert or remove any semicolons.", + 'Insert semicolons at statement ends.', + 'Remove unnecessary semicolons.', + ], + }, + 'javascript.validate.enable': { + type: 'boolean', + default: true, + description: 'Enable/disable JavaScript validation.', + scope: 'window', + }, + 'javascript.format.enable': { + type: 'boolean', + default: true, + description: 'Enable/disable default JavaScript formatter.', + scope: 'window', + }, + 'javascript.format.insertSpaceAfterCommaDelimiter': { + type: 'boolean', + default: true, + description: 'Defines space handling after a comma delimiter.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterConstructor': { + type: 'boolean', + default: false, + description: 'Defines space handling after the constructor keyword.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterSemicolonInForStatements': { + type: 'boolean', + default: true, + description: 'Defines space handling after a semicolon in a for statement.', + scope: 'resource', + }, + 'javascript.format.insertSpaceBeforeAndAfterBinaryOperators': { + type: 'boolean', + default: true, + description: 'Defines space handling after a binary operator.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterKeywordsInControlFlowStatements': { + type: 'boolean', + default: true, + description: 'Defines space handling after keywords in a control flow statement.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions': { + type: 'boolean', + default: true, + description: 'Defines space handling after function keyword for anonymous functions.', + scope: 'resource', + }, + 'javascript.format.insertSpaceBeforeFunctionParenthesis': { + type: 'boolean', + default: false, + description: 'Defines space handling before function argument parentheses.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing non-empty parenthesis.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing non-empty brackets.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces': { + type: 'boolean', + default: true, + description: 'Defines space handling after opening and before closing non-empty braces.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces': { + type: 'boolean', + default: true, + description: 'Defines space handling after opening and before closing empty braces.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing template string braces.', + scope: 'resource', + }, + 'javascript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces': { + type: 'boolean', + default: false, + description: 'Defines space handling after opening and before closing JSX expression braces.', + scope: 'resource', + }, + 'javascript.format.placeOpenBraceOnNewLineForFunctions': { + type: 'boolean', + default: false, + description: 'Defines whether an open brace is put onto a new line for functions or not.', + scope: 'resource', + }, + 'javascript.format.placeOpenBraceOnNewLineForControlBlocks': { + type: 'boolean', + default: false, + description: 'Defines whether an open brace is put onto a new line for control blocks or not.', + scope: 'resource', + }, + 'javascript.format.semicolons': { + type: 'string', + default: 'ignore', + description: 'Defines handling of optional semicolons.', + scope: 'resource', + enum: [ + 'ignore', + 'insert', + 'remove', + ], + enumDescriptions: [ + "Don't insert or remove any semicolons.", + 'Insert semicolons at statement ends.', + 'Remove unnecessary semicolons.', + ], + }, + 'js/ts.implicitProjectConfig.module': { + type: 'string', + markdownDescription: 'Sets the module system for the program. See more: https://www.typescriptlang.org/tsconfig#module.', + default: 'ESNext', + enum: [ + 'CommonJS', + 'AMD', + 'System', + 'UMD', + 'ES6', + 'ES2015', + 'ES2020', + 'ESNext', + 'None', + 'ES2022', + 'Node12', + 'NodeNext', + ], + scope: 'window', + }, + 'js/ts.implicitProjectConfig.target': { + type: 'string', + default: 'ES2020', + markdownDescription: 'Set target JavaScript language version for emitted JavaScript and include library declarations. See more: https://www.typescriptlang.org/tsconfig#target.', + enum: [ + 'ES3', + 'ES5', + 'ES6', + 'ES2015', + 'ES2016', + 'ES2017', + 'ES2018', + 'ES2019', + 'ES2020', + 'ES2021', + 'ES2022', + 'ESNext', + ], + scope: 'window', + }, + 'javascript.implicitProjectConfig.checkJs': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable semantic checking of JavaScript files. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + markdownDeprecationMessage: 'This setting has been deprecated in favor of `js/ts.implicitProjectConfig.checkJs`.', + scope: 'window', + }, + 'js/ts.implicitProjectConfig.checkJs': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable semantic checking of JavaScript files. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + scope: 'window', + }, + 'javascript.implicitProjectConfig.experimentalDecorators': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable `experimentalDecorators` in JavaScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + markdownDeprecationMessage: 'This setting has been deprecated in favor of `js/ts.implicitProjectConfig.experimentalDecorators`.', + scope: 'window', + }, + 'js/ts.implicitProjectConfig.experimentalDecorators': { + type: 'boolean', + default: false, + markdownDescription: 'Enable/disable `experimentalDecorators` in JavaScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + scope: 'window', + }, + 'js/ts.implicitProjectConfig.strictNullChecks': { + type: 'boolean', + default: true, + markdownDescription: 'Enable/disable [strict null checks](https://www.typescriptlang.org/tsconfig#strictNullChecks) in JavaScript and TypeScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + scope: 'window', + }, + 'js/ts.implicitProjectConfig.strictFunctionTypes': { + type: 'boolean', + default: true, + markdownDescription: 'Enable/disable [strict function types](https://www.typescriptlang.org/tsconfig#strictFunctionTypes) in JavaScript and TypeScript files that are not part of a project. Existing `jsconfig.json` or `tsconfig.json` files override this setting.', + scope: 'window', + }, + 'javascript.suggest.names': { + type: 'boolean', + default: true, + markdownDescription: 'Enable/disable including unique names from the file in JavaScript suggestions. Note that name suggestions are always disabled in JavaScript code that is semantically checked using `@ts-check` or `checkJs`.', + scope: 'resource', + }, + 'typescript.tsc.autoDetect': { + type: 'string', + default: 'on', + enum: [ + 'on', + 'off', + 'build', + 'watch', + ], + markdownEnumDescriptions: [ + 'Create both build and watch tasks.', + 'Disable this feature.', + 'Only create single run compile tasks.', + 'Only create compile and watch tasks.', + ], + description: 'Controls auto detection of tsc tasks.', + scope: 'window', + }, + 'javascript.suggest.paths': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestions for paths in import statements and require calls.', + scope: 'resource', + }, + 'typescript.suggest.paths': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestions for paths in import statements and require calls.', + scope: 'resource', + }, + 'javascript.suggest.autoImports': { + type: 'boolean', + default: true, + description: 'Enable/disable auto import suggestions.', + scope: 'resource', + }, + 'typescript.suggest.autoImports': { + type: 'boolean', + default: true, + description: 'Enable/disable auto import suggestions.', + scope: 'resource', + }, + 'javascript.suggest.completeJSDocs': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestion to complete JSDoc comments.', + scope: 'language-overridable', + }, + 'typescript.suggest.completeJSDocs': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestion to complete JSDoc comments.', + scope: 'language-overridable', + }, + 'javascript.suggest.jsdoc.generateReturns': { + type: 'boolean', + default: true, + markdownDescription: 'Enable/disable generating `@returns` annotations for JSDoc templates.', + scope: 'language-overridable', + }, + 'typescript.suggest.jsdoc.generateReturns': { + type: 'boolean', + default: true, + markdownDescription: 'Enable/disable generating `@returns` annotations for JSDoc templates.', + scope: 'language-overridable', + }, + 'typescript.locale': { + type: 'string', + default: 'auto', + enum: [ + 'auto', + 'de', + 'es', + 'en', + 'fr', + 'it', + 'ja', + 'ko', + 'ru', + 'zh-CN', + 'zh-TW', + ], + markdownDescription: "Sets the locale used to report JavaScript and TypeScript errors. Defaults to use VS Code's locale.", + scope: 'window', + }, + 'javascript.suggestionActions.enabled': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestion diagnostics for JavaScript files in the editor.', + scope: 'resource', + }, + 'typescript.suggestionActions.enabled': { + type: 'boolean', + default: true, + description: 'Enable/disable suggestion diagnostics for TypeScript files in the editor.', + scope: 'resource', + }, + 'javascript.preferences.quoteStyle': { + type: 'string', + enum: [ + 'auto', + 'single', + 'double', + ], + default: 'auto', + markdownDescription: 'Preferred quote style to use for Quick Fixes.', + markdownEnumDescriptions: [ + 'Infer quote type from existing code', + "Always use single quotes: `'`", + 'Always use double quotes: `"`', + ], + scope: 'language-overridable', + }, + 'typescript.preferences.quoteStyle': { + type: 'string', + enum: [ + 'auto', + 'single', + 'double', + ], + default: 'auto', + markdownDescription: 'Preferred quote style to use for Quick Fixes.', + markdownEnumDescriptions: [ + 'Infer quote type from existing code', + "Always use single quotes: `'`", + 'Always use double quotes: `"`', + ], + scope: 'language-overridable', + }, + 'javascript.preferences.importModuleSpecifier': { + type: 'string', + enum: [ + 'shortest', + 'relative', + 'non-relative', + 'project-relative', + ], + markdownEnumDescriptions: [ + 'Prefers a non-relative import only if one is available that has fewer path segments than a relative import.', + 'Prefers a relative path to the imported file location.', + 'Prefers a non-relative import based on the `baseUrl` or `paths` configured in your `jsconfig.json` / `tsconfig.json`.', + 'Prefers a non-relative import only if the relative import path would leave the package or project directory.', + ], + default: 'shortest', + description: 'Preferred path style for auto imports.', + scope: 'language-overridable', + }, + 'typescript.preferences.importModuleSpecifier': { + type: 'string', + enum: [ + 'shortest', + 'relative', + 'non-relative', + 'project-relative', + ], + markdownEnumDescriptions: [ + 'Prefers a non-relative import only if one is available that has fewer path segments than a relative import.', + 'Prefers a relative path to the imported file location.', + 'Prefers a non-relative import based on the `baseUrl` or `paths` configured in your `jsconfig.json` / `tsconfig.json`.', + 'Prefers a non-relative import only if the relative import path would leave the package or project directory.', + ], + default: 'shortest', + description: 'Preferred path style for auto imports.', + scope: 'language-overridable', + }, + 'javascript.preferences.importModuleSpecifierEnding': { + type: 'string', + enum: [ + 'auto', + 'minimal', + 'index', + 'js', + ], + markdownEnumDescriptions: [ + 'Use project settings to select a default.', + 'Shorten `./component/index.js` to `./component`.', + 'Shorten `./component/index.js` to `./component/index`.', + 'Do not shorten path endings; include the `.js` extension.', + ], + default: 'auto', + description: 'Preferred path ending for auto imports.', + scope: 'language-overridable', + }, + 'typescript.preferences.importModuleSpecifierEnding': { + type: 'string', + enum: [ + 'auto', + 'minimal', + 'index', + 'js', + ], + markdownEnumDescriptions: [ + 'Use project settings to select a default.', + 'Shorten `./component/index.js` to `./component`.', + 'Shorten `./component/index.js` to `./component/index`.', + 'Do not shorten path endings; include the `.js` extension.', + ], + default: 'auto', + description: 'Preferred path ending for auto imports.', + scope: 'language-overridable', + }, + 'javascript.preferences.jsxAttributeCompletionStyle': { + type: 'string', + enum: [ + 'auto', + 'braces', + 'none', + ], + markdownEnumDescriptions: [ + 'Insert `={}` or `=""` after attribute names based on the prop type. See `javascript.preferences.quoteStyle` to control the type of quotes used for string attributes.', + 'Insert `={}` after attribute names.', + 'Only insert attribute names.', + ], + default: 'auto', + description: 'Preferred style for JSX attribute completions.', + scope: 'language-overridable', + }, + 'typescript.preferences.jsxAttributeCompletionStyle': { + type: 'string', + enum: [ + 'auto', + 'braces', + 'none', + ], + markdownEnumDescriptions: [ + 'Insert `={}` or `=""` after attribute names based on the prop type. See `typescript.preferences.quoteStyle` to control the type of quotes used for string attributes.', + 'Insert `={}` after attribute names.', + 'Only insert attribute names.', + ], + default: 'auto', + description: 'Preferred style for JSX attribute completions.', + scope: 'language-overridable', + }, + 'typescript.preferences.includePackageJsonAutoImports': { + type: 'string', + enum: [ + 'auto', + 'on', + 'off', + ], + enumDescriptions: [ + 'Search dependencies based on estimated performance impact.', + 'Always search dependencies.', + 'Never search dependencies.', + ], + default: 'auto', + markdownDescription: 'Enable/disable searching `package.json` dependencies for available auto imports.', + scope: 'window', + }, + 'typescript.preferences.autoImportFileExcludePatterns': { + type: 'array', + items: { + type: 'string', + }, + markdownDescription: 'Specify glob patterns of files to exclude from auto imports. Requires using TypeScript 4.8 or newer in the workspace.', + scope: 'resource', + }, + 'javascript.preferences.autoImportFileExcludePatterns': { + type: 'array', + items: { + type: 'string', + }, + markdownDescription: 'Specify glob patterns of files to exclude from auto imports. Requires using TypeScript 4.8 or newer in the workspace.', + scope: 'resource', + }, + 'javascript.preferences.renameShorthandProperties': { + type: 'boolean', + default: true, + description: 'Enable/disable introducing aliases for object shorthand properties during renames.', + deprecationMessage: "The setting 'typescript.preferences.renameShorthandProperties' has been deprecated in favor of 'typescript.preferences.useAliasesForRenames'", + scope: 'language-overridable', + }, + 'typescript.preferences.renameShorthandProperties': { + type: 'boolean', + default: true, + description: 'Enable/disable introducing aliases for object shorthand properties during renames.', + deprecationMessage: "The setting 'typescript.preferences.renameShorthandProperties' has been deprecated in favor of 'typescript.preferences.useAliasesForRenames'", + scope: 'language-overridable', + }, + 'javascript.preferences.useAliasesForRenames': { + type: 'boolean', + default: true, + description: 'Enable/disable introducing aliases for object shorthand properties during renames.', + scope: 'language-overridable', + }, + 'typescript.preferences.useAliasesForRenames': { + type: 'boolean', + default: true, + description: 'Enable/disable introducing aliases for object shorthand properties during renames.', + scope: 'language-overridable', + }, + 'typescript.updateImportsOnFileMove.enabled': { + type: 'string', + enum: [ + 'prompt', + 'always', + 'never', + ], + markdownEnumDescriptions: [ + 'Prompt on each rename.', + 'Always update paths automatically.', + "Never rename paths and don't prompt.", + ], + default: 'prompt', + description: 'Enable/disable automatic updating of import paths when you rename or move a file in VS Code.', + scope: 'resource', + }, + 'javascript.updateImportsOnFileMove.enabled': { + type: 'string', + enum: [ + 'prompt', + 'always', + 'never', + ], + markdownEnumDescriptions: [ + 'Prompt on each rename.', + 'Always update paths automatically.', + "Never rename paths and don't prompt.", + ], + default: 'prompt', + description: 'Enable/disable automatic updating of import paths when you rename or move a file in VS Code.', + scope: 'resource', + }, + 'typescript.autoClosingTags': { + type: 'boolean', + default: true, + description: 'Enable/disable automatic closing of JSX tags.', + scope: 'language-overridable', + }, + 'javascript.autoClosingTags': { + type: 'boolean', + default: true, + description: 'Enable/disable automatic closing of JSX tags.', + scope: 'language-overridable', + }, + 'javascript.suggest.enabled': { + type: 'boolean', + default: true, + description: 'Enabled/disable autocomplete suggestions.', + scope: 'language-overridable', + }, + 'typescript.suggest.enabled': { + type: 'boolean', + default: true, + description: 'Enabled/disable autocomplete suggestions.', + scope: 'language-overridable', + }, + 'typescript.surveys.enabled': { + type: 'boolean', + default: true, + description: "Enabled/disable occasional surveys that help us improve VS Code's JavaScript and TypeScript support.", + scope: 'window', + }, + 'typescript.tsserver.useSeparateSyntaxServer': { + type: 'boolean', + default: true, + description: 'Enable/disable spawning a separate TypeScript server that can more quickly respond to syntax related operations, such as calculating folding or computing document symbols.', + markdownDeprecationMessage: 'This setting has been deprecated in favor of `typescript.tsserver.useSyntaxServer`.', + scope: 'window', + }, + 'typescript.tsserver.useSyntaxServer': { + type: 'string', + scope: 'window', + description: 'Controls if TypeScript launches a dedicated server to more quickly handle syntax related operations, such as computing code folding.', + default: 'auto', + enum: [ + 'always', + 'never', + 'auto', + ], + enumDescriptions: [ + 'Use a lighter weight syntax server to handle all IntelliSense operations. This syntax server can only provide IntelliSense for opened files.', + "Don't use a dedicated syntax server. Use a single server to handle all IntelliSense operations.", + 'Spawn both a full server and a lighter weight server dedicated to syntax operations. The syntax server is used to speed up syntax operations and provide IntelliSense while projects are loading.', + ], + }, + 'typescript.tsserver.maxTsServerMemory': { + type: 'number', + default: 3072, + description: 'The maximum amount of memory (in MB) to allocate to the TypeScript server process.', + scope: 'window', + }, + 'typescript.tsserver.experimental.enableProjectDiagnostics': { + type: 'boolean', + default: false, + description: '(Experimental) Enables project wide error reporting.', + scope: 'window', + tags: [ + 'experimental', + ], + }, + 'typescript.tsserver.watchOptions': { + type: 'object', + description: 'Configure which watching strategies should be used to keep track of files and directories.', + scope: 'window', + properties: { + watchFile: { + type: 'string', + description: 'Strategy for how individual files are watched.', + enum: [ + 'fixedChunkSizePolling', + 'fixedPollingInterval', + 'priorityPollingInterval', + 'dynamicPriorityPolling', + 'useFsEvents', + 'useFsEventsOnParentDirectory', + ], + enumDescriptions: [ + 'Polls files in chunks at regular interval.', + 'Check every file for changes several times a second at a fixed interval.', + 'Check every file for changes several times a second, but use heuristics to check certain types of files less frequently than others.', + 'Use a dynamic queue where less-frequently modified files will be checked less often.', + "Attempt to use the operating system/file system's native events for file changes.", + "Attempt to use the operating system/file system's native events to listen for changes on a file's containing directories. This can use fewer file watchers, but might be less accurate.", + ], + default: 'useFsEvents', + }, + watchDirectory: { + type: 'string', + description: 'Strategy for how entire directory trees are watched under systems that lack recursive file-watching functionality.', + enum: [ + 'fixedChunkSizePolling', + 'fixedPollingInterval', + 'dynamicPriorityPolling', + 'useFsEvents', + ], + enumDescriptions: [ + 'Polls directories in chunks at regular interval.', + 'Check every directory for changes several times a second at a fixed interval.', + 'Use a dynamic queue where less-frequently modified directories will be checked less often.', + "Attempt to use the operating system/file system's native events for directory changes.", + ], + default: 'useFsEvents', + }, + fallbackPolling: { + type: 'string', + description: "When using file system events, this option specifies the polling strategy that gets used when the system runs out of native file watchers and/or doesn't support native file watchers.", + enum: [ + 'fixedPollingInterval', + 'priorityPollingInterval', + 'dynamicPriorityPolling', + ], + enumDescriptions: [ + 'configuration.tsserver.watchOptions.fallbackPolling.fixedPollingInterval', + 'configuration.tsserver.watchOptions.fallbackPolling.priorityPollingInterval', + 'configuration.tsserver.watchOptions.fallbackPolling.dynamicPriorityPolling', + ], + }, + synchronousWatchDirectory: { + type: 'boolean', + description: 'Disable deferred watching on directories. Deferred watching is useful when lots of file changes might occur at once (e.g. a change in node_modules from running npm install), but you might want to disable it with this flag for some less-common setups.', + }, + }, + }, + 'typescript.workspaceSymbols.scope': { + type: 'string', + enum: [ + 'allOpenProjects', + 'currentProject', + ], + enumDescriptions: [ + 'Search all open JavaScript or TypeScript projects for symbols.', + 'Only search for symbols in the current JavaScript or TypeScript project.', + ], + default: 'allOpenProjects', + markdownDescription: 'Controls which files are searched by [Go to Symbol in Workspace](https://code.visualstudio.com/docs/editor/editingevolved#_open-symbol-by-name).', + scope: 'window', + }, + 'javascript.suggest.classMemberSnippets.enabled': { + type: 'boolean', + default: true, + description: 'Enable/disable snippet completions for class members.', + scope: 'resource', + }, + 'typescript.suggest.classMemberSnippets.enabled': { + type: 'boolean', + default: true, + description: 'Enable/disable snippet completions for class members.', + scope: 'resource', + }, + 'typescript.suggest.objectLiteralMethodSnippets.enabled': { + type: 'boolean', + default: true, + description: 'Enable/disable snippet completions for methods in object literals. Requires using TypeScript 4.7+ in the workspace.', + scope: 'resource', + }, + 'typescript.experimental.tsserver.web.enableProjectWideIntellisense': { + type: 'boolean', + default: false, + description: 'Enable/disable project-wide IntelliSense on web. Requires that VS Code is running in a trusted context.', + scope: 'window', + tags: [ + 'experimental', + ], + }, + }, + }, + ], + configurationDefaults: undefined, + commands: [ + { + command: 'typescript.reloadProjects', + title: 'Reload Project', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'javascript.reloadProjects', + title: 'Reload Project', + originalTitle: undefined, + category: 'JavaScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.selectTypeScriptVersion', + title: 'Select TypeScript Version...', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.goToProjectConfig', + title: 'Go to Project Configuration', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'javascript.goToProjectConfig', + title: 'Go to Project Configuration', + originalTitle: undefined, + category: 'JavaScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.openTsServerLog', + title: 'Open TS Server log', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.restartTsServer', + title: 'Restart TS Server', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.findAllFileReferences', + title: 'Find File References', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.goToSourceDefinition', + title: 'Go to Source Definition', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.sortImports', + title: 'Sort Imports', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'javascript.sortImports', + title: 'Sort Imports', + originalTitle: undefined, + category: 'JavaScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'typescript.removeUnusedImports', + title: 'Remove Unused Imports', + originalTitle: undefined, + category: 'TypeScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + { + command: 'javascript.removeUnusedImports', + title: 'Remove Unused Imports', + originalTitle: undefined, + category: 'JavaScript', + iconUrl: undefined, + themeIcon: undefined, + enablement: undefined, + }, + ], + menus: { + commandPalette: [ + { + command: 'typescript.reloadProjects', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == typescript && typescript.isManagedFile', + }, + { + command: 'typescript.reloadProjects', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == typescriptreact && typescript.isManagedFile', + }, + { + command: 'javascript.reloadProjects', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == javascript && typescript.isManagedFile', + }, + { + command: 'javascript.reloadProjects', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == javascriptreact && typescript.isManagedFile', + }, + { + command: 'typescript.goToProjectConfig', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == typescript && typescript.isManagedFile', + }, + { + command: 'typescript.goToProjectConfig', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == typescriptreact', + }, + { + command: 'javascript.goToProjectConfig', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == javascript && typescript.isManagedFile', + }, + { + command: 'javascript.goToProjectConfig', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'editorLangId == javascriptreact && typescript.isManagedFile', + }, + { + command: 'typescript.selectTypeScriptVersion', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'typescript.isManagedFile', + }, + { + command: 'typescript.openTsServerLog', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'typescript.isManagedFile', + }, + { + command: 'typescript.restartTsServer', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'typescript.isManagedFile', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsFileReferences && typescript.isManagedFile', + }, + { + command: 'typescript.goToSourceDefinition', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsSourceDefinition && typescript.isManagedFile', + }, + { + command: 'typescript.sortImports', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'supportedCodeAction =~ /(\\s|^)source\\.sortImports\\b/ && editorLangId =~ /^typescript(react)?$/', + }, + { + command: 'javascript.sortImports', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'supportedCodeAction =~ /(\\s|^)source\\.sortImports\\b/ && editorLangId =~ /^javascript(react)?$/', + }, + { + command: 'typescript.removeUnusedImports', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'supportedCodeAction =~ /(\\s|^)source\\.removeUnusedImports\\b/ && editorLangId =~ /^typescript(react)?$/', + }, + { + command: 'javascript.removeUnusedImports', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'supportedCodeAction =~ /(\\s|^)source\\.removeUnusedImports\\b/ && editorLangId =~ /^javascript(react)?$/', + }, + ], + 'editor/context': [ + { + command: 'typescript.goToSourceDefinition', + submenu: undefined, + alt: undefined, + group: 'navigation@9', + when: 'tsSupportsSourceDefinition && resourceLangId == typescript', + }, + { + command: 'typescript.goToSourceDefinition', + submenu: undefined, + alt: undefined, + group: 'navigation@9', + when: 'tsSupportsSourceDefinition && resourceLangId == typescriptreact', + }, + { + command: 'typescript.goToSourceDefinition', + submenu: undefined, + alt: undefined, + group: 'navigation@9', + when: 'tsSupportsSourceDefinition && resourceLangId == javascript', + }, + { + command: 'typescript.goToSourceDefinition', + submenu: undefined, + alt: undefined, + group: 'navigation@9', + when: 'tsSupportsSourceDefinition && resourceLangId == javascriptreact', + }, + ], + 'explorer/context': [ + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: '4_search', + when: 'tsSupportsFileReferences && resourceLangId == typescript', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: '4_search', + when: 'tsSupportsFileReferences && resourceLangId == typescriptreact', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: '4_search', + when: 'tsSupportsFileReferences && resourceLangId == javascript', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: '4_search', + when: 'tsSupportsFileReferences && resourceLangId == javascriptreact', + }, + ], + 'editor/title/context': [ + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsFileReferences && resourceLangId == javascript', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsFileReferences && resourceLangId == javascriptreact', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsFileReferences && resourceLangId == typescript', + }, + { + command: 'typescript.findAllFileReferences', + submenu: undefined, + alt: undefined, + group: undefined, + when: 'tsSupportsFileReferences && resourceLangId == typescriptreact', + }, + ], + }, + taskDefinitions: [ + { + taskType: 'typescript', + source: 'typescript-language-features', + properties: { + required: [ + 'tsconfig', + ], + all: [ + 'tsconfig', + 'option', + ], + schema: { + type: 'object', + required: [ + 'tsconfig', + ], + properties: { + tsconfig: { + type: 'string', + description: 'The tsconfig file that defines the TS build.', + }, + option: { + type: 'string', + }, + type: { + type: 'string', + const: 'typescript', + }, + }, + when: 'shellExecutionSupported', + }, + }, + }, + ], + problemMatchers: [ + { + name: 'tsc', + label: 'TypeScript problems', + owner: 'typescript', + source: 'ts', + applyTo: 'closedDocuments', + fileLocation: [ + 'relative', + '${cwd}', + ], + pattern: '$tsc', + }, + { + name: 'tsc-watch', + label: 'TypeScript problems (watch mode)', + owner: 'typescript', + source: 'ts', + applyTo: 'closedDocuments', + fileLocation: [ + 'relative', + '${cwd}', + ], + pattern: '$tsc', + background: { + activeOnStart: true, + beginsPattern: { + regexp: '^\\s*(?:message TS6032:|\\[?\\D*.{1,2}[:.].{1,2}[:.].{1,2}\\D*(├\\D*\\d{1,2}\\D+┤)?(?:\\]| -)) (Starting compilation in watch mode|File change detected\\. Starting incremental compilation)\\.\\.\\.', + }, + endsPattern: { + regexp: '^\\s*(?:message TS6042:|\\[?\\D*.{1,2}[:.].{1,2}[:.].{1,2}\\D*(├\\D*\\d{1,2}\\D+┤)?(?:\\]| -)) (?:Compilation complete\\.|Found \\d+ errors?\\.) Watching for file changes\\.', + }, + }, + }, + ], + problemPatterns: [ + { + name: 'tsc', + regexp: '^([^\\s].*)[\\(:](\\d+)[,:](\\d+)(?:\\):\\s+|\\s+-\\s+)(error|warning|info)\\s+TS(\\d+)\\s*:\\s*(.*)$', + file: 1, + line: 2, + column: 3, + severity: 4, + code: 5, + message: 6, + }, + ], + resourceLabelFormatters: undefined, + authentication: undefined, + notebooks: undefined, + snippets: undefined, + themes: undefined, + iconThemes: undefined, + colors: undefined, + localizations: undefined, + terminalProfiles: undefined, + }, + }, + { + metadata: { + host: 'main', + model: { + packagePath: '/home/user/theia/examples/browser-only/plugins/vscode.typescript/extension', + packageUri: 'file:///home/user/theia/examples/browser-only/plugins/vscode.typescript/extension', + id: 'vscode.typescript', + name: 'typescript', + publisher: 'vscode', + version: '1.95.3', + displayName: 'TypeScript Language Basics (built-in)', + description: 'Provides snippets, syntax highlighting, bracket matching and folding in TypeScript files.', + engine: { + type: 'vscode', + version: '*', + }, + entryPoint: { + backend: undefined, + }, + iconUrl: undefined, + l10n: undefined, + readmeUrl: 'hostedPlugin/vscode_typescript/.%2FREADME.md', + licenseUrl: 'hostedPlugin/vscode_typescript/.%2FLICENSE', + }, + lifecycle: { + startMethod: 'activate', + stopMethod: 'deactivate', + frontendModuleName: 'vscode_typescript', + frontendInitPath: 'plugin-vscode-init-fe.js', + }, + outOfSync: false, + isUnderDevelopment: false, + }, + type: 0, + contributes: { + activationEvents: [ + 'onLanguage:typescript', + 'onLanguage:typescriptreact', + 'onLanguage:jsonc', + 'onLanguage:json', + ], + configurationDefaults: undefined, + languages: [ + { + id: 'typescript', + aliases: [ + 'TypeScript', + 'ts', + 'typescript', + ], + extensions: [ + '.ts', + '.cts', + '.mts', + ], + filenamePatterns: undefined, + filenames: undefined, + firstLine: undefined, + mimetypes: undefined, + configuration: { + brackets: [ + [ + '${', + '}', + ], + [ + '{', + '}', + ], + [ + '[', + ']', + ], + [ + '(', + ')', + ], + ], + comments: { + lineComment: '//', + blockComment: [ + '/*', + '*/', + ], + }, + folding: { + markers: { + start: '^\\s*//\\s*#?region\\b', + end: '^\\s*//\\s*#?endregion\\b', + }, + }, + wordPattern: { + pattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\@\\~\\!\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>/\\?\\s]+)", + }, + autoClosingPairs: [ + { + open: '{', + close: '}', + notIn: undefined, + }, + { + open: '[', + close: ']', + notIn: undefined, + }, + { + open: '(', + close: ')', + notIn: undefined, + }, + { + open: "'", + close: "'", + notIn: [ + 'string', + 'comment', + ], + }, + { + open: '"', + close: '"', + notIn: [ + 'string', + ], + }, + { + open: '`', + close: '`', + notIn: [ + 'string', + 'comment', + ], + }, + { + open: '/**', + close: ' */', + notIn: [ + 'string', + ], + }, + ], + indentationRules: { + decreaseIndentPattern: { + pattern: '^((?!.*?/\\*).*\\*/)?\\s*[\\}\\]].*$', + }, + increaseIndentPattern: { + pattern: "^((?!//).)*(\\{([^}\"'`/]*|(\\t|[ ])*//.*)|\\([^)\"'`/]*|\\[[^\\]\"'`/]*)$", + }, + unIndentedLinePattern: { + pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', + }, + }, + surroundingPairs: [ + { + open: '{', + close: '}', + }, + { + open: '[', + close: ']', + }, + { + open: '(', + close: ')', + }, + { + open: "'", + close: "'", + }, + { + open: '"', + close: '"', + }, + { + open: '`', + close: '`', + }, + { + open: '<', + close: '>', + }, + ], + onEnterRules: [ + { + beforeText: { + pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', + }, + afterText: { + pattern: '^\\s*\\*/$', + }, + action: { + indent: 'indentOutdent', + appendText: ' * ', + }, + }, + { + beforeText: { + pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', + }, + action: { + indent: 'none', + appendText: ' * ', + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', + }, + previousLineText: { + pattern: '(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))', + }, + action: { + indent: 'none', + appendText: '* ', + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*/\\s*$', + }, + action: { + indent: 'none', + removeText: 1, + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$', + }, + action: { + indent: 'none', + removeText: 1, + }, + }, + { + beforeText: { + pattern: '^\\s*(\\bcase\\s.+:|\\bdefault:)$', + }, + afterText: { + pattern: '^(?!\\s*(\\bcase\\b|\\bdefault\\b))', + }, + action: { + indent: 'indent', + }, + }, + ], + }, + }, + { + id: 'typescriptreact', + aliases: [ + 'TypeScript JSX', + 'TypeScript React', + 'tsx', + ], + extensions: [ + '.tsx', + ], + filenamePatterns: undefined, + filenames: undefined, + firstLine: undefined, + mimetypes: undefined, + configuration: { + brackets: [ + [ + '${', + '}', + ], + [ + '{', + '}', + ], + [ + '[', + ']', + ], + [ + '(', + ')', + ], + ], + comments: { + lineComment: '//', + blockComment: [ + '/*', + '*/', + ], + }, + folding: { + markers: { + start: '^\\s*//\\s*#?region\\b', + end: '^\\s*//\\s*#?endregion\\b', + }, + }, + wordPattern: { + pattern: "(-?\\d*\\.\\d\\w*)|([^\\`\\@\\~\\!\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>/\\?\\s]+)", + }, + autoClosingPairs: [ + { + open: '{', + close: '}', + notIn: undefined, + }, + { + open: '[', + close: ']', + notIn: undefined, + }, + { + open: '(', + close: ')', + notIn: undefined, + }, + { + open: "'", + close: "'", + notIn: [ + 'string', + 'comment', + ], + }, + { + open: '"', + close: '"', + notIn: [ + 'string', + ], + }, + { + open: '`', + close: '`', + notIn: [ + 'string', + 'comment', + ], + }, + { + open: '/**', + close: ' */', + notIn: [ + 'string', + ], + }, + ], + indentationRules: { + decreaseIndentPattern: { + pattern: '^((?!.*?/\\*).*\\*/)?\\s*[\\}\\]].*$', + }, + increaseIndentPattern: { + pattern: "^((?!//).)*(\\{([^}\"'`/]*|(\\t|[ ])*//.*)|\\([^)\"'`/]*|\\[[^\\]\"'`/]*)$", + }, + unIndentedLinePattern: { + pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', + }, + }, + surroundingPairs: [ + { + open: '{', + close: '}', + }, + { + open: '[', + close: ']', + }, + { + open: '(', + close: ')', + }, + { + open: "'", + close: "'", + }, + { + open: '"', + close: '"', + }, + { + open: '`', + close: '`', + }, + { + open: '<', + close: '>', + }, + ], + onEnterRules: [ + { + beforeText: { + pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', + }, + afterText: { + pattern: '^\\s*\\*/$', + }, + action: { + indent: 'indentOutdent', + appendText: ' * ', + }, + }, + { + beforeText: { + pattern: '^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$', + }, + action: { + indent: 'none', + appendText: ' * ', + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$', + }, + previousLineText: { + pattern: '(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))', + }, + action: { + indent: 'none', + appendText: '* ', + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*/\\s*$', + }, + action: { + indent: 'none', + removeText: 1, + }, + }, + { + beforeText: { + pattern: '^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$', + }, + action: { + indent: 'none', + removeText: 1, + }, + }, + { + beforeText: { + pattern: '^\\s*(\\bcase\\s.+:|\\bdefault:)$', + }, + afterText: { + pattern: '^(?!\\s*(\\bcase\\b|\\bdefault\\b))', + }, + action: { + indent: 'indent', + }, + }, + ], + }, + }, + { + id: 'jsonc', + aliases: undefined, + extensions: undefined, + filenamePatterns: [ + 'tsconfig.*.json', + 'jsconfig.*.json', + 'tsconfig-*.json', + 'jsconfig-*.json', + ], + filenames: [ + 'tsconfig.json', + 'jsconfig.json', + ], + firstLine: undefined, + mimetypes: undefined, + }, + { + id: 'json', + aliases: undefined, + extensions: undefined, + filenamePatterns: undefined, + filenames: [ + 'tsconfig.tsbuildinfo', + ], + firstLine: undefined, + mimetypes: undefined, + }, + ], + grammars: [ + { + language: 'typescript', + scope: 'source.ts', + format: 'json', + grammar: { + information_for_contributors: [ + 'This file has been converted from https://github.com/microsoft/TypeScript-TmLanguage/blob/master/TypeScript.tmLanguage', + 'If you want to provide a fix or improvement, please create a pull request against the original repository.', + 'Once accepted there, we are happy to receive an update request.', + ], + version: 'https://github.com/microsoft/TypeScript-TmLanguage/commit/0d73d1117e0a9b1d6635ebbe9aa37d615171b02d', + name: 'TypeScript', + scopeName: 'source.ts', + patterns: [ + { + include: '#directives', + }, + { + include: '#statements', + }, + { + include: '#shebang', + }, + ], + repository: { + shebang: { + name: 'comment.line.shebang.ts', + match: '\\A(#!).*(?=$)', + captures: { + '1': { + name: 'punctuation.definition.comment.ts', + }, + }, + }, + statements: { + patterns: [ + { + include: '#declaration', + }, + { + include: '#control-statement', + }, + { + include: '#after-operator-block-as-object-literal', + }, + { + include: '#decl-block', + }, + { + include: '#label', + }, + { + include: '#expression', + }, + { + include: '#punctuation-semicolon', + }, + { + include: '#string', + }, + { + include: '#comment', + }, + ], + }, + declaration: { + patterns: [ + { + include: '#decorator', + }, + { + include: '#var-expr', + }, + { + include: '#function-declaration', + }, + { + include: '#class-declaration', + }, + { + include: '#interface-declaration', + }, + { + include: '#enum-declaration', + }, + { + include: '#namespace-declaration', + }, + { + include: '#type-alias-declaration', + }, + { + include: '#import-equals-declaration', + }, + { + include: '#import-declaration', + }, + { + include: '#export-declaration', + }, + { + name: 'storage.modifier.ts', + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + beginCaptures: { + '1': { + name: 'meta.definition.variable.ts entity.name.function.ts', + }, + '2': { + name: 'keyword.operator.definiteassignment.ts', + }, + }, + end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + beginCaptures: { + '1': { + name: 'meta.definition.variable.ts variable.other.constant.ts entity.name.function.ts', + }, + }, + end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'storage.modifier.ts', + }, + '2': { + name: 'keyword.operator.rest.ts', + }, + '3': { + name: 'entity.name.function.ts variable.language.this.ts', + }, + '4': { + name: 'entity.name.function.ts', + }, + '5': { + name: 'keyword.operator.optional.ts', + }, + }, + }, + { + match: '(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'meta.definition.property.ts entity.name.function.ts', + }, + '2': { + name: 'keyword.operator.optional.ts', + }, + '3': { + name: 'keyword.operator.definiteassignment.ts', + }, + }, + }, + { + name: 'meta.definition.property.ts variable.object.property.ts', + match: '\\#?[_$[:alpha:]][_$[:alnum:]]*', + }, + { + name: 'keyword.operator.optional.ts', + match: '\\?', + }, + { + name: 'keyword.operator.definiteassignment.ts', + match: '\\!', + }, + ], + }, + 'variable-initializer': { + patterns: [ + { + begin: '(?\\s*$)', + beginCaptures: { + '1': { + name: 'keyword.operator.assignment.ts', + }, + }, + end: '(?=$|^|[,);}\\]]|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])', + beginCaptures: { + '1': { + name: 'storage.modifier.ts', + }, + '2': { + name: 'storage.modifier.ts', + }, + '3': { + name: 'storage.modifier.ts', + }, + '4': { + name: 'storage.modifier.async.ts', + }, + '5': { + name: 'keyword.operator.new.ts', + }, + '6': { + name: 'keyword.generator.asterisk.ts', + }, + }, + end: '(?=\\}|;|,|$)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + ], + }, + { + name: 'meta.method.declaration.ts', + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.ts', + }, + '2': { + name: 'storage.modifier.ts', + }, + '3': { + name: 'storage.modifier.ts', + }, + '4': { + name: 'storage.modifier.async.ts', + }, + '5': { + name: 'storage.type.property.ts', + }, + '6': { + name: 'keyword.generator.asterisk.ts', + }, + }, + end: '(?=\\}|;|,|$)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + ], + }, + ], + }, + 'object-literal-method-declaration': { + name: 'meta.method.declaration.ts', + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + '2': { + name: 'storage.type.property.ts', + }, + '3': { + name: 'keyword.generator.asterisk.ts', + }, + }, + end: '(?=\\}|;|,)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + { + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + '2': { + name: 'storage.type.property.ts', + }, + '3': { + name: 'keyword.generator.asterisk.ts', + }, + }, + end: '(?=\\(|\\<)', + patterns: [ + { + include: '#method-declaration-name', + }, + ], + }, + ], + }, + 'method-declaration-name': { + begin: "(?x)(?=((\\b(?)', + captures: { + '1': { + name: 'storage.modifier.async.ts', + }, + '2': { + name: 'variable.parameter.ts', + }, + }, + }, + { + name: 'meta.arrow.ts', + begin: "(?x) (?:\n (? is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + }, + end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + patterns: [ + { + include: '#comment', + }, + { + include: '#type-parameters', + }, + { + include: '#function-parameters', + }, + { + include: '#arrow-return-type', + }, + { + include: '#possibly-arrow-return-type', + }, + ], + }, + { + name: 'meta.arrow.ts', + begin: '=>', + beginCaptures: { + '0': { + name: 'storage.type.function.arrow.ts', + }, + }, + end: '((?<=\\}|\\S)(?)|((?!\\{)(?=\\S)))(?!\\/[\\/\\*])', + patterns: [ + { + include: '#single-line-comment-consuming-line-ending', + }, + { + include: '#decl-block', + }, + { + include: '#expression', + }, + ], + }, + ], + }, + 'indexer-declaration': { + name: 'meta.indexer.declaration.ts', + begin: '(?:(?]|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^yield|[^\\._$[:alnum:]]yield|^throw|[^\\._$[:alnum:]]throw|^in|[^\\._$[:alnum:]]in|^of|[^\\._$[:alnum:]]of|^typeof|[^\\._$[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)', + beginCaptures: { + '1': { + name: 'punctuation.definition.block.ts', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.block.ts', + }, + }, + patterns: [ + { + include: '#object-member', + }, + ], + }, + 'object-literal': { + name: 'meta.objectliteral.ts', + begin: '\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.block.ts', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.block.ts', + }, + }, + patterns: [ + { + include: '#object-member', + }, + ], + }, + 'object-member': { + patterns: [ + { + include: '#comment', + }, + { + include: '#object-literal-method-declaration', + }, + { + name: 'meta.object.member.ts meta.object-literal.key.ts', + begin: '(?=\\[)', + end: '(?=:)|((?<=[\\]])(?=\\s*[\\(\\<]))', + patterns: [ + { + include: '#comment', + }, + { + include: '#array-literal', + }, + ], + }, + { + name: 'meta.object.member.ts meta.object-literal.key.ts', + begin: "(?=[\\'\\\"\\`])", + end: "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as|satisifies)\\s+))))", + patterns: [ + { + include: '#comment', + }, + { + include: '#string', + }, + ], + }, + { + name: 'meta.object.member.ts meta.object-literal.key.ts', + begin: '(?x)(?=(\\b(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '0': { + name: 'meta.object-literal.key.ts', + }, + '1': { + name: 'entity.name.function.ts', + }, + }, + }, + { + name: 'meta.object.member.ts', + match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)', + captures: { + '0': { + name: 'meta.object-literal.key.ts', + }, + }, + }, + { + name: 'meta.object.member.ts', + begin: '\\.\\.\\.', + beginCaptures: { + '0': { + name: 'keyword.operator.spread.ts', + }, + }, + end: '(?=,|\\})', + patterns: [ + { + include: '#expression', + }, + ], + }, + { + name: 'meta.object.member.ts', + match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$|\\/\\/|\\/\\*)', + captures: { + '1': { + name: 'variable.other.readwrite.ts', + }, + }, + }, + { + name: 'meta.object.member.ts', + match: '(?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#type-parameters', + }, + { + begin: '\\(', + beginCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + ], + }, + { + begin: '(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + '2': { + name: 'meta.brace.round.ts', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + { + begin: '(?<=:)\\s*(async)?\\s*(?=\\<\\s*$)', + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + }, + end: '(?<=\\>)', + patterns: [ + { + include: '#type-parameters', + }, + ], + }, + { + begin: '(?<=\\>)\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'meta.brace.round.ts', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + { + include: '#possibly-arrow-return-type', + }, + { + include: '#expression', + }, + ], + }, + { + include: '#punctuation-comma', + }, + { + include: '#decl-block', + }, + ], + }, + 'ternary-expression': { + begin: '(?!\\?\\.\\s*[^[:digit:]])(\\?)(?!\\?)', + beginCaptures: { + '1': { + name: 'keyword.operator.ternary.ts', + }, + }, + end: '\\s*(:)', + endCaptures: { + '1': { + name: 'keyword.operator.ternary.ts', + }, + }, + patterns: [ + { + include: '#expression', + }, + ], + }, + 'function-call': { + patterns: [ + { + begin: "(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + end: "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + name: 'meta.function-call.ts', + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', + end: "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + include: '#function-call-target', + }, + ], + }, + { + include: '#comment', + }, + { + include: '#function-call-optionals', + }, + { + include: '#type-arguments', + }, + { + include: '#paren-expression', + }, + ], + }, + { + begin: '(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', + end: '(?<=\\>)(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', + patterns: [ + { + name: 'meta.function-call.ts', + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', + end: '(?=(<\\s*[\\{\\[\\(]\\s*$))', + patterns: [ + { + include: '#function-call-target', + }, + ], + }, + { + include: '#comment', + }, + { + include: '#function-call-optionals', + }, + { + include: '#type-arguments', + }, + ], + }, + ], + }, + 'function-call-target': { + patterns: [ + { + include: '#support-function-call-identifiers', + }, + { + name: 'entity.name.function.ts', + match: '(\\#?[_$[:alpha:]][_$[:alnum:]]*)', + }, + ], + }, + 'function-call-optionals': { + patterns: [ + { + name: 'meta.function-call.ts punctuation.accessor.optional.ts', + match: '\\?\\.', + }, + { + name: 'meta.function-call.ts keyword.operator.definiteassignment.ts', + match: '\\!', + }, + ], + }, + 'support-function-call-identifiers': { + patterns: [ + { + include: '#literal', + }, + { + include: '#support-objects', + }, + { + include: '#object-identifiers', + }, + { + include: '#punctuation-accessor', + }, + { + name: 'keyword.operator.expression.import.ts', + match: "(?:(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|(===|!==|==|!=)|(([\\&\\~\\^\\|]\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s+instanceof(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#paren-expression-possibly-arrow-with-typeparameters', + }, + ], + }, + { + begin: '(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\()|(<)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)))\\s*$)', + beginCaptures: { + '1': { + name: 'storage.modifier.async.ts', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#paren-expression-possibly-arrow-with-typeparameters', + }, + ], + }, + { + include: '#possibly-arrow-return-type', + }, + ], + }, + 'paren-expression-possibly-arrow-with-typeparameters': { + patterns: [ + { + include: '#type-parameters', + }, + { + begin: '\\(', + beginCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.ts', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + ], + }, + 'expression-inside-possibly-arrow-parens': { + patterns: [ + { + include: '#expressionWithoutIdentifiers', + }, + { + include: '#comment', + }, + { + include: '#string', + }, + { + include: '#decorator', + }, + { + include: '#destructuring-parameter', + }, + { + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'storage.modifier.ts', + }, + '2': { + name: 'keyword.operator.rest.ts', + }, + '3': { + name: 'entity.name.function.ts variable.language.this.ts', + }, + '4': { + name: 'entity.name.function.ts', + }, + '5': { + name: 'keyword.operator.optional.ts', + }, + }, + }, + { + match: '(?x)(?:(?)', + captures: { + '1': { + name: 'meta.brace.angle.ts', + }, + '2': { + name: 'storage.modifier.ts', + }, + '3': { + name: 'meta.brace.angle.ts', + }, + }, + }, + { + name: 'cast.expr.ts', + begin: '(?:(?*?\\&\\|\\^]|[^_$[:alnum:]](?:\\+\\+|\\-\\-)|[^\\+]\\+|[^\\-]\\-))\\s*(<)(?!)', + endCaptures: { + '1': { + name: 'meta.brace.angle.ts', + }, + }, + patterns: [ + { + include: '#type', + }, + ], + }, + { + name: 'cast.expr.ts', + begin: '(?:(?<=^))\\s*(<)(?=[_$[:alpha:]][_$[:alnum:]]*\\s*>)', + beginCaptures: { + '1': { + name: 'meta.brace.angle.ts', + }, + }, + end: '(\\>)', + endCaptures: { + '1': { + name: 'meta.brace.angle.ts', + }, + }, + patterns: [ + { + include: '#type', + }, + ], + }, + ], + }, + 'expression-operators': { + patterns: [ + { + name: 'keyword.control.flow.ts', + match: '(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?>=|>>>=|\\|=', + }, + { + name: 'keyword.operator.bitwise.shift.ts', + match: '<<|>>>|>>', + }, + { + name: 'keyword.operator.comparison.ts', + match: '===|!==|==|!=', + }, + { + name: 'keyword.operator.relational.ts', + match: '<=|>=|<>|<|>', + }, + { + match: '(?<=[_$[:alnum:]])(\\!)\\s*(?:(/=)|(?:(/)(?![/*])))', + captures: { + '1': { + name: 'keyword.operator.logical.ts', + }, + '2': { + name: 'keyword.operator.assignment.compound.ts', + }, + '3': { + name: 'keyword.operator.arithmetic.ts', + }, + }, + }, + { + name: 'keyword.operator.logical.ts', + match: '\\!|&&|\\|\\||\\?\\?', + }, + { + name: 'keyword.operator.bitwise.ts', + match: '\\&|~|\\^|\\|', + }, + { + name: 'keyword.operator.assignment.ts', + match: '\\=', + }, + { + name: 'keyword.operator.decrement.ts', + match: '--', + }, + { + name: 'keyword.operator.increment.ts', + match: '\\+\\+', + }, + { + name: 'keyword.operator.arithmetic.ts', + match: '%|\\*|/|-|\\+', + }, + { + begin: '(?<=[_$[:alnum:])\\]])\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)+(?:(/=)|(?:(/)(?![/*]))))', + end: '(?:(/=)|(?:(/)(?!\\*([^\\*]|(\\*[^\\/]))*\\*\\/)))', + endCaptures: { + '1': { + name: 'keyword.operator.assignment.compound.ts', + }, + '2': { + name: 'keyword.operator.arithmetic.ts', + }, + }, + patterns: [ + { + include: '#comment', + }, + ], + }, + { + match: '(?<=[_$[:alnum:])\\]])\\s*(?:(/=)|(?:(/)(?![/*])))', + captures: { + '1': { + name: 'keyword.operator.assignment.compound.ts', + }, + '2': { + name: 'keyword.operator.arithmetic.ts', + }, + }, + }, + ], + }, + 'typeof-operator': { + begin: '(?:&|{\\?]|(extends\\s+)|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))', + patterns: [ + { + include: '#type-arguments', + }, + { + include: '#expression', + }, + ], + }, + literal: { + patterns: [ + { + include: '#numeric-literal', + }, + { + include: '#boolean-literal', + }, + { + include: '#null-literal', + }, + { + include: '#undefined-literal', + }, + { + include: '#numericConstant-literal', + }, + { + include: '#array-literal', + }, + { + include: '#this-literal', + }, + { + include: '#super-literal', + }, + ], + }, + 'array-literal': { + name: 'meta.array.literal.ts', + begin: '\\s*(\\[)', + beginCaptures: { + '1': { + name: 'meta.brace.square.ts', + }, + }, + end: '\\]', + endCaptures: { + '0': { + name: 'meta.brace.square.ts', + }, + }, + patterns: [ + { + include: '#expression', + }, + { + include: '#punctuation-comma', + }, + ], + }, + 'numeric-literal': { + patterns: [ + { + name: 'constant.numeric.hex.ts', + match: '\\b(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))', + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + '3': { + name: 'support.variable.property.ts', + }, + '4': { + name: 'support.constant.ts', + }, + }, + }, + { + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + '3': { + name: 'entity.name.function.ts', + }, + }, + }, + { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + '3': { + name: 'variable.other.constant.property.ts', + }, + }, + }, + { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + '3': { + name: 'variable.other.property.ts', + }, + }, + }, + { + name: 'variable.other.constant.ts', + match: '([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', + }, + { + name: 'variable.other.readwrite.ts', + match: '[_$[:alpha:]][_$[:alnum:]]*', + }, + ], + }, + 'object-identifiers': { + patterns: [ + { + name: 'support.class.ts', + match: '([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))', + }, + { + match: '(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n (\\#?[[:upper:]][_$[:digit:][:upper:]]*) |\n (\\#?[_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + '3': { + name: 'variable.other.constant.object.property.ts', + }, + '4': { + name: 'variable.other.object.property.ts', + }, + }, + }, + { + match: '(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'variable.other.constant.object.ts', + }, + '2': { + name: 'variable.other.object.ts', + }, + }, + }, + ], + }, + 'type-annotation': { + patterns: [ + { + name: 'meta.type.annotation.ts', + begin: '(:)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.ts', + }, + }, + end: '(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', + patterns: [ + { + include: '#type', + }, + ], + }, + { + name: 'meta.type.annotation.ts', + begin: '(:)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.ts', + }, + }, + end: '(?])|(?=^\\s*$)|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', + patterns: [ + { + include: '#type', + }, + ], + }, + ], + }, + 'parameter-type-annotation': { + patterns: [ + { + name: 'meta.type.annotation.ts', + begin: '(:)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.ts', + }, + }, + end: '(?=[,)])|(?==[^>])', + patterns: [ + { + include: '#type', + }, + ], + }, + ], + }, + 'return-type': { + patterns: [ + { + name: 'meta.return.type.ts', + begin: '(?<=\\))\\s*(:)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.ts', + }, + }, + end: '(?|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + patterns: [ + { + include: '#arrow-return-type-body', + }, + ], + }, + 'possibly-arrow-return-type': { + begin: '(?<=\\)|^)\\s*(:)(?=\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*=>)', + beginCaptures: { + '1': { + name: 'meta.arrow.ts meta.return.type.arrow.ts keyword.operator.type.annotation.ts', + }, + }, + end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + contentName: 'meta.arrow.ts meta.return.type.arrow.ts', + patterns: [ + { + include: '#arrow-return-type-body', + }, + ], + }, + 'arrow-return-type-body': { + patterns: [ + { + begin: '(?<=[:])(?=\\s*\\{)', + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + include: '#type-predicate-operator', + }, + { + include: '#type', + }, + ], + }, + 'type-parameters': { + name: 'meta.type.parameters.ts', + begin: '(<)', + beginCaptures: { + '1': { + name: 'punctuation.definition.typeparameters.begin.ts', + }, + }, + end: '(>)', + endCaptures: { + '1': { + name: 'punctuation.definition.typeparameters.end.ts', + }, + }, + patterns: [ + { + include: '#comment', + }, + { + name: 'storage.modifier.ts', + match: '(?)', + }, + ], + }, + 'type-arguments': { + name: 'meta.type.parameters.ts', + begin: '\\<', + beginCaptures: { + '0': { + name: 'punctuation.definition.typeparameters.begin.ts', + }, + }, + end: '\\>', + endCaptures: { + '0': { + name: 'punctuation.definition.typeparameters.end.ts', + }, + }, + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + 'type-arguments-body': { + patterns: [ + { + match: '(?)\n ))\n ))\n)) |\n(:\\s*(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))))', + captures: { + '1': { + name: 'storage.modifier.ts', + }, + '2': { + name: 'keyword.operator.rest.ts', + }, + '3': { + name: 'entity.name.function.ts variable.language.this.ts', + }, + '4': { + name: 'entity.name.function.ts', + }, + '5': { + name: 'keyword.operator.optional.ts', + }, + }, + }, + { + match: '(?x)(?:(?)', + patterns: [ + { + include: '#comment', + }, + { + include: '#type-parameters', + }, + ], + }, + { + name: 'meta.type.constructor.ts', + begin: '(?)\n ))\n )\n )\n)', + end: '(?<=\\))', + patterns: [ + { + include: '#function-parameters', + }, + ], + }, + ], + }, + 'type-function-return-type': { + patterns: [ + { + name: 'meta.type.function.return.ts', + begin: '(=>)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'storage.type.function.arrow.ts', + }, + }, + end: '(?)(?:\\?]|//|$)', + patterns: [ + { + include: '#type-function-return-type-core', + }, + ], + }, + { + name: 'meta.type.function.return.ts', + begin: '=>', + beginCaptures: { + '0': { + name: 'storage.type.function.arrow.ts', + }, + }, + end: '(?)(?]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))', + patterns: [ + { + include: '#type-function-return-type-core', + }, + ], + }, + ], + }, + 'type-function-return-type-core': { + patterns: [ + { + include: '#comment', + }, + { + begin: '(?<==>)(?=\\s*\\{)', + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + include: '#type-predicate-operator', + }, + { + include: '#type', + }, + ], + }, + 'type-operators': { + patterns: [ + { + include: '#typeof-operator', + }, + { + include: '#type-infer', + }, + { + begin: '([&|])(?=\\s*\\{)', + beginCaptures: { + '0': { + name: 'keyword.operator.type.ts', + }, + }, + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + begin: '[&|]', + beginCaptures: { + '0': { + name: 'keyword.operator.type.ts', + }, + }, + end: '(?=\\S)', + }, + { + name: 'keyword.operator.expression.keyof.ts', + match: '(?)', + endCaptures: { + '1': { + name: 'meta.type.parameters.ts punctuation.definition.typeparameters.end.ts', + }, + }, + contentName: 'meta.type.parameters.ts', + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + { + begin: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(<)', + beginCaptures: { + '1': { + name: 'entity.name.type.ts', + }, + '2': { + name: 'meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts', + }, + }, + end: '(>)', + endCaptures: { + '1': { + name: 'meta.type.parameters.ts punctuation.definition.typeparameters.end.ts', + }, + }, + contentName: 'meta.type.parameters.ts', + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + { + match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', + captures: { + '1': { + name: 'entity.name.type.module.ts', + }, + '2': { + name: 'punctuation.accessor.ts', + }, + '3': { + name: 'punctuation.accessor.optional.ts', + }, + }, + }, + { + name: 'entity.name.type.ts', + match: '[_$[:alpha:]][_$[:alnum:]]*', + }, + ], + }, + 'punctuation-comma': { + name: 'punctuation.separator.comma.ts', + match: ',', + }, + 'punctuation-semicolon': { + name: 'punctuation.terminator.statement.ts', + match: ';', + }, + 'punctuation-accessor': { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', + captures: { + '1': { + name: 'punctuation.accessor.ts', + }, + '2': { + name: 'punctuation.accessor.optional.ts', + }, + }, + }, + string: { + patterns: [ + { + include: '#qstring-single', + }, + { + include: '#qstring-double', + }, + { + include: '#template', + }, + ], + }, + 'qstring-double': { + name: 'string.quoted.double.ts', + begin: '"', + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.ts', + }, + }, + end: '(")|((?:[^\\\\\\n])$)', + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.ts', + }, + '2': { + name: 'invalid.illegal.newline.ts', + }, + }, + patterns: [ + { + include: '#string-character-escape', + }, + ], + }, + 'qstring-single': { + name: 'string.quoted.single.ts', + begin: "'", + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.ts', + }, + }, + end: "(\\')|((?:[^\\\\\\n])$)", + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.ts', + }, + '2': { + name: 'invalid.illegal.newline.ts', + }, + }, + patterns: [ + { + include: '#string-character-escape', + }, + ], + }, + 'string-character-escape': { + name: 'constant.character.escape.ts', + match: '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)', + }, + template: { + patterns: [ + { + include: '#template-call', + }, + { + contentName: 'string.template.ts', + begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.ts', + }, + '2': { + name: 'string.template.ts punctuation.definition.string.template.begin.ts', + }, + }, + end: '`', + endCaptures: { + '0': { + name: 'string.template.ts punctuation.definition.string.template.end.ts', + }, + }, + patterns: [ + { + include: '#template-substitution-element', + }, + { + include: '#string-character-escape', + }, + ], + }, + ], + }, + 'template-call': { + patterns: [ + { + begin: "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", + end: '(?=`)', + patterns: [ + { + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))', + end: "(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", + patterns: [ + { + include: '#support-function-call-identifiers', + }, + { + name: 'entity.name.function.tagged-template.ts', + match: '([_$[:alpha:]][_$[:alnum:]]*)', + }, + ], + }, + { + include: '#type-arguments', + }, + ], + }, + { + begin: "([_$[:alpha:]][_$[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)`)", + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.ts', + }, + }, + end: '(?=`)', + patterns: [ + { + include: '#type-arguments', + }, + ], + }, + ], + }, + 'template-substitution-element': { + name: 'meta.template.expression.ts', + begin: '\\$\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.template-expression.begin.ts', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.template-expression.end.ts', + }, + }, + patterns: [ + { + include: '#expression', + }, + ], + contentName: 'meta.embedded.line.ts', + }, + 'type-string': { + patterns: [ + { + include: '#qstring-single', + }, + { + include: '#qstring-double', + }, + { + include: '#template-type', + }, + ], + }, + 'template-type': { + patterns: [ + { + include: '#template-call', + }, + { + contentName: 'string.template.ts', + begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.ts', + }, + '2': { + name: 'string.template.ts punctuation.definition.string.template.begin.ts', + }, + }, + end: '`', + endCaptures: { + '0': { + name: 'string.template.ts punctuation.definition.string.template.end.ts', + }, + }, + patterns: [ + { + include: '#template-type-substitution-element', + }, + { + include: '#string-character-escape', + }, + ], + }, + ], + }, + 'template-type-substitution-element': { + name: 'meta.template.expression.ts', + begin: '\\$\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.template-expression.begin.ts', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.template-expression.end.ts', + }, + }, + patterns: [ + { + include: '#type', + }, + ], + contentName: 'meta.embedded.line.ts', + }, + regex: { + patterns: [ + { + name: 'string.regexp.ts', + begin: '(?|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[\\()]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\]|\\(([^\\)\\\\]|\\\\.)+\\))+\\/([dgimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))', + beginCaptures: { + '1': { + name: 'punctuation.definition.string.begin.ts', + }, + }, + end: '(/)([dgimsuy]*)', + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.ts', + }, + '2': { + name: 'keyword.other.ts', + }, + }, + patterns: [ + { + include: '#regexp', + }, + ], + }, + { + name: 'string.regexp.ts', + begin: '((?', + captures: { + '0': { + name: 'keyword.other.back-reference.regexp', + }, + '1': { + name: 'variable.other.regexp', + }, + }, + }, + { + name: 'keyword.operator.quantifier.regexp', + match: '[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??', + }, + { + name: 'keyword.operator.or.regexp', + match: '\\|', + }, + { + name: 'meta.group.assertion.regexp', + begin: '(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?))?', + beginCaptures: { + '0': { + name: 'punctuation.definition.group.regexp', + }, + '1': { + name: 'punctuation.definition.group.no-capture.regexp', + }, + '2': { + name: 'variable.other.regexp', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'punctuation.definition.group.regexp', + }, + }, + patterns: [ + { + include: '#regexp', + }, + ], + }, + { + name: 'constant.other.character-class.set.regexp', + begin: '(\\[)(\\^)?', + beginCaptures: { + '1': { + name: 'punctuation.definition.character-class.regexp', + }, + '2': { + name: 'keyword.operator.negation.regexp', + }, + }, + end: '(\\])', + endCaptures: { + '1': { + name: 'punctuation.definition.character-class.regexp', + }, + }, + patterns: [ + { + name: 'constant.other.character-class.range.regexp', + match: '(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))', + captures: { + '1': { + name: 'constant.character.numeric.regexp', + }, + '2': { + name: 'constant.character.control.regexp', + }, + '3': { + name: 'constant.character.escape.backslash.regexp', + }, + '4': { + name: 'constant.character.numeric.regexp', + }, + '5': { + name: 'constant.character.control.regexp', + }, + '6': { + name: 'constant.character.escape.backslash.regexp', + }, + }, + }, + { + include: '#regex-character-class', + }, + ], + }, + { + include: '#regex-character-class', + }, + ], + }, + 'regex-character-class': { + patterns: [ + { + name: 'constant.other.character-class.regexp', + match: '\\\\[wWsSdDtrnvf]|\\.', + }, + { + name: 'constant.character.numeric.regexp', + match: '\\\\([0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4})', + }, + { + name: 'constant.character.control.regexp', + match: '\\\\c[A-Z]', + }, + { + name: 'constant.character.escape.backslash.regexp', + match: '\\\\.', + }, + ], + }, + comment: { + patterns: [ + { + name: 'comment.block.documentation.ts', + begin: '/\\*\\*(?!/)', + beginCaptures: { + '0': { + name: 'punctuation.definition.comment.ts', + }, + }, + end: '\\*/', + endCaptures: { + '0': { + name: 'punctuation.definition.comment.ts', + }, + }, + patterns: [ + { + include: '#docblock', + }, + ], + }, + { + name: 'comment.block.ts', + begin: '(/\\*)(?:\\s*((@)internal)(?=\\s|(\\*/)))?', + beginCaptures: { + '1': { + name: 'punctuation.definition.comment.ts', + }, + '2': { + name: 'storage.type.internaldeclaration.ts', + }, + '3': { + name: 'punctuation.decorator.internaldeclaration.ts', + }, + }, + end: '\\*/', + endCaptures: { + '0': { + name: 'punctuation.definition.comment.ts', + }, + }, + }, + { + begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', + beginCaptures: { + '1': { + name: 'punctuation.whitespace.comment.leading.ts', + }, + '2': { + name: 'comment.line.double-slash.ts', + }, + '3': { + name: 'punctuation.definition.comment.ts', + }, + '4': { + name: 'storage.type.internaldeclaration.ts', + }, + '5': { + name: 'punctuation.decorator.internaldeclaration.ts', + }, + }, + end: '(?=$)', + contentName: 'comment.line.double-slash.ts', + }, + ], + }, + 'single-line-comment-consuming-line-ending': { + begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', + beginCaptures: { + '1': { + name: 'punctuation.whitespace.comment.leading.ts', + }, + '2': { + name: 'comment.line.double-slash.ts', + }, + '3': { + name: 'punctuation.definition.comment.ts', + }, + '4': { + name: 'storage.type.internaldeclaration.ts', + }, + '5': { + name: 'punctuation.decorator.internaldeclaration.ts', + }, + }, + end: '(?=^)', + contentName: 'comment.line.double-slash.ts', + }, + directives: { + name: 'comment.line.triple-slash.directive.ts', + begin: "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|lib|name|resolution-mode)\\s*=\\s*((\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)))+\\s*/>\\s*$)", + beginCaptures: { + '1': { + name: 'punctuation.definition.comment.ts', + }, + }, + end: '(?=$)', + patterns: [ + { + name: 'meta.tag.ts', + begin: '(<)(reference|amd-dependency|amd-module)', + beginCaptures: { + '1': { + name: 'punctuation.definition.tag.directive.ts', + }, + '2': { + name: 'entity.name.tag.directive.ts', + }, + }, + end: '/>', + endCaptures: { + '0': { + name: 'punctuation.definition.tag.directive.ts', + }, + }, + patterns: [ + { + name: 'entity.other.attribute-name.directive.ts', + match: 'path|types|no-default-lib|lib|name|resolution-mode', + }, + { + name: 'keyword.operator.assignment.ts', + match: '=', + }, + { + include: '#string', + }, + ], + }, + ], + }, + docblock: { + patterns: [ + { + match: '(?x)\n((@)(?:access|api))\n\\s+\n(private|protected|public)\n\\b', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'constant.language.access-type.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)author)\n\\s+\n(\n [^@\\s<>*/]\n (?:[^@<>*/]|\\*[^/])*\n)\n(?:\n \\s*\n (<)\n ([^>\\s]+)\n (>)\n)?', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + '4': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '5': { + name: 'constant.other.email.link.underline.jsdoc', + }, + '6': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)borrows) \\s+\n((?:[^@\\s*/]|\\*[^/])+) # \n\\s+ (as) \\s+ # as\n((?:[^@\\s*/]|\\*[^/])+) # ', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + '4': { + name: 'keyword.operator.control.jsdoc', + }, + '5': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + name: 'meta.example.jsdoc', + begin: '((@)example)\\s+', + end: '(?=@|\\*/)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + patterns: [ + { + match: '^\\s\\*\\s+', + }, + { + contentName: 'constant.other.description.jsdoc', + begin: '\\G(<)caption(>)', + beginCaptures: { + '0': { + name: 'entity.name.tag.inline.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + end: '()|(?=\\*/)', + endCaptures: { + '0': { + name: 'entity.name.tag.inline.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + }, + { + match: '[^\\s@*](?:[^*]|\\*[^/])*', + captures: { + '0': { + name: 'source.embedded.ts', + }, + }, + }, + ], + }, + { + match: '(?x) ((@)kind) \\s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \\b', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'constant.language.symbol-type.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)see)\n\\s+\n(?:\n # URL\n (\n (?=https?://)\n (?:[^\\s*]|\\*[^/])+\n )\n |\n # JSDoc namepath\n (\n (?!\n # Avoid matching bare URIs (also acceptable as links)\n https?://\n |\n # Avoid matching {@inline tags}; we match those below\n (?:\\[[^\\[\\]]*\\])? # Possible description [preceding]{@tag}\n {@(?:link|linkcode|linkplain|tutorial)\\b\n )\n # Matched namepath\n (?:[^@\\s*/]|\\*[^/])+\n )\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.link.underline.jsdoc', + }, + '4': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)template)\n\\s+\n# One or more valid identifiers\n(\n [A-Za-z_$] # First character: non-numeric word character\n [\\w$.\\[\\]]* # Rest of identifier\n (?: # Possible list of additional identifiers\n \\s* , \\s*\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n )*\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + begin: '(?x)((@)template)\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'variable.other.jsdoc', + match: '([A-Za-z_$][\\w$.\\[\\]]*)', + }, + ], + }, + { + match: '(?x)\n(\n (@)\n (?:arg|argument|const|constant|member|namespace|param|var)\n)\n\\s+\n(\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + begin: '((@)typedef)\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'entity.name.type.instance.jsdoc', + match: '(?:[^@\\s*/]|\\*[^/])+', + }, + ], + }, + { + begin: '((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'variable.other.jsdoc', + match: '([A-Za-z_$][\\w$.\\[\\]]*)', + }, + { + name: 'variable.other.jsdoc', + match: "(?x)\n(\\[)\\s*\n[\\w$]+\n(?:\n (?:\\[\\])? # Foo[ ].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [\\w$]+\n)*\n(?:\n \\s*\n (=) # [foo=bar] Default parameter value\n \\s*\n (\n # The inner regexes are to stop the match early at */ and to not stop at escaped quotes\n (?>\n \"(?:(?:\\*(?!/))|(?:\\\\(?!\"))|[^*\\\\])*?\" | # [foo=\"bar\"] Double-quoted\n '(?:(?:\\*(?!/))|(?:\\\\(?!'))|[^*\\\\])*?' | # [foo='bar'] Single-quoted\n \\[ (?:(?:\\*(?!/))|[^*])*? \\] | # [foo=[1,2]] Array literal\n (?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])* # Everything else\n )*\n )\n)?\n\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))", + captures: { + '1': { + name: 'punctuation.definition.optional-value.begin.bracket.square.jsdoc', + }, + '2': { + name: 'keyword.operator.assignment.jsdoc', + }, + '3': { + name: 'source.embedded.ts', + }, + '4': { + name: 'punctuation.definition.optional-value.end.bracket.square.jsdoc', + }, + '5': { + name: 'invalid.illegal.syntax.jsdoc', + }, + }, + }, + ], + }, + { + begin: '(?x)\n(\n (@)\n (?:define|enum|exception|export|extends|lends|implements|modifies\n |namespace|private|protected|returns?|satisfies|suppress|this|throws|type\n |yields?)\n)\n\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + ], + }, + { + match: '(?x)\n(\n (@)\n (?:alias|augments|callback|constructs|emits|event|fires|exports?\n |extends|external|function|func|host|lends|listens|interface|memberof!?\n |method|module|mixes|mixin|name|requires|see|this|typedef|uses)\n)\n\\s+\n(\n (?:\n [^{}@\\s*] | \\*[^/]\n )+\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + contentName: 'variable.other.jsdoc', + begin: "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))", + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + '4': { + name: 'punctuation.definition.string.begin.jsdoc', + }, + }, + end: '(\\3)|(?=$|\\*/)', + endCaptures: { + '0': { + name: 'variable.other.jsdoc', + }, + '1': { + name: 'punctuation.definition.string.end.jsdoc', + }, + }, + }, + { + match: '((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + name: 'storage.type.class.jsdoc', + match: '(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \\b', + captures: { + '1': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + }, + { + include: '#inline-tags', + }, + { + match: '((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\\s+)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + }, + ], + }, + brackets: { + patterns: [ + { + begin: '{', + end: '}|(?=\\*/)', + patterns: [ + { + include: '#brackets', + }, + ], + }, + { + begin: '\\[', + end: '\\]|(?=\\*/)', + patterns: [ + { + include: '#brackets', + }, + ], + }, + ], + }, + 'inline-tags': { + patterns: [ + { + name: 'constant.other.description.jsdoc', + match: '(\\[)[^\\]]+(\\])(?={@(?:link|linkcode|linkplain|tutorial))', + captures: { + '1': { + name: 'punctuation.definition.bracket.square.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.square.end.jsdoc', + }, + }, + }, + { + name: 'entity.name.type.instance.jsdoc', + begin: '({)((@)(?:link(?:code|plain)?|tutorial))\\s*', + beginCaptures: { + '1': { + name: 'punctuation.definition.bracket.curly.begin.jsdoc', + }, + '2': { + name: 'storage.type.class.jsdoc', + }, + '3': { + name: 'punctuation.definition.inline.tag.jsdoc', + }, + }, + end: '}|(?=\\*/)', + endCaptures: { + '0': { + name: 'punctuation.definition.bracket.curly.end.jsdoc', + }, + }, + patterns: [ + { + match: '\\G((?=https?://)(?:[^|}\\s*]|\\*[/])+)(\\|)?', + captures: { + '1': { + name: 'variable.other.link.underline.jsdoc', + }, + '2': { + name: 'punctuation.separator.pipe.jsdoc', + }, + }, + }, + { + match: '\\G((?:[^{}@\\s|*]|\\*[^/])+)(\\|)?', + captures: { + '1': { + name: 'variable.other.description.jsdoc', + }, + '2': { + name: 'punctuation.separator.pipe.jsdoc', + }, + }, + }, + ], + }, + ], + }, + jsdoctype: { + patterns: [ + { + contentName: 'entity.name.type.instance.jsdoc', + begin: '\\G({)', + beginCaptures: { + '0': { + name: 'entity.name.type.instance.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.curly.begin.jsdoc', + }, + }, + end: '((}))\\s*|(?=\\*/)', + endCaptures: { + '1': { + name: 'entity.name.type.instance.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.curly.end.jsdoc', + }, + }, + patterns: [ + { + include: '#brackets', + }, + ], + }, + ], + }, + }, + }, + grammarLocation: './syntaxes/TypeScript.tmLanguage.json', + injectTo: undefined, + embeddedLanguages: undefined, + tokenTypes: { + 'meta.template.expression': 'other', + 'meta.template.expression string': 'string', + 'meta.template.expression comment': 'comment', + 'entity.name.type.instance.jsdoc': 'other', + 'entity.name.function.tagged-template': 'other', + 'meta.import string.quoted': 'other', + 'variable.other.jsdoc': 'other', + }, + }, + { + language: 'typescriptreact', + scope: 'source.tsx', + format: 'json', + grammar: { + information_for_contributors: [ + 'This file has been converted from https://github.com/microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage', + 'If you want to provide a fix or improvement, please create a pull request against the original repository.', + 'Once accepted there, we are happy to receive an update request.', + ], + version: 'https://github.com/microsoft/TypeScript-TmLanguage/commit/0d73d1117e0a9b1d6635ebbe9aa37d615171b02d', + name: 'TypeScriptReact', + scopeName: 'source.tsx', + patterns: [ + { + include: '#directives', + }, + { + include: '#statements', + }, + { + include: '#shebang', + }, + ], + repository: { + shebang: { + name: 'comment.line.shebang.tsx', + match: '\\A(#!).*(?=$)', + captures: { + '1': { + name: 'punctuation.definition.comment.tsx', + }, + }, + }, + statements: { + patterns: [ + { + include: '#declaration', + }, + { + include: '#control-statement', + }, + { + include: '#after-operator-block-as-object-literal', + }, + { + include: '#decl-block', + }, + { + include: '#label', + }, + { + include: '#expression', + }, + { + include: '#punctuation-semicolon', + }, + { + include: '#string', + }, + { + include: '#comment', + }, + ], + }, + declaration: { + patterns: [ + { + include: '#decorator', + }, + { + include: '#var-expr', + }, + { + include: '#function-declaration', + }, + { + include: '#class-declaration', + }, + { + include: '#interface-declaration', + }, + { + include: '#enum-declaration', + }, + { + include: '#namespace-declaration', + }, + { + include: '#type-alias-declaration', + }, + { + include: '#import-equals-declaration', + }, + { + include: '#import-declaration', + }, + { + include: '#export-declaration', + }, + { + name: 'storage.modifier.tsx', + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + beginCaptures: { + '1': { + name: 'meta.definition.variable.tsx entity.name.function.tsx', + }, + '2': { + name: 'keyword.operator.definiteassignment.tsx', + }, + }, + end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + beginCaptures: { + '1': { + name: 'meta.definition.variable.tsx variable.other.constant.tsx entity.name.function.tsx', + }, + }, + end: '(?=$|^|[;,=}]|((?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'storage.modifier.tsx', + }, + '2': { + name: 'keyword.operator.rest.tsx', + }, + '3': { + name: 'entity.name.function.tsx variable.language.this.tsx', + }, + '4': { + name: 'entity.name.function.tsx', + }, + '5': { + name: 'keyword.operator.optional.tsx', + }, + }, + }, + { + match: '(?x)(?:(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'meta.definition.property.tsx entity.name.function.tsx', + }, + '2': { + name: 'keyword.operator.optional.tsx', + }, + '3': { + name: 'keyword.operator.definiteassignment.tsx', + }, + }, + }, + { + name: 'meta.definition.property.tsx variable.object.property.tsx', + match: '\\#?[_$[:alpha:]][_$[:alnum:]]*', + }, + { + name: 'keyword.operator.optional.tsx', + match: '\\?', + }, + { + name: 'keyword.operator.definiteassignment.tsx', + match: '\\!', + }, + ], + }, + 'variable-initializer': { + patterns: [ + { + begin: '(?\\s*$)', + beginCaptures: { + '1': { + name: 'keyword.operator.assignment.tsx', + }, + }, + end: '(?=$|^|[,);}\\]]|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])', + beginCaptures: { + '1': { + name: 'storage.modifier.tsx', + }, + '2': { + name: 'storage.modifier.tsx', + }, + '3': { + name: 'storage.modifier.tsx', + }, + '4': { + name: 'storage.modifier.async.tsx', + }, + '5': { + name: 'keyword.operator.new.tsx', + }, + '6': { + name: 'keyword.generator.asterisk.tsx', + }, + }, + end: '(?=\\}|;|,|$)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + ], + }, + { + name: 'meta.method.declaration.tsx', + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.tsx', + }, + '2': { + name: 'storage.modifier.tsx', + }, + '3': { + name: 'storage.modifier.tsx', + }, + '4': { + name: 'storage.modifier.async.tsx', + }, + '5': { + name: 'storage.type.property.tsx', + }, + '6': { + name: 'keyword.generator.asterisk.tsx', + }, + }, + end: '(?=\\}|;|,|$)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + ], + }, + ], + }, + 'object-literal-method-declaration': { + name: 'meta.method.declaration.tsx', + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + '2': { + name: 'storage.type.property.tsx', + }, + '3': { + name: 'keyword.generator.asterisk.tsx', + }, + }, + end: '(?=\\}|;|,)|(?<=\\})', + patterns: [ + { + include: '#method-declaration-name', + }, + { + include: '#function-body', + }, + { + begin: "(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])", + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + '2': { + name: 'storage.type.property.tsx', + }, + '3': { + name: 'keyword.generator.asterisk.tsx', + }, + }, + end: '(?=\\(|\\<)', + patterns: [ + { + include: '#method-declaration-name', + }, + ], + }, + ], + }, + 'method-declaration-name': { + begin: "(?x)(?=((\\b(?)', + captures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + '2': { + name: 'variable.parameter.tsx', + }, + }, + }, + { + name: 'meta.arrow.tsx', + begin: "(?x) (?:\n (? is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)", + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + }, + end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + patterns: [ + { + include: '#comment', + }, + { + include: '#type-parameters', + }, + { + include: '#function-parameters', + }, + { + include: '#arrow-return-type', + }, + { + include: '#possibly-arrow-return-type', + }, + ], + }, + { + name: 'meta.arrow.tsx', + begin: '=>', + beginCaptures: { + '0': { + name: 'storage.type.function.arrow.tsx', + }, + }, + end: '((?<=\\}|\\S)(?)|((?!\\{)(?=\\S)))(?!\\/[\\/\\*])', + patterns: [ + { + include: '#single-line-comment-consuming-line-ending', + }, + { + include: '#decl-block', + }, + { + include: '#expression', + }, + ], + }, + ], + }, + 'indexer-declaration': { + name: 'meta.indexer.declaration.tsx', + begin: '(?:(?]|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^yield|[^\\._$[:alnum:]]yield|^throw|[^\\._$[:alnum:]]throw|^in|[^\\._$[:alnum:]]in|^of|[^\\._$[:alnum:]]of|^typeof|[^\\._$[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)', + beginCaptures: { + '1': { + name: 'punctuation.definition.block.tsx', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.block.tsx', + }, + }, + patterns: [ + { + include: '#object-member', + }, + ], + }, + 'object-literal': { + name: 'meta.objectliteral.tsx', + begin: '\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.block.tsx', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.block.tsx', + }, + }, + patterns: [ + { + include: '#object-member', + }, + ], + }, + 'object-member': { + patterns: [ + { + include: '#comment', + }, + { + include: '#object-literal-method-declaration', + }, + { + name: 'meta.object.member.tsx meta.object-literal.key.tsx', + begin: '(?=\\[)', + end: '(?=:)|((?<=[\\]])(?=\\s*[\\(\\<]))', + patterns: [ + { + include: '#comment', + }, + { + include: '#array-literal', + }, + ], + }, + { + name: 'meta.object.member.tsx meta.object-literal.key.tsx', + begin: "(?=[\\'\\\"\\`])", + end: "(?=:)|((?<=[\\'\\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as|satisifies)\\s+))))", + patterns: [ + { + include: '#comment', + }, + { + include: '#string', + }, + ], + }, + { + name: 'meta.object.member.tsx meta.object-literal.key.tsx', + begin: '(?x)(?=(\\b(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '0': { + name: 'meta.object-literal.key.tsx', + }, + '1': { + name: 'entity.name.function.tsx', + }, + }, + }, + { + name: 'meta.object.member.tsx', + match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)', + captures: { + '0': { + name: 'meta.object-literal.key.tsx', + }, + }, + }, + { + name: 'meta.object.member.tsx', + begin: '\\.\\.\\.', + beginCaptures: { + '0': { + name: 'keyword.operator.spread.tsx', + }, + }, + end: '(?=,|\\})', + patterns: [ + { + include: '#expression', + }, + ], + }, + { + name: 'meta.object.member.tsx', + match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$|\\/\\/|\\/\\*)', + captures: { + '1': { + name: 'variable.other.readwrite.tsx', + }, + }, + }, + { + name: 'meta.object.member.tsx', + match: '(?]|\\|\\||\\&\\&|\\!\\=\\=|$|^|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#type-parameters', + }, + { + begin: '\\(', + beginCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + ], + }, + { + begin: '(?<=:)\\s*(async)?\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + '2': { + name: 'meta.brace.round.tsx', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + { + begin: '(?<=:)\\s*(async)?\\s*(?=\\<\\s*$)', + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + }, + end: '(?<=\\>)', + patterns: [ + { + include: '#type-parameters', + }, + ], + }, + { + begin: '(?<=\\>)\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'meta.brace.round.tsx', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + { + include: '#possibly-arrow-return-type', + }, + { + include: '#expression', + }, + ], + }, + { + include: '#punctuation-comma', + }, + { + include: '#decl-block', + }, + ], + }, + 'ternary-expression': { + begin: '(?!\\?\\.\\s*[^[:digit:]])(\\?)(?!\\?)', + beginCaptures: { + '1': { + name: 'keyword.operator.ternary.tsx', + }, + }, + end: '\\s*(:)', + endCaptures: { + '1': { + name: 'keyword.operator.ternary.tsx', + }, + }, + patterns: [ + { + include: '#expression', + }, + ], + }, + 'function-call': { + patterns: [ + { + begin: "(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + end: "(?<=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + name: 'meta.function-call.tsx', + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', + end: "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?((<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?\\())", + patterns: [ + { + include: '#function-call-target', + }, + ], + }, + { + include: '#comment', + }, + { + include: '#function-call-optionals', + }, + { + include: '#type-arguments', + }, + { + include: '#paren-expression', + }, + ], + }, + { + begin: '(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', + end: '(?<=\\>)(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\\)]))(<\\s*[\\{\\[\\(]\\s*$))', + patterns: [ + { + name: 'meta.function-call.tsx', + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))', + end: '(?=(<\\s*[\\{\\[\\(]\\s*$))', + patterns: [ + { + include: '#function-call-target', + }, + ], + }, + { + include: '#comment', + }, + { + include: '#function-call-optionals', + }, + { + include: '#type-arguments', + }, + ], + }, + ], + }, + 'function-call-target': { + patterns: [ + { + include: '#support-function-call-identifiers', + }, + { + name: 'entity.name.function.tsx', + match: '(\\#?[_$[:alpha:]][_$[:alnum:]]*)', + }, + ], + }, + 'function-call-optionals': { + patterns: [ + { + name: 'meta.function-call.tsx punctuation.accessor.optional.tsx', + match: '\\?\\.', + }, + { + name: 'meta.function-call.tsx keyword.operator.definiteassignment.tsx', + match: '\\!', + }, + ], + }, + 'support-function-call-identifiers': { + patterns: [ + { + include: '#literal', + }, + { + include: '#support-objects', + }, + { + include: '#object-identifiers', + }, + { + include: '#punctuation-accessor', + }, + { + name: 'keyword.operator.expression.import.tsx', + match: "(?:(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?]|\\|\\||\\&\\&|\\!\\=\\=|$|(===|!==|==|!=)|(([\\&\\~\\^\\|]\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s+instanceof(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.)))|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\(\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))', + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#paren-expression-possibly-arrow-with-typeparameters', + }, + ], + }, + { + begin: '(?<=[(=,]|=>|^return|[^\\._$[:alnum:]]return)\\s*(async)?(?=\\s*((((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?\\()|(<)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)))\\s*$)', + beginCaptures: { + '1': { + name: 'storage.modifier.async.tsx', + }, + }, + end: '(?<=\\))', + patterns: [ + { + include: '#paren-expression-possibly-arrow-with-typeparameters', + }, + ], + }, + { + include: '#possibly-arrow-return-type', + }, + ], + }, + 'paren-expression-possibly-arrow-with-typeparameters': { + patterns: [ + { + include: '#type-parameters', + }, + { + begin: '\\(', + beginCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'meta.brace.round.tsx', + }, + }, + patterns: [ + { + include: '#expression-inside-possibly-arrow-parens', + }, + ], + }, + ], + }, + 'expression-inside-possibly-arrow-parens': { + patterns: [ + { + include: '#expressionWithoutIdentifiers', + }, + { + include: '#comment', + }, + { + include: '#string', + }, + { + include: '#decorator', + }, + { + include: '#destructuring-parameter', + }, + { + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))", + captures: { + '1': { + name: 'storage.modifier.tsx', + }, + '2': { + name: 'keyword.operator.rest.tsx', + }, + '3': { + name: 'entity.name.function.tsx variable.language.this.tsx', + }, + '4': { + name: 'entity.name.function.tsx', + }, + '5': { + name: 'keyword.operator.optional.tsx', + }, + }, + }, + { + match: '(?x)(?:(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?>=|>>>=|\\|=', + }, + { + name: 'keyword.operator.bitwise.shift.tsx', + match: '<<|>>>|>>', + }, + { + name: 'keyword.operator.comparison.tsx', + match: '===|!==|==|!=', + }, + { + name: 'keyword.operator.relational.tsx', + match: '<=|>=|<>|<|>', + }, + { + match: '(?<=[_$[:alnum:]])(\\!)\\s*(?:(/=)|(?:(/)(?![/*])))', + captures: { + '1': { + name: 'keyword.operator.logical.tsx', + }, + '2': { + name: 'keyword.operator.assignment.compound.tsx', + }, + '3': { + name: 'keyword.operator.arithmetic.tsx', + }, + }, + }, + { + name: 'keyword.operator.logical.tsx', + match: '\\!|&&|\\|\\||\\?\\?', + }, + { + name: 'keyword.operator.bitwise.tsx', + match: '\\&|~|\\^|\\|', + }, + { + name: 'keyword.operator.assignment.tsx', + match: '\\=', + }, + { + name: 'keyword.operator.decrement.tsx', + match: '--', + }, + { + name: 'keyword.operator.increment.tsx', + match: '\\+\\+', + }, + { + name: 'keyword.operator.arithmetic.tsx', + match: '%|\\*|/|-|\\+', + }, + { + begin: '(?<=[_$[:alnum:])\\]])\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)+(?:(/=)|(?:(/)(?![/*]))))', + end: '(?:(/=)|(?:(/)(?!\\*([^\\*]|(\\*[^\\/]))*\\*\\/)))', + endCaptures: { + '1': { + name: 'keyword.operator.assignment.compound.tsx', + }, + '2': { + name: 'keyword.operator.arithmetic.tsx', + }, + }, + patterns: [ + { + include: '#comment', + }, + ], + }, + { + match: '(?<=[_$[:alnum:])\\]])\\s*(?:(/=)|(?:(/)(?![/*])))', + captures: { + '1': { + name: 'keyword.operator.assignment.compound.tsx', + }, + '2': { + name: 'keyword.operator.arithmetic.tsx', + }, + }, + }, + ], + }, + 'typeof-operator': { + begin: '(?:&|{\\?]|(extends\\s+)|$|;|^\\s*$|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))', + patterns: [ + { + include: '#type-arguments', + }, + { + include: '#expression', + }, + ], + }, + literal: { + patterns: [ + { + include: '#numeric-literal', + }, + { + include: '#boolean-literal', + }, + { + include: '#null-literal', + }, + { + include: '#undefined-literal', + }, + { + include: '#numericConstant-literal', + }, + { + include: '#array-literal', + }, + { + include: '#this-literal', + }, + { + include: '#super-literal', + }, + ], + }, + 'array-literal': { + name: 'meta.array.literal.tsx', + begin: '\\s*(\\[)', + beginCaptures: { + '1': { + name: 'meta.brace.square.tsx', + }, + }, + end: '\\]', + endCaptures: { + '0': { + name: 'meta.brace.square.tsx', + }, + }, + patterns: [ + { + include: '#expression', + }, + { + include: '#punctuation-comma', + }, + ], + }, + 'numeric-literal': { + patterns: [ + { + name: 'constant.numeric.hex.tsx', + match: '\\b(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\\())\n |\n (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\\b(?!\\$)))', + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + '3': { + name: 'support.variable.property.tsx', + }, + '4': { + name: 'support.constant.tsx', + }, + }, + }, + { + match: '(?)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>] # < typeparam extends\n) |\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\'\\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n))", + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + '3': { + name: 'entity.name.function.tsx', + }, + }, + }, + { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + '3': { + name: 'variable.other.constant.property.tsx', + }, + }, + }, + { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + '3': { + name: 'variable.other.property.tsx', + }, + }, + }, + { + name: 'variable.other.constant.tsx', + match: '([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])', + }, + { + name: 'variable.other.readwrite.tsx', + match: '[_$[:alpha:]][_$[:alnum:]]*', + }, + ], + }, + 'object-identifiers': { + patterns: [ + { + name: 'support.class.tsx', + match: '([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))', + }, + { + match: '(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n (\\#?[[:upper:]][_$[:digit:][:upper:]]*) |\n (\\#?[_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + '3': { + name: 'variable.other.constant.object.property.tsx', + }, + '4': { + name: 'variable.other.object.property.tsx', + }, + }, + }, + { + match: '(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)', + captures: { + '1': { + name: 'variable.other.constant.object.tsx', + }, + '2': { + name: 'variable.other.object.tsx', + }, + }, + }, + ], + }, + 'type-annotation': { + patterns: [ + { + name: 'meta.type.annotation.tsx', + begin: '(:)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.tsx', + }, + }, + end: '(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', + patterns: [ + { + include: '#type', + }, + ], + }, + { + name: 'meta.type.annotation.tsx', + begin: '(:)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.tsx', + }, + }, + end: '(?])|(?=^\\s*$)|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))', + patterns: [ + { + include: '#type', + }, + ], + }, + ], + }, + 'parameter-type-annotation': { + patterns: [ + { + name: 'meta.type.annotation.tsx', + begin: '(:)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.tsx', + }, + }, + end: '(?=[,)])|(?==[^>])', + patterns: [ + { + include: '#type', + }, + ], + }, + ], + }, + 'return-type': { + patterns: [ + { + name: 'meta.return.type.tsx', + begin: '(?<=\\))\\s*(:)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'keyword.operator.type.annotation.tsx', + }, + }, + end: '(?|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + patterns: [ + { + include: '#arrow-return-type-body', + }, + ], + }, + 'possibly-arrow-return-type': { + begin: '(?<=\\)|^)\\s*(:)(?=\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*=>)', + beginCaptures: { + '1': { + name: 'meta.arrow.tsx meta.return.type.arrow.tsx keyword.operator.type.annotation.tsx', + }, + }, + end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\\s+))', + contentName: 'meta.arrow.tsx meta.return.type.arrow.tsx', + patterns: [ + { + include: '#arrow-return-type-body', + }, + ], + }, + 'arrow-return-type-body': { + patterns: [ + { + begin: '(?<=[:])(?=\\s*\\{)', + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + include: '#type-predicate-operator', + }, + { + include: '#type', + }, + ], + }, + 'type-parameters': { + name: 'meta.type.parameters.tsx', + begin: '(<)', + beginCaptures: { + '1': { + name: 'punctuation.definition.typeparameters.begin.tsx', + }, + }, + end: '(>)', + endCaptures: { + '1': { + name: 'punctuation.definition.typeparameters.end.tsx', + }, + }, + patterns: [ + { + include: '#comment', + }, + { + name: 'storage.modifier.tsx', + match: '(?)', + }, + ], + }, + 'type-arguments': { + name: 'meta.type.parameters.tsx', + begin: '\\<', + beginCaptures: { + '0': { + name: 'punctuation.definition.typeparameters.begin.tsx', + }, + }, + end: '\\>', + endCaptures: { + '0': { + name: 'punctuation.definition.typeparameters.end.tsx', + }, + }, + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + 'type-arguments-body': { + patterns: [ + { + match: '(?)\n ))\n ))\n)) |\n(:\\s*(?\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))))', + captures: { + '1': { + name: 'storage.modifier.tsx', + }, + '2': { + name: 'keyword.operator.rest.tsx', + }, + '3': { + name: 'entity.name.function.tsx variable.language.this.tsx', + }, + '4': { + name: 'entity.name.function.tsx', + }, + '5': { + name: 'keyword.operator.optional.tsx', + }, + }, + }, + { + match: '(?x)(?:(?)', + patterns: [ + { + include: '#comment', + }, + { + include: '#type-parameters', + }, + ], + }, + { + name: 'meta.type.constructor.tsx', + begin: '(?)\n ))\n )\n )\n)', + end: '(?<=\\))', + patterns: [ + { + include: '#function-parameters', + }, + ], + }, + ], + }, + 'type-function-return-type': { + patterns: [ + { + name: 'meta.type.function.return.tsx', + begin: '(=>)(?=\\s*\\S)', + beginCaptures: { + '1': { + name: 'storage.type.function.arrow.tsx', + }, + }, + end: '(?)(?:\\?]|//|$)', + patterns: [ + { + include: '#type-function-return-type-core', + }, + ], + }, + { + name: 'meta.type.function.return.tsx', + begin: '=>', + beginCaptures: { + '0': { + name: 'storage.type.function.arrow.tsx', + }, + }, + end: '(?)(?]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))', + patterns: [ + { + include: '#type-function-return-type-core', + }, + ], + }, + ], + }, + 'type-function-return-type-core': { + patterns: [ + { + include: '#comment', + }, + { + begin: '(?<==>)(?=\\s*\\{)', + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + include: '#type-predicate-operator', + }, + { + include: '#type', + }, + ], + }, + 'type-operators': { + patterns: [ + { + include: '#typeof-operator', + }, + { + include: '#type-infer', + }, + { + begin: '([&|])(?=\\s*\\{)', + beginCaptures: { + '0': { + name: 'keyword.operator.type.tsx', + }, + }, + end: '(?<=\\})', + patterns: [ + { + include: '#type-object', + }, + ], + }, + { + begin: '[&|]', + beginCaptures: { + '0': { + name: 'keyword.operator.type.tsx', + }, + }, + end: '(?=\\S)', + }, + { + name: 'keyword.operator.expression.keyof.tsx', + match: '(?)', + endCaptures: { + '1': { + name: 'meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx', + }, + }, + contentName: 'meta.type.parameters.tsx', + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + { + begin: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(<)', + beginCaptures: { + '1': { + name: 'entity.name.type.tsx', + }, + '2': { + name: 'meta.type.parameters.tsx punctuation.definition.typeparameters.begin.tsx', + }, + }, + end: '(>)', + endCaptures: { + '1': { + name: 'meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx', + }, + }, + contentName: 'meta.type.parameters.tsx', + patterns: [ + { + include: '#type-arguments-body', + }, + ], + }, + { + match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', + captures: { + '1': { + name: 'entity.name.type.module.tsx', + }, + '2': { + name: 'punctuation.accessor.tsx', + }, + '3': { + name: 'punctuation.accessor.optional.tsx', + }, + }, + }, + { + name: 'entity.name.type.tsx', + match: '[_$[:alpha:]][_$[:alnum:]]*', + }, + ], + }, + 'punctuation-comma': { + name: 'punctuation.separator.comma.tsx', + match: ',', + }, + 'punctuation-semicolon': { + name: 'punctuation.terminator.statement.tsx', + match: ';', + }, + 'punctuation-accessor': { + match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))', + captures: { + '1': { + name: 'punctuation.accessor.tsx', + }, + '2': { + name: 'punctuation.accessor.optional.tsx', + }, + }, + }, + string: { + patterns: [ + { + include: '#qstring-single', + }, + { + include: '#qstring-double', + }, + { + include: '#template', + }, + ], + }, + 'qstring-double': { + name: 'string.quoted.double.tsx', + begin: '"', + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.tsx', + }, + }, + end: '(")|((?:[^\\\\\\n])$)', + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.tsx', + }, + '2': { + name: 'invalid.illegal.newline.tsx', + }, + }, + patterns: [ + { + include: '#string-character-escape', + }, + ], + }, + 'qstring-single': { + name: 'string.quoted.single.tsx', + begin: "'", + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.tsx', + }, + }, + end: "(\\')|((?:[^\\\\\\n])$)", + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.tsx', + }, + '2': { + name: 'invalid.illegal.newline.tsx', + }, + }, + patterns: [ + { + include: '#string-character-escape', + }, + ], + }, + 'string-character-escape': { + name: 'constant.character.escape.tsx', + match: '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)', + }, + template: { + patterns: [ + { + include: '#template-call', + }, + { + contentName: 'string.template.tsx', + begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.tsx', + }, + '2': { + name: 'string.template.tsx punctuation.definition.string.template.begin.tsx', + }, + }, + end: '`', + endCaptures: { + '0': { + name: 'string.template.tsx punctuation.definition.string.template.end.tsx', + }, + }, + patterns: [ + { + include: '#template-substitution-element', + }, + { + include: '#string-character-escape', + }, + ], + }, + ], + }, + 'template-call': { + patterns: [ + { + begin: "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", + end: '(?=`)', + patterns: [ + { + begin: '(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))', + end: "(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)?`)", + patterns: [ + { + include: '#support-function-call-identifiers', + }, + { + name: 'entity.name.function.tagged-template.tsx', + match: '([_$[:alpha:]][_$[:alnum:]]*)', + }, + ], + }, + { + include: '#type-arguments', + }, + ], + }, + { + begin: "([_$[:alpha:]][_$[:alnum:]]*)?\\s*(?=(<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))(([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>|\\<\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))(?=\\s*([\\<\\>\\,\\.\\[]|=>|&(?!&)|\\|(?!\\|)))))([^<>\\(]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(?<==)\\>)*(?))*(?)*(?\\s*)`)", + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.tsx', + }, + }, + end: '(?=`)', + patterns: [ + { + include: '#type-arguments', + }, + ], + }, + ], + }, + 'template-substitution-element': { + name: 'meta.template.expression.tsx', + begin: '\\$\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.template-expression.begin.tsx', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.template-expression.end.tsx', + }, + }, + patterns: [ + { + include: '#expression', + }, + ], + contentName: 'meta.embedded.line.tsx', + }, + 'type-string': { + patterns: [ + { + include: '#qstring-single', + }, + { + include: '#qstring-double', + }, + { + include: '#template-type', + }, + ], + }, + 'template-type': { + patterns: [ + { + include: '#template-call', + }, + { + contentName: 'string.template.tsx', + begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)', + beginCaptures: { + '1': { + name: 'entity.name.function.tagged-template.tsx', + }, + '2': { + name: 'string.template.tsx punctuation.definition.string.template.begin.tsx', + }, + }, + end: '`', + endCaptures: { + '0': { + name: 'string.template.tsx punctuation.definition.string.template.end.tsx', + }, + }, + patterns: [ + { + include: '#template-type-substitution-element', + }, + { + include: '#string-character-escape', + }, + ], + }, + ], + }, + 'template-type-substitution-element': { + name: 'meta.template.expression.tsx', + begin: '\\$\\{', + beginCaptures: { + '0': { + name: 'punctuation.definition.template-expression.begin.tsx', + }, + }, + end: '\\}', + endCaptures: { + '0': { + name: 'punctuation.definition.template-expression.end.tsx', + }, + }, + patterns: [ + { + include: '#type', + }, + ], + contentName: 'meta.embedded.line.tsx', + }, + regex: { + patterns: [ + { + name: 'string.regexp.tsx', + begin: '(?|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[\\()]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\]|\\(([^\\)\\\\]|\\\\.)+\\))+\\/([dgimsuy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))', + beginCaptures: { + '1': { + name: 'punctuation.definition.string.begin.tsx', + }, + }, + end: '(/)([dgimsuy]*)', + endCaptures: { + '1': { + name: 'punctuation.definition.string.end.tsx', + }, + '2': { + name: 'keyword.other.tsx', + }, + }, + patterns: [ + { + include: '#regexp', + }, + ], + }, + { + name: 'string.regexp.tsx', + begin: '((?', + captures: { + '0': { + name: 'keyword.other.back-reference.regexp', + }, + '1': { + name: 'variable.other.regexp', + }, + }, + }, + { + name: 'keyword.operator.quantifier.regexp', + match: '[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??', + }, + { + name: 'keyword.operator.or.regexp', + match: '\\|', + }, + { + name: 'meta.group.assertion.regexp', + begin: '(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?))?', + beginCaptures: { + '0': { + name: 'punctuation.definition.group.regexp', + }, + '1': { + name: 'punctuation.definition.group.no-capture.regexp', + }, + '2': { + name: 'variable.other.regexp', + }, + }, + end: '\\)', + endCaptures: { + '0': { + name: 'punctuation.definition.group.regexp', + }, + }, + patterns: [ + { + include: '#regexp', + }, + ], + }, + { + name: 'constant.other.character-class.set.regexp', + begin: '(\\[)(\\^)?', + beginCaptures: { + '1': { + name: 'punctuation.definition.character-class.regexp', + }, + '2': { + name: 'keyword.operator.negation.regexp', + }, + }, + end: '(\\])', + endCaptures: { + '1': { + name: 'punctuation.definition.character-class.regexp', + }, + }, + patterns: [ + { + name: 'constant.other.character-class.range.regexp', + match: '(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))', + captures: { + '1': { + name: 'constant.character.numeric.regexp', + }, + '2': { + name: 'constant.character.control.regexp', + }, + '3': { + name: 'constant.character.escape.backslash.regexp', + }, + '4': { + name: 'constant.character.numeric.regexp', + }, + '5': { + name: 'constant.character.control.regexp', + }, + '6': { + name: 'constant.character.escape.backslash.regexp', + }, + }, + }, + { + include: '#regex-character-class', + }, + ], + }, + { + include: '#regex-character-class', + }, + ], + }, + 'regex-character-class': { + patterns: [ + { + name: 'constant.other.character-class.regexp', + match: '\\\\[wWsSdDtrnvf]|\\.', + }, + { + name: 'constant.character.numeric.regexp', + match: '\\\\([0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4})', + }, + { + name: 'constant.character.control.regexp', + match: '\\\\c[A-Z]', + }, + { + name: 'constant.character.escape.backslash.regexp', + match: '\\\\.', + }, + ], + }, + comment: { + patterns: [ + { + name: 'comment.block.documentation.tsx', + begin: '/\\*\\*(?!/)', + beginCaptures: { + '0': { + name: 'punctuation.definition.comment.tsx', + }, + }, + end: '\\*/', + endCaptures: { + '0': { + name: 'punctuation.definition.comment.tsx', + }, + }, + patterns: [ + { + include: '#docblock', + }, + ], + }, + { + name: 'comment.block.tsx', + begin: '(/\\*)(?:\\s*((@)internal)(?=\\s|(\\*/)))?', + beginCaptures: { + '1': { + name: 'punctuation.definition.comment.tsx', + }, + '2': { + name: 'storage.type.internaldeclaration.tsx', + }, + '3': { + name: 'punctuation.decorator.internaldeclaration.tsx', + }, + }, + end: '\\*/', + endCaptures: { + '0': { + name: 'punctuation.definition.comment.tsx', + }, + }, + }, + { + begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', + beginCaptures: { + '1': { + name: 'punctuation.whitespace.comment.leading.tsx', + }, + '2': { + name: 'comment.line.double-slash.tsx', + }, + '3': { + name: 'punctuation.definition.comment.tsx', + }, + '4': { + name: 'storage.type.internaldeclaration.tsx', + }, + '5': { + name: 'punctuation.decorator.internaldeclaration.tsx', + }, + }, + end: '(?=$)', + contentName: 'comment.line.double-slash.tsx', + }, + ], + }, + 'single-line-comment-consuming-line-ending': { + begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)', + beginCaptures: { + '1': { + name: 'punctuation.whitespace.comment.leading.tsx', + }, + '2': { + name: 'comment.line.double-slash.tsx', + }, + '3': { + name: 'punctuation.definition.comment.tsx', + }, + '4': { + name: 'storage.type.internaldeclaration.tsx', + }, + '5': { + name: 'punctuation.decorator.internaldeclaration.tsx', + }, + }, + end: '(?=^)', + contentName: 'comment.line.double-slash.tsx', + }, + directives: { + name: 'comment.line.triple-slash.directive.tsx', + begin: "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|lib|name|resolution-mode)\\s*=\\s*((\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)))+\\s*/>\\s*$)", + beginCaptures: { + '1': { + name: 'punctuation.definition.comment.tsx', + }, + }, + end: '(?=$)', + patterns: [ + { + name: 'meta.tag.tsx', + begin: '(<)(reference|amd-dependency|amd-module)', + beginCaptures: { + '1': { + name: 'punctuation.definition.tag.directive.tsx', + }, + '2': { + name: 'entity.name.tag.directive.tsx', + }, + }, + end: '/>', + endCaptures: { + '0': { + name: 'punctuation.definition.tag.directive.tsx', + }, + }, + patterns: [ + { + name: 'entity.other.attribute-name.directive.tsx', + match: 'path|types|no-default-lib|lib|name|resolution-mode', + }, + { + name: 'keyword.operator.assignment.tsx', + match: '=', + }, + { + include: '#string', + }, + ], + }, + ], + }, + docblock: { + patterns: [ + { + match: '(?x)\n((@)(?:access|api))\n\\s+\n(private|protected|public)\n\\b', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'constant.language.access-type.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)author)\n\\s+\n(\n [^@\\s<>*/]\n (?:[^@<>*/]|\\*[^/])*\n)\n(?:\n \\s*\n (<)\n ([^>\\s]+)\n (>)\n)?', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + '4': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '5': { + name: 'constant.other.email.link.underline.jsdoc', + }, + '6': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)borrows) \\s+\n((?:[^@\\s*/]|\\*[^/])+) # \n\\s+ (as) \\s+ # as\n((?:[^@\\s*/]|\\*[^/])+) # ', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + '4': { + name: 'keyword.operator.control.jsdoc', + }, + '5': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + name: 'meta.example.jsdoc', + begin: '((@)example)\\s+', + end: '(?=@|\\*/)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + patterns: [ + { + match: '^\\s\\*\\s+', + }, + { + contentName: 'constant.other.description.jsdoc', + begin: '\\G(<)caption(>)', + beginCaptures: { + '0': { + name: 'entity.name.tag.inline.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + end: '()|(?=\\*/)', + endCaptures: { + '0': { + name: 'entity.name.tag.inline.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.angle.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.angle.end.jsdoc', + }, + }, + }, + { + match: '[^\\s@*](?:[^*]|\\*[^/])*', + captures: { + '0': { + name: 'source.embedded.tsx', + }, + }, + }, + ], + }, + { + match: '(?x) ((@)kind) \\s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \\b', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'constant.language.symbol-type.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)see)\n\\s+\n(?:\n # URL\n (\n (?=https?://)\n (?:[^\\s*]|\\*[^/])+\n )\n |\n # JSDoc namepath\n (\n (?!\n # Avoid matching bare URIs (also acceptable as links)\n https?://\n |\n # Avoid matching {@inline tags}; we match those below\n (?:\\[[^\\[\\]]*\\])? # Possible description [preceding]{@tag}\n {@(?:link|linkcode|linkplain|tutorial)\\b\n )\n # Matched namepath\n (?:[^@\\s*/]|\\*[^/])+\n )\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.link.underline.jsdoc', + }, + '4': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + match: '(?x)\n((@)template)\n\\s+\n# One or more valid identifiers\n(\n [A-Za-z_$] # First character: non-numeric word character\n [\\w$.\\[\\]]* # Rest of identifier\n (?: # Possible list of additional identifiers\n \\s* , \\s*\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n )*\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + begin: '(?x)((@)template)\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'variable.other.jsdoc', + match: '([A-Za-z_$][\\w$.\\[\\]]*)', + }, + ], + }, + { + match: '(?x)\n(\n (@)\n (?:arg|argument|const|constant|member|namespace|param|var)\n)\n\\s+\n(\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + begin: '((@)typedef)\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'entity.name.type.instance.jsdoc', + match: '(?:[^@\\s*/]|\\*[^/])+', + }, + ], + }, + { + begin: '((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + { + name: 'variable.other.jsdoc', + match: '([A-Za-z_$][\\w$.\\[\\]]*)', + }, + { + name: 'variable.other.jsdoc', + match: "(?x)\n(\\[)\\s*\n[\\w$]+\n(?:\n (?:\\[\\])? # Foo[ ].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [\\w$]+\n)*\n(?:\n \\s*\n (=) # [foo=bar] Default parameter value\n \\s*\n (\n # The inner regexes are to stop the match early at */ and to not stop at escaped quotes\n (?>\n \"(?:(?:\\*(?!/))|(?:\\\\(?!\"))|[^*\\\\])*?\" | # [foo=\"bar\"] Double-quoted\n '(?:(?:\\*(?!/))|(?:\\\\(?!'))|[^*\\\\])*?' | # [foo='bar'] Single-quoted\n \\[ (?:(?:\\*(?!/))|[^*])*? \\] | # [foo=[1,2]] Array literal\n (?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])* # Everything else\n )*\n )\n)?\n\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))", + captures: { + '1': { + name: 'punctuation.definition.optional-value.begin.bracket.square.jsdoc', + }, + '2': { + name: 'keyword.operator.assignment.jsdoc', + }, + '3': { + name: 'source.embedded.tsx', + }, + '4': { + name: 'punctuation.definition.optional-value.end.bracket.square.jsdoc', + }, + '5': { + name: 'invalid.illegal.syntax.jsdoc', + }, + }, + }, + ], + }, + { + begin: '(?x)\n(\n (@)\n (?:define|enum|exception|export|extends|lends|implements|modifies\n |namespace|private|protected|returns?|satisfies|suppress|this|throws|type\n |yields?)\n)\n\\s+(?={)', + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])', + patterns: [ + { + include: '#jsdoctype', + }, + ], + }, + { + match: '(?x)\n(\n (@)\n (?:alias|augments|callback|constructs|emits|event|fires|exports?\n |extends|external|function|func|host|lends|listens|interface|memberof!?\n |method|module|mixes|mixin|name|requires|see|this|typedef|uses)\n)\n\\s+\n(\n (?:\n [^{}@\\s*] | \\*[^/]\n )+\n)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'entity.name.type.instance.jsdoc', + }, + }, + }, + { + contentName: 'variable.other.jsdoc', + begin: "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))", + beginCaptures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + '4': { + name: 'punctuation.definition.string.begin.jsdoc', + }, + }, + end: '(\\3)|(?=$|\\*/)', + endCaptures: { + '0': { + name: 'variable.other.jsdoc', + }, + '1': { + name: 'punctuation.definition.string.end.jsdoc', + }, + }, + }, + { + match: '((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + '3': { + name: 'variable.other.jsdoc', + }, + }, + }, + { + name: 'storage.type.class.jsdoc', + match: '(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \\b', + captures: { + '1': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + }, + { + include: '#inline-tags', + }, + { + match: '((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\\s+)', + captures: { + '1': { + name: 'storage.type.class.jsdoc', + }, + '2': { + name: 'punctuation.definition.block.tag.jsdoc', + }, + }, + }, + ], + }, + brackets: { + patterns: [ + { + begin: '{', + end: '}|(?=\\*/)', + patterns: [ + { + include: '#brackets', + }, + ], + }, + { + begin: '\\[', + end: '\\]|(?=\\*/)', + patterns: [ + { + include: '#brackets', + }, + ], + }, + ], + }, + 'inline-tags': { + patterns: [ + { + name: 'constant.other.description.jsdoc', + match: '(\\[)[^\\]]+(\\])(?={@(?:link|linkcode|linkplain|tutorial))', + captures: { + '1': { + name: 'punctuation.definition.bracket.square.begin.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.square.end.jsdoc', + }, + }, + }, + { + name: 'entity.name.type.instance.jsdoc', + begin: '({)((@)(?:link(?:code|plain)?|tutorial))\\s*', + beginCaptures: { + '1': { + name: 'punctuation.definition.bracket.curly.begin.jsdoc', + }, + '2': { + name: 'storage.type.class.jsdoc', + }, + '3': { + name: 'punctuation.definition.inline.tag.jsdoc', + }, + }, + end: '}|(?=\\*/)', + endCaptures: { + '0': { + name: 'punctuation.definition.bracket.curly.end.jsdoc', + }, + }, + patterns: [ + { + match: '\\G((?=https?://)(?:[^|}\\s*]|\\*[/])+)(\\|)?', + captures: { + '1': { + name: 'variable.other.link.underline.jsdoc', + }, + '2': { + name: 'punctuation.separator.pipe.jsdoc', + }, + }, + }, + { + match: '\\G((?:[^{}@\\s|*]|\\*[^/])+)(\\|)?', + captures: { + '1': { + name: 'variable.other.description.jsdoc', + }, + '2': { + name: 'punctuation.separator.pipe.jsdoc', + }, + }, + }, + ], + }, + ], + }, + jsdoctype: { + patterns: [ + { + contentName: 'entity.name.type.instance.jsdoc', + begin: '\\G({)', + beginCaptures: { + '0': { + name: 'entity.name.type.instance.jsdoc', + }, + '1': { + name: 'punctuation.definition.bracket.curly.begin.jsdoc', + }, + }, + end: '((}))\\s*|(?=\\*/)', + endCaptures: { + '1': { + name: 'entity.name.type.instance.jsdoc', + }, + '2': { + name: 'punctuation.definition.bracket.curly.end.jsdoc', + }, + }, + patterns: [ + { + include: '#brackets', + }, + ], + }, + ], + }, + jsx: { + patterns: [ + { + include: '#jsx-tag-without-attributes-in-expression', + }, + { + include: '#jsx-tag-in-expression', + }, + ], + }, + 'jsx-tag-without-attributes-in-expression': { + begin: '(?:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^default|[^\\._$[:alnum:]]default|^yield|[^\\._$[:alnum:]]yield|^)\\s*(?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', + end: '(?!(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', + patterns: [ + { + include: '#jsx-tag-without-attributes', + }, + ], + }, + 'jsx-tag-without-attributes': { + name: 'meta.tag.without-attributes.tsx', + begin: '(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?)', + end: '()', + beginCaptures: { + '1': { + name: 'punctuation.definition.tag.begin.tsx', + }, + '2': { + name: 'entity.name.tag.namespace.tsx', + }, + '3': { + name: 'punctuation.separator.namespace.tsx', + }, + '4': { + name: 'entity.name.tag.tsx', + }, + '5': { + name: 'support.class.component.tsx', + }, + '6': { + name: 'punctuation.definition.tag.end.tsx', + }, + }, + endCaptures: { + '1': { + name: 'punctuation.definition.tag.begin.tsx', + }, + '2': { + name: 'entity.name.tag.namespace.tsx', + }, + '3': { + name: 'punctuation.separator.namespace.tsx', + }, + '4': { + name: 'entity.name.tag.tsx', + }, + '5': { + name: 'support.class.component.tsx', + }, + '6': { + name: 'punctuation.definition.tag.end.tsx', + }, + }, + contentName: 'meta.jsx.children.tsx', + patterns: [ + { + include: '#jsx-children', + }, + ], + }, + 'jsx-tag-in-expression': { + begin: '(?x)\n (?:*]|&&|\\|\\||\\?|\\*\\/|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^default|[^\\._$[:alnum:]]default|^yield|[^\\._$[:alnum:]]yield|^)\\s*\n (?!<\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s+[^=>])|,)) # look ahead is not type parameter of arrow\n (?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', + end: '(?!(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', + patterns: [ + { + include: '#jsx-tag', + }, + ], + }, + 'jsx-tag': { + name: 'meta.tag.tsx', + begin: '(?=(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?))', + end: '(/>)|(?:())', + endCaptures: { + '1': { + name: 'punctuation.definition.tag.end.tsx', + }, + '2': { + name: 'punctuation.definition.tag.begin.tsx', + }, + '3': { + name: 'entity.name.tag.namespace.tsx', + }, + '4': { + name: 'punctuation.separator.namespace.tsx', + }, + '5': { + name: 'entity.name.tag.tsx', + }, + '6': { + name: 'support.class.component.tsx', + }, + '7': { + name: 'punctuation.definition.tag.end.tsx', + }, + }, + patterns: [ + { + begin: '(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?)', + beginCaptures: { + '1': { + name: 'punctuation.definition.tag.begin.tsx', + }, + '2': { + name: 'entity.name.tag.namespace.tsx', + }, + '3': { + name: 'punctuation.separator.namespace.tsx', + }, + '4': { + name: 'entity.name.tag.tsx', + }, + '5': { + name: 'support.class.component.tsx', + }, + }, + end: '(?=[/]?>)', + patterns: [ + { + include: '#comment', + }, + { + include: '#type-arguments', + }, + { + include: '#jsx-tag-attributes', + }, + ], + }, + { + begin: '(>)', + beginCaptures: { + '1': { + name: 'punctuation.definition.tag.end.tsx', + }, + }, + end: '(?=)', + patterns: [ + { + include: '#comment', + }, + { + include: '#jsx-tag-attribute-name', + }, + { + include: '#jsx-tag-attribute-assignment', + }, + { + include: '#jsx-string-double-quoted', + }, + { + include: '#jsx-string-single-quoted', + }, + { + include: '#jsx-evaluated-code', + }, + { + include: '#jsx-tag-attributes-illegal', + }, + ], + }, + 'jsx-tag-attribute-name': { + match: '(?x)\n \\s*\n (?:([_$[:alpha:]][-_$[:alnum:].]*)(:))?\n ([_$[:alpha:]][-_$[:alnum:]]*)\n (?=\\s|=|/?>|/\\*|//)', + captures: { + '1': { + name: 'entity.other.attribute-name.namespace.tsx', + }, + '2': { + name: 'punctuation.separator.namespace.tsx', + }, + '3': { + name: 'entity.other.attribute-name.tsx', + }, + }, + }, + 'jsx-tag-attribute-assignment': { + name: 'keyword.operator.assignment.tsx', + match: "=(?=\\s*(?:'|\"|{|/\\*|//|\\n))", + }, + 'jsx-string-double-quoted': { + name: 'string.quoted.double.tsx', + begin: '"', + end: '"', + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.tsx', + }, + }, + endCaptures: { + '0': { + name: 'punctuation.definition.string.end.tsx', + }, + }, + patterns: [ + { + include: '#jsx-entities', + }, + ], + }, + 'jsx-string-single-quoted': { + name: 'string.quoted.single.tsx', + begin: "'", + end: "'", + beginCaptures: { + '0': { + name: 'punctuation.definition.string.begin.tsx', + }, + }, + endCaptures: { + '0': { + name: 'punctuation.definition.string.end.tsx', + }, + }, + patterns: [ + { + include: '#jsx-entities', + }, + ], + }, + 'jsx-tag-attributes-illegal': { + name: 'invalid.illegal.attribute.tsx', + match: '\\S+', + }, + }, + }, + grammarLocation: './syntaxes/TypeScriptReact.tmLanguage.json', + injectTo: undefined, + embeddedLanguages: { + 'meta.tag.tsx': 'jsx-tags', + 'meta.tag.without-attributes.tsx': 'jsx-tags', + 'meta.tag.attributes.tsx': 'typescriptreact', + 'meta.embedded.expression.tsx': 'typescriptreact', + }, + tokenTypes: { + 'meta.template.expression': 'other', + 'meta.template.expression string': 'string', + 'meta.template.expression comment': 'comment', + 'entity.name.type.instance.jsdoc': 'other', + 'entity.name.function.tagged-template': 'other', + 'meta.import string.quoted': 'other', + 'variable.other.jsdoc': 'other', + }, + }, + { + language: undefined, + scope: 'documentation.injection.ts', + format: 'json', + grammar: { + injectionSelector: 'L:comment.block.documentation', + patterns: [ + { + include: '#jsdocbody', + }, + ], + repository: { + jsdocbody: { + begin: '(?<=/\\*\\*)([^*]|\\*(?!/))*$', + while: '(^|\\G)\\s*\\*(?!/)(?=([^*]|[*](?!/))*$)', + patterns: [ + { + include: 'source.ts#docblock', + }, + ], + }, + }, + scopeName: 'documentation.injection.ts', + }, + grammarLocation: './syntaxes/jsdoc.ts.injection.tmLanguage.json', + injectTo: [ + 'source.ts', + 'source.tsx', + ], + embeddedLanguages: undefined, + tokenTypes: undefined, + }, + { + language: undefined, + scope: 'documentation.injection.js.jsx', + format: 'json', + grammar: { + injectionSelector: 'L:comment.block.documentation', + patterns: [ + { + include: '#jsdocbody', + }, + ], + repository: { + jsdocbody: { + begin: '(?<=/\\*\\*)([^*]|\\*(?!/))*$', + while: '(^|\\G)\\s*\\*(?!/)(?=([^*]|[*](?!/))*$)', + patterns: [ + { + include: 'source.ts#docblock', + }, + ], + }, + }, + scopeName: 'documentation.injection.js.jsx', + }, + grammarLocation: './syntaxes/jsdoc.js.injection.tmLanguage.json', + injectTo: [ + 'source.js', + 'source.js.jsx', + ], + embeddedLanguages: undefined, + tokenTypes: undefined, + }, + ], + problemMatchers: undefined, + problemPatterns: undefined, + resourceLabelFormatters: undefined, + authentication: undefined, + notebooks: undefined, + snippets: [ + { + language: 'typescript', + source: 'TypeScript Language Basics (built-in)', + uri: 'file:///home/user/theia/theia/plugins/ts-base/extension/snippets/typescript.code-snippets', + }, + { + language: 'typescriptreact', + source: 'TypeScript Language Basics (built-in)', + uri: 'file:///home/user/theia/theia/plugins/ts-base/extension/snippets/typescript.code-snippets', + }, + ], + themes: undefined, + iconThemes: undefined, + colors: undefined, + localizations: undefined, + terminalProfiles: undefined, + }, + }, +]; diff --git a/examples/browser-only/package.json b/examples/browser-only/package.json index 2b29c37293faf..1418f1c223b54 100644 --- a/examples/browser-only/package.json +++ b/examples/browser-only/package.json @@ -14,6 +14,11 @@ } } }, + "theiaPluginsDir": "plugins", + "theiaPlugins": { + "vscode.typescript": "https://open-vsx.org/api/vscode/typescript/1.95.3/file/vscode.typescript-1.95.3.vsix", + "vscode.typescript-language-features": "https://open-vsx.org/api/vscode/typescript-language-features/1.95.3/file/vscode.typescript-language-features-1.95.3.vsix" + }, "dependencies": { "@theia/ai-chat": "1.57.0", "@theia/ai-chat-ui": "1.57.0", @@ -72,8 +77,10 @@ "scripts": { "prepare:no-native": "lerna run prepare --scope=\"@theia/re-exports\" && lerna run generate-theia-re-exports --scope=\"@theia/core\"", "clean": "theia clean", - "build": "theiaext build && npm run -s bundle", + "build": "theiaext build && npm run package:plugins && npm run -s bundle", "bundle": "theia build --mode development", + "download:plugins": "theia download:plugins", + "package:plugins": "node ./prepare-plugins.js", "compile": "theiaext compile", "start": "theia start", "start:debug": "npm run -s start --log-level=debug", diff --git a/examples/browser-only/prepare-plugins.js b/examples/browser-only/prepare-plugins.js new file mode 100644 index 0000000000000..ee30df0f35441 --- /dev/null +++ b/examples/browser-only/prepare-plugins.js @@ -0,0 +1,64 @@ +// ***************************************************************************** +// Copyright (C) 2024 robertjndw +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// ***************************************************************************** + +const { promisify } = require('util'); +const glob = promisify(require('glob')); +const fs = require('fs'); +const fsp = require('fs').promises; +const path = require('path'); + +async function run() { + // Resolve the `package.json` at the current working directory. + const pck = JSON.parse(await fsp.readFile(path.resolve('package.json'), 'utf8')); + + // Resolve the directory for which to download the plugins. + const pluginsDir = pck.theiaPluginsDir || 'extension'; + + // Find all `plugin/extension/*` directories. + const plugins = await glob(`${pluginsDir}/*/extension`); + + for (const pluginExtensionPath of plugins) { + // Extract the plugin name from the parent folder of the extension. + const pluginName = path.basename(path.dirname(pluginExtensionPath)).replace(/[.\-]/g, '_'); + const targetDir = path.join('lib', 'frontend', 'hostedPlugin', pluginName); + + // When the directory exists, skip it + if (fs.existsSync(targetDir)) { + console.log(`Plugin ${pluginName} already prepared. Skipping.`); + continue; + } + // Ensure the target directory exists when not already present. + await fsp.mkdir(targetDir, { recursive: true }); + + // Copy the content of the `extension` folder to the target directory. + const files = await glob(`${pluginExtensionPath}/**/*`, { nodir: true }); + for (const file of files) { + const relativePath = path.relative(pluginExtensionPath, file); + const target = path.join(targetDir, relativePath); + + // Ensure the target directory structure exists. + await fsp.mkdir(path.dirname(target), { recursive: true }); + + // Copy the file. + await fsp.copyFile(file, target); + } + } +} + +run().catch(err => { + console.error(err); + process.exit(1); +}); diff --git a/packages/plugin-ext/package.json b/packages/plugin-ext/package.json index 73a77bf958aa3..7c95d2123f183 100644 --- a/packages/plugin-ext/package.json +++ b/packages/plugin-ext/package.json @@ -59,6 +59,9 @@ "backendElectron": "lib/plugin-ext-backend-electron-module", "frontend": "lib/plugin-ext-frontend-module" }, + { + "frontendOnly": "lib/plugin-ext-frontend-only-module" + }, { "frontendElectron": "lib/plugin-ext-frontend-electron-module" } diff --git a/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts b/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts new file mode 100644 index 0000000000000..5299ea8f4aaf4 --- /dev/null +++ b/packages/plugin-ext/src/hosted/browser-only/frontend-hosted-plugin-server.ts @@ -0,0 +1,61 @@ +// ***************************************************************************** +// Copyright (C) 2023 EclipseSource and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// **************************************************************************** + +import { injectable, inject } from '@theia/core/shared/inversify'; +import { DeployedPlugin, ExtPluginApi, GetDeployedPluginsParams, HostedPluginClient, HostedPluginServer, PluginIdentifiers } from '../../common'; +import { Event, RpcConnectionEventEmitter } from '@theia/core'; + +export const PluginLocalOptions = Symbol('PluginLocalOptions'); +export interface PluginLocalOptions { + pluginMetadata: DeployedPlugin[]; +} + +@injectable() +export class FrontendHostedPluginServer implements HostedPluginServer, RpcConnectionEventEmitter { + readonly onDidOpenConnection: Event = Event.None; + readonly onDidCloseConnection: Event = Event.None; + + @inject(PluginLocalOptions) + protected readonly options: PluginLocalOptions; + + async getDeployedPluginIds(): Promise { + // Use the plugin metadata to build the correct plugin id + return this.options.pluginMetadata.map(p => PluginIdentifiers.componentsToVersionedId(p.metadata.model)); + } + async getUninstalledPluginIds(): Promise { + return []; + + } + async getDeployedPlugins(params: GetDeployedPluginsParams): Promise { + return this.options.pluginMetadata.filter(p => params.pluginIds.includes(PluginIdentifiers.componentsToVersionedId(p.metadata.model))); + } + + async getExtPluginAPI(): Promise { + return []; + } + onMessage(targetHost: string, message: Uint8Array): Promise { + throw new Error('Method not implemented.'); + } + dispose(): void { + throw new Error('Method not implemented.'); + } + setClient(client: HostedPluginClient | undefined): void { + throw new Error('Method not implemented.'); + } + getClient?(): HostedPluginClient | undefined { + throw new Error('Method not implemented.'); + } +} diff --git a/packages/plugin-ext/src/hosted/browser-only/frontend-plugin-path-service.ts b/packages/plugin-ext/src/hosted/browser-only/frontend-plugin-path-service.ts new file mode 100644 index 0000000000000..3d780467a5646 --- /dev/null +++ b/packages/plugin-ext/src/hosted/browser-only/frontend-plugin-path-service.ts @@ -0,0 +1,29 @@ +// ***************************************************************************** +// Copyright (C) 2023 EclipseSource and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// **************************************************************************** + +import { injectable } from '@theia/core/shared/inversify'; +import { PluginPathsService } from '../../main/common/plugin-paths-protocol'; + +@injectable() +export class FrontendPluginPathService implements PluginPathsService { + async getHostLogPath(): Promise { + return ''; + } + async getHostStoragePath(workspaceUri: string | undefined, rootUris: string[]): Promise { + return ''; + } + +} diff --git a/packages/plugin-ext/src/hosted/browser-only/frontend-plugin-server.ts b/packages/plugin-ext/src/hosted/browser-only/frontend-plugin-server.ts new file mode 100644 index 0000000000000..1ebed69f6f264 --- /dev/null +++ b/packages/plugin-ext/src/hosted/browser-only/frontend-plugin-server.ts @@ -0,0 +1,41 @@ +// ***************************************************************************** +// Copyright (C) 2023 EclipseSource and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// **************************************************************************** +import { injectable } from '@theia/core/shared/inversify'; +import { PluginDeployOptions, PluginServer, PluginStorageKind, PluginType } from '../../common'; +import { KeysToAnyValues, KeysToKeysToAnyValue } from '../../common/types'; + +@injectable() +export class FrontendPluginServer implements PluginServer { + deploy(pluginEntry: string, type?: PluginType | undefined, options?: PluginDeployOptions | undefined): Promise { + throw new Error('Method not implemented.'); + } + uninstall(pluginId: `${string}.${string}@${string}`): Promise { + throw new Error('Method not implemented.'); + } + undeploy(pluginId: `${string}.${string}@${string}`): Promise { + throw new Error('Method not implemented.'); + } + setStorageValue(key: string, value: KeysToAnyValues, kind: PluginStorageKind): Promise { + throw new Error('Method not implemented.'); + } + getStorageValue(key: string, kind: PluginStorageKind): Promise { + throw new Error('Method not implemented.'); + } + async getAllStorageValues(kind: PluginStorageKind): Promise { + return {}; + } + +} diff --git a/packages/plugin-ext/src/plugin-ext-frontend-only-module.ts b/packages/plugin-ext/src/plugin-ext-frontend-only-module.ts new file mode 100644 index 0000000000000..af6d713ec69a2 --- /dev/null +++ b/packages/plugin-ext/src/plugin-ext-frontend-only-module.ts @@ -0,0 +1,28 @@ +// ***************************************************************************** +// Copyright (C) 2023 EclipseSource and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// ***************************************************************************** + +import { ContainerModule } from '@theia/core/shared/inversify'; +import { HostedPluginServer, PluginServer } from './common/plugin-protocol'; +import { FrontendHostedPluginServer } from './hosted/browser-only/frontend-hosted-plugin-server'; +import { PluginPathsService } from './main/common/plugin-paths-protocol'; +import { FrontendPluginPathService } from './hosted/browser-only/frontend-plugin-path-service'; +import { FrontendPluginServer } from './hosted/browser-only/frontend-plugin-server'; + +export default new ContainerModule((bind, unbind, isBound, rebind) => { + rebind(HostedPluginServer).to(FrontendHostedPluginServer).inSingletonScope(); + rebind(PluginServer).to(FrontendPluginServer).inSingletonScope(); + rebind(PluginPathsService).to(FrontendPluginPathService).inSingletonScope(); +}); diff --git a/packages/terminal/package.json b/packages/terminal/package.json index 7e34995e4eb29..80213eb6856a6 100644 --- a/packages/terminal/package.json +++ b/packages/terminal/package.json @@ -23,6 +23,9 @@ "frontend": "lib/browser/terminal-frontend-module", "secondaryWindow": "lib/browser/terminal-frontend-module", "backend": "lib/node/terminal-backend-module" + }, + { + "frontendOnly": "lib/browser-only/terminal-frontend-only-module" } ], "keywords": [ diff --git a/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts b/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts new file mode 100644 index 0000000000000..637978392af77 --- /dev/null +++ b/packages/terminal/src/browser-only/terminal-frontend-only-contribution.ts @@ -0,0 +1,65 @@ +// ***************************************************************************** +// Copyright (C) 2024 robertjndw +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// ***************************************************************************** + +import { injectable } from '@theia/core/shared/inversify'; +import { TerminalService } from '../browser/base/terminal-service'; +import { Event, Emitter } from '@theia/core'; +import { WidgetOpenerOptions } from '@theia/core/lib/browser'; +import { TerminalWidgetOptions, TerminalWidget } from '../browser/base/terminal-widget'; + +@injectable() +export class TerminalFrontendOnlyContribution implements TerminalService { + protected readonly onDidCreateTerminalEmitter = new Emitter(); + protected readonly onDidChangeCurrentTerminalEmitter = new Emitter(); + + get onDidCreateTerminal(): Event { + return this.onDidCreateTerminalEmitter.event; + } + + get onDidChangeCurrentTerminal(): Event { + return this.onDidChangeCurrentTerminalEmitter.event; + } + + get currentTerminal(): TerminalWidget | undefined { + return undefined; + } + + get lastUsedTerminal(): TerminalWidget | undefined { + return undefined; + } + + async newTerminal(options: TerminalWidgetOptions): Promise { + throw new Error('Method not implemented.'); + } + + open(terminal: TerminalWidget, options?: WidgetOpenerOptions): void { } + + get all(): TerminalWidget[] { + return []; + } + + getById(id: string): TerminalWidget | undefined { + return undefined; + } + + getByTerminalId(terminalId: number): TerminalWidget | undefined { + return undefined; + } + + async getDefaultShell(): Promise { + return ''; + } +} diff --git a/packages/terminal/src/browser-only/terminal-frontend-only-module.ts b/packages/terminal/src/browser-only/terminal-frontend-only-module.ts new file mode 100644 index 0000000000000..1cca0d9148a55 --- /dev/null +++ b/packages/terminal/src/browser-only/terminal-frontend-only-module.ts @@ -0,0 +1,24 @@ +// ***************************************************************************** +// Copyright (C) 2024 robertjndw +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// ***************************************************************************** + +import { ContainerModule } from '@theia/core/shared/inversify'; +import { TerminalFrontendOnlyContribution } from './terminal-frontend-only-contribution'; +import { TerminalService } from '../browser/base/terminal-service'; + +export default new ContainerModule((bind, unbind, isBound, rebind) => { + bind(TerminalFrontendOnlyContribution).toSelf().inSingletonScope(); + rebind(TerminalService).toService(TerminalFrontendOnlyContribution); +});