diff --git a/README.md b/README.md
index 25fe1db7e2..9ed3c8814c 100644
--- a/README.md
+++ b/README.md
@@ -119,7 +119,7 @@ Add this code to your page:
- [Client-side!](https://livecodes.io/docs/why#client-side)
- Very [configurable](https://livecodes.io/docs/configuration/)
- Developer-friendly build-free environment
-- Powerful [SDK](https://livecodes.io/docs/sdk/) (available for [vanilla JavaScript, TypeScript](https://livecodes.io/docs/sdk/js-ts), [React](https://livecodes.io/docs/sdk/react), [Vue](https://livecodes.io/docs/sdk/vue), [Svelte](https://livecodes.io/docs/sdk/svelte) and [Solid](https://livecodes.io/docs/sdk/solid))
+- Powerful [SDK](https://livecodes.io/docs/sdk/) (available for [vanilla JavaScript, TypeScript](https://livecodes.io/docs/sdk/js-ts), [React](https://livecodes.io/docs/sdk/react), [Vue](https://livecodes.io/docs/sdk/vue), [Svelte](https://livecodes.io/docs/sdk/svelte), [Solid](https://livecodes.io/docs/sdk/solid) and [Ripple](https://livecodes.io/docs/sdk/ripple))
- Comprehensive [Documentations](https://livecodes.io/docs/)
- Focused on [privacy and security](https://livecodes.io/docs/features/security)
- Free and [Open-Source](https://livecodes.io/docs/license)
@@ -156,7 +156,7 @@ createPlayground('#container', {
});
```
-The [JavaScript SDK](https://livecodes.io/docs/sdk/js-ts) is framework/library agnostic. However, wrapper components are also provided for popular libraries (currently [React](https://livecodes.io/docs/sdk/react) and [Vue](https://livecodes.io/docs/sdk/vue)). The SDK can be used in [Svelte](https://livecodes.io/docs/sdk/svelte) and [Solid](https://livecodes.io/docs/sdk/solid) directly without wrappers. [TypeScript support](https://livecodes.io/docs/sdk/js-ts#typescript-types) provides type-safety and a great developer experience.
+The [JavaScript SDK](https://livecodes.io/docs/sdk/js-ts) is framework/library agnostic. However, wrapper components are also provided for popular libraries (currently [React](https://livecodes.io/docs/sdk/react) and [Vue](https://livecodes.io/docs/sdk/vue)). The SDK can be used in [Svelte](https://livecodes.io/docs/sdk/svelte), [Solid](https://livecodes.io/docs/sdk/solid) and [Ripple](https://livecodes.io/docs/sdk/ripple) directly without wrappers. [TypeScript support](https://livecodes.io/docs/sdk/js-ts#typescript-types) provides type-safety and a great developer experience.
React SDK example: ([open in LiveCodes](https://livecodes.io/?x=code/N4IgLglmA2CmIC4QBkIDdYGED2ATWAzgAQBKsAhgMZhEDKAIgNJH4C22IANCPgZQE4QADpGwA7RCC4gAFhVySAPK1hhyRSjPL8CqgLwAdEAFUAKgDEAtAA4jRAPQA+A2OWr1Y8isMg0EWADuQtj8YHaU4mCwYmA+ARC4YDJ6+H6UsJbxiTKcRBBiUBDk0JZ8xbB6AIwAdAAMdk7SMmCs0ACCYGA6ktDkYgDmPtHhvQQEPkbSav0EiADaALrcVJAYAKK4UCGSfIIi0qzaANYArkKIoL0DJ+T98EjNrdIRMdFgkiAAvtwEYACecAuICu-Rud0klDGz0ibw+3xAu2E7wQlz6oNu9xAACsCAAPaGvGKSCCsYKhIioDA4XhEABm-GwrCIAHJoOhYBFePZ+BRqMyANwGfguIUuF6-DTiWkQfpEPREYCisREIiHfinIQIBVKlUqkFg2Ba5lqo64bABMTMzg63UvKIxI0AYiIAAlYNBoNgiAB1ELQXAAQitNu+Ss+guFYnFNAACr0-v0GScxLg5UQABQASjljiIikpWDwhElYmlg2ALzLnyIfkCPh5BBO0DCIAcjgjLlguLJNHwtPITdj8cT2GTuA7EnhvwBhDkqlmCEWPwESIXS5AkIIMYbqg+3CEDPSYxCa6WG5Ov0ZtFUkAGC+A8JJPfv8P+QkIF1fhDA9+BaINkhvoQK77NwdqwkgXzcBgOgQOIkgAMwIVM2DYNAv7ROQABGcAKEgxTQNIKzshC4gEGh8A-GoYAXhCnq6AonyfEAA))
diff --git a/docs/docs/languages/ripple.mdx b/docs/docs/languages/ripple.mdx
new file mode 100644
index 0000000000..0d20e38610
--- /dev/null
+++ b/docs/docs/languages/ripple.mdx
@@ -0,0 +1,439 @@
+---
+toc_max_heading_level: 4
+---
+
+# Ripple
+
+[Ripple](https://www.ripplejs.com/) is a TypeScript UI framework that takes the best parts of React, Solid and Svelte and combines them into one package.
+
+Ripple components can be used in LiveCodes as documented in the [Ripple docs](https://github.com/trueadm/ripple). See below for usage.
+
+## Demo
+
+import LiveCodes from '../../src/components/LiveCodes.tsx';
+import RunInLiveCodes from '../../src/components/RunInLiveCodes.tsx';
+
+export const demo = {
+ activeEditor: 'script',
+ script: {
+ language: 'ripple',
+ content: `import { track } from 'ripple';
+
+export default component Counter() {
+ let count = track(0);
+ let doubled = track(() => @count * 2);
+
+
+
{'Counter'}
+
{\`Count: \${@count}\`}
+
{\`Doubled: \${@doubled}\`}
+
+
@count++}>{'Increment'}
+
@count = 0}>{'Reset'}
+
+
+
+}`,
+ },
+}
+
+
+
+
+## Mounting
+
+### Auto-rendering
+
+A component is mounted and rendered automatically as a Ripple component (without having to [manually mount](#manual-mount) it) if the following conditions are met:
+
+- The component is exported as the default export.
+- No [imports from `"./script"`](#exports) in markup editor.
+- Auto-rendering is not [disabled](#disabling-auto-rendering).
+
+### Root Element
+
+To mount the application instance to a specific DOM element use `"livecodes-app"` as the element `id` in the HTML. Otherwise, if that element is not found, a new `div` element is added to `document.body` and is used to mount the instance.
+In case you need more control, you can [manually mount](#manual-mount) the instance.
+
+Example:
+
+export const customRoot = {
+ markup: {
+ language: 'html',
+ content: `Custom Root Element
+
+...other page content
+`,
+ },
+ script: {
+ language: 'ripple',
+ content: `import { track } from 'ripple';
+
+export default component App() {
+ let name = track('Ripple');
+ {\`I'm a \${@name} component\`}
+
+}
+`,
+ },
+};
+
+
+
+
+### Manual Mount
+
+Exports from Ripple code can be imported in [markup editor](../features/projects.mdx#markup-editor) from `"./Component.ripple"` and used to mount the application instance manually.
+See [Exports](#exports) for details.
+
+Example:
+
+export const manualMount = {
+ markup: {
+ language: 'html',
+ content: `Manual Mount
+
+...other page content
+
+
+`,
+ },
+ script: {
+ language: 'ripple',
+ content: `export component App(props: { name: string }) {
+ {\`I'm a \${props.name} component\`}
+
+}
+`,
+ },
+};
+
+
+
+### Disabling Auto-rendering
+
+To disable [auto-rendering](#auto-rendering), set the [custom settings](#custom-settings) `disableAutoRender` property to `true`.
+
+```json title="Custom Settings"
+{
+ "ripple": {
+ "disableAutoRender": true
+ }
+}
+```
+
+## Importing Modules
+
+### NPM Modules
+
+npm modules can be imported as described in the section about [module resolution](../features/module-resolution.mdx), including bare module imports and importing from different CDNs. Stylesheets imported in the `script` block are added as ` ` tags in the page `head` (see [below](#importing-stylesheets)).
+
+Module imports can be customized using import maps as described in [module resolution](../features/module-resolution.mdx#custom-module-resolution) documentations.
+
+Example:
+
+export const importsDemo = {
+ ripple: `import { track, effect } from "ripple";
+import confetti from "canvas-confetti";
+
+export default component App() {
+
+ let count = track(0);
+
+ effect(() => {
+ if (@count === 2) confetti();
+ });
+
+
@count++}>{@count}
+
+ if (@count > 1) {
+
{'Greater than 1!'}
+ }
+
+
+
+}
+`,
+};
+
+
+
+### External Components
+
+External Ripple components can be imported.
+The import URL can be either:
+- An absolute URL ending with `.ripple` extension.
+- A [bare module import](../features/module-resolution.mdx#bare-module-imports) for a published npm module with full path to the component with extension.
+- A [data URL](../features/data-urls.mdx) starting with `data:text/ripple`.
+
+Any bare or relative imports in the imported files are resolved and compiled recursively.
+If a processor is enabled (e.g. Tailwind CSS), classes in the imported files are detected and used in the generated CSS (see [CSS Frameworks](#css-frameworks) section below).
+
+Example: ([source](https://github.com/hatemhosny/ripple-tailwind-counter-demo))
+
+export const externalComponents = {
+ activeEditor: 'script',
+ script: {
+ language: 'ripple',
+ content: `// import from npm modules
+import { track } from 'ripple';
+import { Counter } from 'ripple-tailwind-counter-demo/src/Counter.ripple';
+// alternatively use absolute URLs
+// import { Counter } from 'https://raw.githubusercontent.com/hatemhosny/ripple-tailwind-counter-demo/refs/heads/main/src/Counter.ripple';
+
+export default component App() {
+ let name = track("World");
+
+ setTimeout(() => {
+ @name = "Ripple + Tailwind!";
+ }, 2000);
+
+
+}
+`,
+ },
+ processors: ['tailwindcss'],
+}
+
+
+
+### Exports
+
+Values exported from [script editor](../features/projects.mdx#script-editor) (default or named) can be imported in the [markup editor](../features/projects.mdx#markup-editor) by importing from `"./script"` (with no extension).
+
+This can be useful, for example, for [manually mounting](#manual-mount) components in the markup editor.
+
+:::info note
+
+When values are imported from `"./script"`, [auto-rendering](#auto-rendering) is disabled, because it is assumed that you want to take control over component rendering.
+
+:::
+
+## Styles
+
+CSS can be applied to the component using various ways:
+
+### Component Styles
+
+Styles in a `style` tag in a Ripple component are applied to that component only.
+
+CSS processors (e.g. SCSS, Stylus) can be used by specifying a `lang` attribute for the `style` tag.
+
+Example:
+
+export const styleTag = {
+ ripple: `export default component App() {
+ {'Hello World!'}
+
+
+}
+`
+}
+
+
+
+
+### Style Editor
+
+Styles added in the [style editor](../features/projects.mdx#style-editor) are applied globally to the [result page](../features/result.mdx). This can use different **languages/processors** supported in LiveCodes including CSS, SCSS, Less, Stylus, ..etc. See [style documentation](../features/css.mdx) for more details.
+
+And of course, styles and stylesheets added in [markup editor](../features/projects.mdx#markup-editor) are also applied globally.
+
+### Importing Stylesheets
+
+Stylesheets imported in [script editor](../features/projects.mdx#script-editor) are added as ` ` tags in the page `head`.
+The stylesheet URL can be an absolute URL or a path in the npm package. The URL has to end with `".css"`.
+
+example:
+
+export const stylesDemo = {
+ ripple: `import "bootstrap/dist/css/bootstrap.css";\n\nexport default component App() {\n {'Hello World!'} \n}\n`,
+};
+
+
+
+### CSS Modules
+
+CSS modules are supported and are [documented separately](./cssmodules.mdx). Make sure to enable CSS modules (from style editor menu or in [`processors`](../configuration/configuration-object.mdx#processors) property of [configuration object](../configuration/configuration-object.mdx)).
+
+Demo:
+
+export const cssModulesDemo = {
+ activeEditor: 'script',
+ style: { language: 'css', content: `.title {\n color: green;\n font-family: sans-serif;\n}\n` },
+ script: {
+ language: 'ripple',
+ content: `import classes from './style.module.css';\n\nexport default component() {\n \n {'Hello, CSS Modules!'}\n \n}\n`,
+ },
+ processors: ['cssmodules'],
+};
+
+
+
+### CSS Frameworks
+
+[CSS Frameworks](../features/css.mdx#css-processors) supported in LiveCodes (e.g. [Tailwind CSS](./tailwindcss.mdx), [UnoCSS](./unocss.mdx), [WindiCSS](./windicss.mdx)) can detect class names added in Ripple components.
+Make sure that the required utility is enabled (from style editor menu or in `processors` property of [configuration object](../configuration/configuration-object.mdx#processors)).
+
+Example:
+
+export const tailwindDemo = {
+ activeEditor: 'script',
+ script: {
+ language: 'ripple',
+ content: `import { track } from 'ripple';
+
+export default component Counter() {
+ let count = track(0);
+
+
+
+
+ @count--}
+ class="w-12 px-4 py-2 bg-red-500 text-white rounded-lg shadow hover:bg-red-600 transition cursor-pointer"
+ >
+ {'-'}
+
+ {@count}
+ @count++}
+ class="w-12 px-4 py-2 bg-green-500 text-white rounded-lg shadow hover:bg-green-600 transition cursor-pointer"
+ >
+ {'+'}
+
+
+
@count = 0}
+ class="px-6 py-2 bg-blue-500 text-white rounded-lg shadow hover:bg-blue-600 transition cursor-pointer"
+ >
+ {'Reset'}
+
+
+
+
+}
+`,
+ },
+ processors: ['tailwindcss'],
+};
+
+
+
+## Language Info
+
+### Name
+
+`ripple`
+
+### Extensions
+
+`.ripple`
+
+### Editor
+
+`script`
+
+## Compiler
+
+The official [Ripple compiler](https://github.com/trueadm/ripple).
+
+### Version
+
+`ripple`: v0.2.15
+
+## Code Formatting
+
+Using [Prettier](https://prettier.io/).
+
+## Custom Settings
+
+[Custom settings](../advanced/custom-settings.mdx) can be added to the property `ripple`.
+These include:
+
+- `"disableAutoRender"` - [disables auto-rendering](#disabling-auto-rendering) (default: `false`).
+- `"version"` - specifies the version of Ripple compiler (default: `"latest"`).
+
+Example:
+
+```json title="Custom Settings"
+{
+ "ripple": {
+ "version": "0.2.15"
+ }
+}
+```
+
+Please note that custom settings should be valid JSON (i.e. functions are not allowed).
+
+## Starter Template
+
+https://livecodes.io/?template=ripple
+
+
+
+## Links
+
+- [Ripple](https://ripplejs.com/)
+- [Ripple documentations](https://github.com/trueadm/ripple)
diff --git a/docs/docs/sdk/index.mdx b/docs/docs/sdk/index.mdx
index db5b604aef..e1e6a53b36 100644
--- a/docs/docs/sdk/index.mdx
+++ b/docs/docs/sdk/index.mdx
@@ -10,7 +10,7 @@ The Software Development Kit (SDK) provides an easy, yet powerful, interface to
The SDK is provided as a light-weight ([less than 5kb gzipped](https://bundlephobia.com/package/livecodes)), zero-dependencies [npm package](#npm-package), that is also available from [CDNs](#cdn). It can be used to create playgrounds with a wide variety of [configurations](../configuration/configuration-object.mdx) and [embed options](js-ts.mdx#embed-options). In addition, [SDK methods](js-ts.mdx#sdk-methods) allow programmatic communication and control of the playgrounds during runtime.
-The [JavaScript SDK](js-ts.mdx) is framework/library agnostic. However, wrapper components are also provided for popular libraries (currently [React](react.mdx) and [Vue](vue.mdx)). The SDK can be used in [Svelte](svelte.mdx) and [Solid](solid.mdx) directly without wrappers. [TypeScript support](js-ts.mdx#typescript-types) provides type-safety and a great developer experience.
+The [JavaScript SDK](js-ts.mdx) is framework/library agnostic. However, wrapper components are also provided for popular libraries (currently [React](react.mdx) and [Vue](vue.mdx)). The SDK can be used in [Svelte](svelte.mdx), [Solid](solid.mdx) and [Ripple](ripple.mdx) directly without wrappers. [TypeScript support](js-ts.mdx#typescript-types) provides type-safety and a great developer experience.
## SDK Demo
@@ -99,14 +99,11 @@ In the full [standalone app](../getting-started.mdx#standalone-app), the JavaScr
The SDK is currently provided in the following variations:
- [JavaScript/TypeScript](./js-ts.mdx)
-
- [React](./react.mdx)
-
- [Vue](./vue.mdx)
-
- [Svelte](./svelte.mdx)
-
- [Solid](./solid.mdx)
+- [Ripple](./ripple.mdx)
## Headless Mode
diff --git a/docs/docs/sdk/js-ts.mdx b/docs/docs/sdk/js-ts.mdx
index 1eb4ef14f4..4c12e7b659 100644
--- a/docs/docs/sdk/js-ts.mdx
+++ b/docs/docs/sdk/js-ts.mdx
@@ -602,4 +602,5 @@ export const sdkDemo = {
- [React SDK](./react.mdx)
- [Vue SDK](./vue.mdx)
- [Using SDK in Svelte](./svelte.mdx)
+- [Using SDK in Ripple](./ripple.mdx)
- [Embedded Playgrounds](../features/embeds.mdx)
diff --git a/docs/docs/sdk/react.mdx b/docs/docs/sdk/react.mdx
index ef8177c3ea..1c54af2d5d 100644
--- a/docs/docs/sdk/react.mdx
+++ b/docs/docs/sdk/react.mdx
@@ -149,4 +149,5 @@ export const reactSDKDemo = {
- [Vue SDK](./vue.mdx)
- [Using SDK in Svelte](./svelte.mdx)
- [Using SDK in Solid](./solid.mdx)
+- [Using SDK in Ripple](./ripple.mdx)
- [Embedded Playgrounds](../features/embeds.mdx)
diff --git a/docs/docs/sdk/ripple.mdx b/docs/docs/sdk/ripple.mdx
new file mode 100644
index 0000000000..cb42b14e5c
--- /dev/null
+++ b/docs/docs/sdk/ripple.mdx
@@ -0,0 +1,82 @@
+# Ripple
+
+import LiveCodes from '../../src/components/LiveCodes.tsx';
+import RunInLiveCodes from '../../src/components/RunInLiveCodes.tsx';
+
+The [JS/TS SDK](js-ts.mdx) can be used directly in [Ripple](https://ripplejs.com) components without the need for any wrappers.
+
+## Installation
+
+Please refer to the [SDK installation](./index.mdx#installation) section.
+
+## Usage
+
+This is an example of using the LiveCodes JS SDK in a Ripple component:
+
+```jsx title="App.ripple"
+import { createPlayground, type EmbedOptions, type Playground } from 'livecodes';
+
+export default component App() {
+ const options: EmbedOptions = {
+ params: {
+ html: 'Hello World! ',
+ css: 'h1 {color: blue;}',
+ js: 'console.log("Hello, Ripple!")',
+ console: 'open',
+ },
+ };
+
+ let playground: Playground | null = null;
+ const onMount = (container: HTMLElement) => {
+ createPlayground(container, options).then((sdk) => {
+ playground = sdk; // now the SDK is available
+ });
+ return () => playground?.destroy();
+ };
+
+
+}
+```
+
+export const rippleSDKDemo = {
+ ripple: `import { createPlayground, type EmbedOptions, type Playground } from 'livecodes';
+
+export default component App() {
+ const options: EmbedOptions = {
+ params: {
+ html: 'Hello World! ',
+ css: 'h1 {color: blue;}',
+ js: 'console.log("Hello, Ripple!")',
+ console: 'open',
+ },
+ };
+
+ let playground: Playground | null = null;
+ const onMount = (container: HTMLElement) => {
+ createPlayground(container, options).then((sdk) => {
+ playground = sdk; // now the SDK is available
+ });
+ return () => playground?.destroy();
+ };
+
+
+}
+`,
+};
+
+
+
+[Embed options](./js-ts.mdx#embed-options), [SDK methods](./js-ts.mdx#sdk-methods) and [TypeScript types](./js-ts.mdx#typescript-types) are available as described in the [JS/TS SDK documentations](./js-ts.mdx).
+
+## Demo
+
+
+
+## Related
+
+- [SDK Installation](./index.mdx#installation)
+- [JS/TS SDK](./js-ts.mdx)
+- [React SDK](./react.mdx)
+- [Vue SDK](./vue.mdx)
+- [Using SDK in Svelte](./svelte.mdx)
+- [Embedded Playgrounds](../features/embeds.mdx)
diff --git a/docs/docs/sdk/svelte.mdx b/docs/docs/sdk/svelte.mdx
index ff903030b9..43362a5709 100644
--- a/docs/docs/sdk/svelte.mdx
+++ b/docs/docs/sdk/svelte.mdx
@@ -98,4 +98,5 @@ However, it is recommended to cleanup when the node is unmounted, like that:
- [React SDK](./react.mdx)
- [Vue SDK](./vue.mdx)
- [Using SDK in Solid](./solid.mdx)
+- [Using SDK in Ripple](./ripple.mdx)
- [Embedded Playgrounds](../features/embeds.mdx)
diff --git a/docs/docs/sdk/vue.mdx b/docs/docs/sdk/vue.mdx
index 9a2a572a27..a8f9133d05 100644
--- a/docs/docs/sdk/vue.mdx
+++ b/docs/docs/sdk/vue.mdx
@@ -164,4 +164,5 @@ export const vueSDKDemo = {
- [React SDK](./react.mdx)
- [Using SDK in Svelte](./svelte.mdx)
- [Using SDK in Solid](./solid.mdx)
+- [Using SDK in Ripple](./ripple.mdx)
- [Embedded Playgrounds](../features/embeds.mdx)
diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts
index 815f2cddfb..9acc45ced2 100644
--- a/docs/docusaurus.config.ts
+++ b/docs/docusaurus.config.ts
@@ -290,6 +290,7 @@ const config: Config = {
plugin: ['typedoc-plugin-missing-exports'],
excludeExternals: true,
internalModule: '_internal',
+ skipErrorChecking: true,
},
],
[
diff --git a/docs/sidebars.ts b/docs/sidebars.ts
index 1b147ba905..7c39ba1d65 100644
--- a/docs/sidebars.ts
+++ b/docs/sidebars.ts
@@ -85,7 +85,15 @@ const sidebars: SidebarsConfig = {
type: 'doc',
id: 'sdk/index',
},
- items: ['sdk/js-ts', 'sdk/react', 'sdk/vue', 'sdk/svelte', 'sdk/solid', 'sdk/headless'],
+ items: [
+ 'sdk/js-ts',
+ 'sdk/react',
+ 'sdk/vue',
+ 'sdk/svelte',
+ 'sdk/solid',
+ 'sdk/ripple',
+ 'sdk/headless',
+ ],
},
{
type: 'category',
diff --git a/docs/src/components/HomepageFeatures.tsx b/docs/src/components/HomepageFeatures.tsx
index 000ff383af..eda2f7a788 100644
--- a/docs/src/components/HomepageFeatures.tsx
+++ b/docs/src/components/HomepageFeatures.tsx
@@ -152,8 +152,9 @@ const FeatureList3: FeatureItem[] = [
playgrounds and allows easy communication with
them. The SDK is available for vanilla JS/TS,{' '}
React, Vue,{' '}
- Svelte and Solid. There is also
- a headless mode for full control over the UI.
+ Svelte, Solid and{' '}
+ Ripple. There is also a{' '}
+ headless mode for full control over the UI.
>
),
},
diff --git a/docs/src/components/LanguageSliders.tsx b/docs/src/components/LanguageSliders.tsx
index 960c4933a6..e7ec272e72 100644
--- a/docs/src/components/LanguageSliders.tsx
+++ b/docs/src/components/LanguageSliders.tsx
@@ -69,6 +69,7 @@ export default function Sliders() {
{ name: 'solid.tsx', title: 'Solid (TS)' },
{ name: 'riot', title: 'Riot.js' },
{ name: 'malina', title: 'Malina.js' },
+ { name: 'ripple', title: 'Ripple' },
{ name: 'coffeescript', title: 'CoffeeScript' },
{ name: 'livescript', title: 'LiveScript' },
{ name: 'civet', title: 'Civet' },
diff --git a/docs/src/components/LiveCodes.tsx b/docs/src/components/LiveCodes.tsx
index 1c9d1ee716..350192fe00 100644
--- a/docs/src/components/LiveCodes.tsx
+++ b/docs/src/components/LiveCodes.tsx
@@ -85,6 +85,20 @@ export default function App() {
return
;
}
+`.trimStart();
+
+ const rippleCode = `
+import { createPlayground, type EmbedOptions } from 'livecodes';
+
+export default component App() {
+ const options: EmbedOptions = ${stringify(options).split('\n').join('\n ')};
+ const onMount = (container: HTMLElement) => {
+ createPlayground(container, options);
+ };
+
+
+}
+
`.trimStart();
return (
@@ -111,6 +125,7 @@ export default function App() {
vue={vueCode}
svelte={svelteCode}
solid={solidCode}
+ ripple={rippleCode}
>
)}
>
diff --git a/docs/src/components/ShowCode.tsx b/docs/src/components/ShowCode.tsx
index 20770a74b6..94df3fd368 100644
--- a/docs/src/components/ShowCode.tsx
+++ b/docs/src/components/ShowCode.tsx
@@ -15,6 +15,7 @@ export default function ShowCode(props: {
vue: string;
svelte: string;
solid: string;
+ ripple: string;
}): ReactNode {
const [jsCode, setJsCode] = useState(props.js);
const [tsCode, setTsCode] = useState(props.ts);
@@ -22,6 +23,7 @@ export default function ShowCode(props: {
const [vueCode, setVueCode] = useState(props.vue);
const [svelteCode, setSvelteCode] = useState(props.svelte);
const [solidCode, setSolidCode] = useState(props.solid);
+ const [rippleCode, setRippleCode] = useState(props.ripple);
const codeBlockTitleHeight = '3.7rem';
const [codeCollapsed, setCodeCollapsed] = useState(true);
@@ -60,6 +62,7 @@ export default function ShowCode(props: {
setVueCode(format(vueCode, 'html'));
setSvelteCode(format(svelteCode, 'html'));
setSolidCode(format(solidCode, 'tsx'));
+ setRippleCode(format(rippleCode, 'tsx'));
}
}, []);
@@ -103,6 +106,9 @@ export default function ShowCode(props: {
{solidCode}
+
+ {rippleCode}
+
diff --git a/docs/src/components/TemplateList.tsx b/docs/src/components/TemplateList.tsx
index a246d4d47a..25d77c5114 100644
--- a/docs/src/components/TemplateList.tsx
+++ b/docs/src/components/TemplateList.tsx
@@ -23,6 +23,7 @@ const templates = [
{ name: 'astro', title: 'Astro Starter', thumbnail: 'astro.svg' },
{ name: 'riot', title: 'Riot.js Starter', thumbnail: 'riot.svg' },
{ name: 'malina', title: 'Malina.js Starter', thumbnail: 'malina.svg' },
+ { name: 'ripple', title: 'Ripple Starter', thumbnail: 'ripple-0.png' },
{ name: 'jquery', title: 'jQuery Starter', thumbnail: 'jquery.svg' },
{ name: 'backbone', title: 'Backbone Starter', thumbnail: 'backbone.svg' },
{ name: 'knockout', title: 'Knockout Starter', thumbnail: 'knockout.svg' },
diff --git a/eslint.config.mjs b/eslint.config.mjs
index aab8c872fb..bdb275ecf3 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -32,6 +32,7 @@ export default [
'**/.jest',
'**/.storybook',
'functions/vendors',
+ 'src/livecodes/editor/monaco/languages/monaco-lang-ripple.ts',
],
},
...fixupConfigRules(
diff --git a/scripts/build.js b/scripts/build.js
index 60b1976642..17e4f13c3c 100644
--- a/scripts/build.js
+++ b/scripts/build.js
@@ -160,6 +160,7 @@ const esmBuild = () =>
'editor/monaco/languages/monaco-lang-astro.ts',
'editor/monaco/languages/monaco-lang-clio.ts',
'editor/monaco/languages/monaco-lang-imba.ts',
+ 'editor/monaco/languages/monaco-lang-ripple.ts',
// 'editor/monaco/languages/monaco-lang-sql.ts',
'editor/monaco/languages/monaco-lang-wat.ts',
'editor/codemirror/codemirror.ts',
@@ -237,6 +238,8 @@ const iifeBuild = () =>
'languages/python-wasm/lang-python-wasm-script.ts',
'languages/rescript/lang-rescript-formatter.ts',
'languages/riot/lang-riot-compiler.ts',
+ 'languages/ripple/lang-ripple-compiler.ts',
+ 'languages/ripple/lang-ripple-formatter.ts',
'languages/ruby-wasm/lang-ruby-wasm-script.ts',
'languages/scss/lang-scss-compiler.ts',
'languages/solid/lang-solid-compiler.ts',
diff --git a/src/livecodes/UI/command-menu-actions.ts b/src/livecodes/UI/command-menu-actions.ts
index 708f5ba1f7..be3be12b67 100644
--- a/src/livecodes/UI/command-menu-actions.ts
+++ b/src/livecodes/UI/command-menu-actions.ts
@@ -266,6 +266,7 @@ export const getCommandMenuActions = ({
'preact',
'svelte',
'solid',
+ 'ripple',
'lit',
'stencil',
'mdx',
diff --git a/src/livecodes/assets/templates/ripple.png b/src/livecodes/assets/templates/ripple.png
new file mode 100644
index 0000000000..9a58b221f2
Binary files /dev/null and b/src/livecodes/assets/templates/ripple.png differ
diff --git a/src/livecodes/compiler/import-map.ts b/src/livecodes/compiler/import-map.ts
index a915cd0040..ae70efb17c 100644
--- a/src/livecodes/compiler/import-map.ts
+++ b/src/livecodes/compiler/import-map.ts
@@ -144,6 +144,14 @@ export const isScriptImport = (mod: string) =>
mod.toLowerCase().endsWith('.vue') ||
mod.toLowerCase().endsWith('.svelte')));
+const isStyleImport = (mod: string) =>
+ mod.toLowerCase().startsWith('./style') ||
+ mod.toLowerCase().endsWith('.css') ||
+ mod.toLowerCase().endsWith('.scss') ||
+ mod.toLowerCase().endsWith('.sass') ||
+ mod.toLowerCase().endsWith('.less') ||
+ mod.toLowerCase().endsWith('.styl');
+
const modulesCache: Record = {};
const fetchModule = async (mod: string) => {
if (modulesCache[mod]) {
@@ -176,7 +184,7 @@ export const replaceSFCImports = async (
const isExtensionless = (mod: string) =>
mod.startsWith('.') && !mod.split('/')[mod.split('/').length - 1].includes('.');
const sfcImports = getImports(code).filter(
- (mod) => isSfc(mod) || isExtensionless(mod) || mod.startsWith('.'),
+ (mod) => !isStyleImport(mod) && (isSfc(mod) || isExtensionless(mod) || mod.startsWith('.')),
);
const projectImportMap = {
...config.imports,
diff --git a/src/livecodes/editor/monaco/languages/monaco-lang-ripple.ts b/src/livecodes/editor/monaco/languages/monaco-lang-ripple.ts
new file mode 100644
index 0000000000..3a663d5443
--- /dev/null
+++ b/src/livecodes/editor/monaco/languages/monaco-lang-ripple.ts
@@ -0,0 +1,8876 @@
+// from https://github.com/trueadm/ripple/blob/main/packages/ripple-vscode-plugin/syntaxes/ripple.tmLanguage.json
+// and https://github.com/trueadm/ripple/blob/main/packages/ripple-vscode-plugin/language-configuration.json
+// and 'https://cdn.jsdelivr.net/gh/zikaari/monaco-textmate-languages@master/grammars/css/css.tmLanguage.json'
+// Config onEnterRules cause errors - currently disabled
+
+export default {
+ syntax: {
+ 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/48f608692aa6d6ad7bd65b478187906c798234a8',
+ name: 'Ripple',
+ scopeName: 'source.ripple',
+ patterns: [
+ {
+ include: '#directives',
+ },
+ {
+ include: '#statements',
+ },
+ {
+ include: '#shebang',
+ },
+ ],
+ repository: {
+ shebang: {
+ name: 'comment.line.shebang.js',
+ match: '\\A(#!).*(?=$)',
+ captures: {
+ '1': {
+ name: 'punctuation.definition.comment.js',
+ },
+ },
+ },
+ 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',
+ },
+ ],
+ },
+ 'component-statements': {
+ patterns: [
+ {
+ include: '#jsx',
+ },
+ {
+ include: '#declaration',
+ },
+ {
+ include: '#component-control-statement',
+ },
+ {
+ include: '#component-decl-block',
+ },
+ {
+ include: '#label',
+ },
+ {
+ include: '#expression',
+ },
+ {
+ include: '#punctuation-semicolon',
+ },
+ {
+ include: '#string',
+ },
+ {
+ include: '#comment',
+ },
+ ],
+ },
+ declaration: {
+ patterns: [
+ {
+ include: '#decorator',
+ },
+ {
+ include: '#var-expr',
+ },
+ {
+ include: '#server-block',
+ },
+ {
+ include: '#component-declaration',
+ },
+ {
+ include: '#fragment-declaration',
+ },
+ {
+ 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.js',
+ 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.js entity.name.function.js',
+ },
+ '2': {
+ name: 'keyword.operator.definiteassignment.js',
+ },
+ },
+ 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.js variable.other.constant.js entity.name.function.js',
+ },
+ },
+ 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.js',
+ },
+ '2': {
+ name: 'keyword.operator.rest.js',
+ },
+ '3': {
+ name: 'entity.name.function.js variable.language.this.js',
+ },
+ '4': {
+ name: 'entity.name.function.js',
+ },
+ '5': {
+ name: 'keyword.operator.optional.js',
+ },
+ },
+ },
+ {
+ 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.js entity.name.function.js',
+ },
+ '2': {
+ name: 'keyword.operator.optional.js',
+ },
+ '3': {
+ name: 'keyword.operator.definiteassignment.js',
+ },
+ },
+ },
+ {
+ name: 'meta.definition.property.js variable.object.property.js',
+ match: '\\#?[_$[:alpha:]][_$[:alnum:]]*',
+ },
+ {
+ name: 'keyword.operator.optional.js',
+ match: '\\?',
+ },
+ {
+ name: 'keyword.operator.definiteassignment.js',
+ match: '\\!',
+ },
+ ],
+ },
+ 'variable-initializer': {
+ patterns: [
+ {
+ begin: '(?\\s*$)',
+ beginCaptures: {
+ '1': {
+ name: 'keyword.operator.assignment.js',
+ },
+ },
+ end: '(?=$|^|[,);}\\]]|((?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])',
+ beginCaptures: {
+ '1': {
+ name: 'storage.modifier.js',
+ },
+ '2': {
+ name: 'storage.modifier.js',
+ },
+ '3': {
+ name: 'storage.modifier.js',
+ },
+ '4': {
+ name: 'storage.modifier.async.js',
+ },
+ '5': {
+ name: 'keyword.operator.new.js',
+ },
+ '6': {
+ name: 'keyword.generator.asterisk.js',
+ },
+ },
+ end: '(?=\\}|;|,|$)|(?<=\\})',
+ patterns: [
+ {
+ include: '#method-declaration-name',
+ },
+ {
+ include: '#function-body',
+ },
+ ],
+ },
+ {
+ name: 'meta.method.declaration.js',
+ begin:
+ '(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])',
+ beginCaptures: {
+ '1': {
+ name: 'storage.modifier.js',
+ },
+ '2': {
+ name: 'storage.modifier.js',
+ },
+ '3': {
+ name: 'storage.modifier.js',
+ },
+ '4': {
+ name: 'storage.modifier.async.js',
+ },
+ '5': {
+ name: 'storage.type.property.js',
+ },
+ '6': {
+ name: 'keyword.generator.asterisk.js',
+ },
+ },
+ end: '(?=\\}|;|,|$)|(?<=\\})',
+ patterns: [
+ {
+ include: '#method-declaration-name',
+ },
+ {
+ include: '#function-body',
+ },
+ ],
+ },
+ ],
+ },
+ 'object-literal-method-declaration': {
+ name: 'meta.method.declaration.js',
+ begin:
+ '(?x)(?]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*))?[\\(])',
+ beginCaptures: {
+ '1': {
+ name: 'storage.modifier.async.js',
+ },
+ '2': {
+ name: 'storage.type.property.js',
+ },
+ '3': {
+ name: 'keyword.generator.asterisk.js',
+ },
+ },
+ 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.js',
+ },
+ '2': {
+ name: 'storage.type.property.js',
+ },
+ '3': {
+ name: 'keyword.generator.asterisk.js',
+ },
+ },
+ end: '(?=\\(|\\<)',
+ patterns: [
+ {
+ include: '#method-declaration-name',
+ },
+ ],
+ },
+ ],
+ },
+ 'method-declaration-name': {
+ begin:
+ '(?x)(?=((\\b(?)',
+ captures: {
+ '1': {
+ name: 'storage.modifier.async.js',
+ },
+ '2': {
+ name: 'variable.parameter.js',
+ },
+ },
+ },
+ {
+ name: 'meta.arrow.js',
+ 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.js',
+ },
+ },
+ end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)\\b)|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.js',
+ begin: '=>',
+ beginCaptures: {
+ '0': {
+ name: 'storage.type.function.arrow.js',
+ },
+ },
+ end: '((?<=\\}|\\S)(?)|((?!\\{)(?=\\S)))(?!\\/[\\/\\*])',
+ patterns: [
+ {
+ include: '#single-line-comment-consuming-line-ending',
+ },
+ {
+ include: '#decl-block',
+ },
+ {
+ include: '#expression',
+ },
+ ],
+ },
+ ],
+ },
+ 'indexer-declaration': {
+ name: 'meta.indexer.declaration.js',
+ 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.js',
+ },
+ },
+ end: '\\}',
+ endCaptures: {
+ '0': {
+ name: 'punctuation.definition.block.js',
+ },
+ },
+ patterns: [
+ {
+ include: '#object-member',
+ },
+ ],
+ },
+ 'object-literal': {
+ name: 'meta.objectliteral.js',
+ begin: '\\{',
+ beginCaptures: {
+ '0': {
+ name: 'punctuation.definition.block.js',
+ },
+ },
+ end: '\\}',
+ endCaptures: {
+ '0': {
+ name: 'punctuation.definition.block.js',
+ },
+ },
+ patterns: [
+ {
+ include: '#object-member',
+ },
+ ],
+ },
+ 'object-member': {
+ patterns: [
+ {
+ include: '#comment',
+ },
+ {
+ include: '#object-literal-method-declaration',
+ },
+ {
+ name: 'meta.object.member.js meta.object-literal.key.js',
+ begin: '(?=\\[)',
+ end: '(?=:)|((?<=[\\]])(?=\\s*[\\(\\<]))',
+ patterns: [
+ {
+ include: '#comment',
+ },
+ {
+ include: '#array-literal',
+ },
+ {
+ include: '#tuple-literal',
+ },
+ ],
+ },
+ {
+ name: 'meta.object.member.js meta.object-literal.key.js',
+ begin: '(?=[\\\'\\"\\`])',
+ end: '(?=:)|((?<=[\\\'\\"\\`])(?=((\\s*[\\(\\<,}])|(\\s+(as|satisfies)\\s+))))',
+ patterns: [
+ {
+ include: '#comment',
+ },
+ {
+ include: '#string',
+ },
+ ],
+ },
+ {
+ name: 'meta.object.member.js meta.object-literal.key.js',
+ 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.js',
+ },
+ '1': {
+ name: 'entity.name.function.js',
+ },
+ },
+ },
+ {
+ name: 'meta.object.member.js',
+ match:
+ '(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*:)',
+ captures: {
+ '0': {
+ name: 'meta.object-literal.key.js',
+ },
+ },
+ },
+ {
+ name: 'meta.object.member.js',
+ begin: '\\.\\.\\.',
+ beginCaptures: {
+ '0': {
+ name: 'keyword.operator.spread.js',
+ },
+ },
+ end: '(?=,|\\})',
+ patterns: [
+ {
+ include: '#expression',
+ },
+ ],
+ },
+ {
+ name: 'meta.object.member.js',
+ match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$|\\/\\/|\\/\\*)',
+ captures: {
+ '1': {
+ name: 'variable.other.readwrite.js',
+ },
+ },
+ },
+ {
+ name: 'meta.object.member.js',
+ 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.js',
+ },
+ },
+ end: '(?<=\\))',
+ patterns: [
+ {
+ include: '#type-parameters',
+ },
+ {
+ begin: '\\(',
+ beginCaptures: {
+ '0': {
+ name: 'meta.brace.round.js',
+ },
+ },
+ end: '\\)',
+ endCaptures: {
+ '0': {
+ name: 'meta.brace.round.js',
+ },
+ },
+ 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.js',
+ },
+ '2': {
+ name: 'meta.brace.round.js',
+ },
+ },
+ end: '\\)',
+ endCaptures: {
+ '0': {
+ name: 'meta.brace.round.js',
+ },
+ },
+ patterns: [
+ {
+ include: '#expression-inside-possibly-arrow-parens',
+ },
+ ],
+ },
+ {
+ begin: '(?<=:)\\s*(async)?\\s*(?=\\<\\s*$)',
+ beginCaptures: {
+ '1': {
+ name: 'storage.modifier.async.js',
+ },
+ },
+ 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.js',
+ },
+ },
+ end: '\\)',
+ endCaptures: {
+ '0': {
+ name: 'meta.brace.round.js',
+ },
+ },
+ 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.js',
+ },
+ },
+ end: '\\s*(:)',
+ endCaptures: {
+ '1': {
+ name: 'keyword.operator.ternary.js',
+ },
+ },
+ 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.js',
+ 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.js',
+ 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.js',
+ match: '(\\#?[_$[:alpha:]][_$[:alnum:]]*)',
+ },
+ ],
+ },
+ 'function-call-optionals': {
+ patterns: [
+ {
+ name: 'meta.function-call.js punctuation.accessor.optional.js',
+ match: '\\?\\.',
+ },
+ {
+ name: 'meta.function-call.js keyword.operator.definiteassignment.js',
+ match: '\\!',
+ },
+ ],
+ },
+ 'support-function-call-identifiers': {
+ patterns: [
+ {
+ include: '#literal',
+ },
+ {
+ include: '#support-objects',
+ },
+ {
+ include: '#object-identifiers',
+ },
+ {
+ include: '#punctuation-accessor',
+ },
+ {
+ name: 'keyword.operator.expression.import.js',
+ 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.js',
+ },
+ },
+ 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.js',
+ },
+ },
+ 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.js',
+ },
+ },
+ end: '\\)',
+ endCaptures: {
+ '0': {
+ name: 'meta.brace.round.js',
+ },
+ },
+ 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.js',
+ },
+ '2': {
+ name: 'keyword.operator.rest.js',
+ },
+ '3': {
+ name: 'entity.name.function.js variable.language.this.js',
+ },
+ '4': {
+ name: 'entity.name.function.js',
+ },
+ '5': {
+ name: 'keyword.operator.optional.js',
+ },
+ },
+ },
+ {
+ match:
+ '(?x)(?:(?]|\\|\\||\\&\\&|\\!\\=\\=|$|((?>=|>>>=|\\|=',
+ },
+ {
+ name: 'keyword.operator.bitwise.shift.js',
+ match: '<<|>>>|>>',
+ },
+ {
+ name: 'keyword.operator.comparison.js',
+ match: '===|!==|==|!=',
+ },
+ {
+ name: 'keyword.operator.relational.js operator.relational.ripple-force entity.name.operator.relational.ripple',
+ match: '<=|>=|<>|<|>',
+ },
+ {
+ match: '(?<=[_$[:alnum:]])(\\!)\\s*(?:(/=)|(?:(/)(?![/*])))',
+ captures: {
+ '1': {
+ name: 'keyword.operator.logical.js',
+ },
+ '2': {
+ name: 'keyword.operator.assignment.compound.js',
+ },
+ '3': {
+ name: 'keyword.operator.arithmetic.js',
+ },
+ },
+ },
+ {
+ name: 'keyword.operator.logical.js',
+ match: '\\!|&&|\\|\\||\\?\\?',
+ },
+ {
+ name: 'keyword.operator.bitwise.js',
+ match: '\\&|~|\\^|\\|',
+ },
+ {
+ name: 'keyword.operator.assignment.js',
+ match: '\\=',
+ },
+ {
+ name: 'keyword.operator.decrement.js',
+ match: '--',
+ },
+ {
+ name: 'keyword.operator.increment.js',
+ match: '\\+\\+',
+ },
+ {
+ name: 'keyword.operator.arithmetic.js',
+ match: '%|\\*|/|-|\\+',
+ },
+ {
+ begin:
+ '(?<=[_$[:alnum:])\\]])\\s*(?=(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)+(?:(/=)|(?:(/)(?![/*]))))',
+ end: '(?:(/=)|(?:(/)(?!\\*([^\\*]|(\\*[^\\/]))*\\*\\/)))',
+ endCaptures: {
+ '1': {
+ name: 'keyword.operator.assignment.compound.js',
+ },
+ '2': {
+ name: 'keyword.operator.arithmetic.js',
+ },
+ },
+ patterns: [
+ {
+ include: '#comment',
+ },
+ ],
+ },
+ {
+ match: '(?<=[_$[:alnum:])\\]])\\s*(?:(/=)|(?:(/)(?![/*])))',
+ captures: {
+ '1': {
+ name: 'keyword.operator.assignment.compound.js',
+ },
+ '2': {
+ name: 'keyword.operator.arithmetic.js',
+ },
+ },
+ },
+ ],
+ },
+ 'typeof-operator': {
+ begin:
+ '(?:&|{\\?]|(extends\\s+)|$|;|^\\s*$|(?:^\\s*(?:abstract|async|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)\\b)|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)|var|while)\\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: '#tuple-literal',
+ },
+ {
+ include: '#record-literal',
+ },
+ {
+ include: '#this-literal',
+ },
+ {
+ include: '#super-literal',
+ },
+ ],
+ },
+ 'array-literal': {
+ name: 'meta.array.literal.js',
+ begin: '\\s*(\\[)',
+ beginCaptures: {
+ '1': {
+ name: 'meta.brace.square.js',
+ },
+ },
+ end: '\\]',
+ endCaptures: {
+ '0': {
+ name: 'meta.brace.square.js',
+ },
+ },
+ patterns: [
+ {
+ include: '#expression',
+ },
+ {
+ include: '#punctuation-comma',
+ },
+ ],
+ },
+ 'tuple-literal': {
+ name: 'meta.tuple.literal.js',
+ begin: '(#)(\\[)',
+ beginCaptures: {
+ '1': {
+ name: 'keyword.control.tuple.js',
+ },
+ '2': {
+ name: 'meta.brace.square.js',
+ },
+ },
+ end: '\\]',
+ endCaptures: {
+ '0': {
+ name: 'meta.brace.square.js',
+ },
+ },
+ patterns: [
+ {
+ include: '#expression',
+ },
+ {
+ include: '#punctuation-comma',
+ },
+ ],
+ },
+ 'record-literal': {
+ name: 'meta.record.literal.js',
+ begin: '(#)(\\{)',
+ beginCaptures: {
+ '1': {
+ name: 'keyword.control.record.js',
+ },
+ '2': {
+ name: 'punctuation.definition.block.js',
+ },
+ },
+ end: '\\}',
+ endCaptures: {
+ '0': {
+ name: 'punctuation.definition.block.js',
+ },
+ },
+ patterns: [
+ {
+ include: '#object-member',
+ },
+ ],
+ },
+ 'numeric-literal': {
+ patterns: [
+ {
+ name: 'constant.numeric.hex.js',
+ 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.js',
+ },
+ '2': {
+ name: 'punctuation.accessor.optional.js',
+ },
+ '3': {
+ name: 'support.variable.property.js',
+ },
+ '4': {
+ name: 'support.constant.js',
+ },
+ },
+ },
+ {
+ 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.js',
+ },
+ '2': {
+ name: 'punctuation.accessor.optional.js',
+ },
+ '3': {
+ name: 'entity.name.function.js',
+ },
+ },
+ },
+ {
+ match:
+ '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])',
+ captures: {
+ '1': {
+ name: 'punctuation.accessor.js',
+ },
+ '2': {
+ name: 'punctuation.accessor.optional.js',
+ },
+ '3': {
+ name: 'variable.other.constant.property.js',
+ },
+ },
+ },
+ {
+ match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)',
+ captures: {
+ '1': {
+ name: 'punctuation.accessor.js',
+ },
+ '2': {
+ name: 'punctuation.accessor.optional.js',
+ },
+ '3': {
+ name: 'variable.other.property.js',
+ },
+ },
+ },
+ {
+ name: 'variable.other.constant.js',
+ match: '([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])',
+ },
+ {
+ name: 'variable.other.readwrite.js',
+ match: '[_$[:alpha:]][_$[:alnum:]]*',
+ },
+ ],
+ },
+ 'object-identifiers': {
+ patterns: [
+ {
+ name: 'support.class.js',
+ 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.js',
+ },
+ '2': {
+ name: 'punctuation.accessor.optional.js',
+ },
+ '3': {
+ name: 'variable.other.constant.object.property.js',
+ },
+ '4': {
+ name: 'variable.other.object.property.js',
+ },
+ },
+ },
+ {
+ match:
+ '(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)',
+ captures: {
+ '1': {
+ name: 'variable.other.constant.object.js',
+ },
+ '2': {
+ name: 'variable.other.object.js',
+ },
+ },
+ },
+ ],
+ },
+ 'type-annotation': {
+ patterns: [
+ {
+ name: 'meta.type.annotation.js',
+ begin: '(:)(?=\\s*\\S)',
+ beginCaptures: {
+ '1': {
+ name: 'keyword.operator.type.annotation.js',
+ },
+ },
+ end: '(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))',
+ patterns: [
+ {
+ include: '#type',
+ },
+ ],
+ },
+ {
+ name: 'meta.type.annotation.js',
+ begin: '(:)',
+ beginCaptures: {
+ '1': {
+ name: 'keyword.operator.type.annotation.js',
+ },
+ },
+ end: '(?])|(?=^\\s*$)|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))',
+ patterns: [
+ {
+ include: '#type',
+ },
+ ],
+ },
+ ],
+ },
+ 'parameter-type-annotation': {
+ patterns: [
+ {
+ name: 'meta.type.annotation.js',
+ begin: '(:)',
+ beginCaptures: {
+ '1': {
+ name: 'keyword.operator.type.annotation.js',
+ },
+ },
+ end: '(?=[,)])|(?==[^>])',
+ patterns: [
+ {
+ include: '#type',
+ },
+ ],
+ },
+ ],
+ },
+ 'return-type': {
+ patterns: [
+ {
+ name: 'meta.return.type.js',
+ begin: '(?<=\\))\\s*(:)(?=\\s*\\S)',
+ beginCaptures: {
+ '1': {
+ name: 'keyword.operator.type.annotation.js',
+ },
+ },
+ end: '(?|\\{|(^\\s*(export|function|class|interface|let|var|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)\\b)|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.js meta.return.type.arrow.js keyword.operator.type.annotation.js',
+ },
+ },
+ end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)\\b)|const|import|enum|namespace|module|type|abstract|declare)\\s+))',
+ contentName: 'meta.arrow.js meta.return.type.arrow.js',
+ 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.js',
+ begin: '(<)',
+ beginCaptures: {
+ '1': {
+ name: 'punctuation.definition.typeparameters.begin.js',
+ },
+ },
+ end: '(>)',
+ endCaptures: {
+ '1': {
+ name: 'punctuation.definition.typeparameters.end.js',
+ },
+ },
+ patterns: [
+ {
+ include: '#comment',
+ },
+ {
+ name: 'storage.modifier.js',
+ match:
+ '(?)',
+ },
+ ],
+ },
+ 'type-arguments': {
+ name: 'meta.type.parameters.js',
+ begin: '\\<',
+ beginCaptures: {
+ '0': {
+ name: 'punctuation.definition.typeparameters.begin.js',
+ },
+ },
+ end: '\\>',
+ endCaptures: {
+ '0': {
+ name: 'punctuation.definition.typeparameters.end.js',
+ },
+ },
+ 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.js',
+ },
+ '2': {
+ name: 'keyword.operator.rest.js',
+ },
+ '3': {
+ name: 'entity.name.function.js variable.language.this.js',
+ },
+ '4': {
+ name: 'entity.name.function.js',
+ },
+ '5': {
+ name: 'keyword.operator.optional.js',
+ },
+ },
+ },
+ {
+ match:
+ '(?x)(?:(?)',
+ patterns: [
+ {
+ include: '#comment',
+ },
+ {
+ include: '#type-parameters',
+ },
+ ],
+ },
+ {
+ name: 'meta.type.constructor.js',
+ begin:
+ '(?)\n ))\n )\n )\n)',
+ end: '(?<=\\))',
+ patterns: [
+ {
+ include: '#function-parameters',
+ },
+ ],
+ },
+ ],
+ },
+ 'type-function-return-type': {
+ patterns: [
+ {
+ name: 'meta.type.function.return.js',
+ begin: '(=>)(?=\\s*\\S)',
+ beginCaptures: {
+ '1': {
+ name: 'storage.type.function.arrow.js',
+ },
+ },
+ end: '(?)(?:\\?]|//|$)',
+ patterns: [
+ {
+ include: '#type-function-return-type-core',
+ },
+ ],
+ },
+ {
+ name: 'meta.type.function.return.js',
+ begin: '=>',
+ beginCaptures: {
+ '0': {
+ name: 'storage.type.function.arrow.js',
+ },
+ },
+ 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.js',
+ },
+ },
+ end: '(?<=\\})',
+ patterns: [
+ {
+ include: '#type-object',
+ },
+ ],
+ },
+ {
+ begin: '[&|]',
+ beginCaptures: {
+ '0': {
+ name: 'keyword.operator.type.js',
+ },
+ },
+ end: '(?=\\S)',
+ },
+ {
+ name: 'keyword.operator.expression.keyof.js',
+ match:
+ '(?)',
+ endCaptures: {
+ '1': {
+ name: 'meta.type.parameters.js punctuation.definition.typeparameters.end.js',
+ },
+ },
+ contentName: 'meta.type.parameters.js',
+ patterns: [
+ {
+ include: '#type-arguments-body',
+ },
+ ],
+ },
+ {
+ begin: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(<)',
+ beginCaptures: {
+ '1': {
+ name: 'entity.name.type.js',
+ },
+ '2': {
+ name: 'meta.type.parameters.js punctuation.definition.typeparameters.begin.js',
+ },
+ },
+ end: '(>)',
+ endCaptures: {
+ '1': {
+ name: 'meta.type.parameters.js punctuation.definition.typeparameters.end.js',
+ },
+ },
+ contentName: 'meta.type.parameters.js',
+ patterns: [
+ {
+ include: '#type-arguments-body',
+ },
+ ],
+ },
+ {
+ match: '([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))',
+ captures: {
+ '1': {
+ name: 'entity.name.type.module.js',
+ },
+ '2': {
+ name: 'punctuation.accessor.js',
+ },
+ '3': {
+ name: 'punctuation.accessor.optional.js',
+ },
+ },
+ },
+ {
+ name: 'entity.name.type.js',
+ match: '[_$[:alpha:]][_$[:alnum:]]*',
+ },
+ ],
+ },
+ 'punctuation-comma': {
+ name: 'punctuation.separator.comma.js',
+ match: ',',
+ },
+ 'punctuation-semicolon': {
+ name: 'punctuation.terminator.statement.js',
+ match: ';',
+ },
+ 'punctuation-accessor': {
+ match: '(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))',
+ captures: {
+ '1': {
+ name: 'punctuation.accessor.js',
+ },
+ '2': {
+ name: 'punctuation.accessor.optional.js',
+ },
+ },
+ },
+ string: {
+ patterns: [
+ {
+ include: '#qstring-single',
+ },
+ {
+ include: '#qstring-double',
+ },
+ {
+ include: '#template',
+ },
+ ],
+ },
+ 'qstring-double': {
+ name: 'string.quoted.double.js',
+ begin: '"',
+ beginCaptures: {
+ '0': {
+ name: 'punctuation.definition.string.begin.js',
+ },
+ },
+ end: '(")|((?:[^\\\\\\n])$)',
+ endCaptures: {
+ '1': {
+ name: 'punctuation.definition.string.end.js',
+ },
+ '2': {
+ name: 'invalid.illegal.newline.js',
+ },
+ },
+ patterns: [
+ {
+ include: '#string-character-escape',
+ },
+ ],
+ },
+ 'qstring-single': {
+ name: 'string.quoted.single.js',
+ begin: "'",
+ beginCaptures: {
+ '0': {
+ name: 'punctuation.definition.string.begin.js',
+ },
+ },
+ end: "(\\')|((?:[^\\\\\\n])$)",
+ endCaptures: {
+ '1': {
+ name: 'punctuation.definition.string.end.js',
+ },
+ '2': {
+ name: 'invalid.illegal.newline.js',
+ },
+ },
+ patterns: [
+ {
+ include: '#string-character-escape',
+ },
+ ],
+ },
+ 'string-character-escape': {
+ name: 'constant.character.escape.js',
+ 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.js',
+ begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)',
+ beginCaptures: {
+ '1': {
+ name: 'entity.name.function.tagged-template.js',
+ },
+ '2': {
+ name: 'string.template.js punctuation.definition.string.template.begin.js',
+ },
+ },
+ end: '`',
+ endCaptures: {
+ '0': {
+ name: 'string.template.js punctuation.definition.string.template.end.js',
+ },
+ },
+ 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.js',
+ 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.js',
+ },
+ },
+ end: '(?=`)',
+ patterns: [
+ {
+ include: '#type-arguments',
+ },
+ ],
+ },
+ ],
+ },
+ 'template-substitution-element': {
+ name: 'meta.template.expression.js',
+ begin: '\\$\\{',
+ beginCaptures: {
+ '0': {
+ name: 'punctuation.definition.template-expression.begin.js',
+ },
+ },
+ end: '\\}',
+ endCaptures: {
+ '0': {
+ name: 'punctuation.definition.template-expression.end.js',
+ },
+ },
+ patterns: [
+ {
+ include: '#expression',
+ },
+ ],
+ contentName: 'meta.embedded.line.js',
+ },
+ 'type-string': {
+ patterns: [
+ {
+ include: '#qstring-single',
+ },
+ {
+ include: '#qstring-double',
+ },
+ {
+ include: '#template-type',
+ },
+ ],
+ },
+ 'template-type': {
+ patterns: [
+ {
+ include: '#template-call',
+ },
+ {
+ contentName: 'string.template.js',
+ begin: '([_$[:alpha:]][_$[:alnum:]]*)?(`)',
+ beginCaptures: {
+ '1': {
+ name: 'entity.name.function.tagged-template.js',
+ },
+ '2': {
+ name: 'string.template.js punctuation.definition.string.template.begin.js',
+ },
+ },
+ end: '`',
+ endCaptures: {
+ '0': {
+ name: 'string.template.js punctuation.definition.string.template.end.js',
+ },
+ },
+ patterns: [
+ {
+ include: '#template-type-substitution-element',
+ },
+ {
+ include: '#string-character-escape',
+ },
+ ],
+ },
+ ],
+ },
+ 'template-type-substitution-element': {
+ name: 'meta.template.expression.js',
+ begin: '\\$\\{',
+ beginCaptures: {
+ '0': {
+ name: 'punctuation.definition.template-expression.begin.js',
+ },
+ },
+ end: '\\}',
+ endCaptures: {
+ '0': {
+ name: 'punctuation.definition.template-expression.end.js',
+ },
+ },
+ patterns: [
+ {
+ include: '#type',
+ },
+ ],
+ contentName: 'meta.embedded.line.js',
+ },
+ regex: {
+ patterns: [
+ {
+ name: 'string.regexp.js',
+ begin:
+ '(?|&&|\\|\\||\\*\\/)\\s*(\\/)(?![\\/*])(?=(?:[^\\/\\\\\\[\\()]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\]|\\(([^\\)\\\\]|\\\\.)+\\))+\\/([dgimsuvy]+|(?![\\/\\*])|(?=\\/\\*))(?!\\s*[a-zA-Z0-9_$]))',
+ beginCaptures: {
+ '1': {
+ name: 'punctuation.definition.string.begin.js',
+ },
+ },
+ end: '(/)([dgimsuvy]*)',
+ endCaptures: {
+ '1': {
+ name: 'punctuation.definition.string.end.js',
+ },
+ '2': {
+ name: 'keyword.other.js',
+ },
+ },
+ patterns: [
+ {
+ include: '#regexp',
+ },
+ ],
+ },
+ {
+ name: 'string.regexp.js',
+ 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.js',
+ begin: '/\\*\\*(?!/)',
+ beginCaptures: {
+ '0': {
+ name: 'punctuation.definition.comment.js',
+ },
+ },
+ end: '\\*/',
+ endCaptures: {
+ '0': {
+ name: 'punctuation.definition.comment.js',
+ },
+ },
+ patterns: [
+ {
+ include: '#docblock',
+ },
+ ],
+ },
+ {
+ name: 'comment.block.js',
+ begin: '(/\\*)(?:\\s*((@)internal)(?=\\s|(\\*/)))?',
+ beginCaptures: {
+ '1': {
+ name: 'punctuation.definition.comment.js',
+ },
+ '2': {
+ name: 'storage.type.internaldeclaration.js',
+ },
+ '3': {
+ name: 'punctuation.decorator.internaldeclaration.js',
+ },
+ },
+ end: '\\*/',
+ endCaptures: {
+ '0': {
+ name: 'punctuation.definition.comment.js',
+ },
+ },
+ },
+ {
+ begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)',
+ beginCaptures: {
+ '1': {
+ name: 'punctuation.whitespace.comment.leading.js',
+ },
+ '2': {
+ name: 'comment.line.double-slash.js',
+ },
+ '3': {
+ name: 'punctuation.definition.comment.js',
+ },
+ '4': {
+ name: 'storage.type.internaldeclaration.js',
+ },
+ '5': {
+ name: 'punctuation.decorator.internaldeclaration.js',
+ },
+ },
+ end: '(?=$)',
+ contentName: 'comment.line.double-slash.js',
+ },
+ ],
+ },
+ 'single-line-comment-consuming-line-ending': {
+ begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)',
+ beginCaptures: {
+ '1': {
+ name: 'punctuation.whitespace.comment.leading.js',
+ },
+ '2': {
+ name: 'comment.line.double-slash.js',
+ },
+ '3': {
+ name: 'punctuation.definition.comment.js',
+ },
+ '4': {
+ name: 'storage.type.internaldeclaration.js',
+ },
+ '5': {
+ name: 'punctuation.decorator.internaldeclaration.js',
+ },
+ },
+ end: '(?=^)',
+ contentName: 'comment.line.double-slash.js',
+ },
+ directives: {
+ name: 'comment.line.triple-slash.directive.js',
+ 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.js',
+ },
+ },
+ end: '(?=$)',
+ patterns: [
+ {
+ name: 'meta.tag.js',
+ begin: '(<)(reference|amd-dependency|amd-module)',
+ beginCaptures: {
+ '1': {
+ name: 'punctuation.definition.tag.directive.js',
+ },
+ '2': {
+ name: 'entity.name.tag.directive.js',
+ },
+ },
+ end: '/>',
+ endCaptures: {
+ '0': {
+ name: 'punctuation.definition.tag.directive.js',
+ },
+ },
+ patterns: [
+ {
+ name: 'entity.other.attribute-name.directive.js',
+ match: 'path|types|no-default-lib|lib|name|resolution-mode',
+ },
+ {
+ name: 'keyword.operator.assignment.js',
+ 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: '()caption(>)|(?=\\*/)',
+ 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.js',
+ },
+ },
+ },
+ ],
+ },
+ {
+ 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.js',
+ },
+ '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-style',
+ },
+ {
+ include: '#jsx-tag-without-attributes',
+ },
+ {
+ include: '#jsx-tag',
+ },
+ ],
+ },
+ '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.js',
+ begin:
+ '(<)\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?)',
+ end: '()\\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?)',
+ beginCaptures: {
+ '1': {
+ name: 'punctuation.definition.tag.begin.js',
+ },
+ '2': {
+ name: 'entity.name.tag.namespace.js',
+ },
+ '3': {
+ name: 'punctuation.separator.namespace.js',
+ },
+ '4': {
+ name: 'entity.name.tag.js',
+ },
+ '5': {
+ name: 'support.class.component.js',
+ },
+ '6': {
+ name: 'punctuation.definition.tag.end.js',
+ },
+ },
+ endCaptures: {
+ '1': {
+ name: 'punctuation.definition.tag.begin.js',
+ },
+ '2': {
+ name: 'entity.name.tag.namespace.js',
+ },
+ '3': {
+ name: 'punctuation.separator.namespace.js',
+ },
+ '4': {
+ name: 'entity.name.tag.js',
+ },
+ '5': {
+ name: 'support.class.component.js',
+ },
+ '6': {
+ name: 'punctuation.definition.tag.end.js',
+ },
+ },
+ contentName: 'meta.jsx.children.js',
+ 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-style': {
+ name: 'style.tag.js',
+ begin: '(<)\\s*(style)\\b(?![^>]*/>)(?=[^>]*>)',
+ beginCaptures: {
+ '1': {
+ name: 'punctuation.definition.tag.begin.js',
+ },
+ '2': {
+ name: 'entity.name.tag.js',
+ },
+ },
+ end: '()(style)(>)',
+ endCaptures: {
+ '1': {
+ name: 'punctuation.definition.tag.begin.js',
+ },
+ '2': {
+ name: 'entity.name.tag.js',
+ },
+ '3': {
+ name: 'punctuation.definition.tag.end.js',
+ },
+ },
+ patterns: [
+ {
+ begin: '(>)',
+ beginCaptures: {
+ '1': {
+ name: 'punctuation.definition.tag.end.js',
+ },
+ },
+ end: '(?=)',
+ contentName: 'source.css',
+ patterns: [
+ {
+ include: 'source.css',
+ },
+ ],
+ },
+ {
+ begin: '(?<=
+}
+
+export default component App() {
+ const name = track("World");
+ setTimeout(() => @name = "Ripple", 2000);
+
+}
+`.trimStart(),
+ },
+};
diff --git a/src/livecodes/vendors.ts b/src/livecodes/vendors.ts
index b09950faa6..183990be43 100644
--- a/src/livecodes/vendors.ts
+++ b/src/livecodes/vendors.ts
@@ -297,8 +297,12 @@ export const mjmlUrl = /* @__PURE__ */ getUrl('mjml-browser@4.15.3/lib/index.js'
export const monacoBaseUrl = /* @__PURE__ */ getUrl('@live-codes/monaco-editor@0.3.0/');
+export const monacoEditorTextmateUrl = /* @__PURE__ */ getModuleUrl('monaco-editor-textmate@4.0.0');
+
export const monacoEmacsUrl = /* @__PURE__ */ getUrl('monaco-emacs@0.3.0/dist/monaco-emacs.js');
+export const monacoTextmateUrl = /* @__PURE__ */ getModuleUrl('monaco-textmate@3.0.1');
+
export const monacoThemesBaseUrl = /* @__PURE__ */ getUrl('monaco-themes@0.4.4/themes/');
export const monacoVimUrl = /* @__PURE__ */ getUrl('monaco-vim@0.4.1/dist/monaco-vim.js');
@@ -317,6 +321,10 @@ export const normalizeCssUrl = /* @__PURE__ */ getUrl('normalize.css@8.0.1/norma
export const nunjucksBaseUrl = /* @__PURE__ */ getUrl('nunjucks@3.2.4/browser/');
+export const onigasmUrl = /* @__PURE__ */ getModuleUrl('onigasm@2.2.5');
+
+export const onigasmWasmUrl = /* @__PURE__ */ getUrl('onigasm@2.2.5/lib/onigasm.wasm');
+
export const opalBaseUrl = /* @__PURE__ */ getUrl('https://cdn.opalrb.com/opal/1.8.2/');
export const parinferUrl = /* @__PURE__ */ getUrl('parinfer@3.13.1/parinfer.js');
@@ -337,6 +345,8 @@ export const postcssImportUrlUrl = /* @__PURE__ */ getUrl(
export const prettierBaseUrl = /* @__PURE__ */ getUrl('prettier@3.3.2/');
+export const prettierEsmUrl = /* @__PURE__ */ getModuleUrl('prettier@3.3.2/standalone');
+
export const prettierPhpUrl = /* @__PURE__ */ getUrl('@prettier/plugin-php@0.22.2/standalone.js');
export const prismBaseUrl = /* @__PURE__ */ getUrl('prismjs@1.29.0/components/');
diff --git a/src/sdk/models.ts b/src/sdk/models.ts
index adebd1a1ae..ea8a23caa9 100644
--- a/src/sdk/models.ts
+++ b/src/sdk/models.ts
@@ -1247,6 +1247,7 @@ export type ParserName =
| 'babel-ts'
| 'babel-flow'
| 'glimmer'
+ | 'ripple'
| 'html'
| 'markdown'
| 'css'
@@ -1260,6 +1261,10 @@ export interface Parser {
name: ParserName;
plugins?: any[];
pluginUrls: string[];
+ postFormat?: (parsed: {
+ formatted: string;
+ cursorOffset: number;
+ }) => Promise<{ formatted: string; cursorOffset: number }>;
}
export type FormatFn = (
value: string,
@@ -1268,7 +1273,7 @@ export type FormatFn = (
) => Promise<{ formatted: string; cursorOffset: number }>;
export interface LanguageFormatter {
- factory: (baseUrl: string, language: Language) => FormatFn;
+ factory: (baseUrl: string, language: Language, config: Config) => FormatFn | Promise;
}
export type CssPresetId = '' | 'normalize.css' | 'reset-css';
@@ -1392,6 +1397,7 @@ export type TemplateName =
| 'preact'
| 'svelte'
| 'solid'
+ | 'ripple'
| 'lit'
| 'stencil'
| 'mdx'
@@ -2078,6 +2084,7 @@ export interface CDNService {
getPkgInfo: (pkgName: string) => Promise;
getPkgFiles: (pkgName: string) => Promise<{ default?: string; files: string[] } | APIError>;
getPkgDefaultFiles: (pkgName: string) => Promise<{ js?: string; css?: string } | APIError>;
+ getPkgLatestVersion: (pkgName: string) => Promise;
}
export interface WorkerMessageEvent extends MessageEvent {
diff --git a/typos.toml b/typos.toml
index 629bd22d2b..b71e8ea5b4 100644
--- a/typos.toml
+++ b/typos.toml
@@ -8,6 +8,7 @@ extend-exclude = [
"src/livecodes/services/google-fonts.ts", # Font name
"src/livecodes/templates/starter/blockly-starter.ts", # Random string id
"functions/vendors/*.js", # Built files
+ "src/livecodes/editor/monaco/languages/monaco-lang-ripple.ts"
]
[default]